# c1-v3 — the confirmed fix round (routing completeness, the readback rules, teardown, R-12) Branch `p5/c1`. Base `41992649` (round 2), then step-0 merge of `feat/disaggregated@c3e736a3` (→ merge commit `f280baf2`) and one work commit. Commit range **`41992649..5682f429`**; the work commit is the one below `f280baf2`. Every item the two round-2 reviews CONFIRMED is fixed here. The cross-family verifier (`c1-codex-verify-v2.md`) confirmed all ten of its executed items (2,4,5,6,7,8,9,10,11,12); none was refuted, so nothing here is skipped-by-refutation. R-16: every gate ships its red-once line and the red-check runner (rewritten, §M6) made all nine RED once, each on **its own** string, with the baseline restored green after each — `~/w7/p5-c1-r3-redcheck.log`, exit 0, `CONTROLS_THAT_DID_NOT_GO_RED=none`. --- ## 1. The items, each with its red-once line **B1 — the five `&MGPipeApply*` sites taken by address (`PipeFill.cpp` `EmitDeleteIfPublished` callers `:1536/:1557/:1598/:1635/:1656`).** R-17 renamed call *expressions*; these five pass the applier's *address*, so `DeleteSamplerView`, `DeleteShaderState`, `DeleteSamplerState` and texture/renderbuffer `ResourceDestroy` still ran the applier on the GL thread under split. Now `&MGPipeRoute` (same signature, `const MGPHandleOnly&`→void), and `EmitDeleteIfPublished`'s parameter is documented as a route. Gate: the red-check refuses any `&MGPipeApply` under `MG_Impl/` (grep, now 0); the routing is exercised by the split lane (14/21 holds). **Red once:** revert one site to `&MGPipeApplyResourceDestroy` → the split delete runs the applier on the GL thread (the reviewer's abort probe took 21/21). `MGPipeRouteDeleteSamplerView`/`DeleteShaderState` now have a caller. **B3 / codex 9 — nothing observed the CLIENT arm's 37 rows.** New `RemoteClientTest.PipeRouting.TheInstalledClientArmIsWireAndNotMonolithAndEveryRoutedRowMoved`: after `InstallClientWireTables()` it counts the generated-table cells that DIFFER from the kept monolith adapters (`MGPipeMonolith*()`), asserts exactly **33** moved (Screen+Context) and **4** escapes moved, and `MGPipeInstalledArm()==kClientWire`. Plus a fork runtime control (`AClientWireRowWithNoSessionRefusesByName...`) driving one routed row with no session → the wire row aborts `Fatal{NoClientSession,"ResourceDestroy"}`, which the monolith adapter (a dropped row) does not. **Red once:** the red-check comments out one `InstallClientWireTables` assignment → the row reads equal to the monolith adapter → `33` becomes `32` → the case fails (verified RED). **M1 / ID-53 / codex 7 — `Fatal{BarrierViolation, ""}`.** The check is at `ClientSession.cpp:692`, reads `g_applyThreadInsideApplier`, and fires through **`MGLOG_F`** (so it reaches the per-lane log ID-53's E1 asserts on). What it reads and what arms it: the flag's only writers are `NoteApplyThreadEnteredApplier/LeftApplier`, called only by `ScopedApplierEntry`, whose one use is v1's bracket in `PipeApplier::ApplyOne` — **v1's file, the integrator's merge-time hunk (ID-52)**. c1 cannot arm it (the applier is v1's), and I say so rather than pretend: with the bracket applied the verifier drove the flag up at emission and got the named Fatal; with it down at emission a fill that raced the applier is unobserved. **Codex 7's placement point** (move the check to the first `gPipeInputs` write, `MGP_FILL`) lands in **p1's `MGPipeValidateForVerb`** (`PipeFill`'s poison/residual part, p1's ownership), not c1's — requested from p1/the integrator; a deterministic two-thread race harness was not cheap here and the verifier marked that sub-point PARTIAL, so it is stated as a design argument, not asserted. On this head, with `MOBILEGL_IPC_VERB_BARRIER=0`, `BarrierViolation` does not appear in the split lane's ctest output because the `DirectGLES.Split.*` entries set no `MOBILEGL_LOG_FILE_PATH` — that lane plumbing is ID-53's joint-merge package, and my string is `MGLOG_F` precisely so it lands there once it exists. **M2 / codex 11 — the readback never read status or size.** `EmitAndWait` now returns the reply's own byte count (`Uint64* replySizeOut`), and `EmitReadPixels` calls `RequireReadbackReplyComplete` on both the fast and bounce paths: `Fatal{ReplyError,"ReadPixels"}` / `Fatal{ReadbackDeclined,...}` / `Fatal{ReadbackReplyShort,"ReadPixels < "}` — never stale bytes. The predicate is `ReadbackReplyIsComplete(status, size, tight)`, exposed and driven by `RemoteReadback.AReplyIsScatteredOnlyWhenItIsOkAndExactlyTheReadsExtent`. **Red once:** the red-check drops the size term from the predicate → the short-reply case fails (verified RED). **M3 / codex 10 — the tight-size helper production did not call.** `EmitReadPixels` now computes `info.DstSize` via `TightReadbackBytes(...)`, the same function `TightReadbackByteCount` (the test) calls, so there is one body. **Red once:** `+16` in `TightReadbackBytes` → `DstSizeIsTheTightExtentAndNeverThePackedOne` fails (verified RED). The capacity half (codex 10b): the red-check's `ID47b` multiplies the tight extent by 100000 and drives the split lane with the init patch → `Fatal{ReplyTooLarge}` at the CLIENT before the ordinal advances (verified RED, rc=-6, baseline restored green); deleting `RequireReadPixelsReplyFits` moves the abort to the server (`Post`), so the client `ReplyTooLarge` assertion goes absent = the control notices. **M4 / codex 5 — ERROR handled three ways.** The two escapes now abort `Fatal{ReplyError,"resource_respecify"}` / `"map_persistent"` on Status=ERROR, matching the generated rows' `MGPipeTakeReplyBool` (unchanged). `SessionWait::ShutDown` now sets the status to **DECLINED**, not the pre-set ERROR, so a session torn down mid-verb returns `false`/`nullptr` cleanly instead of aborting `Fatal{ReplyError}` — the comment ("teardown legitimately reaches here") is now true rather than contradicted one frame later. (The verifier confirmed the before-state: respecify ERROR → rc=0 no Fatal; a generated row ERROR → `Fatal{ReplyError,"resource_create"}`.) **M5 — `Fatal{InitialBytesNotCarried}` role-aware.** `PipeFill.cpp`'s split respecify and flush follow-up branches now also require `!MG_Remote::Client::RunsAsTheServerRole()` (v1's `ServerLoop::OnApplyThread()`, newly declared in `WireTables.h` so `PipeFill` needs no server header). On the apply thread the server-role respecify/flush takes the same route monolith does (`MGPipeRouteResourceRespecify(desc, initialBytes)`), never the client-record follow-up whose `ClientWireRecordsEmitted()` self-check would abort the server (the split respecify branch also gave the server a `respecify(nullptr)+subdata` path monolith lacks — both gone). Proof the server never reaches it on the joint: the 14/21 split lane holds; the census shows no `Fatal{InitialBytesNotCarried}` from `mgl-srv-apply`. **M6 / codex 8 — the red-check runner.** Rewritten (`~/w7/p5-c1-r3-redcheck.py`): (1) every case asserts its OWN string — a `[ FAILED ] Suite.Name` line for a unit control, a named `Fatal{...}` read from the per-case `MOBILEGL_LOG_FILE_PATH` for a death control; `rc!=0` and a bare `[ FAILED ]` are no longer accepted. (2) A perturbation that does not compile is a HARNESS failure, never a red. (3) Every case restores, rebuilds and re-runs its baseline GREEN, and the integration cases (ID47b, M8) are included in that restore — round 2 excluded `MobileGLIntegrationTest`. (4) Non-zero exit if any control did not go red, any baseline is not green, or any perturbation failed to build. Result: **9/9 RED, restored baseline GREEN each, no harness failures, exit 0.** **M7 — `ClientWireRecordsEmitted()` is not what arms the lane.** Corrected the false claim in `WireTables.h` (round 2 called it "t1's fourth arming fact"): the harness reads the encoder's `EmitSeq` (`SplitRuntimePeek.cpp:50`, `ScenarioFixture.h:85`), which moves for the class-B verbs too. `ClientWireRecordsEmitted()` counts the ROUTED ordinal and is read only by `PipeFill`'s `InitialBytesNotCarried` self-check; making the harness read it instead is **t1's `SplitRuntimePeek`**, so I corrected the header rather than assert a fact I cannot make true, and the note names t1 as the owner of the re-point. **M8 / ID-57 — the pack-PBO destination.** `EmitReadPixels` now refuses a bound `GL_PIXEL_PACK_BUFFER` BEFORE emission and before `pixels` is touched: `Fatal{UnmigratedVerb, "ReadPixels+PACK_BUFFER"}` (R-4 class-C shape), under an active transport only (the emit table is installed only under split). **Red once:** the red-check forces the PBO probe true and drives the split lane → the named Fatal fires (verified RED, rc=-6, baseline restored green). Under monolith the path is unchanged (the emit table is never installed). The real form (server writes the reply into the buffer, b1's `MarkReadPixelsPackBuffer` as the producer) is the P6 ROADMAP item ID-57 records. **codex 6 — `PACK_SKIP_IMAGES` applied to a 2-D read.** `ReadbackPackStateIsTight` no longer rejects on `SkipImages`, and `ScatterTightReadbackIntoPackState` no longer offsets by `SkipImages*ImageHeight*stride` — GL ignores the image-level pack params for glReadPixels, as the monolith path does with `honorPackImageParams=false` (`DirectGLES.cpp:10905`). New `RemoteReadback.PackSkipImagesIsIgnoredForATwoDimensionalRead`: a 4×3 RGBA8 read with `SKIP_IMAGES=1` lands at bytes 0–47 (was 48–95) and 48–95 keep their sentinel; the fast path takes it. **Red once:** the red-check re-adds the SkipImages term → the case fails (verified RED). **codex 4 — `Stop` reinstalled the monolith adapters while the transport was live.** New atomic `g_clientTablesUninstalled`; `UninstallClientWireTables()` now RAISES it (does not reinstall monolith) and `RequireSession` reads it first, aborting `Fatal{ClientTablesUninstalled, ""}` before any ring access. `ClientSession::Stop` calls Uninstall at the top (as before) and `ReinstallMonolithAfterTeardown()` at the very end of BOTH paths — so during teardown a routed GL-thread call refuses by name, and only once the rings are freed do the monolith adapters go back for the at-exit `~BufferObject` deletes. New `PipeRouting.ARoutedCallDuringTeardownRefusesByNameNotRunsTheApplier` (fork). **Red once:** the red-check reverts Uninstall to `MGPipeInstallMonolithTables()` → the routed call runs the applier, no refusal → the case fails (verified RED). **codex 12 — a repeated `MakeEGLCurrent` did not adopt its new caps.** `BackendObject_Remote:: MakeEGLCurrent` now, after the base call succeeds and for a non-release make-current, pumps the control plane and refreshes the format caps — so `ServerMakeEGLCurrent`'s republished snapshot is adopted on EVERY successful make-current, not just the first-per-surface one the base runs `InitCapabilities` for. R-12 arm (a) now holds at the make-current that caused it. (The verifier's control: change a server cap, repeat make-current, read the mirror generation + a public getter without a manual pump/Present — measured before-fix as `gen 3→3`; after this it advances.) **item (b), coordinator — `Fatal{BlobMissing, "SetDynamicState"}`.** `set_dynamic_state` carries an OPTIONAL blob, not a mandatory one: `EmitRenderState` (`PipeFill.cpp:2405`) sends a version-only update with `ChunkMask==0` and zero bytes, which the round-2 `MGP_WIRE_BLOB` wrapper's `StageRequired` aborted on. `Wire_SetDynamicState` is now hand-written and uses `StageOptional` (like the two sub-data rows); the decoder already took the `ChunkMask==0` arm (`PipeWireCodec.cpp:1582`, `CheckBlobIsHonest`, no blob resolved). Classification: it was a c1 round-2 regression that turned a legal header-only update into a blob-shape abort on the ordinary inproc lanes, masking the honest class-C death. Confirmed: on this head `BlobMissing` appears **0 times** in the full inproc census, and `CrossFrameBufferScenario` now dies at its honest `Fatal{UnmigratedVerb, "DrawElements"}`. (Not unit-red-checkable without a session + empty-chunk draw; covered by the census probe.) **The six minors (`c1-review-v2.md` §Minors).** - **m2** (routed rows ran monolith after Stop; Uninstall before the `!m_started` early return): addressed by codex 4 — routed rows now refuse `ClientTablesUninstalled` during teardown, and `ReinstallMonolithAfterTeardown` runs on the failed-Start early-return path too, so "the arm is monolith" after a failed Start is once again true. - **m6** (`ImageHeight` ignored / `ROW_LENGTH