# Planar RGB video and public-codec cleanup

This is a finite Tabmorph fidelity/reliability repair, with no new pair, format or alias.
The competitive goal remains incomplete. The retained latest operation matrix has 2,128
Tabmorph normalized pairs and 886 missing in-scope CloudConvert pairs. FROM cards and
canonical pages are not capabilities. CutConvert's 102-workflow connected live catalog
is retained in cutconvert-catalog.json; all caption, transcript, timecode and editing
project interchange workflows remain excluded. These tests process actual video pictures.

## Inputs and immutable baseline

Three original CC0 one-second synthetic arrays supply independently known values: 10-bit
GBRP, 12-bit GBRP, and 10-bit GBRAP with partial alpha. The packed BGR8 control derives
from the first corpus and is not a fourth original. The fixture manifest records all raw
array/FFV1 hashes, commands, transfer/primary/range declarations and exact native decoded
sample equality. No user file was used or uploaded. Never regenerate these originals.
Browser repeats, quality settings, remux probes and repeated outputs are not new corpora.

production-baseline.json and before-source/ retain accepted Fly87's exact entry, native
bytes and application sources. The authoritative complete old production run is
qa/production87-before2-browser.json: 16 cases, 10 pass, six genuine planar WebM failures,
no skips/flaky cases. Its ten actual downloads are in production87-before2/. The final
independent native reader read-production87-before5/ records 12 wrong MP4 matrix/range
observations plus six missing WebM files, with completeScope=false. No absent output is
accepted as a quality point. Old YUV MP4 carries matrix=gbr and range=pc. Standalone
Chromium playback fails source-color controls on all three planar corpora; WebKit and
the packed control pass. See player-production87-before1/, eight actual-player cases,
three failures. Native readers tolerate/interpret the incorrect tags differently.

The RGB branch previously matched rgb/bgr/pal8 but omitted planar gbr/gbra. Adding gbr
routes both planar inputs through the established explicit RGB-to-YUV matrix/range path.
Actual target pixel depth now supplies the precision notice, including 8-bit VP9 alpha.
Native codec binaries, rate/quantizer controls, profiles and dependencies are unchanged.
H.264 reduces to 8-bit 4:2:0 and composites alpha; VP9 retains supported alpha but reduces
precision/chroma; ProRes has finite alpha precision. FFV1 without transforms retains all
supported full-depth decoded samples. This is not universal format support or parity.

## Independent readers, curves and actual players

scripts/validate-video-rgb.py uses independent stock native FFmpeg/ffprobe, original
G/B/R(/A) arrays, NumPy and Pillow. It checks every picture/timestamp, stream count,
metadata, native alpha samples, interior color patches and full raw FFV1 equality.
Visible RGB measurements explicitly use RGBA8 display expansion. Native alpha is read
in its own native plane/depth, rather than inferred from a rounded RGBA8/16 expansion.
MOV's nclc atom has no explicit full-range flag, so decoded 12-bit nominal Y black/white
codes (256/3760 +/-32) independently test range while matrix/primaries/transfer remain
strict. Full original/download hashes and native reader version are retained.

unit-full2/ contains16 exports across MP4, WebM, ProRes MOV and FFV1 MKV;
read-unit-full2/report.json has180 controls, zero failures and complete scope.
curves-full2/ contains24 recorded uniform High/Balanced/Smaller settings across the same
four source encodings and H.264/VP9, with264 observations across three independent-reader
runs. Duplicate identical VP9-alpha outputs remain duplicates. visual1/report.json
records all24 points, unique output count and exact settings, size, PSNR and alpha
measurements. These are Tabmorph-only quality/size curves, not matched-bitrate CloudConvert
curves. The packed derivative is explicitly labelled. The source-relative native PSNR
does not improve universally after the correct matrix/range repair; all before/after
values remain, including regressions. Correct Chromium rendering and WebM reliability,
rather than selecting a favorable single metric, establish this specific repair.

The standalone player script uses native Chromium/WebKit video decoders in an offline
about:blank page outside the converter. This avoids weakening the engine's media CSP.
It captures unscaled full first pictures onto an explicit sRGB canvas and compares large
interior patches to the original-array/white-matte reference. The predeclared RMSE limit
is .035, with size/duration checks and zero HTTP. player-local1/ has eight passes and no
failures. visual1/ shows complete original, actual production87 Chromium and repaired
Chromium pictures without cropping/resizing. The old WebKit success is retained; the
repair is not claimed to improve every reader. Native browser images are display-depth
checks, not proof of high-depth rendering or a human perception study.

## Bounded cleanup and cold loading

fetchCodecBytes previously awaited reader.cancel() after abort. A cancellation promise
that never settles held retry progress indefinitely. Cancellation is now best effort,
with rejection handled and lock release guarded; at most three complete same-origin,
credentials-omitted GET attempts and15-second idle bounds remain. Every executed buffer
still passes exact full size and SHA256. No partial-response assembly or integrity bypass
was added. CSP, origin isolation, native codec bytes and no-user-upload behavior stay intact.

qa/cancel-before1.txt retains the deterministic unit failure (one failure, one pass,
nine skipped by name filter); qa/cancel-after1.txt has all11 loader controls passing.
The authoritative controlled old production run is cancel-production87-before2/ and its
two-failure browser JSON. All four pool workers receive the controlled cancellation
wrapper before the first truncated WASM response. Both browsers record exactly one
cancel call, zero subsequent binary fetches and never reach ready within30 seconds.
The repaired local run includes never-settling and rejecting cleanup in both browsers,
then real WTV-to-MP4 conversion offline. First injected response is discarded; a complete
size/hash-matching response loads before file selection. All four pass.

A separate natural WebKit old-production cold timeout is retained under before3. Trace
has successful WASM response headers but unfinished body fields and no later retry.
Its underlying network/runtime cause remains UNVERIFIED. The controlled cleanup defect
is independently reproduced; do not claim it explains every network timeout. Finite
cold-load runs cannot guarantee arbitrary throughput or network reliability.

## Complete local acceptance, retained failures and diagnostics

qa/unit-full2.txt:672 units/78 files pass; application and browser TypeScript pass.
qa/local1-browser.json:68 cases, zero unexpected/flaky/skipped; actual24 RGB downloads,
26 prior video cases,14 existing codec fault cases and four new cleanup cases. Fresh
4481/4482 previews have strict COOP/COEP/CSP recorded. Original4321/4322 preview PIDs95346/
95348 must remain unchanged; their historical startup-loaded missing COOP/COEP is only a
diagnostic. Tests use actual source-page top pickers, offline downloads and zero file-
conversion HTTP/CSP errors. Local legacy26 downloads exactly match accepted85 production
whole files; all18 local fault downloads exactly match its independently decoded WTV
control. Those inherited byte-identical outputs are not fresh independent reader runs.

All failed, partial and setup runs remain, without pooling passes:
- production87-before initial wide harness was interrupted after one pass (15 skipped).
  qa/before1-interruption.json records the coordinator interruption. Not a complete pass.
- before3 expanded to24 cases:17 pass, six real WebM errors and one natural cold timeout.
  Its test source changed during the run; both snapshots and an explicit diagnostic are
  retained. It is not the authoritative acceptance baseline and adds no new corpora.
- cancel-production87-before1 patched only one pool worker, while another fetched the
  truncated response. calls=0/request-count expectation failed: harness diagnostic only.
  The corrected all-worker before2 run is the product proof. Exact sources are retained.
- First reader syntax attempt failed before reading files. Next reader assumed a MOV range
  flag and treated native expanded alpha rounding as stored-sample error. The next RGBA8
  alpha diagnostic also failed; final native alpha-plane reading fixes the measurement
  method without changing output. All intermediate reader sources/reports remain.
- The native FFV1 MOV remux probe is a container diagnostic, not a supported new format,
  input corpus, independent holdout or conversion capability.
- A developer plotting dependency was absent; it was installed only in a temporary tools
  folder, with log retained. No application package/lockfile or shipped dependency changed.
- Full unit runs rewrite a historical semantic ODT fixture nondeterministically. Generated
  copies are retained in qa/ and the tracked original restored; no historical evidence
  was refreshed. Earlier RGB-only unit outputs remain separate from final RGB+cleanup.

## CloudConvert comparison and limits

No new provider request, conversion, upload, account or credit purchase occurred. No
independently verified quota reset was available; recorded quota failure remains binding.
retained-motion1/ re-reads the SAME prior original motion MKV and saved CloudConvert MP4,
with settings, hashes and all48 native decoded frames. Current packed-RGB High output is
exactly the prior measured235050-byte file. Saved CloudConvert is96727 bytes,15.154800dB
PSNR/.805147 SSIM; current output14.915952dB/.831460 SSIM. CloudConvert's size and PSNR
advantage REMAINS OPEN. Codec/audio/settings are different, not a matched-quality scale.
SSIM is separate. This old source cannot supply a reference for the three new RGB corpora.
Their CloudConvert quality and broad superiority remain UNVERIFIED. Short synthetic
checks do not establish photographic/motion/HDR/long-form quality or device coverage.

Sources for interpretation (paraphrased, not copied):
- FFmpeg pixel layout definitions: https://ffmpeg.org/doxygen/trunk/pixfmt_8h_source.html
- FFmpeg scale matrix/range controls: https://ffmpeg.org/ffmpeg-filters.html
- QuickTime colr/nclc fields: https://developer.apple.com/documentation/quicktime-file-format/color_parameter_atom
Native FFmpeg is a developer fixture/reader tool, never shipped as a new dependency.

## Reproduce and release boundary

Use the retained manifest/raw inputs rather than regenerating originals. Run the current
video-rgb unit file, actual Playwright video-rgb/video/codec-delivery/codec-cancel suites,
then the independent native reader and offline player on a fresh output directory. All
scripts refuse or avoid replacing earlier evidence. Source offers44/33/12 follow current
integration and freeze on publication; all older source/runtime/evidence stays immutable.
The first-publication engine evidence snapshot contains these exact local results and
failures. Actual production browser/native/player/whole-HTTP and engine-tree acceptance
is separately required in benchmarks/reports/video-rgb1-release.json. Local acceptance
alone is never a deployed or competitive-quality claim. The broader goal stays active.

An attempted duplicate read-local1 rerun was correctly refused because its complete24-file/264-control report already existed. That original report and outputs remain unchanged; qa/read-local1.txt records only the refused rerun, not its successful earlier command.
