Files
MobileGL/docs/Disaggregated/notes/p5b/p5b-results/r2-v1.md
T
swung0x48 aba329cc53 [Docs] (Disaggregated): P6's plan and contract draft; the working notes move from a local directory into the repository
Two things land together: the plan and contract draft P6 needs before it starts, and the
working notes that until now existed on exactly one machine.

1. P6's plan and contract draft (neither started; not one line of code)

     docs/Disaggregated/P6-SPAWN-PLAN.md      the package plan
     docs/Disaggregated/P6-CONTRACT-DRAFT.md  the contract draft (moves to
                                              MG_Remote/CONTRACT-P6.md when c6 lands)

   The three findings that mattered, all written into the documents:

   a. P6 is SMALLER than its roadmap cell suggests. The transport primitives are already in
      the tree and already tested: SocketDoorbell including hangup detection and the two
      lost-wakeup fences (Doorbell.cpp:211-360, four cases in FdPassingTest), SCM_RIGHTS fd
      passing, ShmSegment::Adopt, and the SurfaceOp / WindowKind schema already defined in
      protocol.fbs. inproc uses a real second shm mapping rather than an alias, and
      SessionRings.h:22-28 says that was done so today is not the first time it runs. P6 is
      assembly plus a control plane plus a process, not "write a socket transport".

   b. The evidence for "P6 is only a transport swap" has EXPIRED. It was bought by P5c, whose
      audit found 59 direct memory accesses in a tree that already looked clean. P5e changed
      the tree again. So the first package, a6, is a read-only audit that writes no code, and
      every contract row that depends on it is marked PENDING a6 rather than decided in
      advance.

   c. P6 does not get a game running on the phone. ANativeWindow* is meaningless in the child,
      and protocol.fbs:186-196's own comment says Android transfers the window out of band -
      that band is P12. P6 lands pbuffer / surfaceless / offscreen, which is what HeadlessGL,
      the split-equivalent lane and trace replay need, and which is exactly what P6's own exit
      gate measures. A real window reaching the server is a named refusal. This gets its own
      section because "P6 is done" would otherwise read as "the game runs now".

   The contract adds rule G: a role may not name a process-local handle. It extends P5c's
   rule E (a role may not name the other role's memory) from memory to identity - EGLDisplay /
   EGLSurface / EGLContext / ANativeWindow* / fd number / pid / mapped address either cross as
   a token this contract defines or they do not cross, and a descriptor crosses only through
   SCM_RIGHTS, where the kernel renumbers it.

   What P5e left for P6 gets its own section. The latch semantics are already designed
   (ARCHITECTURE.md:504) and are copied unchanged. What is new is that after run-ahead the
   client no longer waits while the peer process can DIE: the client holds records that were
   published and will never be applied, and Android's freezer suspends the child without
   closing anything. So slow and dead must be distinguishable WITHOUT a timeout threshold.
   That is P6's only new design; everything else is carriage. It shares a predicate with E1's
   outstanding re-specification (ID-122), and the two should be designed together.

   Two gates carried over from P5e's lessons: G2 requires integration-spawn's test-name set to
   match integration-split's name for name, because a differing set means the lane is quietly
   running less; and the arm-proof gate requires every entry to record the child pid and
   transport=spawn in its OWN private log - ID-124 established that this kind of false green
   really happens, and a spawn lane that actually ran monolith would pass every other gate.
   S2's shape must be settled before it is written, and the document says why: E1 is the
   cautionary case.

2. The working notes move into the repository (docs/Disaggregated/notes/, 415 .md files)

   ROADMAP / CURRENT_STAGE_PROGRESS / MEASUREMENTS cite ruling numbers, audit line numbers and
   the provenance of gate figures from ~/w7/notes/, a directory that exists on one machine and
   is under no version control. A record cited hundreds of times that lives only locally is not
   a record, so it moves in whole, with its directory structure intact.

   Only .md moves. Scripts, run logs, census and gate result JSON, patches, APKs and nm dumps
   stay where they are: they are evidence DATA rather than documents - large, regenerated per
   run, and mostly carrying absolute paths and device serials that mean something only on the
   machine that produced them. The mapping and this split are written in
   docs/Disaggregated/notes/README.md.

   Two exceptions are recorded there too: P6's BRIEF has been promoted to a first-class
   document and keeps no copy under notes/, so the two cannot drift apart; and recovered/ holds
   material salvaged from failed workflow runs, which may duplicate the like-named phase
   directories and is kept because a few of those were the only complete version at the time.

   CI's citation lint takes docs/Disaggregated/*.md only (non-recursive), and notes/ is
   deliberately outside it: those notes' file:line citations were written against their own
   code heads, and resolving them against today's HEAD would fail wholesale - which is not an
   error, it is their correct state as a historical record. To check one, use the revision it
   declares (--rev).

3. Inconsistencies fixed in passing

   - README.md's status line still said P5e was in progress while the stage table already said
     closed.
   - CURRENT_STAGE_PROGRESS's next-step item 1 still listed the exit gate as pending, though
     (a) and (b) were run in the previous commit; rewritten to closed plus the one item that
     actually remains (E1).
   - ROADMAP's P6 row still had the pre-phase plan in three of its cells; it now carries the
     package order, the scope boundary and the two new gates.

Checked with check_doc_citations.py: 125 citations across docs/Disaggregated/*.md, 0 problems.
2026-09-18 23:31:39 -04:00

120 lines
14 KiB
Markdown

# P5b r2 — CI, controls and runner fixes
Range: `37fc4fdb..d50183cb`, isolated worktree `/home/swung/w7/p5b-r2`, branch `p5b/r2`.
`6fa6a925` contains the CI/control fixes; `d50183cb` isolates finding 8's allocator/telemetry
and harness seam for the r1 merge. `feat/disaggregated` remained `37fc4fdb` at completion.
This is ID-73's implementation round, not another adversarial review.
## Findings and executed red-once evidence
| Finding | Change | Executed red-once / own diagnostic |
|---|---|---|
| 5 | Broad inproc CTest status is recorded, its JUnit uploaded and its pass/skip/abort/fail counts written to the job summary. Monolith, reduced split and controls remain hard gates; E1/E3 also run under `!cancelled()`. No temporary branch-trigger additions. | Executed the actual YAML shell body with an indebted CTest exit 8: fixed body records aborted=1 and reaches `CONTROLS_REACHED`. Removing only `|| inproc_rc=$?` exits 8 before that marker. `p5b-r2-probes.log`: `F5 RED: fail-fast restored -> controls not reached (exit 8)`; transcript `p5b-r2-probes/5-census-step.log`. |
| 6 | Pull-library control saves/restores the exact frozen split library through an EXIT trap; both retrace controls assert `nm` identity, including nm failure. Draw-drop receives the frozen path explicitly from CI. Output restoration also runs on failure/interruption. Smoke checks compare the restored library bytes. | Real CTest OpenRA baseline, pull control, then draw-drop ran in workflow order. SHA256 unchanged after pull control. Preplacing the pull library at that path makes draw-drop fail before replay: `draw-drop control requires a split library: MG_Remote=0`. `p5b-r2-retrace.log`, `p5b-r2-retrace/{baseline,pull-control,drop-control,wrong-library-red}.log`. |
| 7 | E3(a) selects the two pixel cases explicitly in default/SmallRing lanes, excluding `TheMapLandsInTheArmItsLaneDeclares` with the by-design reason in the script. Pixel evidence is required in EACH selected JUnit testcase, not the combined transcript. Added E3-specific pre-flight-skip smoke case. | Restoring the broad selection on the live build fails: `SplitLogPaths FAILED: E3(a) control: the knob killed the pre-flight, not the entry - 2 selected entries skipped` (`p5b-r2-e3-red.log`). Restored selection: four own pixel failures plus four own private disabled-push diagnostics. E3 pre-flight skip remains rejected in smoke. |
| 8 | `ringwaits` now counts an allocation blocked on outstanding retirement after immediate reclaim failed, once per allocation. The live encoder receives the session's shutdown-aware doorbell and waits/retries outstanding staging marks; unsubmitted exhaustion and individually oversized blobs still refuse. SmallRing drives two ordinary 768 KiB GL uploads with a scheduling-only before-retire hook, then asserts both wrap and wait. New unit case proves lazy reclamation alone is zero waits. | `p5b-r2-ring-red.log`: 1 MiB arm green; raising command AND staging rings to 8 MiB fails on both `NEVER WENT ROUND` and `producer NEVER WAITED`. Logs `p5b-r2-ring-{1,8}.{out,log}`. At 1 MiB: maxrec 784, cap 524288, cmdbytes 1315256, ringwraps 1, ringpads 0, ringwaits 1, emitseq 24328. |
| 9 | All-skip control baseline is a hard failure; baseline CTest errors cannot arm controls. CI and local baseline invoke shared `junit_tally.py --require-split-ran`, filtering out the metadata test so it cannot arm an empty runtime lane. | Actual control with all-skipping stub: `split baseline FAILED: every DirectGLES.Split. entry SKIPPED; the split implementation did not execute`. `p5b-r2-probes/9-all-skip.log`; smoke now expects failure. |
| 10 | `MOBILEGL_ITEST_REQUIRE_GPU=1` on the split unit step and local split unit invocation. Local gate now propagates that unit exit code rather than swallowing it in a summary substitution. | Real `ServerLoopEglTest.MakeCurrentBindsNativelyOncePerContextAndNeverForwardsAClientRelease`, invalid EGL vendor: optional arm SKIPPED/exit 0; required arm fails with `a failure, not a skip`. `p5b-r2-probes/10-{optional,required}.log`. |
| 11 | Both external census Python runners truncate each private log BEFORE launch, count actual gtest RUN records, reject zero-run success as `harness-error`, distinguish segfault/abort, and do not let skip text override failure. Timeout bytes and launch errors handled. The shell runner preserves its output directory and rewrites this run's artifacts instead of recursive deletion. | Both exact runners executed against a nonexistent gtest selection: `HARNESS ERROR: zero executed tests`. Both preseeded with stale FATAL evidence, then launched a nonexistent executable: rc=127, current private log empty, fatal=None. `p5b-r2-probes.log` and its `r2-{zero,stale}-*` artifacts. Real census reproduced 432/185/505/27. |
| 12 | Both pin self-tests call production `extract_baseline` using real historical refs with drifted pinned bodies (p3a ff2994d9; p4a 37da3c3a); their negative arm also uses production baseline extraction. They no longer directly call the pin helper. | Removed ONLY the production `apply_pinned_shas` call, leaving helper intact. Both self-tests failed with `PIN CONTROL FAILED: a baseline that carried a DIFFERENT sha for FlushPendingRangesFrom...`. `p5b-r2-p3a-red.log`, `p5b-r2-p4a-red.log`; restored positives `p5b-r2-{p3a,p4a}.log`. |
| 13 | c1f mutation now targets ID-67's different-tuple adoption case. Both different-tuple and identical-tuple cases must pass in baseline/restored runs; the adoption mutation is expected to redden only different-tuple. | Full shipped mutation runner: 15 named REDs, restored GREEN, `FAILED_CONTROLS=[]` in `p5b-r2-c1f-full.log`; focused `codex12-repeat-skip: RED build=0 run=1` in `p5b-r2-c1f.log`. The obsolete name is no longer selected. |
All evidence paths above are under `/home/swung/w7/`. External driver sources are
`notes/tools/p5b-r2-{setup,build,gate}.sh`, `notes/tools/p5b-r2-{probes,retrace,ring-red}.py`;
the owned link toggle is `p5b-r2-submodlinks.sh`. `p5b-r2-venv` supplies PyYAML for YAML probes.
The real retrace uses existing host replay tooling and hydrated fixtures read from pipe; no
LFS fetch, adb access, or write to another worktree/build directory occurred.
## Integration seam and external files
Finding 8 necessarily meets r1 finding 4 at `PipeWireEncoder::StageAllocate`.
This branch adds the smallest live staging wait needed to make a truthful wait counter and
SmallRing gate execute: `ClientSession` supplies its own doorbell; immediate reclaim is not
counted; only pending published marks are waited on, with a five-second shutdown-aware bound.
It does not fix command-ring exhaustion or claim closure of r1's full finding 4.
Integrator must preserve r1's retirement policy and these counter semantics when merging,
plus the before-retire scheduling hook used by the GL-driven SmallRing gate. The hook does
not publish watermarks, allocate bytes or modify counters. All of this is split-only.
Changes outside git, applied in place: `/home/swung/w7/p5b-c0b-census.{sh,py}`,
`/home/swung/w7/notes/tools/p6_census_lane.py`, and minimal split unit/baseline/control
exit propagation plus ID-65 wording in `/home/swung/w7/notes/tools/wsl_p5_gate.sh`.
These must travel with the integration tooling; a git merge alone cannot install them elsewhere.
## Corrections for the docs close-out (docs deliberately not edited)
1. x2's “all three obligations closed” was package-local evidence, not final workflow proof.
Old SmallRing asserted wrap only, and old ringwaits counted reclaim attempts. This report
supplies the combined control sequence and actual wait assertion.
2. The unmapped E5 staged-shadow control does not prove coherent-map wire-only correctness.
r1 finding 1 owns server re-entry; old `pmap` figures cannot establish exclusive transport.
3. `SlotCaps.h`'s “frontend CPU readback, which is exact” is too broad: 22 retained texture
readback failures contradict it. A phase waiver is not correctness.
4. “none is v1's” and describing all 27 wrong answers as texture readback are unsupported.
The record separates 22 texture readbacks, three queries, one inspection and one FBO/RBO
lifetime path. The latter uses ReadPixels; its full pixel causality was not isolated.
5. Old 426/185/511/27 comprises 505 class-C aborts AND six P5 overbroad
StageSnapshotTooNarrow refusals. Those six were fixed by v1 r3, not waived to P8/P11.
The reproduced review-head census is 432/185/505/27, all 505 UnmigratedVerb.
6. MEASUREMENTS max-record/census/A-B “pending” entries need the later measured reports.
Minecraft inproc aborts belong to ID-66/68's P5b exit work; device barrier cost remains
unmeasured, not inferred from splitctl or aborted benchmarks.
7. Historical joint G1/G2/G14, unit/retrace counts, RSS and controls remain historical and
revision-qualified. CTest totals include skips. E3(a)'s old “6 red” was 4 red/2 skip;
ID-42/audit had documented skips; rsp=35 is a lower bound; inproc RSS is shared-process,
not two independent peaks or an N-frame slope. No old summary proves a final merged workflow.
8. Final-head full-gate/APK evidence was unavailable to the review (the gate log was then
empty; the APK report used e61d0012). The docs close-out must cite completed, pinned new
evidence rather than relabel package or joint gates. c1f's historical 15/15 used the old
case name; this report supplies a reproducible current-name run.
## ROADMAP-shaped rows for previously unnamed debts
| Phase / proposed owner | Concrete gap | Retirement gate / status |
|---|---|---|
| P5b r1 / buffer + server | Coherent-map server re-entry into the client producer, including frontend serial/aggregate writes and direct adapter bypass | Suppress only client pre-draw push; coherent mapped draws must expose missing transported bytes; producer must refuse server-role access. Assigned r1, not claimed fixed here. |
| P5b r1 / readback | Client multibyte PACK_SWAP_BYTES conversion after tight server readback | One-pixel non-symmetric UNSIGNED_SHORT read matches monolith with swap toggled; r1 finding 3. |
| P5b r1 + r2 / transport | Applied-before-retired scheduling and allocation wait/retry policy | Delayed-retirement uploads wait without false RingOverrun; command ring and shutdown policy covered by r1; r2 adds actual staging-wait telemetry and GL SmallRing proof. |
| P5b r2 / CI controls | Combined control lifecycle and own-entry red selection | Restore exact frozen split library, run pull then draw-drop; E3 skips cannot satisfy pixel control; broad census cannot suppress reduced gates. Closed by this package's executed controls. |
| P7/P8 / PipeInputs owner (assignment proposed) | Sticky/non-verb forwards bypass rsp accounting and strict checks when no verb is stamped | Count and classify every non-verb frontend read; deleting one classification must produce its own named gate failure. Existing rsp is a lower bound until then. |
| P5b follow-up / client reply protocol (assignment proposed) | Exact-sized ReadPixels reply status 3 is accepted though only 0/1/2 are valid | Adversarial live reply sink posts status 3 with correct extent; client must reject by named protocol diagnostic. Production emission of status 3 remains unverified. |
Previously named context-loss restaging, PACK-PBO, oversized readback, GetCaps/ABI sizing,
texture readback, query and inspection debts are not relabeled as new debts here.
## Final acceptance
| Gate | Result on the final source |
|---|---|
| Split unit, REQUIRE_GPU=1 | **2087 selected, zero failures** (2086 baseline + lazy-reclaim unit case; pre-existing non-EGL skips remain) |
| inproc integration-split, REQUIRE_GPU=1 | **22 selected, zero failures**, including the two documented map-arm body skips; metadata is excluded from the runtime baseline tally |
| E1 / E3(a), exact CI script | **14 own barrier reds / 4 own pixel+private-log reds**, script exit 0 |
| OpenRA E2, real CTest | Baseline **SSIM 1.0**; sequential pull-library and draw-drop controls exit 0; draw-drop **0.000036**, **758** drops |
| Smoke / smoke redcheck | **16 core + 12 private-log cases**, zero failures; `P5_T1_CONTROL_SMOKE_REDCHECK_OK` |
| Full c1f mutation runner | **15/15 RED**, every restored baseline green, `FAILED_CONTROLS=[]` |
| Census on this tree | **432 passed / 185 skipped / 505 aborted / 27 failed**, 1149 total; all 505 aborts carry UnmigratedVerb, zero segfault / zero harness-error |
| Push integration-gpu | **1128 selected, zero failures** |
| G5 pin self-tests | Both green; deleting each production pin-selection call fails on its own PIN CONTROL FAILED message |
| YAML | `test.yml` and `apk.yml` parse successfully; actual changed census shell body executed by the red-once probe |
| G1 | **Unaffected by construction: no pull-reachable production code changed.** MG_Remote implementation/header changes are split-only; other C++ changes are test harnesses/tests. No new pull binary comparison is claimed; inherited 0/0/0/0 and `.text +0` are not relabeled as a new measurement. |
Final gate driver exits 0 with `UNIT_OK SPLIT_OK CONTROLS_OK SMOKE_OK CENSUS_OK PUSH_OK`
in `p5b-r2-final-gate.log`. Authoritative test transcripts: `p5b-r2-{unit,split,push,controls,
smoke,redcheck,census}.log`, census per-entry evidence `p5b-r2-census-logs/results.json` and
its adjacent fresh private logs/output, and `p5b-r2-controls/` (JUnit/control evidence).
The intentional E3 broad-selection run also retains `p5b-r2-controls-red/`.
Retained configure/build evidence: `p5b-r2-config-{split,push}.log`,
`p5b-r2-build-{split,push,wait,wait-final,push-final}.log`. `p5b-r2-wait.log` is an earlier
focused SmallRing run; the later two-arm `p5b-r2-ring-red.log` is the final wait control.
The initial focused c1f attempt hit a CMake regeneration timeout scanning the inherited Windows
PATH; it was stopped before source mutation, and the cited successful runs use
`PATH=/usr/bin:/bin`. No failed build was accepted as a mutation red.
Commit driver: `notes/tools/p5b-r2-commit.sh`; identity and exact SHAs in
`p5b-r2-commit.log`. Both commits are one-line messages with no trailers, committer
`Swung0x48 <swung0x48@outlook.com>`. `git diff --check` clean; final worktree clean,
submodule links **off**. No integration-head merge was needed.
Final clean-tree, links-off, unchanged integration head and per-abort attribution check:
`notes/tools/p5b-r2-final-check.py`, transcript `p5b-r2-final-check.log`.