[Docs] (Disaggregated): the four index documents keep only summaries, and every phase's detail lives in its own notes/<phase>/README.md

- ROADMAP, MEASUREMENTS and ARCHITECTURE are rewritten as summaries (333 KB of index text -> 84 KB).
  ROADMAP's phase table is one line per phase plus a link; MEASUREMENTS keeps headline numbers under
  its old §1-§13 numbering (plus §14-§16 for P6.5, P7 and P12); ARCHITECTURE keeps every decided rule
  under the same §1-§17 / appendix numbering, so the `ARCHITECTURE.md §N` references in code still
  land, and §17 becomes an index of the phase landing shapes.
- CURRENT_STAGE_PROGRESS now describes the current stage (the P12 on-screen-server subset) and absorbs
  CURRENT_STAGE_STATUS, which is removed. The P7 status tables, the P6 closing snapshot and the P6.5
  first-wave snapshot move to notes/p7, notes/p6 and notes/p65.
- Each phase gets notes/<phase>/README.md: a short summary, then the verbatim material that left
  the index documents (its ROADMAP row, its MEASUREMENTS section with subsection numbers kept, its
  ARCHITECTURE §17 part, milestones) and a file index. P8-P11 and P13 get their planned scope;
  the full open-question list moves to notes/OPEN-QUESTIONS.md.
- The phase reports that sat at the top level move into their phase folders with unchanged names:
  P5D-INPROC-PERFORMANCE, P5E-RUNAHEAD, P5F-WIRE-COMPLETENESS, P6-SPAWN-PLAN, P6-CONTRACT-DRAFT,
  P6-ENDSTATE-REVIEW. Their relative links, CONTRACT-P6.md's links to them and one tool docstring
  are updated; notes/README.md maps every old path and section number to its new place.
- 71 files under notes/recovered/ that were byte-identical copies of phase-folder files are removed.
- Corrections made while condensing: the server process reads Transport as Spawn (CONTRACT-P6 §3.1
  amended the old "child forces monolith" rule); both backends now publish kCapRunAheadApply;
  MOBILEGL_IPC_RESPAWN is a named refusal and MOBILEGL_IPC_IDLE_EXIT_S is not parsed; the Redmi
  pin row is in tools/device_bench/pin_device.sh.

check_doc_citations over docs/Disaggregated/*.md: 0 problems. No relative link is newly broken.
This commit is contained in:
2026-09-24 22:21:09 +00:00
parent 1fb18d9e73
commit 43b5cfa94e
111 changed files with 2645 additions and 20434 deletions
@@ -1,572 +0,0 @@
# P1 implementation brief — PipeInputs strangler, per-verb fill points, poison generations, MOBILEGL_PIPE_VERIFY comparator and its CI mode
Tree: `feat/disaggregated @ 087685d1` (worktree `C:/Users/geekerwan/AndroidStudioProjects/FoldCraftLauncher/MobileGL-disagg`; WSL `~/w7/pipe` is a worktree of the same repo at `087685d1`, branch `feat/disaggregated`, with a configured `build-linux/` — Release, `/usr/sbin/clang++` (clang 22.1.6; there is no `clang++-20` in WSL), ccache, `MOBILEGL_LOG_ACTIVE_LEVEL=MOBILEGL_LOG_LEVEL_INFO`, `MOBILEGL_BUILD_TEST=ON`, `MOBILEGL_BUILD_INTEGRATION_TEST=ON`, `MOBILEGL_BUILD_DISAGGREGATED=OFF`, `MOBILEGL_ITEST_EGL_VENDOR=/usr/share/glvnd/egl_vendor.d/50_mesa.json`, `MOBILEGL_ITEST_VK_ICD=/usr/share/vulkan/icd.d/lvp_icd.json`, `MOBILEGL_ITEST_REQUIRE_GPU=OFF`; `build-retrace/` exists; 94 fixture files under `tools/trace_replay/fixtures/`; 28 cores). `~/w7/base` is `dev@81b17c0b` (the performance anchor, untouched). The P0.5 tooling in `scratchpad/wf2/` (`wsl_p05_trees.sh`, `wsl_integrate_p05.sh`, `retrace_gate.py`, `wsl_retrace_baseline.sh`) is the shape every WSL step below copies with `p05`→`p1`.
Every `file:line` below was re-opened at `087685d1` (the scouts were written at `5635e33f`; the one commit between is CI-only, `.github/workflows/test.yml`, and every scout line number still holds). Corrections to the scouts are marked **[correction]**; deliberate deviations from the design documents are marked **[deviation]** and carry their reason.
**Scout verification summary.** The pull-site catalogue (`scout-pull-sites.md` §1) was cross-checked mechanically against the live tree (`scratchpad/wf4/xcheck.py`): all 335 `pGLContext` occurrences on 332 lines in 12 files match the catalogue line-for-line and accessor-for-accessor (the script's one "DIFF" for `VulkanRenderer.cpp` is the parser swallowing the §5 sync tables that follow that heading; 158 − 26 = 132 = live). Spot-reads of 40+ sites across both backends confirmed the `enclosing function` / `verb path` columns with one exception, **[correction]** `VkRenderPassManager.cpp:1111` sits inside `VkRenderPassManager::GetOrCreateRenderPass` (the `ConvertTextureInternalFormatToVkEnum` the catalogue names at `:1044` is `MG_Util::`'s, a different function that reads nothing), so all three `VkRenderPassManager.cpp` reads are render-pass creation — reached from draws, clears and blits only. No `pGLContext` use exists in `MG_Backend` outside the 12 catalogued files (`Init.cpp`, `BackendObject.*`, `BackendObjects.h` and every other `.h` are clean); no other `MG_State::` global is reached (`MG_State::pGLContext` is the only one, 335/335). Other corrections: `scout-docs-spec.md` says "~34 `MOBILEGL_ASSERT`" — the live count is **43** (34 in `DirectVulkan.cpp` + 9 in `UniformManager.cpp`); `scout-pull-sites.md` cites `MGPipeHostSpan.h:119-154` — the file is 57 lines, `struct MGHostSpan` is `:28-37`; `scout-test-infra.md` B2/B4 gate the poison on `MOBILEGL_DEBUG`, which does not exist anywhere in the tree (D2 below). The MG_Impl boundary is **83 call statements over 69 distinct table entries**, not "~93 sites" (the 91-line grep counts null-checks and captured-pointer lines; §B.7). `Present` and `SetSwapInterval` are never called through `gBackendFunctionsTable` from `MG_Impl` — EGL goes through `BackendObject` virtuals (`EGLImpl.cpp:178,448`) — and neither backend's present path reads `pGLContext`, so they are not fill points.
---
## A. Goal and acceptance gate
`docs/Disaggregated/ROADMAP.md:17`, verbatim:
> **P1** `PipeInputs` 替换与 verify harness | 10–13 | `MG_Backend/MGPipe/PipeInputs.h`(Espryt 32 / Magma 55 访问器);`sed` 293 处 + 58 行非箭头清单逐条转换(显式交付物);逐 verb 类填充点(G5 表,~93 个边界站点);逐 verb 世代 poison;G4 影子比对器 + 第三种 CI 模式;20 处 `SyncPersistentMappedRange` + 6 处 `SyncGpuWrites` 的逐站点归属表 | pull 构建 `nm --defined-only` 不变、`.text` 差异逐行归因(空守卫/三元重写推迟到 P2);40 trace + 全部集成测试在 `MOBILEGL_PIPE_VERIFY=1` 下零分歧;故意损坏一个快照字段能让 verify 变红;故意在 `glGenerateMipmap` 的填充表漏一个字段能在**那条 verb** 上触发 poison Fatal | P0.5
Binding context: `ARCHITECTURE.md:325-340` (the `PipeInputs`/`MGB_CTX` sketch), `:342-347` (phase A/B/C table — P1 is phase A plus the phase-B scaffolding: verify harness, poison, fill points), `:348-349` (fill points per verb class; poison is a per-verb generation, `Fatal{UnmigratedPipeInput, "<Field>@<Verb>"}`; gate C greps `pGLContext`, not `pGLContext->`), `:501` (gate 13.2-②: two state models in one address space, `SnapshotFromGLContext()`, field-wise, first differing field + draw serial, third CI mode 5–10× slower, never shipped, survives P13), `:369` (P13 keeps `MOBILEGL_PIPE_VERIFY` with the `MG_State` include it needs), `:553` (`MG_Backend/MGPipe/` is created in P1), `:583` (`MOBILEGL_PIPE_VERIFY` is a **CMake** option, planned P1). `ROADMAP.md:7`: **每个门必须能因它存在的理由变红**; Windows is not a correctness gate. `ROADMAP.md:38`: day 25 is the P1 exit, "verify harness 逐 draw 逐字段证明推送等价于拉取", not a GO/NO-GO. `ROADMAP.md:46`: the first GO/NO-GO item is P1's proof.
Decoded into checkable statements:
| # | statement | how it is checked |
|---|---|---|
| G1 | The **pull build** (`MOBILEGL_PIPE_PUSH=OFF`, `MOBILEGL_PIPE_VERIFY=OFF`, Release/INFO, LTO off) has an identical `nm --defined-only` symbol set before and after P1, and a `.text` byte delta of **zero**; if not zero, every differing symbol is attributed to one of the 58 converted non-arrow lines (D9). | `scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0 --json` → `added == removed == resized == renamed == 0`, `.text` delta 0 (C.integrator). |
| G2 | Every backend read of frontend state goes through `MGB_CTX` (335 occurrences → 0 `pGLContext` tokens in `MG_Backend/**` except inside the pull arm of the one switch header, which lives in `MG_Pipe/`). | `grep -rc "pGLContext" MobileGL/MG_Backend | grep -v ":0$"` is empty. |
| G3 | In the **verify build** (`MOBILEGL_PIPE_VERIFY=ON` ⇒ `MOBILEGL_PIPE_PUSH=ON`), with `MOBILEGL_PIPE_VERIFY=1` in the environment, the 40-trace retrace (79 desktop cases: 40 × 2 backends minus `iterationrp × DirectGLES`; `create-indirect` waived on device only) and **every** integration entry (the 742-entry `integration-verify` lane) run with zero `Fatal{PipeVerifyDiffer` and zero `Fatal{UnmigratedPipeInput` and the arming line present in every log. | `retrace_gate.py` under `MOBILEGL_PIPE_VERIFY=1` against the verify `.so`; `ctest -L integration-verify --no-tests=error`; `run_trace_case.cmake`'s arming/differ assertions (E). |
| G4 | Negative control A: `MOBILEGL_PIPE_VERIFY_CORRUPT=GetRenderStateParameters` turns a green verify run red, naming that field and the verb serial. | unit (A), lane (E), CI step (E). |
| G5 | Negative control B: `MOBILEGL_PIPE_POISON_OMIT=GenerateMipmap:GetActiveTextureUnit` makes `glGenerateMipmap` abort with `Fatal{UnmigratedPipeInput, "GetActiveTextureUnit@GenerateMipmap"}` on **that** call, and no other verb is affected (a sibling field on the same verb stays fresh; the preceding draw does not abort). | unit (A), fork/waitpid scenario per backend (E). |
| G6 | Every one of the 20 `SyncPersistentMappedRange` and 6 `SyncGpuWrites` sites has a row in the ownership table (D10) stating the §5.7 reconcile class it must reproduce; the `*IndirectCount` rows record today's behaviour verbatim (open question #15, not fixed in P1). | the table is in this brief; the integrator lands it in `docs/Disaggregated/MEASUREMENTS.md`. |
| G7 | Existing test names unchanged (additions only); `pipe-gates`, `include-graph-check`, `test`, `integration`, `retrace` all green; the new generated file is regenerated by `gen_pipe.py` and diffed by CI. | `ctest -N` name diff (`comm -23` empty); `gh workflow run test.yml --ref feat/disaggregated`. |
| G8 | The gate itself can go red for its reason: the arming assertion fails a lane whose library never armed; `--no-tests=error` fails a lane whose label matched nothing; the two negative controls are always-on CI steps. | E. |
---
## B. Fixed design decisions (every package follows these; nothing here is re-decided inside a package)
### D1 — Counts, measured at `087685d1`
| what | value |
|---|---|
| `pGLContext` occurrences / lines in `MG_Backend/**` | **335 / 332** (3 lines hold two: `VulkanRenderer.cpp:9214,10719,10963`) |
| arrow sites `pGLContext->` | **277** occurrences on 274 lines: `DirectGLES.cpp` 91, `Managers.cpp` 15, `MultiDraw.cpp` 5, `Utils.cpp` 2, `BackendObject_DirectVulkan.cpp` 2, `DirectVulkan.cpp` 12, `UniformManager.cpp` 14, `VkClearManager.cpp` 1, `VkRenderPassManager.cpp` 3, `VkTextureManager.cpp` 2, `VulkanRenderer.cpp` 127 (130 occurrences) |
| non-arrow lines | **58**: 43 `MOBILEGL_ASSERT`, 7 null guards, 5 `!= nullptr` outside asserts, 1 `== nullptr`, 1 `.get()`, 1 comment (D9 lists every line) |
| distinct accessors read | **62** (Espryt 32, Magma 56) + one `.get()` |
| `PipeInputs` field set | **63** = the 61 rows of `Coverage.def:30-97` + `GetBoundTransformFeedbackLifetimeId` + `HasOpenTransformFeedbackSpan` (D13). `GetBoundTransformFeedbackName` (`Coverage.def:34`) is read by no backend; it stays as a field so the vendored inventory row `backend_read_inventory.md:594` keeps its mapping (`kMGPipeInventoryUnmapped == 0` is asserted at `PipeCatalogueTest.cpp:213-214`), and is marked dead in the header. |
| MG_Impl fill points | **83** call statements over **69** verbs (every function-pointer member of `GLFunctionsTable`, `BackendObject.h:117-289`); `CompileEnv.cpp:135,137` (`MG_Util`) also calls `GL.GetIntegeri_v` and gets no fill point (the entry reads no frontend state on either backend) |
| `SyncPersistentMappedRange` / `SyncGpuWrites` | 20 / 6, exactly as catalogued (D10) |
ROADMAP's "293 / 32+55 / ~93" are the vendored-inventory numbers; the integrator corrects them in the docs (C.5). `MEASUREMENTS.md:82`'s "61 个 PipeInputs 字段" becomes 63.
### D2 — Switches and their spellings
| switch | kind | default | meaning |
|---|---|---|---|
| `MOBILEGL_PIPE_PUSH` | CMake `option()` + compile definition `-DMOBILEGL_PIPE_PUSH=1` (in `MOBILEGL_COMPILE_DEF`, `CMakeLists.txt:523-525` shape) | OFF | `MGB_CTX` expands to `&gPipeInputs`; the fill points and the filler are compiled; `MobileGL/MG_Backend/MGPipe/PipeInputs.cpp` and `MobileGL/MG_Impl/Pipe/PipeFill.cpp` are appended to `SOURCE_FILES`. OFF is the pull build and must be byte-identical to today. |
| `MOBILEGL_PIPE_VERIFY` | CMake `option()` + `-DMOBILEGL_PIPE_VERIFY=1`; **forces `MOBILEGL_PIPE_PUSH` ON** (`set(MOBILEGL_PIPE_PUSH ON)` as a normal variable in the configure that sees VERIFY, with a `message(STATUS)`) | OFF | compiles the second snapshot, the entry comparator, the compare-at-read hook and the two negative-control knobs. Never shipped. |
| `MOBILEGL_PIPE_POISON` | derived preprocessor macro, defined **once**, in `MobileGL/MG_Backend/MGPipe/PipeInputs.h`: `#if MOBILEGL_PIPE_PUSH && (MOBILEGL_LOG_ACTIVE_LEVEL <= MOBILEGL_LOG_LEVEL_DEBUG || MOBILEGL_BUILD_DISAGGREGATED || MOBILEGL_PIPE_VERIFY)` → `#define MOBILEGL_PIPE_POISON 1` else `0` | — | the per-verb generation stamps and the read-side `Fatal{UnmigratedPipeInput}` check. **[correction]** the docs' `MOBILEGL_DEBUG` does not exist; the repo's debug gate is `MOBILEGL_LOG_ACTIVE_LEVEL <= MOBILEGL_LOG_LEVEL_DEBUG` (`Defines.h:104-115`). The verify CI build is Release/INFO with `MOBILEGL_BUILD_DISAGGREGATED=OFF`, so the third arm is what arms the poison there without dragging `MG_Remote` in. |
| runtime `MOBILEGL_PIPE_PUSH` (`Features.PipePush`, `Config.h:326`, `ConfigLoader.cpp:245`) | Uint64 bitmask | 0 | **not consumed in P1.** The P1 filler fills every field in a verb's mask regardless of the bitmap; P2 makes the filler yield per bit to the tracker. Bit 63 stays reserved for the CSO negative control. Same name for the macro and the env var is deliberate (`ARCHITECTURE.md:334,367`): the macro selects the arm, the bitmap selects subsystems inside it. |
| runtime `MOBILEGL_PIPE_VERIFY` (`Features.PipeVerify`, `Config.h:332`, `ConfigLoader.cpp:246`) | Bool | 0 | arms the comparator at run time in a verify build. Ignored (with one `MGLOG_W_ONCE`) in a build where `MOBILEGL_PIPE_VERIFY` is not compiled in — that warning is what the arming assertion turns into red. |
| runtime `MOBILEGL_PIPE_VERIFY_FATAL` | Bool, new `Features.PipeVerifyFatal`, parsed `QueryEnvQuirkOverride(...) != ForceOff` (tri-state, like `PipeLegacyMemos`, `ConfigLoader.cpp:251-252`) | 1 | first divergence aborts (`MGLOG_F` + `std::abort()`); `0` logs and counts, for triage and for the lane that must survive to read its own log. |
| runtime `MOBILEGL_PIPE_VERIFY_CORRUPT` | String, new `Features.PipeVerifyCorrupt` (`QueryEnvVariable`) | "" | `<FieldName>` from `kMGPipeInputFieldNames[]`; perturbs that field in the **snapshot** arm before the entry compare. Unknown name → `Fatal{PipeVerifyBadKnob}`. |
| runtime `MOBILEGL_PIPE_POISON_OMIT` | String, new `Features.PipePoisonOmit` | "" | `<Verb>:<FieldName>` (`kMGPipeVerbNames[]` × `kMGPipeInputFieldNames[]`); the filler skips the **stamp** (not the value) of that field for that verb. Unknown name → `Fatal{PipeVerifyBadKnob}`. |
The three new `Features` members and their three parser lines are wrapped in `#if MOBILEGL_PIPE_PUSH` in `Config.h` and `ConfigLoader.cpp` so the pull build's `Features` object is unchanged in size (G1). `ConfigLoader.cpp:242-244`: no allow-list edit is needed for `MOBILEGL_*` names.
### D3 — `MGB_CTX` and the switch header (exact text; A creates it, B and C include it)
`MobileGL/MG_Pipe/PipeInputsSwitch.h` — lives under `MG_Pipe/`, never under `MG_Backend/`, so the pull arm's `pGLContext` spelling is outside what purity gate C greps (`ARCHITECTURE.md:500,349`):
```cpp
// MobileGL - MobileGL/MG_Pipe/PipeInputsSwitch.h
// (banner lines 2-7 as in MGPipe.h:2-7)
#pragma once
#ifndef MOBILEGL_MG_PIPE_INPUTS_SWITCH_H // belt and braces: reachable as <MG_Pipe/..> and <..> (CMakeLists.txt:531,535)
#define MOBILEGL_MG_PIPE_INPUTS_SWITCH_H
// The strangler switch (ARCHITECTURE.md 9.2). Every backend read of frontend state is spelled
// MGB_CTX->Accessor(...). Pull arm: the live GLContext, so the pull build is the tree before P1
// token for token. Push arm: the PipeInputs block the frontend fills at every verb boundary.
// The pull arm is the ONLY place under MobileGL/ outside MG_State and MG_Impl that may spell
// pGLContext; purity gate C greps MG_Backend/ for that token.
#if MOBILEGL_PIPE_PUSH
#include <MG_Backend/MGPipe/PipeInputs.h>
#define MGB_CTX (&::MobileGL::MG_Pipe::gPipeInputs)
#define MGB_CTX_LIVE (::MobileGL::MG_Pipe::gPipeInputs.IsLive())
#define MGB_CTX_IDENTITY (::MobileGL::MG_Pipe::gPipeInputs.ContextIdentity())
#else
#include <MG_State/GLState/Core.h>
#define MGB_CTX (::MobileGL::MG_State::pGLContext)
#define MGB_CTX_LIVE (::MobileGL::MG_State::pGLContext != nullptr)
#define MGB_CTX_IDENTITY (static_cast<const void*>(::MobileGL::MG_State::pGLContext.get()))
#endif
#endif
```
`MG_State::pGLContext` is `extern UniquePtr<GLState::GLContext>& pGLContext;` (`Core.h:596`), so `MGB_CTX->X()` in the pull arm is exactly today's `MG_State::pGLContext->X()`, and `MGB_CTX_LIVE` is `UniquePtr::operator bool`'s definition spelled out. Backend TUs include `<MG_Pipe/PipeInputsSwitch.h>` immediately after their `MG_State/GLState/Core.h` include (`DirectGLES.cpp:18`, `MultiDraw.cpp:11`, `Utils.cpp:19`, `BackendObject_DirectVulkan.cpp:14`, `DirectVulkan.cpp:12`, `UniformManager.cpp:12`, `VkClearManager.cpp:15`, `VkTextureManager.cpp:13`, `VulkanRenderer.cpp:16`; `Managers.cpp` gets it after its `Managers.h` include, `VkRenderPassManager.cpp` after its own include block — neither includes `Core.h` directly).
### D4 — `PipeInputs`: one struct, three field classes, types identical to today's reads
`MobileGL/MG_Backend/MGPipe/PipeInputs.h`, `namespace MobileGL::MG_Pipe`, `struct PipeInputs` + `inline PipeInputs gPipeInputs{};` (the single global the docs name, `ARCHITECTURE.md:331`; inline variable, no `.cpp` needed for the definition). Includes: `<MG_Pipe/MGPipe.h>` (field ids, verb enum, poison helpers), `<MG_State/GLState/Core.h>` (the frontend types the accessors return — allowed: P13 keeps the `MG_State` include for the verify arm, `ARCHITECTURE.md:369`; the header spells **no** `pGLContext` token). Every accessor has the **same name, parameters and return type** as its `GLContext` counterpart (`Core.h:66-506`), so the `sed` is type-neutral (phase A rule, `ARCHITECTURE.md:328`). Three storage classes:
- **V (value)** — copied out of `GLContext` at fill time by calling the same accessor (`m_x = ctx->GetX(...)`; no derivation logic is re-implemented in `PipeInputs`, which is what keeps the copy semantically identical by construction). Accessor returns the copy (by value or `const&`, whichever `Core.h` uses).
- **O (object reference)** — a `SharedPtr` copy, or a raw pointer to the live `GLContext`-owned slot/array for the accessors that return a non-const reference into the context. Same return type as today; identity is what phase C turns into a handle.
- **F (forwarded)** — argument-keyed lookups and reverse-channel calls. Declared in `PipeInputs.h`, **defined out of line in `MobileGL/MG_Impl/Pipe/PipeFill.cpp`** (the client side, where `pGLContext` may be spelled), forwarding to the live context. Sticky (D6).
| field (id from `kMGPipeInputFieldNames`) | class | storage in `PipeInputs` | accessor signature (= `Core.h`) | fill |
|---|---|---|---|---|
| GetActiveTextureUnit | V | `Int m_activeTextureUnit` | `Int GetActiveTextureUnit() const` | `ctx->GetActiveTextureUnit()` |
| GetBlendColor | V | `FloatVec4 m_blendColor` | `const FloatVec4& GetBlendColor() const` | |
| GetBlendEquationIndexed | V | `BlendEquation m_blendEquation[kMGMaxDrawBuffers][2]` | `void GetBlendEquationIndexed(Uint, BlendEquation&, BlendEquation&) const` | loop i<8 |
| GetBlendFuncIndexed | V | `BlendFactor m_blendFunc[kMGMaxDrawBuffers][4]` | `void GetBlendFuncIndexed(Uint, BlendFactor&×4) const` | loop i<8 |
| GetBoundTransformFeedbackName | V | `Uint m_boundTransformFeedbackName` | `Uint GetBoundTransformFeedbackName() const` | **dead field**: filled, never read (D1) |
| GetBoundVertexArray | O | `SharedPtr<VertexArrayObject> m_boundVertexArray` | `const SharedPtr<VertexArrayObject>& GetBoundVertexArray()` | copy |
| GetBufferBindingSlot | O | `BindingSlot<BufferObject>* m_bufferBindingSlot[BufferTargetCount]` | `BindingSlot<BufferObject>& GetBufferBindingSlot(BufferTarget)` | `&ctx->GetBufferBindingSlot(t)` for every `t` in `GlobalBufferTargets` (`BufferState.h:15`); others null; accessor asserts non-null |
| GetBufferBindingPoint | O | `BindingSlotRange1D<BufferObject>* m_bufferBindingPointBase[BufferTargetCount]` | `BindingSlotRange1D<BufferObject>& GetBufferBindingPoint(BufferTarget, Uint)` | `&ctx->GetBufferBindingPoint(t, 0)` for `t` in `BufferBindPointTargets` (`BufferState.h:20`); storage is `Array<Array<..., 84>, N>` (`BufferState.h:73`) so `base[index]` is the live slot |
| GetBufferBindingPointCount | F | — | `SizeT GetBufferBindingPointCount(BufferTarget) const` | forward (constexpr table) |
| GetTouchedBufferBindingPointCount | V | `SizeT m_touchedBindingPointCount[BufferTargetCount]` | `SizeT GetTouchedBufferBindingPointCount(BufferTarget) const` | loop over `BufferBindPointTargets` |
| GetClampReadColor | V | `GLenum` | `GLenum GetClampReadColor() const` | |
| GetClearColor / GetClearDepth / GetClearStencil | V | `FloatVec4` / `Float` / `Uint32` | as `Core.h:272-276` | |
| GetColorMaskIndexed | V | `BoolVec4 m_colorMask[kMGMaxDrawBuffers]` | `BoolVec4 GetColorMaskIndexed(Uint) const` | loop |
| GetCullFaceMode | V | `CullFaceMode` | | |
| GetCurrentVertexAttribute | V | `CurrentVertexAttributeValue m_currentVertexAttribute[VertexArrayObject::MAX_VERTEX_ATTRIBS]` (32, `VertexArrayObject.h:24`) | `const CurrentVertexAttributeValue& GetCurrentVertexAttribute(Uint) const` | loop |
| GetDepthFunc / GetDepthMask | V | `DepthTestFunc` / `Bool` | | |
| GetDepthRangeIndexed | V | `FloatVec2 m_depthRange[RenderStateParameters::MAX_VIEWPORTS]` | `const FloatVec2& GetDepthRangeIndexed(Uint) const` | loop 16 |
| GetFramebufferBindingSlot | O | `BindingSlot<FramebufferObject>* m_framebufferBindingSlot[FramebufferTargetCount]` | `BindingSlot<FramebufferObject>& GetFramebufferBindingSlot(FramebufferTarget)` | both targets |
| GetImageTextureBinding | O | `ImageTextureBinding* m_imageTextureBindingBase` | `ImageTextureBinding& GetImageTextureBinding(Int)` (+ const overload) | `&ctx->GetImageTextureBinding(0)`; storage `Array<ImageTextureBinding, 192>` (`TextureState.h:129`) |
| GetLineWidth / GetLogicOp / GetMaxTouchedTextureUnit / GetMinSampleShadingValue | V | `Float` / `LogicOperation` / `Int` / `Float` | | |
| GetPatchDefaultInnerLevel / GetPatchDefaultOuterLevel / GetPatchVertices | V | `FloatVec2` / `FloatVec4` / `Uint` | `const FloatVec2&` / `const FloatVec4&` / `Uint` | |
| GetPipelineStateVersion / GetRenderStateParametersVersion | V | `Uint` / `Uint` | | |
| GetPixelStoreParameters | V | `PixelStoreParameters m_pixelStore[2]` (`[0]`=pack, `[1]`=unpack) | `PixelStoreParameters GetPixelStoreParameters(Bool isUnpack) const` | both |
| GetPolygonModeFront / GetPolygonOffsetFactor / GetPolygonOffsetUnits / GetPrimitiveRestartIndex / GetProvokingVertexMode | V | `GLenum` / `Float` / `Float` / `Uint32` / `ProvokingVertexMode` | | |
| GetProgramForDispatch / GetProgramForDraw / GetTransformFeedbackProgram | O | `SharedPtr<ProgramObject>` ×3 | `const SharedPtr<ProgramObject>& ...()` | copy (`GetProgramForDraw()` is called once per fill; it has a guarded static, `DirectGLES.cpp:2965-2968`) |
| GetProgramObject | F | — | `const SharedPtr<ProgramObject>& GetProgramObject(Uint)` | forward |
| GetRenderStateParameters | V | `RenderStateParameters m_renderState` (1168 B) | `const RenderStateParameters& GetRenderStateParameters() const` | memcpy-by-assignment |
| GetSamplingResolutionGeneration / GetTextureBindGeneration / GetTextureContextId | V | `Uint64` ×3 | | |
| GetScissorBox | V | `IntVec4` | `const IntVec4& GetScissorBox() const` | |
| GetStencilState | V | `StencilFaceState m_stencil[2]` | `const StencilFaceState& GetStencilState(StencilFace) const` | both faces |
| GetTextureObject | F | — | `const SharedPtr<ITextureObject>& GetTextureObject(Uint)` | forward |
| GetTextureUnitObject | O | `TextureUnit* m_textureUnitBase` | `TextureUnit& GetTextureUnitObject(Int)` | `&ctx->GetTextureUnitObject(0)`; storage `Array<TextureUnit, MAX_TEXTURE_IMAGE_UNITS=192>` (`TextureState.h:41,128`) |
| GetTransformFeedbackCapturedVertices / GetTransformFeedbackGeneration / GetTransformFeedbackPausedPrimitiveCounter / GetBoundTransformFeedbackLifetimeId | V | `Uint64` ×4 | as `Core.h:334,349,357,441` | |
| GetViewport | V | `IntVec4` | `IntVec4 GetViewport() const` | |
| GetViewportIndexed | V | `FloatVec4 m_viewport[MAX_VIEWPORTS]` | `const FloatVec4& GetViewportIndexed(Uint) const` | loop 16 |
| IsCapabilityEnabled | V | `Bool m_capability[CapabilityInputCount]` (37 entries, `MGPipeValueTypes.h:168-204`) | `Bool IsCapabilityEnabled(CapabilityInput) const` | loop over all caps (`FramebufferSrgb` copies today's constant `false`, `MEASUREMENTS.md:84` — no change of value) |
| IsCapabilityEnabledIndexed | V | `Bool m_blendIndexed[kMGMaxDrawBuffers]`, `Bool m_scissorIndexed[MAX_VIEWPORTS]` | `Bool IsCapabilityEnabledIndexed(CapabilityInput, Uint) const` | `Blend` ×8, `ScissorTest` ×16; any other cap → `Fatal{UnmigratedPipeInput}` with the cap name (no backend asks; `VulkanRenderer.cpp:5437` asks `Blend`) |
| IsTransformFeedbackActive / IsTransformFeedbackPaused | V | `Bool` ×2 | | |
| HasOpenTransformFeedbackSpan | F | — | `Bool HasOpenTransformFeedbackSpan(Uint64) const` | forward |
| InvalidateCompileEnv / ValidateProgramName / RecordError | F | — | `void InvalidateCompileEnv()` / `Bool ValidateProgramName(Uint) const` / `void RecordError(ErrorCode, UniquePtr<ErrorInfo>)` | forward (`RecordError` forwards even when no context is live? no: `IsLive()` false → drop with `MGLOG_E_ONCE`; today's guarded sites (`Managers.cpp:8750`) never reach it without a context) |
Non-field members: `const void* m_contextIdentity` (the live `GLContext` address at fill; `ContextIdentity()` serves `MGB_CTX_IDENTITY`), `Bool m_live` (`IsLive()`), `MGPipeVerb m_currentVerb`, and under `MOBILEGL_PIPE_POISON` an `MGPipeFilledState m_filled` (`PipeFilled.inc:293-296`, `CurrentVerbSerial` + `FilledGen[63]`). Estimated size ≈ 3.5 KB (well under the docs' ~20 KB). `static_assert(sizeof(PipeInputs) < 20 * 1024)`.
Every accessor body is: `MGP_INPUT_CHECK(MGPipeInputField::X);` (poison, D6) → `MGP_INPUT_VERIFY_READ(MGPipeInputField::X, idx0, idx1);` (compare-at-read, D8) → return the storage. Both macros expand to nothing when their switch is off, so a plain `MOBILEGL_PIPE_PUSH` build's accessor is a load.
Known gap, closed in P2 (Espryt 0b deletes `g_fbSlotCache`, `ROADMAP.md:18`): the five reads through `GetFramebufferBindingSlotFast` (`DirectGLES.cpp:1611,1905,2743,2858,2933`) bypass the accessor once the cache is warm, so they are not poison-checked; the entry compare still covers `GetFramebufferBindingSlot`.
### D5 — Files created, and where the `pGLContext` spelling is allowed
| path | owner | contents | may spell `pGLContext`? |
|---|---|---|---|
| `MobileGL/MG_Pipe/PipeInputsSwitch.h` | A | D3 | only in the `#else` arm |
| `MobileGL/MG_Pipe/FillPoints.def` | A | D7 source of truth | no |
| `MobileGL/MG_Pipe/generated/PipeFillPoints.inc` | A (generated) | verb enum, class tables, masks | no |
| `MobileGL/MG_Backend/MGPipe/PipeInputs.h` | A | D4 struct, accessors, `gPipeInputs`, `MOBILEGL_PIPE_POISON`, the two accessor macros | **no** |
| `MobileGL/MG_Backend/MGPipe/PipeInputs.cpp` | A | `MGPipeInputPoisonFatal` wrapper with verb name, per-field equality (`MGPipeInputsFieldEqual`), corruption injector | **no** |
| `MobileGL/MG_Impl/Pipe/PipeFill.h` | A | `MGP_FILL(Verb)` macro; declarations of `MGPipeFillForVerb`, `SnapshotFromGLContext` | no (macro expands to nothing under pull) |
| `MobileGL/MG_Impl/Pipe/PipeFill.cpp` | A | the filler (non-verify branch), `SnapshotFromGLContext` (verify branch), the F-class forwarders, `IsLive`, compare-at-read hook, entry compare, knob parsing | yes (client side) |
**[deviation]** `ARCHITECTURE.md:553` lists `MGPipeImpl_DirectGLES.cpp` / `MGPipeImpl_DirectVulkan.cpp` as `[P1+]`. P1 creates neither: nothing backend-specific exists in `PipeInputs` until a backend installs an `MGPipeContext` table (P5). The directory `MG_Backend/MGPipe/` is created with `PipeInputs.h/.cpp`; the integrator records this in the docs.
### D6 — Poison: per-verb generation, seven sticky fields, the Fatal
- `MGPipeFillForVerb(MGPipeVerb v)` (`PipeFill.cpp`) does, in order: `++m_filled.CurrentVerbSerial` (starts at 1 so `FilledGen == 0` means never filled); `m_currentVerb = v`; if `pGLContext == nullptr` → `m_live = false`, return; else `m_live = true`, `m_contextIdentity = ctx`, then for every field in `kMGPipeClassFieldMask[kMGPipeVerbClass[v]]`: copy per D4 and `m_filled.FilledGen[f] = CurrentVerbSerial` — **unless** `(v, f)` equals the parsed `MOBILEGL_PIPE_POISON_OMIT` pair, in which case the value is still copied and only the stamp is skipped (an omission indistinguishable from a forgotten row). Cost is irrelevant in P1 (verify build) and is replaced by the tracker in P2.
- `MGP_INPUT_CHECK(f)` under `MOBILEGL_PIPE_POISON`: `if (!MGPipeInputFieldIsFresh(m_filled, f)) MGPipeInputPoisonFatalForVerb(f, m_currentVerb);` → `MGPipeInputPoisonFatal(f, kMGPipeVerbNames[v])` (`PipeFilled.inc:298-302`: `MGLOG_F("MGPipe: Fatal{UnmigratedPipeInput, \"%s@%s\"}")` + `std::abort()`; before the first verb the name is `"<none>"`). `MGLOG_F` is live at every log level (`Log.h:87-92`) and this is not `MOBILEGL_ASSERT` on purpose (inert in INFO builds, `Defines.h:113-115`).
- **Sticky = exactly the seven F-class fields**: `RecordError`, `InvalidateCompileEnv`, `ValidateProgramName`, `GetProgramObject`, `GetTextureObject`, `HasOpenTransformFeedbackSpan`, `GetBufferBindingPointCount`. Argument (goes into `Coverage.def` as the reason string): each takes an argument that is not verb state — a GL name, a lifetime id, a target — i.e. it is a lookup or a reverse-channel write, not a state read; there is no value the filler could copy and no verb whose fill could make it stale; phase C replaces them with handle tables/callbacks. They are stamped once (`FilledGen = 1`) by the first fill that sees a live context and pass `MGPipeInputFieldIsFresh` through the `Sticky → FilledGen != 0` branch (`PipeFilled.inc:304-307`). **None of the version/generation accessors is sticky** (`GetTextureContextId`, `GetTextureBindGeneration`, `GetSamplingResolutionGeneration`, `GetTransformFeedbackGeneration`, `GetPipelineStateVersion`, `GetRenderStateParametersVersion` change under verbs and are precisely what the poison must protect; scout R5).
- `kMGPipeInputFieldSticky[]` stops being all-`false`: `Coverage.def` gains `MGP_COVERAGE_STICKY_LIST(X)` with seven `X(Accessor, "reason")` rows; `gen_filled` emits `true` for those and `sys.exit`s on a name that is not an accessor.
- `IsCapabilityEnabledIndexed` with a cap other than `Blend`/`ScissorTest`, and `GetBufferBindingSlot`/`GetBufferBindingPoint` with a target the fill left null, are also `MGPipeInputPoisonFatal` (the message names the field and the verb; the cap/target goes in a preceding `MGLOG_E`).
### D7 — Fill points: 69 verbs, 9 classes, one `.def`, one generated `.inc`, one macro
`MobileGL/MG_Pipe/FillPoints.def` (hand-maintained, A):
```
// X(Verb, Class) — one row per function-pointer member of MG_Backend::GLFunctionsTable (BackendObject.h:117-289),
// in declaration order. gen_pipe.py parses that struct and refuses a row set that is not exactly its member set.
#define MGP_FILL_VERB_LIST(X) \
X(DrawArrays, kDraw) X(DrawElements, kDraw) ... X(GetGpuTimestampNs, kQuery)
// (must be followed by an empty line: gen_pipe.py's block regexes end at a blank line)
// X(Class) — the nine verb classes (ARCHITECTURE.md:153 names eight; kProgramOp is split out because
// ShaderStorageBlockBinding is the one non-draw verb that syncs Espryt's render state and textures).
#define MGP_FILL_CLASS_LIST(X) \
X(kDraw) X(kDispatch) X(kClear) X(kBlitOrCopy) X(kTextureOp) X(kReadback) X(kXfbSpan) X(kProgramOp) X(kQuery)
// X(Class, Field) — the may-read table. A field named here is filled and stamped at every verb of the class;
// a read of a field NOT named here is Fatal{UnmigratedPipeInput, "Field@Verb"} in a poison build.
#define MGP_FILL_FIELD_LIST(X) \
X(kDraw, GetBoundVertexArray) ...
```
Verb → class (69 rows; the count and the membership are the contract, verified by a `gen_pipe.py` parse of `struct GLFunctionsTable`):
| class | verbs |
|---|---|
| `kDraw` (20) | DrawArrays, DrawElements, DrawElementsBaseVertex, MultiDrawArrays, MultiDrawElements, MultiDrawElementsBaseVertex, MultiDrawElementsIndirect, MultiDrawArraysIndirect, MultiDrawElementsIndirectCount, MultiDrawArraysIndirectCount, DrawRangeElementsBaseVertex, DrawRangeElements, DrawElementsInstancedBaseVertexBaseInstance, DrawElementsInstancedBaseVertex, DrawElementsInstancedBaseInstance, DrawElementsInstanced, DrawElementsIndirect, DrawArraysInstancedBaseInstance, DrawArraysInstanced, DrawArraysIndirect |
| `kDispatch` (2) | DispatchCompute, DispatchComputeIndirect |
| `kClear` (9) | Clear, ClearBufferfi, ClearBufferfv, ClearBufferiv, ClearBufferuiv, ClearNamedFramebufferfv, ClearNamedFramebufferfi, ClearNamedFramebufferiv, ClearNamedFramebufferuiv |
| `kBlitOrCopy` (5) | BlitFramebuffer, BlitNamedFramebuffer, CopyTexImage2D, CopyTexSubImage2D, CopyImageSubData |
| `kTextureOp` (2) | GenerateMipmap, BindImageTexture |
| `kReadback` (3) | ReadPixels, GetTexImage, GetTextureImage |
| `kXfbSpan` (6) | BeginTransformFeedback, EndTransformFeedback, PauseTransformFeedback, ResumeTransformFeedback, BindTransformFeedback, DeleteTransformFeedback |
| `kProgramOp` (1) | ShaderStorageBlockBinding |
| `kQuery` (21) | BeginOcclusionQuery, EndOcclusionQuery, BeginTimeElapsedQuery, EndTimeElapsedQuery, QueryCounterTimestamp, BeginXfbPrimitivesQuery, EndXfbPrimitivesQuery, IsQueryResultAvailable, GetQueryResult64, DeleteBackendQuery, IsTimerQuerySupported, GetGpuTimestampNs, FenceSync, ClientWaitSync, WaitSync, GetSyncStatus, DeleteSync, MemoryBarrier, MemoryBarrierByRegion, PatchParameteri, GetIntegeri_v |
Class → may-read fields (from the verified reachability, `scout-pull-sites.md` §4.2, union over both backends; the seven sticky fields are implicit everywhere and are not listed). **The verify lane is the oracle: a `Fatal{UnmigratedPipeInput}` found there is fixed by adding the row to this table, never by marking the field sticky.**
| class | fields |
|---|---|
| `kDraw` | GetBoundVertexArray, GetProgramForDraw, GetBufferBindingSlot, GetBufferBindingPoint, GetTouchedBufferBindingPointCount, GetTextureUnitObject, GetTextureContextId, GetTextureBindGeneration, GetMaxTouchedTextureUnit, GetSamplingResolutionGeneration, GetImageTextureBinding, GetCurrentVertexAttribute, GetRenderStateParameters, GetRenderStateParametersVersion, GetPipelineStateVersion, GetViewport, GetViewportIndexed, GetDepthRangeIndexed, GetScissorBox, IsCapabilityEnabled, IsCapabilityEnabledIndexed, GetBlendColor, GetBlendFuncIndexed, GetBlendEquationIndexed, GetColorMaskIndexed, GetLogicOp, GetDepthFunc, GetDepthMask, GetStencilState, GetCullFaceMode, GetPolygonModeFront, GetPolygonOffsetFactor, GetPolygonOffsetUnits, GetLineWidth, GetMinSampleShadingValue, GetProvokingVertexMode, GetPatchVertices, GetPatchDefaultOuterLevel, GetPatchDefaultInnerLevel, GetPrimitiveRestartIndex, GetFramebufferBindingSlot, IsTransformFeedbackActive, IsTransformFeedbackPaused, GetTransformFeedbackProgram, GetTransformFeedbackGeneration, GetBoundTransformFeedbackLifetimeId, GetTransformFeedbackCapturedVertices |
| `kDispatch` | GetProgramForDispatch, GetBufferBindingSlot, GetBufferBindingPoint, GetTouchedBufferBindingPointCount, GetTextureUnitObject, GetTextureContextId, GetTextureBindGeneration, GetMaxTouchedTextureUnit, GetSamplingResolutionGeneration, GetImageTextureBinding, GetFramebufferBindingSlot, GetPatchVertices, GetPatchDefaultOuterLevel, GetPatchDefaultInnerLevel (Espryt `SyncCurrentProgram` → `AttachPassthroughTessControlStage`, `Managers.cpp:7193-7204`) |
| `kClear` | GetRenderStateParameters, GetRenderStateParametersVersion, GetViewport, IsCapabilityEnabled, GetFramebufferBindingSlot, GetClearColor, GetClearDepth, GetClearStencil, GetScissorBox, GetColorMaskIndexed, GetDepthMask, GetStencilState, GetTextureUnitObject, GetTextureContextId, GetSamplingResolutionGeneration, GetTextureBindGeneration, GetMaxTouchedTextureUnit, GetImageTextureBinding |
| `kBlitOrCopy` | GetFramebufferBindingSlot, IsCapabilityEnabled, GetScissorBox, IsTransformFeedbackActive, IsTransformFeedbackPaused, GetRenderStateParameters, GetRenderStateParametersVersion, GetViewport, GetActiveTextureUnit, GetTextureUnitObject, GetTextureContextId, GetSamplingResolutionGeneration, GetTextureBindGeneration, GetMaxTouchedTextureUnit, GetImageTextureBinding, GetColorMaskIndexed, GetDepthMask, GetStencilState |
| `kTextureOp` | GetActiveTextureUnit, GetTextureUnitObject, GetImageTextureBinding, GetTextureContextId, GetSamplingResolutionGeneration, GetTextureBindGeneration, GetMaxTouchedTextureUnit |
| `kReadback` | GetPixelStoreParameters, GetBufferBindingSlot, GetFramebufferBindingSlot, GetActiveTextureUnit, GetTextureUnitObject, GetClampReadColor, IsCapabilityEnabled, GetRenderStateParameters, GetRenderStateParametersVersion, GetViewport, GetTextureContextId, GetSamplingResolutionGeneration, GetTextureBindGeneration, GetMaxTouchedTextureUnit, GetImageTextureBinding |
| `kXfbSpan` | GetTransformFeedbackProgram, GetBufferBindingPoint, GetTouchedBufferBindingPointCount, GetTransformFeedbackCapturedVertices, IsTransformFeedbackActive, IsTransformFeedbackPaused, GetTransformFeedbackGeneration, GetBoundTransformFeedbackLifetimeId |
| `kProgramOp` | GetRenderStateParameters, GetRenderStateParametersVersion, GetViewport, IsCapabilityEnabled, GetFramebufferBindingSlot, GetTextureUnitObject, GetTextureContextId, GetSamplingResolutionGeneration, GetTextureBindGeneration, GetMaxTouchedTextureUnit, GetImageTextureBinding |
| `kQuery` | GetTransformFeedbackPausedPrimitiveCounter (`DirectVulkan.cpp:1237,1284`) — every other verb in the class reads nothing; the fill is a serial bump |
`gen_pipe.py` G5b (`gen_fill_points`) emits `generated/PipeFillPoints.inc`: `enum class MGPipeVerb : Uint8 { DrawArrays, ..., kVerbCount }` (69), `kMGPipeVerbNames[]`, `enum class MGPipeVerbClass : Uint8` (9), `kMGPipeVerbClassNames[]`, `kMGPipeVerbClass[kMGPipeVerbCount]`, `struct MGPipeFieldMask { Uint64 Words[2]; }` + `kMGPipeClassFieldMask[9]` with the seven sticky fields OR'ed in, `MGPipeFieldMaskHas(mask, field)`, and `static_assert(kMGPipeVerbCount == 69)`. It is included from `MGPipe.h` after `PipeFilled.inc` (`MGPipe.h:86`) — the banner's "included from MG_Pipe/MGPipe.h inside namespace MobileGL::MG_Pipe" stays true.
`MobileGL/MG_Impl/Pipe/PipeFill.h`:
```cpp
#pragma once
#if MOBILEGL_PIPE_PUSH
#include <MG_Pipe/MGPipe.h>
namespace MobileGL::MG_Pipe {
void MGPipeFillForVerb(MGPipeVerb verb); // PipeFill.cpp
}
#define MGP_FILL(Verb) ::MobileGL::MG_Pipe::MGPipeFillForVerb(::MobileGL::MG_Pipe::MGPipeVerb::Verb)
#else
#define MGP_FILL(Verb) ((void)0)
#endif
```
Placement rule (A applies it at the 83 statements of §B.7): `MGP_FILL(X);` is the statement **immediately before** the call through the table, after every early return the call is behind (the `ConditionalRenderDiscardsCommand()` check in the `*_Backend` wrappers, `GL_Drawing.cpp:529`; the `if (!f) { RecordError; return; }` null checks; the `if (const auto f = table.GL.X) {` guards). A verb whose table entry is null on this backend never bumps. For a call inside a loop (`GL_Query.cpp:915`, `GL_Sync.cpp:229`) the fill is inside the loop body before the call. In the pull build the macro is `((void)0)` (G1).
### D8 — The comparator: what it compares, where it runs, what it prints
Two mechanisms, both compiled only under `MOBILEGL_PIPE_VERIFY` and active only when `Features.PipeVerify` is set:
1. **Entry compare, once per verb** ("每 draw 比一次"): at the end of `MGPipeFillForVerb`, `SnapshotFromGLContext(gPipeSnapshot, mask)` fills a second, file-static `PipeInputs` from the live context (the "verify branch" that survives P13), applies `MOBILEGL_PIPE_VERIFY_CORRUPT` to **the snapshot** (perturb one field: flip a bool, `+1` a scalar, `^0x5A` the first byte of a struct, swap a pointer for `nullptr`), then `MGPipeVerifyInputs(gPipeInputs, gPipeSnapshot, mask, &field)` compares every field in the mask with `MGPipeInputsFieldEqual(field, a, b)` (`PipeInputs.cpp`: V via G4's `MGPipeFieldEqual` — bitwise floats, field-wise structs; O by identity). **Honest statement of what this proves in P1**: both arms come from the same context at the same instant, so it is tautological except under the CORRUPT knob (negative control A) — its oracle role starts in P2 when the tracker fills the first arm. It is nevertheless the mechanism the gate names, and P1 lands it complete.
2. **Compare-at-read, on every accessor**: `MGP_INPUT_VERIFY_READ(f, i0, i1)` calls `MGPipeVerifyReadHook(f, i0, i1)` (`PipeFill.cpp`), which re-reads the same accessor with the same indices from the live context and compares against the stored value. This is the arm that is **real in P1**: it catches any field whose value differs between the verb boundary (what push reads) and the moment of the read (what pull reads) — a frontend counter bumped by the backend mid-verb, a texture re-mint bumping `SamplingResolutionGeneration` between `TrySetupDrawFastPath` and `SetupDraw` (`VulkanRenderer.cpp:6304` vs `:6999`), an error recorded by a helper. Zero divergence here is the semantic statement "push equals pull for every value any backend read in the 40 traces and 808 integration entries".
Reporting: `MGLOG_F("MGPipe: Fatal{PipeVerifyDiffer, \"%s@%s\", verb=%llu, where=%s}", field, verbName, serial, "entry"|"read")` then `std::abort()` unless `PipeVerifyFatal` is off (then a relaxed-atomic counter, summarised at teardown with `MGLOG_E`). Arming, once, at the first fill under verify: `MGLOG_I("MGPipe: verify armed - %u fields, %u verbs, fatal=%d")` (an `MGLOG_I` with a stated reason, per `PipeStats.cpp:224-231`; the lanes grep for `MGPipe: verify armed`). Knob acknowledgements: `MGLOG_I("MGPipe: verify corruption armed - %s")`, `MGLOG_I("MGPipe: poison omission armed - %s@%s")`. Never `MGLOG_D` (compiled out at INFO, `Log.h:59-64`); never stdio (`test.yml:862-869`).
G4 growth (A):
- `PipeFields.def` gains `MGP_FIELDS_RenderStateParameters` (all 67 members of `MGPipeValueTypes.h` `struct RenderStateParameters`, in declaration order, `Viewports` … `ScissorBoxes`), `MGP_FIELDS_PixelStoreParameters` (8), `MGP_FIELDS_PerBufferBlendState` (7), `MGP_FIELDS_StencilFaceState` (7), `MGP_FIELDS_DynamicBackendParameters` (every member of `BackendObject.h:316-…`, `Pad`-named members excluded), `MGP_FIELDS_MGHostSpan` (`Ptr`, `Seg`, `Size`, `Offset`; `Pad0` excluded), all appended to `MGP_VERIFY_PAYLOAD_LIST` → `kMGPipeVerifiedPayloadCount` 63 → **69**. `MEMCMP_FALLBACK_TYPES` (`gen_pipe.py:167-172`) becomes empty and the fallback branch in `gen_verify` becomes `static_assert(sizeof(T) == 0, "no field list in PipeFields.def")` — a future memcmp fallback is a compile error, not a padding false positive.
- Two overloads added to `gen_verify`'s emitted `MGPipeFieldEqual`, declared **before** the generic template: `template <class T, SizeT N> Bool MGPipeFieldEqual(const Array<T, N>&, const Array<T, N>&)` (element-wise; `Array` is `std::array`, `Types.h:57`), and `template <class D, class T, SizeT N> Bool MGPipeFieldEqual(const VecBase<D, T, N>& a, const VecBase<D, T, N>& b)` (element-wise over `data`, so `FloatVec4`/`FloatVec2` compare **bitwise** — `VecBase::operator==` at `VectorTypes.h:41` is IEEE `==`, under which a NaN patch level would differ from itself; the docs' stated policy is bitwise, `ARCHITECTURE.md:159`). Partial ordering picks these over `const T&`.
- Coverage assertion ("the comparator's coverage is itself asserted", `PipeFields.def:15-17`): `gen_pipe.py` gains `check_field_lists_cover_struct_members()`: for every payload in `MGP_VERIFY_PAYLOAD_LIST`, locate `struct <Name> {` in `MGPipeTypes.h`, `MGPipeValueTypes.h`, `MGPipeHostSpan.h`, `MG_Backend/BackendObject.h` (comments/strings masked, `gen_pipe_dirty_surface.py:46-85` shape), collect the direct data members (regex over one-member-per-line bodies; skip `static`, `constexpr`, member functions, nested types; a member named `Pad\d*` is padding), and `sys.exit` on any member absent from the `F(...)` list or any `F(...)` name that is not a member. Runs in both modes (`--check` included) and therefore in `pipe-gates`. Negative control inside `gen_pipe.py --self-test` (new flag): a canned struct/field-list pair that must trip.
### D9 — The 58 non-arrow lines: exact rewrite per category, and why the pull build does not move
| category | count | lines | rewrite | pull-build effect |
|---|---|---|---|---|
| `MOBILEGL_ASSERT(MG_State::pGLContext, "...")` | 34 | `DirectVulkan.cpp` 337,343,349,355,362,369,376,383,389,394,445,451,496,523,567,582,616,622,631,638,644,650,656,741,746,752,758,817,842,865,971,977,1001,1008 | `MOBILEGL_ASSERT(MGB_CTX_LIVE, "...")` | none (macro is empty at INFO, `Defines.h:113-115`) |
| `MOBILEGL_ASSERT(MG_State::pGLContext != nullptr, ...)` | 9 | `UniformManager.cpp` 812,837,992,1152,1266,1651,1806,1888,1968 | `MOBILEGL_ASSERT(MGB_CTX_LIVE, ...)` | none |
| bare guard `if (MG_State::pGLContext) {` | 5 | `Managers.cpp` 3644,3844,8750; `BackendObject_DirectVulkan.cpp` 388,786 | `if (MGB_CTX_LIVE) {` | `UniquePtr::operator bool` is `get() != nullptr`; identical codegen expected |
| compound guard | 2 | `Managers.cpp` 3773 (`&& MG_State::pGLContext &&`), 4735 (`if (MG_State::pGLContext && ...`) | `MGB_CTX_LIVE` in place | as above |
| ternary condition `MG_State::pGLContext != nullptr` | 3 | `Managers.cpp` 7192,7200,7203 (their `?` arms 7193,7201,7204 are arrow lines and take the sed) | `MGB_CTX_LIVE` | as above |
| `!= nullptr` in a condition | 2 | `DirectVulkan.cpp` 1236; `VulkanRenderer.cpp` 12766 | `MGB_CTX_LIVE` | as above |
| `== nullptr` | 1 | `VulkanRenderer.cpp` 11267 | `!MGB_CTX_LIVE` | as above |
| `.get()` raw capture + `decltype` alias | 1 (+ arrow line 143) | `DirectGLES.cpp` 143-155 | `:143` → `decltype(MGB_CTX->GetFramebufferBindingSlot(FramebufferTarget::Draw))`; `:144` → `static const void* g_fbSlotCacheContext = nullptr;`; `:147` → `const void* ctx = MGB_CTX_IDENTITY;`; `:150` → `g_fbSlotCache[i] = &MGB_CTX->GetFramebufferBindingSlot(static_cast<FramebufferTarget>(i));` | a `const void*` compare instead of `GLContext*`: identical codegen expected; if `.text` moves, this is the first suspect |
| comment | 1 | `VertexInputStateFactory.h:133` | "they live on the frontend context's VAOs" | none |
| ternary with arrow on one line | (arrow line) | `DirectVulkan.cpp` 1284 | `MGB_CTX_LIVE ? MGB_CTX->GetTransformFeedbackPausedPrimitiveCounter() : 0` | as above |
**[deviation]** `ARCHITECTURE.md:344` says the ~34 asserts are *deleted*. They are converted instead: identical in every INFO build (G1 is unaffected), preserves DEBUG-build parity, and gate C is satisfied equally (no `pGLContext` token remains). Under push, `MGB_CTX_LIVE` is always true once a context exists, which changes the guarded sites' semantics only in the push arm — that is the "空守卫/三元重写推迟到 P2" the gate names: P1 keeps them textually equivalent, P2 gives them real meaning.
Expected G1 result: `.text` delta **0**, symbols 0/0/0/0. The only code-bearing rewrites are the 13 guard/compare lines and the `.get()` block, and each is a like-for-like pointer test.
### D10 — `SyncPersistentMappedRange` (20) + `SyncGpuWrites` (6): per-site ownership table
Reconcile classes are `ARCHITECTURE.md:233-238` (§5.7): **R0** none; **R1** EBO/max-index scan = `SyncPersistentMappedRange` **+** `SyncGpuWrites`; **R2** `*IndirectCount` count = **only** `SyncPersistentMappedRange` (open question #15, `ROADMAP.md:88` — recorded, not fixed); **R3** server-side restart rewrite / multi-draw flatten = server reads its mirror, GPU-writer visibility by `OnGpuWritten`; **R4** UBO host payload, the immovable consumer (D-B8, `ARCHITECTURE.md:294`). In P1 every site stays exactly where it is (the `sed` touches none of these lines); the table records the class each site must reproduce when P8 moves the reconcile to the client.
| # | site (verified) | receiver | verb | today | class |
|---|---|---|---|---|---|
| P1 | `DirectGLES.cpp:263` | drawBuffer | draw indirect (CPU fallback `ResolveIndirectCommandBytes`) | SPMR only | R2 |
| P2 | `DirectGLES.cpp:4468` (+ G1 `:4469`) | indexBuffer | draw, restart substitution | SPMR + SGW | R1 |
| P3/P4 | `DirectGLES.cpp:4722,4723` | drawBuffer, parameterBuffer | `MultiDrawElementsIndirectCount` | SPMR only | R2 |
| P5/P6 | `DirectGLES.cpp:4824,4825` | drawBuffer, parameterBuffer | `MultiDrawArraysIndirectCount` | SPMR only | R2 |
| P7 | `Managers.cpp:1569` | bufferObject | buffer op (`EnsureBufferResource`) | SPMR | R0 (client array/staging: application memory, no GPU writer) |
| P8 | `MultiDraw.cpp:510` (+ G3 `:511`) | indexBuffer | multi-draw flatten `RunRebasedDrawElements` | SPMR + SGW | R3 |
| P9 | `DirectVulkan.cpp:280` | drawBuffer | draw indirect (CPU fallback) | SPMR only | R2 |
| P10 | `DirectVulkan.cpp:471` | parameterBuffer | `MultiDrawArraysIndirectCount` | SPMR only | R2 |
| P11 | `DirectVulkan.cpp:795` | indexBufferShared | `BuildClosedLineLoopIndices` (index read) | SPMR only | R1 (client pointer source → R0 when the indices are client memory) |
| P12 | `UniformManager.cpp:2023` | bufferObject | `ResolveUniformBufferPayload` | SPMR | **R4** — immovable |
| P13 | `VkBufferManager.cpp:628` | bufferObject | `AcquireResidentSlice` | SPMR | R0 |
| P14 | `VkBufferManager.cpp:679` | bufferObject | `AcquireStreamedSlice` | SPMR | R0 |
| P15 | `VulkanRenderer.cpp:3434` (+ G4 `:3433`) | indexBufferShared | `TryComputeMaxIndexFromHostBytes` | SPMR + SGW | R1 |
| P16 | `VulkanRenderer.cpp:3513` | bufferObject | `TryBindResolvedVertexBindings` | SPMR | R0 |
| P17 | `VulkanRenderer.cpp:3828` (+ G5 `:3827`) | sourceBufferShared | fp64 narrowing in `UploadAndBindVertexBuffers` | SPMR + SGW | R1 (a GPU-written vertex source) |
| P18 | `VulkanRenderer.cpp:7137` | indirectBuffer | `DispatchComputeIndirect` | SPMR only | R2 |
| P19/P20 | `VulkanRenderer.cpp:12132,12133` | drawBuffer, parameterBuffer | `MultiDrawElementsIndirectCount` | SPMR only | R2 |
| G2 | `Managers.cpp:2643` | bufferObject | `SyncFloat64AttributeAsFloat32` | SGW | R1 |
| G6 | `VulkanRenderer.cpp:4161` | indexBufferShared | `UploadAndBindIndexBuffer`, restart branch | SGW | R3 |
Split: SPMR 8 Espryt / 12 Magma; SGW 3 / 3. Comment-only mentions (not sites): `Managers.cpp:1461,2681`, `VulkanRenderer.h:1214`, `DirectGLES.cpp:459,509`. The integrator lands this table in `docs/Disaggregated/MEASUREMENTS.md` as a new §6.
### D11 — Deferred out of P1 (recorded, with the doc lines to correct)
| item | why not P1 | doc to fix |
|---|---|---|
| `gen_pipe_dirty_surface.py` mapping file + `--check` gate | `ROADMAP.md:18` puts "首轮映射成门" in **P2**; the table cells are the authority (scout R2) | `ARCHITECTURE.md:172,568`, `test.yml:871-874` comment, `scripts/gen_pipe_dirty_surface.py:21-22` say P1 → P2 (integrator) |
| `GetBufferBindingSlot` rows split by target in `Coverage.def` (`:36-40`) | needs the re-vendored inventory carrying the target argument; the extractor lives in MobileGL-CS, not here | note in `Coverage.def:36-40` ("when the inventory is re-vendored") |
| re-vendoring `scripts/data/backend_read_inventory.md` | same; D13's live cross-check is the stop-gap gate | `MEASUREMENTS.md:82` |
| `DynamicBackendParameters` fixed-width members (`MGPipeTypes.h:32`, scout R6) | not in the P1 row; the field list (D8) covers verify without it | — |
| semantic rewrite of the 13 guard/ternary sites | gate text: "推迟到 P2" | — |
| `MGPipeImpl_*.cpp` | D5 | `ARCHITECTURE.md:553` |
| `PipeStats` `AccessorCalls` tallies (`PipeStats.cpp:16-100`) | unchanged: the sites still call the same accessors through `MGB_CTX`; `RecordDrawPayloadBytes` stays unwired until a generator emits records | — |
### D12 — Coverage.def and the live accessor cross-check (A)
`Coverage.def` gains two rows after `:97`: `X(GetBoundTransformFeedbackLifetimeId, SetStreamOutputTargets)` and `X(HasOpenTransformFeedbackSpan, SetStreamOutputTargets)` (the D21 XFB counter-slot rekey's reads, `VulkanRenderer.cpp:11219,11236`; the calls they map to are the same as `GetTransformFeedbackGeneration`'s); `GetBoundTransformFeedbackName` keeps its row with a `/* dead: no backend reads it since D21; kept for inventory row 594 */` comment. `gen_pipe.py` gains `scan_live_accessors()`: walk `MobileGL/MG_Backend/**.{cpp,h}` (comments masked), collect every `\b(?:MGB_CTX|pGLContext)\s*->\s*(\w+)` name, `sys.exit` if a name has no `Coverage.def` row, and print (informational) rows no backend reads. Runs in both modes, so `pipe-gates` catches the next drift the day it lands. Zero-row accessors are already fine for `gen_coverage` (`gen_pipe.py:513-579` only iterates inventory rows).
### D13 — Namespaces, naming, generated-file discipline
Pipe code: `namespace MobileGL::MG_Pipe` (`MGPipe.h:26`); `PipeInputs`, `gPipeInputs`, `MGPipeVerb`, `MGPipeVerbClass`, `MGPipeFieldMask`, `kMGPipe*` constants, `MGPipeFillForVerb`, `SnapshotFromGLContext`, `MGPipeVerifyInputs`, `MGPipeVerifyReadHook`, `MGPipeInputsFieldEqual`. Generated files: `MobileGL/MG_Pipe/generated/*.inc`, LF, written through `write()` inside `main()` (`gen_pipe.py:619-652`) so `--check` and the CI `git diff -- MobileGL/MG_Pipe/generated` see them. Banner: `MGPipe.h:1-7`. Commits: `[Type] (Scope): description`, single line, no `Co-Authored-By`. Logging per D8. Test names: additions only.
---
## C. Packages
Four packages on four branches, four WSL worktrees. **Branch points:** `p1/core` from `feat/disaggregated@087685d1`. `p1/core`'s **first commit is the contract** (`c1`, tagged `p1/contract`): the switch header, `PipeInputs.h` with every accessor, `PipeFill.h`, `FillPoints.def` + regenerated `PipeFillPoints.inc`, the CMake options, `PipeInputs.cpp`/`PipeFill.cpp` with the forwarders and a `MGPipeFillForVerb` that only bumps (no field copies yet), `Config.h`/`ConfigLoader.cpp` knobs. `p1/espryt`, `p1/magma`, `p1/verify` branch from `p1/contract`, so their push builds compile and link while A finishes. `c1` is byte-neutral for the pull build (headers nobody includes, sources behind an OFF option).
WSL tree creation (copy `scratchpad/wf2/wsl_p05_trees.sh` → `wsl_p1_trees.sh`; `p05`→`p1`, slugs `core espryt magma verify`; the three non-core trees are created after `p1/contract` exists with `git worktree add -q ~/w7/p1-$slug -b p1/$slug p1/contract`). Each tree configures three build directories:
```
# pull (the G1 build; flags identical to ~/w7/pipe/build-linux)
cmake -S . -B build-linux -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Release -DMOBILEGL_LOG_ACTIVE_LEVEL=MOBILEGL_LOG_LEVEL_INFO -DMOBILEGL_BUILD_TEST=ON -DMOBILEGL_BUILD_INTEGRATION_TEST=ON -DMOBILEGL_ITEST_EGL_VENDOR=/usr/share/glvnd/egl_vendor.d/50_mesa.json -DMOBILEGL_ITEST_VK_ICD=/usr/share/vulkan/icd.d/lvp_icd.json -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5
# push
cmake -S . -B build-push ... same ... -DMOBILEGL_PIPE_PUSH=ON
# verify (A and E, and the integrator)
cmake -S . -B build-verify ... same ... -DMOBILEGL_PIPE_VERIFY=ON -DMOBILEGL_ITEST_REQUIRE_GPU=ON
```
Before anything else the integrator captures the baseline: `cp ~/w7/pipe/build-linux/libMobileGL.so ~/w7/p1-before-libMobileGL.so` (confirm `git -C ~/w7/pipe log -1` is `087685d1` and the cache flags above), `ctest --test-dir ~/w7/pipe/build-linux -N | grep -E '^\s+Test #' | sed 's/^ *Test *#[0-9]*: //' | sort > ~/w7/p1-before-ctest-names.txt`, `grep -rc "pGLContext" MobileGL/MG_Backend | sort > ~/w7/p1-before-pglcontext.txt` (must equal the D1 per-file counts).
### C.1 Package A — `p1-core` (tree `~/w7/p1-core`, branch `p1/core`)
**Files**
| action | file | what |
|---|---|---|
| CREATE | `MobileGL/MG_Pipe/PipeInputsSwitch.h` | D3 verbatim |
| CREATE | `MobileGL/MG_Pipe/FillPoints.def` | D7: three macros, 69 verb rows in `GLFunctionsTable` declaration order, 9 classes, the field rows; blank line after each macro |
| CREATE | `MobileGL/MG_Backend/MGPipe/PipeInputs.h`, `PipeInputs.cpp` | D4, D6, D8 |
| CREATE | `MobileGL/MG_Impl/Pipe/PipeFill.h`, `PipeFill.cpp` | D7, D8; `PipeFill.cpp` includes `<MG_State/GLState/Core.h>`, `<MG_Backend/MGPipe/PipeInputs.h>`, `<Config.h>` |
| MODIFY | `MobileGL/MG_Pipe/Coverage.def` | D12 rows; `MGP_COVERAGE_STICKY_LIST(X)` with the seven D6 rows and reasons; note at `:36-40` |
| MODIFY | `MobileGL/MG_Pipe/PipeFields.def` | D8: six new field lists + payload-list entries |
| MODIFY | `scripts/gen_pipe.py` | parse `FillPoints.def` (`parse_fill_points()`, blank-line-terminated blocks, `sys.exit` on: a verb not in `GLFunctionsTable`, a table member without a row, a verb in two classes, a class with no verbs, an unknown field, a duplicate (class, field)); parse `MGP_COVERAGE_STICKY_LIST`; `gen_filled` emits real sticky flags; `gen_fill_points` → `PipeFillPoints.inc` written via `write()` in `main()` between the `PipeFilled.inc` and `PipeCoverage.inc` lines (`:650-651`); `gen_verify` overloads + empty `MEMCMP_FALLBACK_TYPES` + `static_assert` fallback; `check_field_lists_cover_struct_members()`; `scan_live_accessors()`; `--self-test` (canned negative controls for the struct-member check and the verb-set check; `trips == 0 → error`, `check_include_closure.py:541-543` shape); summary line gains "N verbs, M classes" |
| MODIFY | `MobileGL/MG_Pipe/generated/*.inc` | regenerate and commit (7 files change: `PipeFilled.inc` count 63 + sticky, `PipeVerify.inc`, new `PipeFillPoints.inc`, the banner of any file whose sources line changes) |
| MODIFY | `MobileGL/MG_Pipe/MGPipe.h` | `#include "generated/PipeFillPoints.inc"` after `:86` with a G5b comment |
| MODIFY | `CMakeLists.txt` | after `:24`: `option(MOBILEGL_PIPE_PUSH "Backends read frontend state through the MGPipe PipeInputs block instead of MG_State::pGLContext (ARCHITECTURE.md 9.2 phase A)" OFF)`, `option(MOBILEGL_PIPE_VERIFY "Compile SnapshotFromGLContext() and the G4 per-verb shadow comparator; implies MOBILEGL_PIPE_PUSH; never shipped" OFF)`; after `:451`: `if (MOBILEGL_PIPE_VERIFY AND NOT MOBILEGL_PIPE_PUSH) message(STATUS ...) set(MOBILEGL_PIPE_PUSH ON) endif()`; `if (MOBILEGL_PIPE_PUSH) list(APPEND SOURCE_FILES MobileGL/MG_Backend/MGPipe/PipeInputs.cpp MobileGL/MG_Impl/Pipe/PipeFill.cpp) endif()`; after `:525`: the two `list(APPEND MOBILEGL_COMPILE_DEF -DMOBILEGL_PIPE_PUSH=1 / -DMOBILEGL_PIPE_VERIFY=1)` |
| MODIFY | `MobileGL/Config.h:332` region, `MobileGL/ConfigLoader.cpp:246` region | D2's three knobs under `#if MOBILEGL_PIPE_PUSH` |
| MODIFY | `MobileGL/MG_Impl/GLImpl/{Drawing/GL_Drawing.cpp, Framebuffer/GL_Framebuffer.cpp, Texture/GL_Texture.cpp, Getter/GL_Getter.cpp, Program/GL_Program.cpp, Query/GL_Query.cpp, Sync/GL_Sync.cpp}` | `#include <MG_Impl/Pipe/PipeFill.h>` after each TU's last `MG_State`/`MG_Backend` include; the 83 `MGP_FILL(X);` statements of §B.7 |
| MODIFY | `MobileGL/MG_Test/Pipe/PipeCatalogueTest.cpp` | `:225` 61 → 63; new tests below; if the verify-only tests need it, `#if MOBILEGL_PIPE_VERIFY … #else GTEST_SKIP() << "verify not compiled in" #endif` (a visible skip, not a vanishing test) |
| MODIFY | `MobileGL/MG_Test/Pipe/CMakeLists.txt` | only if a `PipeInputs`-linking test target is added: `PipeInputsTest` linking `${LINK_LIBRARIES}` (the static library), registered `LABELS unit` |
**Ordered steps**
1. `c1` (contract): switch header; `FillPoints.def` + generator growth + regenerate; `PipeInputs.h` complete (all 63 accessors, storage, macros expanding to nothing until step 3); `PipeInputs.cpp` (equality, corruption injector); `PipeFill.h`; `PipeFill.cpp` with `IsLive`, `ContextIdentity`, the seven forwarders, and `MGPipeFillForVerb` = serial bump + `m_currentVerb` only; CMake options and conditional sources; `Config.h`/`ConfigLoader.cpp` knobs; `Coverage.def` + `PipeFields.def` edits; `PipeCatalogueTest.cpp` count. Build pull (identical), push, verify; commit; **tag `p1/contract`** and tell the other packages. Message: `[Feat] (Pipe): land the P1 contract - PipeInputsSwitch.h with MGB_CTX, the 63-field PipeInputs block with type-identical accessors, FillPoints.def and its G5b generator, the MOBILEGL_PIPE_PUSH/VERIFY options and the three verify knobs; pull build unchanged`.
2. `c2`: the filler proper (per-class copies, stamps, omission knob), poison checks in the accessors (`MGP_INPUT_CHECK`), sticky stamping on first live fill. Message: `[Feat] (Pipe): fill PipeInputs per verb class from GLContext and stamp per-verb generations - a read of a field the verb did not fill is Fatal{UnmigratedPipeInput}`.
3. `c3`: the 83 fill points in `MG_Impl`. Message: `[Feat] (Impl): call MGP_FILL before every GLFunctionsTable entry - 83 statements over 69 verbs, a no-op in the pull build`.
4. `c4`: `SnapshotFromGLContext`, entry compare, compare-at-read, arming line, `CORRUPT`/`FATAL` knobs. Message: `[Feat] (Pipe): the MOBILEGL_PIPE_VERIFY shadow comparator - a per-verb entry compare over the fill set and a compare-at-read in every accessor, first differing field and verb serial, fatal by default`.
5. `c5`: G4 field lists for the six value types, the two overloads, the struct-member coverage check, `scan_live_accessors`, `--self-test`; regenerate. Message: `[Feat] (Pipe): give the six value structs G4 field lists and assert the lists cover their members - the memcmp fallback is now a compile error, floats in vector types compare bitwise`.
6. `c6`: unit tests. Message: `[Test] (Pipe): pin the P1 poison and verify shapes - 63 fields, 69 verbs, the seven sticky fields, an omitted GenerateMipmap field leaves exactly that field stale, a corrupted snapshot names its field, reading an unfilled field aborts with SIGABRT`.
**Tests to add** (`PipeCatalogueTest.cpp`; the fork/waitpid one follows `HeadlessGL.cpp:343-388` / `FdPassingTest.cpp:62-132`, never `EXPECT_DEATH` — the tree has none):
- `PipeInputFieldsStartUnfilled`: 63.
- `VerbTableIsTheFunctionTable`: `kMGPipeVerbCount == 69`; every class non-empty; the seven sticky bits are set in every class mask.
- `StickyFieldsAreExactlyTheSeven`: iterate `kMGPipeInputFieldSticky[]`.
- `OmittingOneFieldForOneVerbLeavesExactlyThatFieldStale` (scout B4 layer 1, verbatim shape): fill twice with a fake context (`MG_State::pGLContext = MakeUnique<GLContext>()`, the `SanityTest.cpp:907` idiom), once clean, once with `SetPoisonOmission("GenerateMipmap", "GetActiveTextureUnit")`; assert `GetTextureUnitObject` fresh and `GetActiveTextureUnit` stale, and that a `DrawArrays` fill afterwards leaves `GetActiveTextureUnit` stale (not in `kDraw`'s mask) while `GetBoundVertexArray` is fresh.
- `ReadingAnOmittedFieldAbortsNamingTheVerb` (`#if MOBILEGL_PIPE_POISON` else `GTEST_SKIP`): fork; child fills `GenerateMipmap` with the omission then calls `gPipeInputs.GetActiveTextureUnit()`; parent expects `WIFSIGNALED && WTERMSIG == SIGABRT`; sibling test without the omission expects `_exit(0)`. Log assertion of the exact `Fatal{UnmigratedPipeInput, "GetActiveTextureUnit@GenerateMipmap"}` string via `MOBILEGL_LOG_FILE_PATH` set in the test's own `main()` (`LogLevelTest` shape, `MG_Test/Util/CMakeLists.txt:19-22`) — if that needs a separate target, `PipeInputsTest` links `GTest::gtest`.
- `CorruptedSnapshotFieldIsNamedWithItsSerial` (`#if MOBILEGL_PIPE_VERIFY`): clean arm true; `ApplyVerifyCorruption(snapshot, "GetRenderStateParameters")` → false, field string equal, serial equal to the fill serial.
- `FloatVectorsCompareBitwise`: `MGPipeFieldEqual(FloatVec4{NaN,...}, same bits)` true; `-0.0f` vs `0.0f` false; `Array<PerBufferBlendState, 8>` differing in element 3 → `MGPipeVerify(ResidualValueBlock…)` names `RenderState`.
- `SixValueStructsHaveFieldLists`: `kMGPipeVerifiedPayloadCount == 69u`.
**Constraints**: `PipeInputs.h` and `PipeInputs.cpp` never spell `pGLContext` (`grep -c pGLContext MobileGL/MG_Backend/MGPipe/*` == 0). `MG_Backend/DirectGLES/**` and `MG_Backend/DirectVulkan/**` are **not touched** (B and C own them). `PipeCalls.def` untouched. No renames of `PipeStats` counter names (`PipeStatsTest.cpp:260-279`). No `MGLOG_D` in verify reporting.
**Verification (WSL, `~/w7/p1-core`)**
```
python3 scripts/gen_pipe.py --check && python3 scripts/gen_pipe.py --self-test
cmake --build build-linux --parallel 28 && ctest --test-dir build-linux -L unit --no-tests=error --output-on-failure
python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0 # 0/0/0/0, .text +0
grep -rc "pGLContext" MobileGL/MG_Backend | sort | diff - ~/w7/p1-before-pglcontext.txt # empty (A converts no site)
grep -c "pGLContext" MobileGL/MG_Backend/MGPipe/PipeInputs.h MobileGL/MG_Backend/MGPipe/PipeInputs.cpp # 0 0
grep -c "MGP_FILL(" MobileGL/MG_Impl/GLImpl/*/*.cpp | awk -F: '{s+=$2} END {print s}' # 83
cmake --build build-push --parallel 28 && ctest --test-dir build-push -L unit --no-tests=error
cmake --build build-verify --parallel 28 && ctest --test-dir build-verify -L unit --no-tests=error
# the poison is real: with the sites still on pGLContext (B/C not merged) nothing reads gPipeInputs, so run the
# integration suite in build-push to prove the fill points and filler are inert-correct (all green, no aborts):
ctest --test-dir build-push -L integration-gpu --no-tests=error -j 4
ctest --test-dir build-linux -N | grep -E '^\s+Test #' | sed 's/^ *Test *#[0-9]*: //' | sort | comm -23 ~/w7/p1-before-ctest-names.txt - # empty
```
### C.2 Package B — `p1-espryt` (tree `~/w7/p1-espryt`, branch `p1/espryt`, from `p1/contract`)
**Files**: `MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp`, `Managers.cpp`, `MultiDraw.cpp`, `Utils.cpp` (nothing else; `Managers.h`, `Utils.h`, `DirectGLES.h`, `BackendObject_DirectGLES.cpp` have no sites).
**Site list it owns** — 122 lines = 113 arrow lines (113 occurrences) + 9 non-arrow:
| file | arrow lines (sed `MG_State::pGLContext->` → `MGB_CTX->`) | non-arrow (D9) |
|---|---|---|
| `DirectGLES.cpp` (91 + 1) | 143,261,357,370,429,462,465,474,481,518,662,892,987,1007,1244,1275,1373,1386,1414,1415,1515,1517,1518,1580,1728,1820,2026,2054,2083,2166,2842,2844,2846,2957,2968,3048,3212,3362,3482,3580,3662,3712,3821,3822,3826,4062,4088,4093,4156,4215,4380,4396,4397,4402,4442,4570,4609,4680,4711,4712,4782,4813,4814,4973,5014,5259,5260,6044,6045,6107,6108,6185,6375,6699,6700,6794,6795,6932,6933,7357,7358,7554,7562,8544,8774,9041,9084,9194,9197,9420,9510 | 147 (`.get()`, with the 143-155 block rewrite of D9) |
| `Managers.cpp` (15 + 8) | 3645,3646,3774,3775,3845,3846,4736,4737,5355,5460,6230,7193,7201,7204,8751 | 3644,3773,3844,4735 (guards), 7192,7200,7203 (ternary conditions), 8750 (guard) |
| `MultiDraw.cpp` (5) | 45,51,52,87,95 | — |
| `Utils.cpp` (2) | 2297,2301 | — |
**Ordered steps**
1. Add `#include <MG_Pipe/PipeInputsSwitch.h>` (D3 placement) to the four TUs.
2. Mechanical sed over the four files: `sed -i 's/MG_State::pGLContext->/MGB_CTX->/g'` — then confirm the per-file occurrence counts above (`grep -c 'MGB_CTX->'`), and that the only remaining `pGLContext` tokens are the 9 non-arrow lines.
3. Convert the 9 non-arrow lines per D9 (the `DirectGLES.cpp:143-155` block by hand).
4. Build pull; symbol report; build push; run.
5. One commit: `[Refactor] (Espryt): route every frontend read through MGB_CTX - 113 arrow sites sed'd, 9 non-arrow lines converted (the fb-slot cache keys on MGB_CTX_IDENTITY); pull build byte-identical`.
**Constraints**: no reordering, no reformatting beyond the touched lines; the `PipeStats` `AddCalls` literals near the sites (`DirectGLES.cpp:1416-2969`, `Managers.cpp:783-4433`, `MultiDraw.cpp:176-754`) are unchanged; the 8 + 3 sync sites of D10 are untouched; no new `pGLContext` spelling anywhere.
**Verification (WSL, `~/w7/p1-espryt`)**
```
grep -rc "pGLContext" MobileGL/MG_Backend/DirectGLES | grep -v ":0$" # empty
grep -c "MGB_CTX" MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp MobileGL/MG_Backend/DirectGLES/Managers.cpp MobileGL/MG_Backend/DirectGLES/MultiDraw.cpp MobileGL/MG_Backend/DirectGLES/Utils.cpp # ≥ 92+23+5+2 (occurrences per file: DirectGLES 91 arrow + 4 in the cache block + 1 alias; Managers 15+8; MultiDraw 5; Utils 2)
cmake --build build-linux --parallel 28 && ctest --test-dir build-linux -L unit --no-tests=error
python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0 # 0/0/0/0, .text +0 expected; any delta attributed to D9 lines in the commit message
ctest --test-dir build-linux -L integration-gpu -R '^DirectGLES\.' --no-tests=error -j 4 # by-name green
cmake --build build-push --parallel 28 && ctest --test-dir build-push -L integration-gpu -R '^DirectGLES\.' --no-tests=error -j 4 # links; runs (on the contract tree the filler does not copy yet, so under push this run is expected to hit Fatal{UnmigratedPipeInput} at the first read - that is the poison working; rerun after rebasing onto p1/core c2+ and it must be green)
```
### C.3 Package C — `p1-magma` (tree `~/w7/p1-magma`, branch `p1/magma`, from `p1/contract`)
**Files**: `MobileGL/MG_Backend/DirectVulkan/DirectVulkan.cpp`, `BackendObject_DirectVulkan.cpp`, `Renderer/UniformManager.cpp`, `Renderer/VulkanRenderer.cpp`, `Renderer/VkClearManager.cpp`, `Renderer/VkRenderPassManager.cpp`, `Renderer/VkTextureManager.cpp`, `Renderer/VertexInputStateFactory.h` (comment only).
**Site list it owns** — 213 lines = 164 arrow occurrences on 161 lines + 49 non-arrow:
| file | arrow lines | non-arrow (D9) |
|---|---|---|
| `DirectVulkan.cpp` (12 + 35) | 270,273,278,402,465,533,586,716,786,910,1237,1284 (1284 also gets the `MGB_CTX_LIVE ?` rewrite) | 337,343,349,355,362,369,376,383,389,394,445,451,496,523,567,582,616,622,631,638,644,650,656,741,746,752,758,817,842,865,971,977,1001,1008 (asserts), 1236 (`!= nullptr`) |
| `BackendObject_DirectVulkan.cpp` (2 + 2) | 389,787 | 388,786 (guards) |
| `UniformManager.cpp` (14 + 9) | 506,555,782,821,847,1016,1189,1194,1295,1662,1850,1938,2013,2018 | 812,837,992,1152,1266,1651,1806,1888,1968 (asserts) |
| `VkClearManager.cpp` (1) | 57 | — |
| `VkRenderPassManager.cpp` (3) | 613,965,1111 | — |
| `VkTextureManager.cpp` (2) | 809,952 | — |
| `VulkanRenderer.cpp` (127 lines / 130 occurrences + 2) | 463,468,523,556,557,570,649,650,1243,1247,1303,2771,2988,3448,3449,3926,4060,4815,4816,4817,4828,4940,4984,5172,5173,5175,5178,5180,5181,5187,5199,5200,5202,5287,5288,5294,5298,5312,5317,5318,5354,5355,5407,5435,5436,5437,5442,5858,5919,5943,6019,6043,6091,6105,6110,6121,6122,6130,6304,6434,6464,6471,6472,6512,6526,6532,6650,6669,6830,6831,6972,6973,6999,7036,7088,7132,7206,7209,7257,7260,7268,7269,7270,7277,7300,7327,7340,7369,7373,7389,7410,7439,7481,7512,7514,7526,7583,7601,7609,7628,8586,8587,8619,8620,9214(×2),9222,9933,10688,10689,10719(×2),10963(×2),11219,11236,11268,11274,11277,11316,11347,11370,12018,12096,12106,12112,12197,12207,12277,12767 | 11267 (`== nullptr`), 12766 (`!= nullptr`) |
| `VertexInputStateFactory.h` (0 + 1) | — | 133 (comment) |
Steps, constraints and verification exactly as B, with `DirectVulkan` in place of `DirectGLES`, the seven TUs getting the switch include (D3 placement), and one commit: `[Refactor] (Magma): route every frontend read through MGB_CTX - 164 arrow sites sed'd, 49 non-arrow lines converted (43 asserts keep their meaning as MGB_CTX_LIVE); pull build byte-identical`. The 12 + 3 sync sites of D10 are untouched. `grep -rc "pGLContext" MobileGL/MG_Backend/DirectVulkan | grep -v ":0$"` is empty.
### C.4 Package E — `p1-verify` (tree `~/w7/p1-verify`, branch `p1/verify`, from `p1/contract`)
The third CI mode and the negative controls. Everything E codes against is a contract fixed above: option names (D2), env knobs (D2), log lines (D8), the `MGPipeVerb`/field vocabularies (D7/D4), `MGLOG_F` + `std::abort()` = SIGABRT.
**Files**
| action | file | what |
|---|---|---|
| MODIFY | `MobileGL/MG_IntegrationTest/CMakeLists.txt` | after `:393`: `set(MGL_ITEST_VERIFY_TIMEOUT 900)`; `if (MOBILEGL_PIPE_VERIFY)` block with two ambient registrations `DirectGLES.Verify.` / `DirectVulkan.Verify.` (env `MOBILEGL_PIPE_VERIFY=1` + `MOBILEGL_LOG_FILE_PATH=${CMAKE_CURRENT_BINARY_DIR}/pipe-verify-<backend>.log` + **`${MGL_ITEST_COMMON_ENV}` / `${MGL_ITEST_VULKAN_ENV}` appended** (`:339-344` rule), `LABELS integration-gpu integration-verify`, `TIMEOUT ${MGL_ITEST_VERIFY_TIMEOUT}`, joined with `mgl_itest_join_environment` (`:307-317`)); two corrupted-field lanes `DirectGLES.VerifyCorrupted.` / `DirectVulkan.VerifyCorrupted.` (`TEST_FILTER "PipeVerifyArmingScenario.CorruptedFieldIsReported"`, env adds `MOBILEGL_PIPE_VERIFY_CORRUPT=GetRenderStateParameters MOBILEGL_PIPE_VERIFY_FATAL=0`, own log path); two omission lanes `DirectGLES.PoisonOmitted.` / `DirectVulkan.PoisonOmitted.` (`TEST_FILTER "PoisonOmissionScenario.*"`, env adds `MOBILEGL_PIPE_POISON_OMIT=GenerateMipmap:GetActiveTextureUnit`, own log path). Both scenario files added to the `add_executable` list (`:51-130`) |
| CREATE | `MobileGL/MG_IntegrationTest/Scenarios/PipeVerifyArmingScenario.cpp` | `Armed`: skips unless `AmbientQuirkFromEnvironment("MOBILEGL_PIPE_VERIFY") == On` (`ScenarioFixture.h:56-65`) and the log path is set (`UnlocatedIoBlockScenario.cpp:354-360` idiom, only bytes written after the case started); draws once; asserts `MGPipe: verify armed` present and no `Fatal{PipeVerifyDiffer`. `CorruptedFieldIsReported`: skips unless `MOBILEGL_PIPE_VERIFY_CORRUPT` is set; draws once; asserts `Fatal{PipeVerifyDiffer, "GetRenderStateParameters@` present |
| CREATE | `MobileGL/MG_IntegrationTest/Scenarios/PoisonOmissionScenario.cpp` | `OmittedFieldAbortsOnThatVerb`: skips unless `MOBILEGL_PIPE_POISON_OMIT` is set; `fork()` **before** any scenario-local GPU work (`HeadlessGL.cpp:343-388`, `_exit` never `exit`, `:365-368`); child: create a 2-level texture, `glDrawArrays` once (must not abort), `glGenerateMipmap` (must abort), `_exit(0)`; parent: `WIFSIGNALED && WTERMSIG == SIGABRT`, log carries `Fatal{UnmigratedPipeInput, "GetActiveTextureUnit@GenerateMipmap"}` and no `@DrawArrays`. `WithoutOmissionCompletes`: same child without the knob → `WIFEXITED && WEXITSTATUS == 0` (registered in the same lane by filter; the env var is present, so this case clears it? No — env is process-wide: the clean arm runs in the ambient `Verify.` lanes instead, where the scenario asserts the knob is unset) |
| MODIFY | `tools/trace_replay/run_trace_case.cmake` | after `:129`: `if(DEFINED ENV{MOBILEGL_PIPE_VERIFY} AND NOT "$ENV{MOBILEGL_PIPE_VERIFY}" STREQUAL "0")` → `FATAL_ERROR` if `mobilegl.log` missing, if it lacks `MGPipe: verify armed`, or if it contains `Fatal\{PipeVerifyDiffer` / `Fatal\{UnmigratedPipeInput` (scout B2.2 text) |
| MODIFY | `tools/trace_replay/CMakeLists.txt:373-379` | add `LABELS retrace` to both `set_tests_properties` (the lane is otherwise selectable only by regex) |
| MODIFY | `tools/trace_replay/trace_cases.json`, `trace_cases.py` | `"verify": true` on eight cases: the five 180 s cases plus `minecraft-1.21.4-in-world`, `minecraft-1.21.4-fabric-sodium-in-world`, `improved-transparency-minecraft-26.3` (exact names from the file; E lists them in the commit); `--format github-verify-matrix` = `github_test_matrix(cases with verify)`; unit-check in `trace_cases.py`'s existing self-checks |
| MODIFY | `scripts/symbol_report.py` | implement `--fail-on-added-bytes N` (`:287-288` is reserved) and add `--fail-on-symbol-set-change`; default behaviour unchanged; `--self-test` covers both |
| MODIFY | `.github/workflows/test.yml` | (a) `build-linux-verify` (copy of `build-linux:12-147` with `BUILD_DIR=build-verify`, its own ccache key `${{ runner.os }}-test-${{ github.job }}-ccache-v1`, configure adds `-DMOBILEGL_PIPE_VERIFY=ON` and keeps `MOBILEGL_LOG_ACTIVE_LEVEL=MOBILEGL_LOG_LEVEL_INFO`, artifact `mobilegl-linux-runtime-verify`, `timeout-minutes: 120`); (b) `integration-verify` (`needs: build-linux-verify`; the `integration:205-296` shape incl. the path-normalisation step over `build-verify`, `ctest --output-on-failure -L integration-verify --no-tests=error`, core-dump upload, `timeout-minutes: 180`) plus the two negative-control steps: `MOBILEGL_PIPE_VERIFY_CORRUPT=GetRenderStateParameters ctest -L integration-verify -R 'DirectGLES\.Verify\..*ClearThenReadPixels' --no-tests=error` must **fail** (`if ctest ...; then echo "::error::..."; exit 1; fi`), and `MOBILEGL_PIPE_POISON_OMIT=GenerateMipmap:GetActiveTextureUnit ctest -L integration-verify -R 'DirectGLES\.Verify\..*Mipmap' --no-tests=error` must fail (job env reaches the process: no `ENVIRONMENT` property names these, `test.yml:274-288` precedent); (c) `retrace-verify` (`needs: [build-linux-verify, build-retrace, trace-cases, trace-fixtures]`, matrix from a new `trace-cases` output `verify-matrix` = `--format github-verify-matrix`, `max-parallel: 4`, `timeout-minutes: 240`; unpack the **verify** runtime so the verify `.so` lands at `build-linux/libMobileGL.so` (the path frozen into `CTestTestfile.cmake`), `test -f` + `nm -D build-linux/libMobileGL.so | grep -q MGPipeVerifyInputs`, `export MOBILEGL_PIPE_VERIFY=1` next to the per-case exports (`:700-723`), `ctest -V --no-tests=error --timeout 10800 -R '^MobileGLTraceReplay\.<case>\.<backend>$'`, artifacts suffixed `-verify`); one inverted `OpenRA` step with `MOBILEGL_PIPE_VERIFY_CORRUPT`; (d) `remove-artifact-clutter:787` `needs: [retrace-summary, retrace-verify]`; (e) `monolith-symbol-report` (`workflow_dispatch` input `baseline_sha`, default `087685d1`): two pull builds with identical flags (`-DMOBILEGL_BUILD_TEST=OFF -DMOBILEGL_BUILD_BENCHMARK=OFF -DMOBILEGL_BUILD_INTEGRATION_TEST=OFF -DMOBILEGL_BUILD_TRACE_REPLAY=OFF -DMOBILEGL_BUILD_DISAGGREGATED=OFF -DMOBILEGL_PIPE_PUSH=OFF -DMOBILEGL_PIPE_VERIFY=OFF -DMOBILEGL_ENABLE_LTO=OFF`, clang-20), `symbol_report.py --threshold 0 --fail-on-symbol-set-change --fail-on-added-bytes 0 --markdown --json`, upload the markdown, and `nm --defined-only build-sym-head/libMobileGL.so | grep -q MG_Remote && exit 1` (`ARCHITECTURE.md:506`); (f) the `pipe-gates` dirty-surface comment `:871-872` → "in P2"; (g) `pipe-gates` gains `python3 scripts/gen_pipe.py --self-test` after `:851`. Triggers (`:3-9`) unchanged (P0.5 D10). |
**Constraints**: every new `ENVIRONMENT` list appends `${MGL_ITEST_COMMON_ENV}`/`${MGL_ITEST_VULKAN_ENV}`; the 11 filtered mode lanes are not doubled; no `ENVIRONMENT` property ever names `MOBILEGL_PIPE_VERIFY_CORRUPT`/`MOBILEGL_PIPE_POISON_OMIT` on the ambient `Verify.` lanes (the CI negative-control steps rely on job env reaching them); the verify lanes are registered only under `if (MOBILEGL_PIPE_VERIFY)` so `--no-tests=error` makes a mis-configured lane red; `MG_Test/**`, `MobileGL/**` outside `MG_IntegrationTest/`, `CMakeLists.txt` (root) untouched.
**Verification (WSL, `~/w7/p1-verify`)**
```
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/test.yml'))"
python3 tools/trace_replay/trace_cases.py --ci --format github-verify-matrix | python3 -c "import json,sys; m=json.load(sys.stdin); print(len(m['include']))" # 16 (8 cases x 2, minus any ci_backends restriction)
python3 scripts/symbol_report.py --self-test
cmake -S . -B build-verify ... -DMOBILEGL_PIPE_VERIFY=ON -DMOBILEGL_ITEST_REQUIRE_GPU=ON && cmake --build build-verify --parallel 28
ctest --test-dir build-verify -N -L integration-verify | grep -c 'Test #' # 742 + 2 + 2 (the 371 x 2 ambient entries plus the four control entries)
ctest --test-dir build-verify -N -L integration-gpu | sed 's/\.Verify\././' | sort -u | wc -l # parity with the pull registration set
# On the contract tree the library never arms (the comparator lands in p1/core c4), so the arming case must SKIP-or-FAIL, never pass:
ctest --test-dir build-verify -R 'DirectGLES\.Verify\.PipeVerifyArmingScenario' --output-on-failure # expected red (REQUIRE_GPU on) - the lane is falsifiable
```
Full functional verification of E happens on the integrated tree (D.3).
### C.5 File-ownership table (no two packages edit the same file)
| file / glob | A core | B espryt | C magma | E verify | integrator |
|---|---|---|---|---|---|
| `MobileGL/MG_Pipe/{PipeInputsSwitch.h, FillPoints.def, Coverage.def, PipeFields.def, MGPipe.h, generated/*.inc}` | owner | – | – | – | – |
| `scripts/gen_pipe.py` | owner | – | – | – | – |
| `MobileGL/MG_Backend/MGPipe/**` (new) | owner | – | – | – | – |
| `MobileGL/MG_Impl/Pipe/**` (new), `MobileGL/MG_Impl/GLImpl/{Drawing,Framebuffer,Texture,Getter,Program,Query,Sync}/*.cpp` | owner | – | – | – | – |
| root `CMakeLists.txt`, `MobileGL/Config.h`, `MobileGL/ConfigLoader.cpp` | owner | – | – | – | – |
| `MobileGL/MG_Test/Pipe/**` | owner | – | – | – | – |
| `MobileGL/MG_Backend/DirectGLES/{DirectGLES.cpp, Managers.cpp, MultiDraw.cpp, Utils.cpp}` | – | owner | – | – | – |
| `MobileGL/MG_Backend/DirectVulkan/{DirectVulkan.cpp, BackendObject_DirectVulkan.cpp, Renderer/UniformManager.cpp, Renderer/VulkanRenderer.cpp, Renderer/VkClearManager.cpp, Renderer/VkRenderPassManager.cpp, Renderer/VkTextureManager.cpp, Renderer/VertexInputStateFactory.h}` | – | – | owner | – | – |
| `MobileGL/MG_IntegrationTest/**`, `tools/trace_replay/{run_trace_case.cmake, CMakeLists.txt, trace_cases.json, trace_cases.py}`, `scripts/symbol_report.py`, `.github/workflows/test.yml` | – | – | – | owner | – |
| `docs/Disaggregated/*.md`, `scripts/gen_pipe_dirty_surface.py` (comment), `test.yml:871-872` comment (E lands it) | – | – | – | – | owner |
| everything else | nobody | nobody | nobody | nobody | nobody |
The contract (`p1/contract`) is the only shared code, and it is a single commit all three other branches descend from; the integrator's rebase of B/C/E onto the final `p1/core` therefore never sees an edit on both sides of one file.
---
## D. Integration order and what the integrator runs
D.0 Preconditions: baseline captures of §C (`~/w7/p1-before-*`); `~/w7/pipe` clean at `087685d1`; fixture binaries hidden as in `wsl_p05_trees.sh`.
D.1 Order: **core → espryt → magma → verify.** Copy `scratchpad/wf2/wsl_integrate_p05.sh` → `wsl_integrate_p1.sh` (`p05`→`p1`); per slug: rebase `p1/<slug>` onto `feat/disaggregated` in its worktree, `git merge --ff-only`, then in `~/w7/pipe`:
```
cmake --build build-linux --parallel 28 && ctest --test-dir build-linux -L unit --no-tests=error --output-on-failure
python3 scripts/gen_pipe.py --check && python3 scripts/gen_pipe.py --self-test
python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0 --markdown ~/w7/p1-symbol-<slug>.md # 0/0/0/0 and .text +0 after every merge
```
After espryt and magma additionally: `grep -rc "pGLContext" MobileGL/MG_Backend | grep -v ":0$"` → empty (G2); `ctest --test-dir build-linux -L integration-gpu --no-tests=error -j 4` green by name (`comm -23 ~/w7/p1-before-ctest-names.txt` empty).
D.2 Push build on the integrated tree (`~/w7/pipe/build-push`, `-DMOBILEGL_PIPE_PUSH=ON`): unit + `integration-gpu` green — no `Fatal{UnmigratedPipeInput}` is possible here (the poison is off in a Release/INFO push build without VERIFY), so this run proves only that the filler and accessors are functionally equivalent under pull semantics.
D.3 Verify build (`~/w7/pipe/build-verify`, `-DMOBILEGL_PIPE_VERIFY=ON -DMOBILEGL_ITEST_REQUIRE_GPU=ON`):
```
ctest --test-dir build-verify -L unit --no-tests=error
ctest --test-dir build-verify -L integration-verify --no-tests=error -j 4 --output-on-failure # 746 entries green: G3 half one
grep -c "MGPipe: verify armed" build-verify/MobileGL/MG_IntegrationTest/pipe-verify-*.log # > 0 in both
MOBILEGL_PIPE_VERIFY_CORRUPT=GetRenderStateParameters ctest --test-dir build-verify -L integration-verify -R 'DirectGLES\.Verify\..*ClearThenReadPixels' ; echo rc=$? # non-zero: G4
MOBILEGL_PIPE_POISON_OMIT=GenerateMipmap:GetActiveTextureUnit ctest --test-dir build-verify -L integration-verify -R 'Mipmap' ; echo rc=$? # non-zero: G5
ctest --test-dir build-verify -R 'PoisonOmitted\.|VerifyCorrupted\.' --no-tests=error # the four control entries green (they assert the red)
# 40 traces (79 desktop cases) under verify - the second half of G3:
cp scratchpad/wf2/retrace_gate.py ~/w7/retrace_gate.py
MOBILEGL_PIPE_VERIFY=1 python3 ~/w7/retrace_gate.py --tree ~/w7/pipe --lib ~/w7/pipe/build-verify/libMobileGL.so --out ~/w7/retrace-out/p1-verify -j 4
grep -L "MGPipe: verify armed" ~/w7/retrace-out/p1-verify/*/mobilegl.log # empty: every case armed
grep -l "Fatal{" ~/w7/retrace-out/p1-verify/*/mobilegl.log # empty
```
A `Fatal{UnmigratedPipeInput, "F@V"}` here is a missing row in `FillPoints.def`'s class table: add it (never sticky), regenerate, rerun. A `Fatal{PipeVerifyDiffer, ..., where=read}` is a real push/pull semantic divergence: record it in `MEASUREMENTS.md` with the site and decide (plan owner) whether the pull value or the boundary value is the intended one; it is not silenced.
D.4 CI: `gh workflow run test.yml --ref feat/disaggregated` and, once green, `gh workflow run test.yml --ref feat/disaggregated -f baseline_sha=087685d1` for `monolith-symbol-report`; record both run URLs. Expected: `pipe-gates`, `include-graph-check`, `test`, `integration`, `integration-verify`, `retrace` (77), `retrace-verify` (16), `monolith-symbol-report` green.
D.5 Docs (integrator-owned, one commit; `scripts/check_doc_citations.py docs/Disaggregated/*.md` must stay clean): `README.md:3` status → P1 landed with the hash; `ROADMAP.md:17` ✅ with "277 处(274 行)+ 58 行", "Espryt 32 / Magma 56(63 字段)", "83 个填充点 / 69 个 verb"; `ROADMAP.md:18` unchanged (dirty-surface stays P2); `ARCHITECTURE.md:172,568` "P1 起成为门/P1 成门" → P2; `:344` counts; `:349` add `MOBILEGL_PIPE_POISON`'s definition and the `MOBILEGL_DEBUG` correction; `:553` note that `MGPipeImpl_*.cpp` land with the first installed table; `:583` `MOBILEGL_PIPE_VERIFY` → 已落地, add `MOBILEGL_PIPE_PUSH` (CMake) row and the three runtime knobs at `:588-597`; `MEASUREMENTS.md`: new §6 (the D10 table), §4 "61 字段" → 63 / "63 verify payload" → 69, the G1 symbol-report summary lines, the verify-lane wall times, and the P1 `.text` attribution (expected: "0 bytes; 58 lines converted, none code-bearing"). Then `[Merge]` to `dev` per the milestone flow (P1 is not one of the five full-CTS boundaries, `ROADMAP.md:34`, but the `dev` merge still triggers the full `gl44to46` run on both devices — schedule it, off the critical path).
---
## E. Risks and mitigations
| risk | mitigation |
|---|---|
| **A fill table that is too small turns the verify lane red for a reason that is not a bug.** The class masks in D7 are derived statically from `scout-pull-sites.md` §4.2; a helper reached through a path the reachability trace missed reads a field its class does not list. | This is exactly what the lane exists to find, and the fix is mechanical (add the row, regenerate). The rule in D7 — never sticky — keeps the fix honest. Budget one day of D.3 iteration for it; each Fatal names field and verb. |
| **A read outside any verb.** `InvalidateCompileEnv` at backend init (`BackendObject_DirectVulkan.cpp:389,787`) and `RecordError` from sampler sync run with no verb; texture-sync helpers (`Managers.cpp:3645-4737`) are reached only from verbs (callers verified: `DirectGLES.cpp:1325,1567,1632`, `Managers.cpp:5234`, all under `SyncNeccessaryTextures`/FBO sync); Magma's render-pass and view helpers are reached only from draw/clear/blit (`GetOrCreateRenderPass` callers `VulkanRenderer.cpp:6363,6833,6846,7196,7229,8491`); `Present` reads nothing. | The seven sticky fields cover the two genuine out-of-verb cases. If the lane finds another (`@<none>` in the Fatal), the answer is a fill point at that boundary (an EGL virtual in `EGLImpl.cpp`), never a sticky flag. |
| **`.text` moves in the pull build.** The 13 guard/compare rewrites and the `.get()` block are like-for-like, but a compiler may schedule a `const void*` compare differently. | `symbol_report.py --threshold 0` after every merge (D.1); any delta is attributed line by line in the commit message and in `MEASUREMENTS.md`; the gate text allows an attributed delta, not an unexplained one. |
| **The verify lane is green because it never armed.** A `MOBILEGL_PIPE_VERIFY=1` against a library without the option is a no-op that looks green. | `run_trace_case.cmake` fails a verify run whose log lacks the arming line; `PipeVerifyArmingScenario` fails the itest lane the same way; `--no-tests=error` fails a lane whose registration was skipped; the retrace-verify job asserts the swapped `.so` exports `MGPipeVerifyInputs`. |
| **The entry compare is tautological in P1 and someone reads "zero divergence" as more than it is.** | D8 states it; `MEASUREMENTS.md` records which arm proved what; the compare-at-read arm and the poison are the P1 semantic content, and the CORRUPT control keeps the entry compare falsifiable until P2 gives it a real first arm. |
| **Verify cost.** 5–10× on 742 itest entries and 79 traces; the 1800 s trace cases already sit above ctest's 1500 s default. | `TIMEOUT 900` on the verify lanes; `--timeout 10800` on retrace-verify; `timeout-minutes` on every new job (the file has none today); per-push CI runs the 8-case verify subset, the full 79 runs at the P1 exit on WSL (D.3) and on `workflow_dispatch`; `-j 4` locally (each case unpacks a multi-GB trace). |
| **`std::abort()` inside a scenario kills the whole `MobileGLIntegrationTest` process.** | ctest runs one case per process (`gtest_discover_tests`), so a Fatal reds exactly one entry and leaves a core; the omission scenario forks first (`HeadlessGL.cpp:323-343`). |
| **The `GetFramebufferBindingSlotFast` cache bypasses the accessor** for five Espryt reads. | Known and recorded (D4); the entry compare still covers the field; P2's Espryt 0b deletes the cache. |
| **`Coverage.def` and the stale vendored inventory disagree** (a 62-accessor tree, a 61-row table, a dead row). | D12's `scan_live_accessors()` is a `pipe-gates` gate from `c5` on; the dead row is labelled; re-vendoring is a recorded P2 item. |
| **Two `PipeInputs` field lists drift from `RenderStateParameters` when P2 adds `FramebufferSrgb`/`DepthClamp` storage** (`ROADMAP.md:18`). | D8's struct-member coverage check makes a member without an `F(...)` entry a `pipe-gates` failure; `MGL_RESIDUAL_BLOCK_SIZE` and the value-header `static_assert` catch the size. |
| **MSVC / Android.** `fork()`-based tests and the itest lanes are POSIX; the push/verify options are desktop-only in P1. | Windows is not a correctness gate (`ROADMAP.md:7`); the new sources compile on MSVC (no POSIX in `PipeInputs`/`PipeFill`); the fork tests are `#if !_WIN32` with a visible skip; `apk.yml` is unaffected (options OFF). |
| **A/B/C/E land against an outdated contract.** | The contract is one commit, tagged; A must not change any signature in `PipeInputs.h`, `PipeFill.h` or `PipeInputsSwitch.h` after `p1/contract` without telling B/C/E (a rebase-time compile error is the backstop). |
---
## B.7 (appendix) — the 83 fill-point statements at `087685d1`
Insert `MGP_FILL(<Verb>);` immediately before each statement (D7 placement):
- `GL_Drawing.cpp`: 530 Clear; 538 DrawElements; 547 MultiDrawElements; 556 MultiDrawElementsBaseVertex; 565 DrawArrays; 573 MultiDrawArrays; 582 DrawElementsBaseVertex; 591 MultiDrawElementsIndirect; 599 MultiDrawArraysIndirect; 608 MultiDrawElementsIndirectCount; 618 MultiDrawArraysIndirectCount; 628 DrawRangeElementsBaseVertex; 638 DrawRangeElements; 648 DrawElementsInstancedBaseVertexBaseInstance; 658 DrawElementsInstancedBaseVertex; 668 DrawElementsInstancedBaseInstance; 678 DrawElementsInstanced; 686 DrawElementsIndirect; 694 DrawArraysInstancedBaseInstance; 703 DrawArraysInstanced; 711 DrawArraysIndirect; 742 DispatchCompute (`dispatchCompute(numGroupsX, …)`); 794 DispatchComputeIndirect; 815 PatchParameteri; 885 MemoryBarrier; 907 MemoryBarrier (`TextureBarrier`); 919 MemoryBarrierByRegion; 1241 BeginTransformFeedback; 1323 EndTransformFeedback; 1331 FenceSync; 1332 ClientWaitSync; 1334 DeleteSync; 1352 PauseTransformFeedback; 1366 ResumeTransformFeedback; 1571 DeleteTransformFeedback; 1602 BindTransformFeedback — **36**
- `GL_Framebuffer.cpp`: 619 BlitFramebuffer; 632 BlitNamedFramebuffer; 643 ClearNamedFramebufferfv; 653 ClearNamedFramebufferfi; 663 ClearNamedFramebufferiv; 673 ClearNamedFramebufferuiv; 2732 ClearBufferfi; 2738 ClearBufferfv; 2744 ClearBufferuiv; 2750 ClearBufferiv; 2997 ReadPixels — **11**
- `GL_Texture.cpp`: 1079 ReadPixels; 1622 GenerateMipmap; 4027 CopyTexSubImage2D; 4043 CopyImageSubData; 4464 CopyTexImage2D; 5074 GetTexImage; 6456 GetTextureImage; 6660 BindImageTexture — **8**
- `GL_Getter.cpp`: 1176 GetIntegeri_v; 1356 GetGpuTimestampNs; 2266 GetGpuTimestampNs — **3**
- `GL_Program.cpp`: 3401 ShaderStorageBlockBinding — **1**
- `GL_Query.cpp`: 167, 274, 320, 444, 591, 915 DeleteBackendQuery; 181 EndTimeElapsedQuery; 261, 301 GetQueryResult64; 289 IsQueryResultAvailable; 425, 607 EndOcclusionQuery; 523 BeginXfbPrimitivesQuery; 530 BeginOcclusionQuery; 534 BeginTimeElapsedQuery; 582 EndXfbPrimitivesQuery; 646 QueryCounterTimestamp; 775 IsTimerQuerySupported — **18**
- `GL_Sync.cpp`: 59 FenceSync; 97 ClientWaitSync; 122 WaitSync; 142 DeleteSync; 177 GetSyncStatus; 229 DeleteSync — **6**
Not fill points: the 8 null-check/capture lines the 91-line grep also matches (`GL_Drawing.cpp:1010,1031,1255,1329`, `GL_Query.cpp:218,471,545,768`, `GL_Texture.cpp:6455,6715`, `ProgramInterface.h:27`), `CompileEnv.cpp:135,137` (D1), and the EGL virtuals (`EGLImpl.cpp:178,267,284,347,448`).
@@ -1,65 +0,0 @@
# P1 verify-lane findings on the integrated tree (`feat/disaggregated` @ 97b997d5, WSL `~/w7/pipe`)
All four P1 packages are merged. The pull build is clean: `symbol_report --threshold 0` reports 0 added / 0 removed / 0 resized / 0 renamed, `grep -rc pGLContext MobileGL/MG_Backend` is empty everywhere, `ctest -L unit` 1482/1482, `ctest -L integration-gpu` 878 with one known `-j` flake that reruns green, `ctest -N` names 0 removed / 26 added, `gen_pipe.py --check` and `--self-test` clean.
The push and verify builds are not clean. Three distinct problems, in the order they must be fixed.
## F1 — missing fill rows (mechanical, `MobileGL/MG_Pipe/FillPoints.def`)
The 79-case retrace under `MOBILEGL_PIPE_VERIFY=1` (`~/w7/retrace-out/p1-verify/`) aborts four cases with:
```
Fatal{UnmigratedPipeInput, "IsCapabilityEnabled@GenerateMipmap"} x3 cases
Fatal{UnmigratedPipeInput, "IsCapabilityEnabled@DispatchCompute"} x1 case
```
`IsCapabilityEnabled` is listed for `kDraw`, `kClear`, `kBlitOrCopy` and `kReadback` but not for `kTextureOp` (which owns `GenerateMipmap`) or `kDispatch`. Adding a row is the whole fix, but do not stop at these two: audit every class against the verb paths in `scratchpad/wf4/scout-pull-sites.md` §3b and add every row the lane can still miss, then prove it by re-running the lane and the retrace (they are the only real oracle).
One row of the same kind was already fixed at `9087f133` (`kReadback` was missing `IsTransformFeedbackActive` / `IsTransformFeedbackPaused`, which the depth/stencil read emulation reads through `ScopedEmulationDrawState`, `DirectGLES.cpp:5224`).
## F2 — the backend mutates frontend state inside a verb, so the pushed block goes stale mid-verb
Two retrace cases and eight `integration-verify` entries abort with:
```
Fatal{PipeVerifyDiffer, "GetSamplingResolutionGeneration@DrawArrays", verb=3, where=read}
Fatal{PipeVerifyDiffer, "GetSamplingResolutionGeneration@DrawElements", ..., where=read}
```
The failing entries are `DirectVulkan.Verify.UnboundImageDescriptorScenario.*` (6) and `DirectVulkan.Verify.SampledSetStalenessScenario.*` (2); the log line immediately before the divergence is `ResolveSamplerDescriptor: using fallback texture for unbound sampler ...`.
Mechanism, verified in the tree: `GetSamplingResolutionGeneration` counts frontend mutations. It is bumped from exactly two places, both frontend objects: `SamplerObject::BumpVersion()` (`MG_State/GLState/SamplerState/SamplerObject.cpp:34`) and `TextureObjectBase::BumpShapeVersion()` (`MG_State/GLState/TextureState/TextureObject.cpp:37`). During a draw, Magma's own paths (fallback-texture resolution for an unbound sampler, materialising a queued clear) write into frontend texture/sampler objects, so the counter moves between the verb's fill and the backend's read. This is the known "backend writes into frontend objects" surface (about 40 call sites; see `scout-pull-sites.md` §2).
This is a real finding, not a harness artefact, and it must not be silenced. Decide and implement one of:
- **(preferred) push on mutation.** The frontend mutator that changes a pushed value refreshes that field in the pushed block (and restamps it for the current verb) when `MOBILEGL_PIPE_PUSH` is on. This keeps the comparator's invariant ("the pushed block equals the live context at every read") literally true, and it is the shape P2's tracker needs anyway. Layering is fine: `MG_State` already includes `MG_Pipe/MGPipeValueTypes.h`.
- **(fallback) an explicit volatile-in-verb class.** The field is compared at verb entry only, the compare-at-read is skipped for it, the reason is written next to the field list, and the exact backend call sites that mutate it are listed in `docs/Disaggregated/MEASUREMENTS.md` as P2/P7 work.
Whichever you choose: enumerate every PipeInputs field a backend can invalidate through its own frontend writes (do not assume this one field is the only one; the lane found it because the fixture happened to hit it), handle them all the same way, add a unit test that reproduces the mid-verb mutation and would fail without the fix, and write the enumeration into the result file.
## F3 — unit tests that drive backend helpers with no verb
Eleven `ctest -L unit` entries fail in the push and verify builds and pass in the pull build:
```
DirectGLESSanity.BindsAMultisampleTextureDespiteTheDefaultMipmapFilter
DirectGLESSanity.BindingZeroClearsPreviousNativeTextureBinding
FramebufferTest.{DrawIntoAWidenedDrawBufferReachesTheDriverWithAlphaWritesMaskedOff,
ClearIntoAWidenedDrawBufferKeepsAlphaWritableAndSubstitutesOne,
ApplicationAlphaMaskOffIsStillHonouredOnANativeDrawBuffer,
DualSourceBlendFactorsReachTheDriverWhenTheExtensionIsThere,
DualSourceBlendIsDeclinedRatherThanThrownWhenTheExtensionIsMissing,
DualSourceFactorsAreDeclinedEvenWithBlendingDisabled,
DualSourceFactorsWithBlendingDisabledStillReachACapableDriver}
DirectGLESTextureSync.* (1)
TextureTest.* (1)
```
These construct a `GLContext` by hand and call a backend helper directly (for example `DirectGLES::BindCurrentTextures()` at `MG_Test/SanityTest.cpp:366`), so no GL entry point runs and no `MGP_FILL` ever fires; the first accessor read hits the poison. The tests are right and the poison is right: what is missing is that a test which drives a backend helper directly must state which verb it is standing in.
Fix in the test layer only (`MobileGL/MG_Test/**`): give those tests a small, explicit helper that fills the block for the verb class the helper under test belongs to (a scoped RAII "as if we were inside verb X" object is the natural shape), so the test declares the verb rather than the poison being weakened. Do not add a global escape hatch, do not make the poison tolerant in unit builds, and do not change any test name. The pull build must stay byte-identical.
## F4 — corrections to the integrator's own commands (not code)
- The lane-level poison control is not `-R 'Mipmap'`: the four dedicated control entries are `DirectGLES|DirectVulkan.VerifyCorrupted.PipeVerifyArmingScenario.CorruptedFieldIsReported` and `...PoisonOmitted.PoisonOmissionScenario.OmittedFieldAbortsOnThatVerb` (all four pass).
- The retrace arming line is `MGPipe verify: <case> <backend> armed, zero divergences, zero unmigrated reads` in the case log, not `MGPipe: verify armed`; 73 of 79 cases carry it, the other 6 are the F1/F2 aborts.
@@ -1,73 +0,0 @@
# P1 package A (p1-core) — c1, the contract commit
Tree `~/w7/p1-core`, branch `p1/core`, base `feat/disaggregated @ 087685d1`.
## Commit
- `bf86b1ede6f9a43b4114fe2603f68a0bc2aa233c` — `[Feat] (Pipe): land the P1 contract - PipeInputsSwitch.h with MGB_CTX, the 63-field PipeInputs block with type-identical accessors, FillPoints.def and its G5b generator, the MOBILEGL_PIPE_PUSH/VERIFY options and the three verify knobs; pull build unchanged`
- Tag: `p1/contract` (annotation-less tag on that commit; `git describe --tags` → `p1/contract`). Not pushed.
- 15 files, +1834 / −30. Working tree clean apart from the three untracked build directories.
| action | file |
|---|---|
| CREATE | `MobileGL/MG_Pipe/PipeInputsSwitch.h` (D3 verbatim, 28 lines) |
| CREATE | `MobileGL/MG_Pipe/FillPoints.def` (69 verb rows in `GLFunctionsTable` declaration order, 9 classes, 138 (class, field) rows) |
| CREATE | `MobileGL/MG_Pipe/generated/PipeFillPoints.inc` (generated: `MGPipeVerb` 69, `kMGPipeVerbNames`, `MGPipeVerbClass` 9, `kMGPipeVerbClassNames`, `kMGPipeVerbClass[]`, `MGPipeFieldMask{Words[2]}`, `MGPipeFieldMaskHas`, `kMGPipeClassFieldMask[9]` with the 7 sticky bits OR'ed in, `static_assert(kMGPipeVerbCount == 69)`) |
| CREATE | `MobileGL/MG_Backend/MGPipe/PipeInputs.h` (D4: all 63 accessors — 49 V, 7 O, 7 F — with GLContext-identical signatures; `gPipeInputs` inline; `MOBILEGL_PIPE_POISON` derived once; `MGP_INPUT_CHECK` / `MGP_INPUT_VERIFY_READ`; `MGP_INPUT_STORAGE_LIST` + `VisitStorage`; `static_assert(sizeof < 20 KiB)`) |
| CREATE | `MobileGL/MG_Backend/MGPipe/PipeInputs.cpp` (`MGPipeVerbName`, `MGPipeInputPoisonFatalForVerb`, `MGPipeFindInputField` / `MGPipeFindVerb`; under `MOBILEGL_PIPE_VERIFY`: `MGPipeInputsFieldEqual`, `MGPipeApplyVerifyCorruption`) |
| CREATE | `MobileGL/MG_Impl/Pipe/PipeFill.h` (D7 `MGP_FILL(Verb)`, `((void)0)` under pull) |
| CREATE | `MobileGL/MG_Impl/Pipe/PipeFill.cpp` (`PipeInputs::IsLive`, the seven F-class forwarders, `MGPipeFillForVerb` = serial bump + verb + identity + one-time sticky stamps; no field copies) |
| MODIFY | `MobileGL/MG_Pipe/Coverage.def` (D12: `GetBoundTransformFeedbackLifetimeId`, `HasOpenTransformFeedbackSpan` rows after `RecordError`; dead-row comment on `GetBoundTransformFeedbackName`; the `:36-40` note reworded to "when the inventory is re-vendored"; `MGP_COVERAGE_STICKY_LIST(X)` with the seven D6 rows and reasons) |
| MODIFY | `MobileGL/MG_Pipe/generated/PipeFilled.inc` (63 fields, 7 `true` sticky flags with reasons, `kMGPipeInputStickyFieldCount = 7`) |
| MODIFY | `MobileGL/MG_Pipe/MGPipe.h` (`#include "generated/PipeFillPoints.inc"` after `PipeFilled.inc`, G5b comment) |
| MODIFY | `scripts/gen_pipe.py` (`parse_function_table()`, `parse_fill_points()`, sticky-list parsing in `parse_coverage()`, `gen_filled` real sticky flags, `gen_fill_points()`, `PipeFillPoints.inc` written between `PipeFilled.inc` and `PipeCoverage.inc`, summary line "… 63 PipeInputs fields (7 sticky), 69 verbs, 9 classes") |
| MODIFY | `CMakeLists.txt` (options after `:24`; VERIFY⇒PUSH block + conditional `SOURCE_FILES` append after the disaggregated fallback `endif()` at `:452`; the two `MOBILEGL_COMPILE_DEF` appends after `:525`) |
| MODIFY | `MobileGL/Config.h`, `MobileGL/ConfigLoader.cpp` (D2 `PipeVerifyFatal` / `PipeVerifyCorrupt` / `PipePoisonOmit` under `#if MOBILEGL_PIPE_PUSH`) |
| MODIFY | `MobileGL/MG_Test/Pipe/PipeCatalogueTest.cpp` (`:225` 61u → 63u) |
Not touched (per brief): `MG_Backend/DirectGLES/**`, `MG_Backend/DirectVulkan/**`, `PipeCalls.def`, `PipeFields.def`, `MG_Impl/GLImpl/**`, `tools/trace_replay/fixtures/**`.
## Verification (all run in WSL on `~/w7/p1-core`; logs under `~/w7/p1-core-verify-*.log`, `~/w7/p1-core-build-*-c1.log`)
Tree creation: `bash wsl_p1_tree.sh core feat/disaggregated verify` → worktree on `p1/core @ 087685d1`, submodules ok, `build-linux` / `build-push` / `build-verify` all rc=0 at the base (955/955).
Before any edit (sanity of the tooling): `symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0` → `.text 10792579 -> 10792579 (+0)`, `27799 -> 27799 defined symbols: 0 added, 0 removed, 0 resized, 0 renamed`.
After the edits, in this order:
1. `python3 scripts/gen_pipe.py` → wrote `PipeFilled.inc`, `PipeFillPoints.inc`; `python3 scripts/gen_pipe.py --check` → `gen_pipe: 71 calls (11 screen, 60 context), 63 verify payloads, 63 PipeInputs fields (7 sticky), 69 verbs, 9 classes` / `inventory 477 rows … 0 UNMAPPED` / `generated files are up to date`, rc=0.
2. `cmake --build build-linux -j 20` (reconfigured itself on the `CMakeLists.txt` change; `MOBILEGL_PIPE_PUSH=1` occurs 0 times in `build-linux/compile_commands.json`) → rc=0.
`python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0` →
`.text 10792579 -> 10792579 (+0, +0.000%)`, `.data +0`, `.bss +0`, `.rodata +0`, `Total +0`, `27799 -> 27799 defined symbols: 0 added, 0 removed, 0 resized, 0 renamed`, `27060 normalised names unchanged`; file bytes identical (19100448). `nm --defined-only build-linux/libMobileGL.so | grep -c MGPipe` = 0, same as the baseline. **G1 holds: the pull build is symbol-identical with a .text delta of 0** (the new `.cpp` files are not listed in the pull build — D5/D13: appended to `SOURCE_FILES` only under `MOBILEGL_PIPE_PUSH`; the new headers are included by nobody in the pull build; `Config.h`'s three members are behind `#if MOBILEGL_PIPE_PUSH`; the `MGPipe.h` include of `PipeFillPoints.inc` adds only `inline constexpr` tables that no pull TU odr-uses).
3. `cmake --build build-push -j 20` → rc=0, links (`MOBILEGL_PIPE_PUSH=1` on all 496 compile commands; `nm -C build-push/libMobileGL.so` exports `MGPipeFillForVerb`, `PipeInputs::IsLive`, `gPipeInputs`). Configure log: `MobileGL: PipeInputs push ON, appending the MGPipe fill sources`.
4. `cmake --build build-verify -j 20` → rc=0, links (`MOBILEGL_PIPE_PUSH=1` and `MOBILEGL_PIPE_VERIFY=1` on all 496; exports `MGPipeInputsFieldEqual`, `MGPipeApplyVerifyCorruption`). Configure log: `MobileGL: MOBILEGL_PIPE_VERIFY=ON forces MOBILEGL_PIPE_PUSH ON for this configure`.
5. `ctest -L unit --no-tests=error -j 12`: build-linux `100% tests passed, 0 tests failed out of 1466`; build-push `100% … out of 1466`; build-verify `100% … out of 1466`.
6. `(cd build-linux && ctest -N | grep -E '^\s+Test\s+#[0-9]+:' | sed 's/^ *Test *#[0-9]*: //' | sort)` → 2334 names; `comm -23 ~/w7/p1-before-ctest-names.txt -` → **0 removed**, `comm -13` → 0 added. (Note: the brief's regex `'^\s+Test #'` only matches test numbers ≥ 1000 — ctest pads smaller numbers with extra spaces — and would report 999 spurious removals; the baseline file itself holds all 2334 names, so the diff above uses the padding-tolerant regex.)
7. `grep -rc "pGLContext" MobileGL/MG_Backend | sort | diff - ~/w7/p1-before-pglcontext.txt` → only the two new files appear, both `:0` (`MG_Backend/MGPipe/PipeInputs.h:0`, `PipeInputs.cpp:0`); every catalogued file's count is unchanged (A converts no site). `grep -c pGLContext` on the two MGPipe files → `0 0`.
8. `grep -c "MGP_FILL(" MobileGL/MG_Impl/GLImpl/*/*.cpp` → 0 (fill points are c3).
9. Integration smoke in the push and verify libraries (`ctest -L integration-gpu -R 'ClearThenReadPixels|GenerateMipmap|Mipmap' -j 4`): build-push `100% tests passed, 0 failed out of 10`, build-verify `100% … out of 10`, zero `Fatal{` in either log — the inert filler and the unarmed poison do not disturb a run in which no backend site reads `gPipeInputs` yet.
Not run (not in the task's proof list; long): the full `ctest -L integration-gpu` in build-push (brief C.1 step 1 lists it for A's own tree — recommended after c3 when the fill points exist, since at c1 nothing calls `MGPipeFillForVerb`).
## Deviations from the brief (and brief-vs-tree facts)
1. **`MGP_INPUT_CHECK` is live at c1** (under `MOBILEGL_PIPE_POISON`) rather than "expanding to nothing until step 3" (C.1 step 1 wording). Reason: B's and C's verification text expects a push run on the contract tree to hit `Fatal{UnmigratedPipeInput}` at the first read ("that is the poison working"); with an empty check the first read of an O-class field would be a null dereference instead. The check costs nothing in a non-poison push build (`((void)0)`), and c2 now only has to add the filler copies. `MGP_INPUT_VERIFY_READ` expands to nothing as specified (c4 arms it).
2. **Sticky stamping is in c1** (three lines in `MGPipeFillForVerb`: the seven sticky fields get `FilledGen = 1` on the first live fill) rather than c2. It is generation bookkeeping, not a field copy, and it keeps the F-class forwarders usable under poison from the contract on.
3. **`MGPipeInputsFieldEqual` and `MGPipeApplyVerifyCorruption` are in c1** (`PipeInputs.cpp`, `#if MOBILEGL_PIPE_VERIFY`), per C.1 step 1's "`PipeInputs.cpp` (equality, corruption injector)"; the comparator proper (`SnapshotFromGLContext`, entry compare, compare-at-read hook, arming line, knob parsing) is NOT in c1, as the task instruction requires. Both are one call of `PipeInputs::VisitStorage` over `MGP_INPUT_STORAGE_LIST` (56 storage rows + 7 forwarded = 63, static_asserted) instead of two 63-way switches. `IsCapabilityEnabledIndexed`'s two arrays are one `IndexedCapabilities` struct so the list stays one row per field.
4. **`PipeFields.def` is untouched in c1.** C.1 step 1 says "`Coverage.def` + `PipeFields.def` edits" but step 5 (c5) owns the six G4 field lists / overloads / coverage check, and the task instruction for c1 does not list `PipeFields.def`. Deferred to c5. Consequence: `kMGPipeVerifiedPayloadCount` stays 63 at c1 and `RenderStateParameters` / `PixelStoreParameters` still go through the memcmp fallback inside `MGPipeInputsFieldEqual` (both arms are copied by assignment into zero-initialised globals, so padding is equal; c5 removes the fallback anyway).
5. **`PipeInputs::IsLive()` forwards to the live context** (defined in `PipeFill.cpp`, returns `pGLContext != nullptr`) instead of returning a fill-time `m_live` flag; `m_live` is still recorded at fill for the filler's own use. Reason: D5 lists `IsLive` among `PipeFill.cpp`'s contents and D9 says `MGB_CTX_LIVE` "is always true once a context exists" under push, which a fill-time flag cannot promise before the first verb (e.g. `InvalidateCompileEnv` at backend init, `BackendObject_DirectVulkan.cpp:389,787`). `ContextIdentity()` is the fill-time address as specified.
6. **`GetBufferBindingPointCount` is not `constexpr`** in `PipeInputs` (GLContext's is): it is an out-of-line forwarder per D4's F class. No backend uses it in a constant expression.
7. **`MGPipeFieldMask::Words[2]`** as the brief says, generated as `max(2, ceil(fields/64))` so a 129th field grows the mask instead of silently truncating (`static_assert(kMGPipeInputFieldCount <= 2 * 64)` in the `.inc`).
8. **Two extra `gen_pipe.py` checks beyond the brief's list**: verb rows must be in `GLFunctionsTable` declaration order (not just the same set), so `MGPipeVerb`'s numbering is the table's by construction; a class listed twice in `MGP_FILL_CLASS_LIST` is refused. `--self-test`, `scan_live_accessors()` and `check_field_lists_cover_struct_members()` are c5, as the brief's step 5 says.
9. **Tree-vs-brief line facts**: `CMakeLists.txt` "after :451" — the disaggregated fallback's `endif()` is at `:452`; the block was inserted after it (before the `if (MOBILEGL_BUILD_DISAGGREGATED)` sources block at `:454`). The `MOBILEGL_COMPILE_DEF` appends went after the `endif()` at `:525` as stated. The brief's ctest-name regex issue is item 6 above.
10. **Accessor namespaces**: `BufferTarget` and `FramebufferTarget` live in `namespace MobileGL` (not `MG_State::GLState`, where the brief's text implies all frontend types sit); the header's `using` aliases spell them accordingly. Everything else (`VertexArrayObject`, `ProgramObject`, `ITextureObject`, `BufferObject`, `FramebufferObject`, `TextureUnit`, `ImageTextureBinding`, `CurrentVertexAttributeValue`) is `MG_State::GLState::`; value types are `MobileGL::`.
11. `IsCapabilityEnabled` with a cap ≥ `CapabilityInputCount` returns `false` (defensive bound; GLContext would index its own table); indexed getters mirror `RenderState`'s bounds handling (`MOBILEGL_ASSERT` + element 0 / early return; `GetCurrentVertexAttribute` mirrors `Core.cpp:246-253` with `MGLOG_E_ONCE` + a static default).
## Unfinished / next for A
- c2: per-class copies and stamps in `MGPipeFillForVerb` (mask = `kMGPipeClassFieldMask[kMGPipeVerbClass[verb]]`), `MOBILEGL_PIPE_POISON_OMIT` parsing.
- c3: the 83 `MGP_FILL(X);` statements (§B.7).
- c4: `SnapshotFromGLContext`, entry compare, `MGPipeVerifyReadHook` behind `MGP_INPUT_VERIFY_READ`, arming/knob log lines, `PipeVerifyFatal`.
- c5: `PipeFields.def` field lists, `MGPipeFieldEqual` overloads, `check_field_lists_cover_struct_members`, `scan_live_accessors`, `--self-test`.
- c6: the unit tests listed in C.1.
- Full `ctest -L integration-gpu` in build-push (after c3).
@@ -1,103 +0,0 @@
# Adversarial review — p1-core v1 (tree `~/w7/p1-core`, branch `p1/core`, HEAD `440d3c52`)
Verdict: **NOT approved — 1 major, 8 minors.** The package is otherwise complete against C.1 and the D-decisions; every claim in `core-v1.md` that I could re-run reproduced. The one major is a defect in the delivered G5 negative-control unit tests, not in the filler/poison/comparator code.
Tree left exactly as found (`git status` clean apart from the three untracked build dirs; no file edited, nothing committed). All logs under `~/w7/p1-core-review/`.
## 1. What I re-ran (all on `440d3c52`; builds were `ninja: no work to do` in all three dirs)
| check | command | observed |
|---|---|---|
| G1 symbols | `python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0 --json` | `.text 10792579 -> 10792579 (+0)`, `Total +0`, `27799 -> 27799: 0 added, 0 removed, 0 resized, 0 renamed` |
| G1 bytes | `cmp -l before after \| wc -l`; `readelf -SW` diff; `strings` diff | 34 bytes; section table identical; the only differing strings are `GIT@5d99ee4 -> GIT@83b1656` and glslang's `Timestamp: 2026-09-05T23:14:30 -> 2026-09-06T02:05:06` (see minor 6 for the stamp value) |
| G2 (A's half) | `grep -rc pGLContext MobileGL/MG_Backend \| sort \| diff - ~/w7/p1-before-pglcontext.txt` | only `MG_Backend/MGPipe/PipeInputs.{cpp,h}:0` appear; every catalogued file's count unchanged — A converts no site, touches no B/C file |
| `pGLContext` in A's backend files | `grep -c pGLContext MobileGL/MG_Backend/MGPipe/*` | `0 0` |
| fill points | `grep -c "MGP_FILL(" MobileGL/MG_Impl/GLImpl/*/*.cpp` | Drawing 36, Framebuffer 11, Texture 8, Getter 3, Program 1, Query 18, Sync 6 = **83**; no `MGP_FILL` outside `MG_Impl/GLImpl` |
| generator | `python3 scripts/gen_pipe.py --check` / `--self-test` | rc 0 / rc 0; `63 PipeInputs fields (7 sticky), 69 verbs, 9 classes`, `generated files are up to date`; six controls trip, positive control OK |
| D7 table vs `FillPoints.def` | `d7check.py` (mechanical diff of the brief's verb→class and class→field tables against the .def) | 69/69 verbs identical; 139/139 (class, field) rows identical |
| D8 field lists vs the structs (independent oracle) | clang `-ast-dump=json -ast-dump-filter=<Struct>` on `PipeFill.cpp`'s compile command, `FieldDecl` names vs `PipeFields.def` (`ast.py`) | RenderStateParameters 65/65, PixelStoreParameters 8/8, PerBufferBlendState 7/7, StencilFaceState 7/7, DynamicBackendParameters 85/85, MGHostSpan 5 members of which `Pad0` is the excluded padding → 4/4. The regex-based `check_field_lists_cover_struct_members()` agrees with clang on every struct |
| accessor signatures | `Core.h:66-506` vs `PipeInputs.h` | all 63 identical in name, parameters, constness and return type (incl. the `const&` returns for `GetRenderStateParameters`, `GetBlendColor`, `GetViewportIndexed`, …; no by-value copy of the 1168-byte struct was introduced). Only difference: `GetBufferBindingPointCount` is `constexpr` on `GLContext` and a plain forwarder here — the three backend uses (`DirectGLES.cpp:474`, `UniformManager.cpp:1189,2013`) are runtime, so nothing breaks |
| fill-probe side effects | `BufferState.cpp:90-98`, `TextureState.cpp:157-173`, `Core.cpp:179,594` | `GetBindingPoint(t,0)`, `GetUnitObject(0)`, `GetImageTextureBinding(0)`, `GetBoundVertexArray()` are pure lookups; `TouchBindPoint` is only reached from `Core.h:84` (the setter). `GetProgramForDraw()` joins link+SPIR-V — same verb as today's first read |
| unit, 3 configs | `ctest -L unit --no-tests=error -j 12` in build-linux / build-push / build-verify | `100% tests passed, 0 tests failed out of 1475` × 3 |
| `ctest -N` names | `comm` against `~/w7/p1-before-ctest-names.txt` | 2343 names, **0 removed**, 9 added; identical name sets in push and verify |
| skip visibility | `ctest -R 'PipeInputsTest' -V` | build-linux: all 5 `***Skipped` ("push not compiled in"); build-push: 4 skipped (poison/verify), `ReadingAFilledFieldCompletes` passes; build-verify: all 5 pass |
| nm -D | `nm -D --defined-only <lib> \| grep -c MGPipeVerifyInputs` | push 0, verify 1 |
| integration-gpu, push | `ctest --test-dir build-push -L integration-gpu --no-tests=error -j 4` | `100% tests passed, 0 tests failed out of 868`, `grep -c 'Fatal{'` = 0 |
| G4 lane smoke, verify | `MOBILEGL_PIPE_VERIFY=1 ctest -R 'DirectGLES\..*ClearThenReadPixels'` | 5/5 green; log has 1 × `MGPipe: verify armed - 63 fields, 69 verbs, fatal=1`, 0 `Fatal{` |
| G4 negative control A | same + `MOBILEGL_PIPE_VERIFY_CORRUPT=GetRenderStateParameters` | rc 8, 0/5; `verify corruption armed - GetRenderStateParameters`; `Fatal{PipeVerifyDiffer, "GetRenderStateParameters@Clear", verb=1, where=entry}` |
| FATAL=0 | + `MOBILEGL_PIPE_VERIFY_FATAL=0` | 5/5 green, 0 `Fatal{PipeVerifyDiffer` aborts, `verify summary - 3 divergence(s) survived MOBILEGL_PIPE_VERIFY_FATAL=0` |
| bad CORRUPT name | `MOBILEGL_PIPE_VERIFY_CORRUPT=NoSuchField` | rc 8, `Fatal{PipeVerifyBadKnob, "MOBILEGL_PIPE_VERIFY_CORRUPT=NoSuchField": no such field in kMGPipeInputFieldNames}` |
| POISON_OMIT env path, verify | `MOBILEGL_PIPE_POISON_OMIT=GenerateMipmap:GetActiveTextureUnit ctest -R 'DirectGLES\..*ClearThenReadPixels'` | green (no backend reads `gPipeInputs` on this tree), log has `poison omission armed - GetActiveTextureUnit@GenerateMipmap`, 0 `Fatal{` |
| POISON_OMIT bad verb | `MOBILEGL_PIPE_POISON_OMIT=NoSuchVerb:GetActiveTextureUnit` | rc 8, `Fatal{PipeVerifyBadKnob, "MOBILEGL_PIPE_POISON_OMIT=NoSuchVerb:GetActiveTextureUnit": no such verb in kMGPipeVerbNames}` |
| POISON_OMIT in a POISON-less push build | same in build-push | green, `MGPipe: poison omission GetActiveTextureUnit@GenerateMipmap requested but the poison is not compiled in (MOBILEGL_PIPE_POISON=0)` |
| `MOBILEGL_PIPE_VERIFY=1` in a push build | build-push | green, one `MGPipe: MOBILEGL_PIPE_VERIFY=1 requested but the comparator is not compiled in` |
| G5 unit, serial | `ctest --test-dir build-verify -R PipeInputsTest -j 1` | 5/5 |
| **G5 unit, parallel** | `ctest --test-dir build-verify -R PipeInputsTest -j 8` × 40 | **40/40 runs red** (major 1) |
| commit hygiene | `git log --format=%B` | 6 commits, `[Type] (Scope): …` subject + blank + `- ` bullets; 0 `Co-Authored-By`; nothing pushed |
| ownership | `git diff --stat feat/disaggregated..HEAD` (26 files) | every path is in A's C.5 rows; `DirectGLES/**`, `DirectVulkan/**`, `PipeCalls.def`, fixtures, `MG_IntegrationTest/**`, `test.yml`, docs untouched |
| logging discipline | grep `MGLOG_D`/stdio in `PipeFill.cpp`, `PipeInputs.{h,cpp}` | none |
| line endings | `git diff --name-only … \| xargs file \| grep -i crlf` | none (all LF) |
## 2. Major
### M1 — The G5 negative-control unit tests share one fixed log file and fail 100% under `ctest -j`
`MobileGL/MG_Test/Pipe/PipeInputsTest.cpp:255-270` (`main()`): every `PipeInputsTest` process computes the same path `temp_directory_path()/mobilegl-pipeinputs-test.log`, **unlinks it** (`fs::remove(path, ec)`, line 261) and points `MOBILEGL_LOG_FILE_PATH` at it. `gtest_discover_tests` registers the five cases as five separate processes, so under a parallel ctest all five start within milliseconds, each deleting the file the others are writing to and reading from (`ReadLog()` reopens by path, lines 49-54, 144/162, 175/191).
Reproduction (verify build, this tree):
```
ctest --test-dir build-verify -R 'PipeInputsTest' -j 1 # 100% tests passed, 0 tests failed out of 5
ctest --test-dir build-verify -R 'PipeInputsTest' -j 8 # red; 40 of 40 iterations red (~/w7/p1-core-review/stress2-*.log)
```
Observed failure text (iteration 1, `--output-on-failure`):
```
../MobileGL/MG_Test/Pipe/PipeInputsTest.cpp:192: Failure
Expected equality of these values:
log.find("Fatal{")
Which is: 49
std::string::npos
Which is: 18446744073709551615
[02:20:47] [Linux PipeInputsTest/FATAL]: MGPipe: Fatal{UnmigratedPipeInput, "GetActiveTextureUnit@GenerateMipmap"}
[ FAILED ] PipeInputsTest.ReadingAFilledFieldCompletes (0 ms)
```
i.e. `ReadingAFilledFieldCompletes` reads the **sibling process's** Fatal line out of the shared file and goes red; in the first stress loop (`stress-*.log`) the other direction showed: `ReadingAnOmittedFieldAbortsNamingTheVerb` red 25/25 because a sibling's `main()` unlinked the file between the child's write and the parent's read, so its own line was gone.
Why major: these two cases are the package's G5 proof (`core-v1.md` "G5 unit"), and they go red for a reason that is not the poison — the opposite of `ROADMAP.md:7` (a gate goes red for its own reason) — whenever anyone runs the unit label with `-j` (the integrator's habit in D.1/D.3 is `-j 4`; my full `-L unit -j 12` run happened to pass only because the five cases were spread among 1470 others). The CI `test` job (`test.yml:192,194`) runs `ctest -L unit` serially today, which is why it has not shown up there; that is luck, not a property of the test. Fix is local to the test: a per-process file (e.g. `mobilegl-pipeinputs-test-<pid>.log`, removed at exit) — the forked child inherits the path, so nothing else changes.
## 3. Minors
1. **Undeclared 10th placement deviation — `GL_Sync.cpp:235` (`DeleteSync` in the orphan sweep).** `MGP_FILL(DeleteSync);` sits inside the loop body but **before** `if (backendDeleteSync && syncObject->backendHandle)`, so a backend with a null `DeleteSync` entry, or a sync without a backend handle, bumps the serial for every orphan. D7 says a null entry never bumps, and the sibling loop at `GL_Query.cpp:937` (`DeleteBackendQuery`) was placed inside the guard. Harmless (kQuery fills one field; nothing reads between two fills) — the same argument as the nine sites the result file declares — but it is not in the declared list (deviation 1 names 9 sites). Either move it inside the guard or add it to the record.
2. **The compare-at-read arm has zero execution coverage in this package.** `MGPipeVerifyReadHook` (`PipeFill.cpp:409-426`) is the arm the result file and D8 call "the arm that is real in P1", yet no unit test calls an accessor with `Features.PipeVerify` set after mutating the live context, and on this tree no lane can reach it (no backend spells `MGB_CTX->` yet, so no accessor is ever entered). It is exercised for the first time only in D.3 on the integrated tree, where a hook that silently never fires would look like "zero divergence". The code reads correctly (`&self == &gPipeInputs`, sticky skip, `InHook` guard, `CopyField` into `g_readScratch`, `MGPipeInputsFieldEqual`, `ReportDivergence(field, "read")`), but the brief's own mitigation for "green because it never ran" is a falsifier, and the entry compare got one (CORRUPT) while this arm got none. Cheap unit test in the same fork shape: `MG_Config::Features.PipeVerify = true; MGPipeFillForVerb(DrawArrays); pGLContext->SetLineWidth(2.f); (void)gPipeInputs.GetLineWidth();` → expect `SIGABRT` and `Fatal{PipeVerifyDiffer, "GetLineWidth@DrawArrays", verb=<serial>, where=read}`. (Not required by C.1's test list, hence minor.)
3. **`OmittingOneFieldForOneVerbLeavesExactlyThatFieldStale` does not prove "exactly".** `PipeInputsTest.cpp:106-132` asserts one sibling (`GetTextureUnitObject`) and one sticky field; "exactly that field" would be a loop over `kMGPipeClassFieldMask[kTextureOp]` asserting every other bit fresh (the shape `EveryVerbFillsItsClassAndNothingElse` already uses at `:238-247`). Two lines; makes the test name true.
4. **The two env-knob parsers are not covered by any registered test.** `ParsePoisonOmissionKnob` (`PipeFill.cpp:300-316`) and `ArmVerify`'s CORRUPT parse (`:351-371`) are only reachable through `MG_Config::Features`, which the unit binary never loads (I confirmed: `MOBILEGL_PIPE_POISON_OMIT=GenerateMipmap:GetActiveTextureUnit ctest -R ReadingAFilledFieldCompletes` in build-verify does not arm — the itest path does). I exercised both parsers manually through `DirectGLES.*ClearThenReadPixels` (table above: armed lines, `PipeVerifyBadKnob` on a bad field and a bad verb, the W_ONCE in a POISON-less push build) and they behave; the record is that this coverage lives in E's lanes on the integrated tree, not in A's tests.
5. **`IsCapabilityEnabledIndexed` semantic asymmetry to record.** Per D6 the push accessor aborts for a cap other than `Blend`/`ScissorTest` (`PipeInputs.h:448-460`), while the pull arm returns `false` with an `MGLOG_I` (`RenderState.cpp:471-488`: "a query must never be able to terminate the process"). No backend asks another cap today (`VulkanRenderer.cpp:5437` asks `Blend`), so it cannot trip in P1, but it is the one accessor where push and pull disagree on a *reachable* input by design; worth a line in `MEASUREMENTS.md` (integrator) so the next person who adds `glIsEnabledi`-driven backend reads knows the push arm is fatal there.
6. **`build-linux/libMobileGL.so` carries `GIT@83b1656`, not the `GIT@087685d` the result file cites.** The stamp is taken at configure time; the library in the tree was last linked at c5 (`83b16561`), and c6 (`440d3c52`) touches only `MG_Test/Pipe/**`, so the G1 comparison is of the right bytes (I confirmed `ninja: no work to do` and the section table identical). Purely a bookkeeping mismatch between `core-v1.md` and the artifact; the integrator's D.1 re-run on `~/w7/pipe` supersedes it.
7. **Generated-file "7 files change" (C.1) vs 3 — correctly recorded by the implementer**, and I confirm the reason: `Coverage.def`'s two new accessor rows change `PipeFilled.inc` (63 + sticky) but not `PipeCoverage.inc` (which iterates inventory rows only), and `PipeVerify.inc` changes at c5. `--check` is clean, so nothing is stale.
8. **`kMGPipeForwardedFieldCount = 7` is duplicated by hand** (`PipeInputs.h:133`) next to the generated `kMGPipeInputStickyFieldCount = 7` (`PipeFilled.inc:230`); the two are tied only by `StickyFieldsAreExactlyTheSeven`. A `static_assert(kMGPipeForwardedFieldCount == kMGPipeInputStickyFieldCount)` in `PipeInputs.h` would make the header refuse an eighth sticky row instead of the test.
## 4. Where the tree and the brief disagree (verified; the implementer's list is right)
- `GL_Drawing.cpp:906/907` `MemoryBarrier (TextureBarrier)`: the call is on 906, the brief's 907 is the closing brace — fill placed at (now) 932, before the call. ✓
- `RenderStateParameters` has **65** direct data members (clang FieldDecl count; brief D8 says 67). `DynamicBackendParameters` **85**. ✓
- `CapabilityInput`: storage is sized from the enum; the brief's "37" is not load-bearing anywhere in the code. (Not independently recounted.)
- The result file's `ctest -N` regex note (`'^\s+Test\s+#[0-9]+:'`) is right: ctest right-aligns the number; the brief's `'^\s+Test #'` would drop the padded rows. My name diff used the padded form and matched the baseline count (2343 = 2334 + 9).
## 5. Notes for the integrator (not A's findings, surfaced while reviewing)
- **The brief's CI negative-control step (C.4 (b)) as spelled is vacuous on this tree:** `ctest -L integration-verify -R 'DirectGLES\.Verify\..*Mipmap'` — no integration test has "Mipmap" in its name (`ctest -N | grep -i mipmap` finds 7 names, all `TextureTest.*`/`DirectGLESSanity.*` unit-label cases; `grep -rli generatemipmap MobileGL/MG_IntegrationTest/` is empty). With `--no-tests=error` a no-match run exits non-zero, so the inverted "must fail" check would pass without any process ever loading the library. E's `PoisonOmissionScenario.OmittedFieldAbortsOnThatVerb` does not contain "Mipmap" either. Either the scenario's name or the regex needs to change, and the step should additionally grep the lane log for `Fatal{UnmigratedPipeInput, "GetActiveTextureUnit@GenerateMipmap"}` so it cannot be satisfied by "no tests found". Same applies to D.3's `-R 'Mipmap'` line.
- The compare-at-read hook (minor 2) is the thing to watch in D.3: if the 79 traces and 742 entries report zero `where=read` divergences, make sure at least one accessor was actually entered under verify (e.g. count `MGPipe: verify read of` lines with a deliberately mutated context, or land minor 2's unit test first).
## 6. Verdict
Not approved: fix M1 (per-process log path in `PipeInputsTest::main`, and re-run `ctest --test-dir build-verify -R PipeInputsTest -j 8` a few dozen times green), then re-review. Minors 1-3 and 8 are one-line-each and worth taking in the same pass; 4-7 are records.
@@ -1,95 +0,0 @@
# Adversarial review — p1-core v2 (tree `~/w7/p1-core`, branch `p1/core`, HEAD `d9f4698d`)
Verdict: **NOT approved — 1 major, 5 minors.** Every claim in `core-v2.md` that can be re-run reproduced on this HEAD, all eight v1 items are fixed or honestly recorded, and the four rework commits are correct for what they set out to do. The major is not in the rework; it is a gap in the poison mechanism itself that neither round's tests reach, and it contradicts a sentence of D6 verbatim. It is a one-line fix in a file this package owns.
Tree left exactly as found: `git status` shows only the three untracked build directories; no file edited, nothing committed, nothing pushed. Reviewer logs under `~/w7/p1-core-review2/`; scratch inputs under `scratchpad/wf4/core-review2/` (`s1.sh`, `s2.sh`, `s3.sh`, `prefill.cpp`, `d7check.py`).
## 1. What I re-ran (all on `d9f4698d`; all three build dirs were `ninja: no work to do`)
| check | command | observed |
|---|---|---|
| G1 symbols | `python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0` | `.text 10792579 -> 10792579 (+0, +0.000%)`; `27799 -> 27799 defined symbols: 0 added, 0 removed, 0 resized, 0 renamed, 27060 unchanged` |
| G1 bytes | `cmp -l … \| wc -l`; `readelf -SW` diff | 34 bytes; section table identical; library stamp `GIT@83b1656` (configure-time, as the result file records) |
| G2 (A's half) | `grep -rc pGLContext MobileGL/MG_Backend \| sort \| diff - ~/w7/p1-before-pglcontext.txt` | only `MG_Backend/MGPipe/PipeInputs.{cpp,h}:0` appear; every catalogued count unchanged — A converts no site, touches no B/C file |
| `grep -c pGLContext MobileGL/MG_Backend/MGPipe/*` | | `0 0` |
| fill points | `grep -c "MGP_FILL(" MobileGL/MG_Impl/GLImpl/*/*.cpp` | Drawing 36, Framebuffer 11, Getter 3, Program 1, Query 18, Sync 6, Texture 8 = **83**; none outside `MG_Impl/GLImpl` |
| fill placement | read of every hunk in `git diff feat/disaggregated..HEAD -- MobileGL/MG_Impl/GLImpl` | every statement is immediately before its table call and after the early returns it is behind; the frontend mutation that precedes the call (`BindImageTexture`'s `Bind`/`NoteTextureUnitTouched`, `SetPatchVertices`, `BeginTransformFeedback`, `SetTransformFeedbackPaused`, `BindTransformFeedbackObject`, `ScopedNeutralPackState`) is before the fill in every case; the nine guarded-expression sites are the nine declared; `GL_Sync.cpp:236` now inside its guard (v1 minor 1 fixed) |
| generator | `python3 scripts/gen_pipe.py --check` / `--self-test` | rc 0 / rc 0; `63 PipeInputs fields (7 sticky), 69 verbs, 9 classes`, `generated files are up to date`; 6 controls trip, positive OK |
| **generator gates against real drift** (scratch copy `/tmp/gp-review`, never the tree) | 11 mutations, `--check` each | m1 `MGB_CTX->NotAnAccessor()` in `Utils.cpp` → rc 1 `Coverage.def: accessor(s) read by a backend with no row: NotAnAccessor (…/Utils.cpp)`; m2 the same inside a `//` comment → rc 0 (masked); m3 `MGB_CTX->GetBoundTransformFeedbackName()` → the "no backend reads" line disappears (the `MGB_CTX->` spelling IS collected — first time it has met one); m4 `pGLContext->NotAnAccessor2()` → rc 1; m5 `GenerateMipmap` verb row deleted → rc 1 `member(s) without a verb row: GenerateMipmap`; m6 verb class changed → rc 1 `OUT OF DATE: …PipeFillPoints.inc`; m7 `Int ReviewerExtraMember` added to `RenderStateParameters` → rc 1 `member(s) with no F(...)`; m8 field row swapped → rc 1 (stale inc); m9 generated file touched → rc 1; m10 duplicate `(kDraw, GetLineWidth)` → rc 1; m11 `X(kDraw, NotAField)` → rc 1 `not an accessor in Coverage.def` |
| D7 tables vs `FillPoints.def` | `d7check.py` (brief tables parsed mechanically) | 69/69 verb→class identical; 139/139 (class, field) rows identical, per class 47/14/18/18/7/15/8/11/1 |
| unit, 3 configs | `ctest -L unit --no-tests=error -j 12` in build-linux / build-push / build-verify | `100% tests passed, 0 tests failed out of 1481` × 3 |
| `ctest -N` names | padded regex, `comm` against `~/w7/p1-before-ctest-names.txt` | 2349 names in each dir; **0 removed**, 15 added (4 `PipeCatalogue.*` + 11 `PipeInputsTest.*`); linux/push/verify name sets identical |
| skip visibility | `ctest -R PipeInputsTest -V` | build-linux 11 `***Skipped`; build-push 9 skipped + `ReadingAFilledFieldCompletes`, `BadPoisonOmitKnobIsFatalNamingTheKnob` pass; build-verify 11/11 pass |
| **M1(v1) repro, fixed** | `ctest --test-dir build-verify -R PipeInputsTest -j 8` × 40 | **0/40 red**; build-push × 10 → 0/10; `ls /tmp/mobilegl-pipeinputs-test* \| wc -l` = 0 afterwards |
| nm -D | `nm -D --defined-only <lib> \| grep -c MGPipeVerifyInputs` | push 0, verify 1 |
| integration-gpu, push | `ctest --test-dir build-push -L integration-gpu --no-tests=error -j 4` | `100% tests passed, 0 tests failed out of 868`; `grep -c 'Fatal{'` = 0 |
| G4 lane smoke, verify | `MOBILEGL_PIPE_VERIFY=1 MOBILEGL_LOG_FILE_PATH=… ctest --test-dir build-verify -R 'DirectGLES\..*ClearThenReadPixels'` | 5/5 green; 1 × `MGPipe: verify armed`, 0 `Fatal{`, 0 `verify read of` (no backend reads `gPipeInputs` on this tree — expected) |
| G4 negative control A | + `MOBILEGL_PIPE_VERIFY_CORRUPT=GetRenderStateParameters` | rc 8, 0/5; `Fatal{PipeVerifyDiffer, "GetRenderStateParameters@Clear", verb=1, where=entry}` |
| FATAL=0 | + `MOBILEGL_PIPE_VERIFY_FATAL=0` | 5/5 green; 1 × `verify summary - … survived MOBILEGL_PIPE_VERIFY_FATAL=0` |
| POISON_OMIT env path | `MOBILEGL_PIPE_POISON_OMIT=GenerateMipmap:GetActiveTextureUnit` | green (no reader on this tree), 1 × `poison omission armed` |
| accessor edge semantics | `Core.cpp:98-110,246-253,309-319,806,938-948,965-1041,1087,1180`; `RenderState.cpp:18-26,101-107,471-478,541-593,666,694-696,770-776`; `BufferState.cpp:43-50,90-97`; `TextureState.cpp:157-173` vs `PipeInputs.h:199-556` | bounds handling matches GLContext's for every indexed accessor (same `MOBILEGL_ASSERT`+fallback shapes, `GetColorMaskIndexed` unchecked on both sides, stencil `Back→1 else 0` = `GetStencilFaceIndex`); `GetRenderStateParameters` returns `const&` on both sides — no 1168-byte copy on a read path |
| O-class target domain | `grep -o 'GetBufferBindingSlot([^)]*)' MG_Backend`; `SyncBoundBuffer` callers `DirectGLES.cpp:664,691`; `GetBufferBindingPoint` targets | slots read: DrawIndirect ×16, PixelPack ×7, Parameter ×4, DispatchIndirect ×1 — all in `GlobalBufferTargets`; points read: Uniform/TransformFeedback/AtomicCounter/ShaderStorage = `BufferBindPointTargets`; the variable-target loop at `DirectGLES.cpp:369-370` is bounded by a touched count that is 0 for any other target. No read the fill leaves null is reachable today |
| commit hygiene | `git log --format=%B 440d3c52..HEAD` | 4 commits, `[Type] (Scope): …` + blank + `- ` bullets, 0 `Co-Authored-By`; nothing pushed; all LF |
| ownership | `git diff --stat feat/disaggregated..HEAD` (26 files) | every path in A's C.5 rows; the rework touched 4 files, all A's |
| logging discipline | grep `MGLOG_D`/stdio in `PipeFill.cpp`, `PipeInputs.{h,cpp}` | none |
## 2. Major
### M1 — The poison (and the compare-at-read hook) cannot trip on any read made before the first fill: `FilledGen == 0` is "fresh" while `CurrentVerbSerial == 0`
D6, verbatim: `++m_filled.CurrentVerbSerial` "(starts at 1 so `FilledGen == 0` means never filled)", and the Fatal "before the first verb the name is `<none>`" (`PipeInputs.h:29-30` repeats the promise: `"<none>" before the first verb`). The freshness predicate that every `MGP_INPUT_CHECK` (`PipeInputs.h:44-49`) evaluates is
```
MobileGL/MG_Pipe/generated/PipeFilled.inc:313-317 (emitted by scripts/gen_pipe.py gen_filled)
inline Bool MGPipeInputFieldIsFresh(const MGPipeFilledState& state, MGPipeInputField field) {
return kMGPipeInputFieldSticky[index] ? state.FilledGen[index] != 0
: state.FilledGen[index] == state.CurrentVerbSerial;
}
```
Before the first `MGPipeFillForVerb` both sides are 0 (`gPipeInputs` is value-initialised, `PipeInputs.h:612,678`), so `0 == 0` is **fresh**: every V-class accessor and both `SharedPtr` O-class accessors return their default-constructed storage (zeros, empty `SharedPtr`) with no Fatal. The serial only "starts at 1" *after* the first fill (`PipeFill.cpp:517-519`), which makes 0 distinguishable from every filled generation but does not make it stale. The second net has the same window: `ArmVerify()` runs only inside `MGPipeFillForVerb` (`PipeFill.cpp:505-507,361-366`), so `MGPipeVerifyReadHook` sees `g_verify.Enabled == false` (`PipeFill.cpp:421`) until the first fill even when `Features.PipeVerify` is already set. Only the four raw-pointer O-class accessors (`GetBufferBindingSlot`, `GetBufferBindingPoint`, `GetFramebufferBindingSlot`, `GetImageTextureBinding`/`GetTextureUnitObject`) trip before the first fill, through their null-base checks (`PipeInputs.h:489,499,512,521,552`) — 55 of 63 fields are silently served wrong values.
Reproduction (a 30-line program compiled and linked with `PipeInputsTest`'s own ninja commands against `build-verify`, nothing in the tree touched; `scratchpad/wf4/core-review2/prefill.cpp`, `s3.sh` section (a)):
```
$ MOBILEGL_LOG_FILE_PATH=~/w7/p1-core-review2/prefill-plain.log ~/w7/p1-core-review2/prefill
before-first-fill: serial=0 gen[GetLineWidth]=0 fresh=1 live=1
read completed: stored=0 live=7 # gPipeInputs.GetLineWidth() after pGLContext->SetLineWidth(7.f), no fill
GetRenderStateParameters completed: LineWidth=1
GetProgramForDraw completed: (nil)
rc=0 # expected per D6: SIGABRT, Fatal{UnmigratedPipeInput, "GetLineWidth@<none>"}
$ … prefill x # same with MG_Config::Features.PipeVerify = true before the reads
before-first-fill: serial=0 gen[GetLineWidth]=0 fresh=1 live=1
read completed: stored=0 live=7
rc=0 # no "verify armed", no "verify read of", no Fatal in the log
```
Why major: this is the "poison that can never trip" shape, on the exact window the brief's own risk table names (E: "A read outside any verb … If the lane finds another (`@<none>` in the Fatal), the answer is a fill point"). With this predicate the lane cannot find one for a V-class field: a backend read that lands before the first verb — an init-time capability probe, the first link, anything reached from `eglMakeCurrent` — is served zeros by the push arm, is not compared by the read hook, and reports nothing. `PipeCatalogue.PipeInputFieldsStartUnfilled` (`PipeCatalogueTest.cpp:225-228`, pre-P1) sets `state.CurrentVerbSerial = 1` by hand before asserting "unfilled", i.e. the P0.5 test already steps around serial 0; none of the 11 `PipeInputsTest` cases reads before a fill. Honest scope: **latent on this tree** — the scout catalogue (`scout-pull-sites.md:951`) finds exactly two out-of-verb pulls, both `InvalidateCompileEnv` (sticky, forwarded, unchecked), so D.3 will not hit it today. It is still a deviation from D6 that nobody declared, in a mechanism whose whole value is catching the case that is not catalogued yet.
Fix (A's files): emit `state.FilledGen[index] != 0 && state.FilledGen[index] == state.CurrentVerbSerial` for the non-sticky arm in `gen_filled` (`gen_pipe.py`, the `MGPipeInputFieldIsFresh` text) and regenerate; add the serial-0 assertion to `PipeInputFieldsStartUnfilled`; add one fork case (`ReadingBeforeAnyFillAbortsNamingNoVerb`: live context, no fill, `gPipeInputs.GetLineWidth()` → SIGABRT + `Fatal{UnmigratedPipeInput, "GetLineWidth@<none>"}`). With the poison fixed the read hook's arming-at-first-fill is harmless in a verify build (a pre-fill read is Fatal before the hook matters); if a plain push build without POISON is also meant to be covered, arm in the hook when `!g_verify.Parsed`.
## 3. Minors
1. **The seven F-class forwarders carry no `MGP_INPUT_CHECK`** (`PipeInputs.h:563-571`, `PipeFill.cpp:464-500`), while D4 says "Every accessor body is: `MGP_INPUT_CHECK(...)` → `MGP_INPUT_VERIFY_READ(...)`" and the header comment narrows it to "every non-forwarded accessor" (`PipeInputs.h:40,155`). This is the *right* behaviour — the two init-time `InvalidateCompileEnv` calls (`BackendObject_DirectVulkan.cpp:388-390,786-788`) run before any fill and would otherwise be `Fatal{…@<none>}` — but it is an undeclared deviation, and it means the sticky stamp (`FilledGen = 1`, `PipeFill.cpp:530-535`) and the `Sticky → FilledGen != 0` branch are consulted by no accessor at all: the sticky machinery is exercised only by tests that call `MGPipeInputFieldIsFresh` directly. Record it in the deviations list (and in `MEASUREMENTS.md`), so P2's tracker does not "fix" the missing check.
2. **`ArmVerify` re-arms only when `Features.PipeVerify` changes** (`PipeFill.cpp:362`); `PipeVerifyCorrupt` and `PipeVerifyFatal` are latched at that moment (`:367-374`) and a later change to either without a `PipeVerify` toggle is not seen. Deviation 14 and the `878db2c4` subject ("re-parse the POISON_OMIT and VERIFY knobs when their Features value changes") overstate this. Lane behaviour is unaffected (all three are loaded before the first fill); the unit tests set all three before the child's first fill. Say so precisely in the record.
3. **`GetBufferBindingSlot(BufferTarget::Index)` diverges between arms by design and no `FillPoints.def` row can repair it.** `GLContext::GetBufferBindingSlot` is polymorphic (`Core.cpp:98-106`: `Index` returns the bound VAO's element-buffer slot); the fill copies `GlobalBufferTargets` only and leaves `Index` null (`PipeFill.cpp:63-69`), so the push accessor is `Fatal{UnmigratedPipeInput, "GetBufferBindingSlot@…"}` there (`PipeInputs.h:489-492`). Unreachable today (every backend slot read is DrawIndirect/DispatchIndirect/Parameter/PixelPack; table above), same class as v1 minor 5 (`IsCapabilityEnabledIndexed`): both belong in the same `MEASUREMENTS.md` line for the integrator, because the D.3 rule "a Fatal is fixed by adding the row" is false for these two accessors.
4. **`VerifyFatalOffLogsTheDivergenceAndContinues` never observes the `verify summary` line** — the child `_exit(0)`s (`PipeInputsTest.cpp:446`), so `VerifyState::~VerifyState` (`PipeFill.cpp:348-354`) does not run; the summary path is covered only by my lane run (`summary=1` under `MOBILEGL_PIPE_VERIFY_FATAL=0`). Fine as a unit-level statement of "continues"; note that the teardown line's coverage lives in E's lanes.
5. **`MGPipeVerifyReadHook` re-reads the whole field on every accessor call** (`PipeFill.cpp:430`) — for `GetRenderStateParameters` that is a 1168-byte copy plus a 65-member compare per backend read, and `GetProgramForDraw` re-joins the link per read. Declared (deviation 2) and inside the 5–10× verify budget; recorded here only so the D.3 wall-time numbers are read with this in mind, and because the `InHook` guard (`:429-432`) is what keeps a `GetProgramForDraw`-triggered backend re-entry from recursing — worth a comment at the site.
## 4. Where the tree and the brief disagree (verified; the implementer's list stands)
Unchanged from v1: `GL_Drawing.cpp:906` vs 907; `RenderStateParameters` 65 members not 67; `CapabilityInput` 35 not 37; c5 regenerates 1 file not 7; `integration-gpu` 868 entries; the `ctest -N` regex needs the padded form. Nothing new this round.
## 5. Notes for the integrator (not A's findings)
- The v1 note on the vacuous `-R 'DirectGLES\.Verify\..*Mipmap'` CI regex still stands; the implementer's record of it in `core-v2.md` is accurate.
- Once M1 is fixed, D.3 gains a new failure mode worth expecting: any backend read reached from EGL/init before the first verb will now be `Fatal{UnmigratedPipeInput, "<Field>@<none>"}` in the verify lane — per E's risk table the answer is a fill point at that boundary (an EGL virtual), never a sticky flag or a `FillPoints.def` row.
- `GetBufferBindingSlot(Index)` and `IsCapabilityEnabledIndexed(other cap)` are the two accessors where "add the row" does not apply (minor 3): put both on one `MEASUREMENTS.md` line.
## 6. Verdict
Not approved: fix M1 (predicate emission in `gen_pipe.py` + regenerate, serial-0 assertion in `PipeInputFieldsStartUnfilled`, one fork case for the `@<none>` Fatal), then re-review. Minors 1–3 are records for the deviations list / `MEASUREMENTS.md`; 4–5 are notes.
@@ -1,324 +0,0 @@
# Adversarial review — p1-core v3 (tree `~/w7/p1-core`, branch `p1/core`, HEAD `44ffafb2`)
Verdict: **NOT approved — 1 major, 6 minors.**
Everything the round-2 review asked for is genuinely fixed and I reproduced each fix independently
rather than through the implementer's own tests: the serial-0 window is closed on **both** branches
of the freshness predicate (sticky included), the `PipeInputsTest` log-path race is gone (0/20 red
under `-j 8`, no leftovers), `ArmVerify` keys on all three knobs, and the FATAL=0 child now observes
its teardown summary. All eight G-gates that can be checked in this tree are green, the 83 fill
points are in the right places, and the 63 accessors are signature-identical to `GLContext`'s.
The major is not in the rework. It is a **hole in `FillPoints.def`'s `kReadback` class mask** that
the espryt reviewer raised against package A in round 1, that is still open at HEAD, and that turns
gate G3 red on the integrated tree — the first of the two cross-package items I was asked to settle.
The second (the `FilledGen == 0` window) is genuinely closed.
Tree left exactly as found: `git status` shows only the three untracked build directories, `git diff`
is empty, HEAD is `44ffafb2`. All reviewer artifacts under `~/w7/p1-core-review3/`; scratch inputs
under `scratchpad/wf4/core-review3/` (`gates.sh`, `nc.sh`, `lane.sh`, `probe.cpp`, `probe2.cpp`,
`sig.py`, `mut.sh`, `fixsim.sh`). Two generator mutation experiments ran in `/tmp` copies, never in
the tree, and were deleted afterwards.
---
## 1. What I re-ran (all on `44ffafb2`; all three build dirs were `ninja: no work to do`)
| check | command | observed |
|---|---|---|
| **G1 symbols** | `python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0` | `.text 10792579 -> 10792579 (+0, +0.000%)`; `27799 -> 27799 defined symbols: 0 added, 0 removed, 0 resized, 0 renamed, 27060 unchanged`; Removed/Added/Resized/Renamed sections all `_none_` |
| **generator** | `python3 scripts/gen_pipe.py --check` / `--self-test` | rc 0 / rc 0; `63 PipeInputs fields (7 sticky), 69 verbs, 9 classes`, `generated files are up to date`; 6 negative controls `tripped as expected`, `positive control OK` |
| generated files match their sources | `git status --porcelain` after `--check` | only the three untracked build dirs; no `.inc` drift |
| **ctest -L unit ×3** | `ctest --test-dir {build-linux,build-push,build-verify} -L unit --no-tests=error -j 12` | `100% tests passed, 0 tests failed out of 1482` in each |
| **`ctest -N` name diff** | padded regex `sed -E 's/^ *Test +#[0-9]+: //'`, `comm` vs `~/w7/p1-before-ctest-names.txt` | 2350 names in each of the three dirs; **0 removed**; 16 added (4 `PipeCatalogue.*` + 12 `PipeInputsTest.*`); linux/push/verify name sets byte-identical (`diff` empty) |
| fill points | `grep -c "MGP_FILL(" MobileGL/MG_Impl/GLImpl/*/*.cpp` | Drawing 36, Framebuffer 11, Getter 3, Program 1, Query 18, Sync 6, Texture 8 = **83** over **69** distinct verbs; none outside `MG_Impl/GLImpl` |
| every table call has a fill | all `gBackendFunctionsTable.GL.<Entry>` occurrences in `MG_Impl` classified | 89 occurrences; every one that is a *call* has an `MGP_FILL` on its path; the surplus occurrences are null-checks (`BeginOcclusionQuery` ×3, `GetTexImage`, `GetTextureImage`, `EndTransformFeedback`) and captures (`MemoryBarrier` ×2, `MemoryBarrierByRegion`, `DispatchCompute*`, `PatchParameteri`). No missing fill point |
| **negative control A, unit** | `PipeInputsTest.VerifyCorruptKnobNamesTheFieldAtEntry`, plus my own `probe2 corrupt` | see §2.2 — red for the stated reason |
| **negative control B, unit** | `PipeInputsTest.ReadingAnOmittedFieldAbortsNamingTheVerb` / `PoisonOmitKnobArmsTheOmission`, plus my own `probe2 omit` / `omit-other-verb` | see §2.2 — red on that verb only |
| negative control A, lane | `MOBILEGL_PIPE_VERIFY=1 MOBILEGL_PIPE_VERIFY_CORRUPT=GetRenderStateParameters ctest --test-dir build-verify -R 'DirectGLES\..*ClearThenReadPixels'` | **red**: `1586 - DirectGLES.ClearThenReadPixelsScenario.ADrawIntoTheDefaultFramebufferSurvivesAnEarlierClear (Subprocess aborted)`; log: `Fatal{PipeVerifyDiffer, "GetRenderStateParameters@Clear", verb=1, where=entry}` |
| clean lane smoke | same without the knob | 5/5 green, `verify armed`=1, `Fatal{`=0, `verify read of`=0 |
| negative control B, lane | `+ MOBILEGL_PIPE_POISON_OMIT=GenerateMipmap:GetActiveTextureUnit` | 5/5 green, `poison omission armed`=1, `Fatal{`=0 — vacuous on this tree by construction (minor 5) |
| M1(v1) log race, re-stressed | `ctest --test-dir build-verify -R PipeInputsTest -j 8` × 20 | **red = 0/20**; `ls /tmp/mobilegl-pipeinputs-test*` = 0 afterwards; log path is per-pid (`PipeInputsTest.cpp:525-526`) |
| skip visibility | `ctest -R PipeInputsTest` in the three dirs | build-verify 12/12 pass; build-push 4 skipped (verify-only + the poison-only new case); build-linux 12 skipped ("push not compiled in") |
| **M1(v2) fix, independently** | `probe2 prefill` (my own binary, linked against `build-verify`) | `serial=0: fresh fields = 0 of 63 (sticky RecordError fresh=0)`; `serial=5, all stamps 0: fresh fields = 0`; then rc **134** with `Fatal{UnmigratedPipeInput, "GetLineWidth@<none>"}` |
| accessor signature parity | `sig.py`: all 63 accessor declarations in `PipeInputs.h` vs `MG_State/GLState/Core.h` | **63/63 identical** in name, parameters, constness and return type. The nine my regex first reported as DIFF (`IsTransformFeedbackActive`, `GetTextureContextId`, …) are one-line inline definitions in `Core.h` (`:325,326,334,357,429,441,126,130,143`) that the regex skipped; re-read by hand, all match. **No `const&` became a copy**, on the draw path or anywhere else |
| build-configuration hygiene | `ninja -t commands` in the three dirs | build-verify/build-push: **0** `MobileGL/` TUs compiled without `-DMOBILEGL_PIPE_PUSH=1` (so the `#if MOBILEGL_PIPE_PUSH` members added to `MG_Config::Features` cannot produce an ODR/layout split); build-linux: 0 occurrences of either macro and `PipeInputs.cpp`/`PipeFill.cpp` not compiled |
| D3 verbatim | `cat MobileGL/MG_Pipe/PipeInputsSwitch.h` | identical to the brief's D3 text, including the `#else` arm being the only `pGLContext` spelling |
| generator gate on the M1 fix | `mut.sh` m1: delete `if (gen == 0) return false;` from the generated `PipeFilled.inc` in a `/tmp` copy | `gen_pipe.py --check` → **rc 1** (the predicate cannot silently regress) |
| commit hygiene / ownership | `git log`, `git diff --stat 087685d1..HEAD` | 14 commits, `[Type] (Scope): …` single-line subjects, 0 `Co-Authored-By`, nothing pushed; 26 files, every path in A's C.5 rows |
---
## 2. The two cross-package items I was asked to settle
### 2.1 (a) `kReadback` and the transform-feedback flags — **still open. This is the major.**
See §3 (M1). Answer to the question as posed: **no**, `FillPoints.def`'s `kReadback` class does not
carry `IsTransformFeedbackActive` / `IsTransformFeedbackPaused` at HEAD, and **yes**, HEAD's class
table still produces `Fatal{UnmigratedPipeInput, "IsTransformFeedbackActive@ReadPixels"}` — I
reproduced it directly against this tree's `build-verify` library, without the espryt patch.
On the second half of the question ("whether any other verb class is missing a field its verb path
reads"): I found **no second gap**, from three independent angles —
1. the espryt reviewer's full `DirectGLES` `integration-gpu` run under verify on an integrated tree
(441 entries) produced exactly 19 aborts, all this one Fatal (`espryt-review-v1.md:46`);
2. the magma reviewer's full `DirectVulkan` verify run produced **zero** `UnmigratedPipeInput` and
zero `@<none>` (`magma-review-v1.md:99`);
3. my own source audit of the helpers that serve more than one verb class against the pull-site
catalogue §4.2 and §1: `SyncRenderState` (kDraw/kClear/kBlitOrCopy/kProgramOp — all four masks
carry its four accessors), `SyncNeccessaryTextures` (its five texture accessors are in every
class that reaches it, kReadback included), `SyncCurrentFBO` /
`FramebufferImpl::GetReadColorAttachment` (`Managers.cpp:5355`) and
`IsFixedPointFallbackReadAttachment` (`:5460`) read `GetFramebufferBindingSlot`, which kReadback
has; `BoundImageUnitFormat` (`Managers.cpp:6230`, `GetImageTextureBinding`) is reached only
through `ImageUnitFormatsStillMatch` from `SyncCurrentProgram` (`DirectGLES.cpp:2812`), i.e. the
draw/dispatch closure, and both masks carry the field; `MultiDraw.cpp:45,51,52,87,95` are kDraw
accessors in kDraw's mask.
Residual exposure worth naming for D.3: **nobody has yet run the 40-trace retrace under
`MOBILEGL_PIPE_VERIFY=1`**, and that is the part of G3 that exercises paths the itest lanes do
not (MC shaders, XFB spans, indirect count). More `FillPoints.def` rows may fall out there; per
D7 the fix is always "add the row", never a sticky flag.
### 2.2 (b) The `FilledGen == 0` / `serial == 0` window — **closed, on both branches and for sticky fields.**
`MobileGL/MG_Pipe/generated/PipeFilled.inc:316-321` (emitted by `gen_pipe.py:813-818`):
```
inline Bool MGPipeInputFieldIsFresh(const MGPipeFilledState& state, MGPipeInputField field) {
const SizeT index = static_cast<SizeT>(field);
const Uint64 gen = state.FilledGen[index];
if (gen == 0) return false;
return kMGPipeInputFieldSticky[index] || gen == state.CurrentVerbSerial;
}
```
The `gen == 0` refusal precedes the branch, so it covers the sticky arm too. Verified three ways,
none of them by trusting the delivered tests:
```
$ MOBILEGL_LOG_FILE_PATH=~/w7/p1-core-review3/p2-prefill.log ~/w7/p1-core-review3/probe2 prefill
serial=0: fresh fields = 0 of 63 (sticky RecordError fresh=0)
serial=5, all stamps 0: fresh fields = 0
rc=134
[FATAL]: MGPipe: Fatal{UnmigratedPipeInput, "GetLineWidth@<none>"}
```
(the second line is the case the v2 fix's wording does not cover explicitly: a *non-zero* serial with
an unstamped sticky field is stale too, so a process that filled before a sticky field was ever
stamped cannot read it as fresh either).
The compare-at-read branch: the hook still arms only inside `MGPipeFillForVerb`
(`PipeFill.cpp:532`), so it is blind before the first fill — but `MGP_INPUT_CHECK` precedes
`MGP_INPUT_VERIFY_READ` in every accessor body (`PipeInputs.h:199-474`) and a verify build always
defines `MOBILEGL_PIPE_POISON` (`PipeInputs.h:21-26`), pinned by
`static_assert(MOBILEGL_PIPE_POISON, ...)` at `PipeFill.cpp:349`. The probe run above sets
`Features.PipeVerify = true` before the read and still aborts on the poison first, with no
`verify armed` and no `PipeVerifyDiffer` in the log — i.e. the window is closed on that branch by
construction, not by luck. In a push build without the poison the window is open by design (both
macros compile out); that is D2's definition, not a defect.
### 2.3 The two negative controls, exercised independently
Driving `MG_Config::Features` exactly as `ConfigLoader.cpp:247-252` does, from my own binary
(`~/w7/p1-core-review3/probe2`, linked against `build-verify`):
```
===== corrupt (Features.PipeVerify=1, PipeVerifyCorrupt="GetRenderStateParameters")
rc=134
MGPipe: verify armed - 63 fields, 69 verbs, fatal=1
MGPipe: verify corruption armed - GetRenderStateParameters
MGPipe: Fatal{PipeVerifyDiffer, "GetRenderStateParameters@DrawArrays", verb=1, where=entry}
===== omit (Features.PipePoisonOmit="GenerateMipmap:GetActiveTextureUnit")
draw read ok <- the preceding DrawArrays read is unaffected
sibling read ok <- GetTextureUnitObject, same verb, still fresh
rc=134
MGPipe: poison omission armed - GetActiveTextureUnit@GenerateMipmap
MGPipe: Fatal{UnmigratedPipeInput, "GetActiveTextureUnit@GenerateMipmap"}
===== omit-other-verb (same knob, fill BindImageTexture — same kTextureOp class)
green: BindImageTexture (same kTextureOp class) is unaffected rc=0
```
Both controls turn something red, each for its stated reason, and G5's "on **that** verb and only
there" holds even against a sibling verb of the same class. The lane-level CORRUPT control is red as
well (§1).
---
## 3. Major
### M1 — `FillPoints.def`'s `kReadback` class lacks `IsTransformFeedbackActive` / `IsTransformFeedbackPaused`, which Espryt's `ReadPixels` **and** `GetTexImage` verb paths read; G3 is red on the integrated tree
**Where.** `MobileGL/MG_Pipe/FillPoints.def:225-240` — the `kReadback` block holds 15 rows and
neither flag. The generated mask says so:
`MobileGL/MG_Pipe/generated/PipeFillPoints.inc:290-291`, `// kReadback: 22 fields (15 own + 7 sticky)`,
`{{0x5c50f3a041300541ull, 0x0000000000000000ull}}`.
**The read, at `087685d1` and unchanged on `p1/espryt`:**
```
MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp:5259-5260 (ScopedEmulationDrawState::ScopedEmulationDrawState, :5226)
if (MG_State::pGLContext->IsTransformFeedbackActive() &&
!MG_State::pGLContext->IsTransformFeedbackPaused() && g_GLESFuncs.glPauseTransformFeedback) {
```
reached as
`ReadPixels` (`:8999`, the `GLFunctionsTable.ReadPixels` entry)
→ `ReadPixelsDepthComponent` (call `:9066`, definition `:8140`)
→ `DepthStencilSamplingReadImpl::Read` (call `:8128`, definition `:8039`)
→ `ScopedEmulationDrawState emulationState;` (`:8061`)
→ the two reads at `:5259-5260`.
`GetTexImage` (`:9166`) is in the same class and reaches the same helper through its own pack path
(`:9498`, `:9502`), so the identical Fatal is reachable as `IsTransformFeedbackActive@GetTexImage`.
The catalogue's §4.2 row for Espryt's `ReadPixels` lists only the pack/format-conversion helpers and
misses this branch entirely (`scout-pull-sites.md:893`), which is how the row was lost; the
catalogue's own §1 entry for `:5259` attributes it to `ResolveThenBlit` / "blit" only
(`scout-pull-sites.md:188-189`), and `kBlitOrCopy` does carry both flags — which is why only the
readback class is short.
**Reproduction (this tree, `build-verify`, nothing in the tree touched).** A 40-line program
(`scratchpad/wf4/core-review3/probe.cpp`, built with `PipeInputsTest`'s own compile/link flags into
`~/w7/p1-core-review3/probe`) that does what `DirectGLES.cpp:5259` does under `MGB_CTX` on the
`ReadPixels` verb:
```
$ MOBILEGL_LOG_FILE_PATH=~/w7/p1-core-review3/probe.log ~/w7/p1-core-review3/probe
after ReadPixels fill: serial=1 verb=ReadPixels
fresh(IsTransformFeedbackActive)=0 fresh(IsTransformFeedbackPaused)=0 fresh(GetPixelStoreParameters)=1
Aborted rc=134
$ cat ~/w7/p1-core-review3/probe.log
[FATAL]: MGPipe: Fatal{UnmigratedPipeInput, "IsTransformFeedbackActive@ReadPixels"}
```
**Corroboration on a real lane** (not mine, but the reason this was raised against core in round 1):
`espryt-review-v1.md:46,50` — `MOBILEGL_PIPE_VERIFY=1 ctest --test-dir build-verify -L integration-gpu -R '^DirectGLES\.' -j 4`
on an integrated tree gives **421/441**, the 19 failures all `DirectGLES.ForcedDepthStencilEmulation.*`
(`MOBILEGL_ESPRYT_FORCE_DS_READBACK_EMULATION=1`, cases 2274-2293), each aborting on exactly this
Fatal (`~/w7/p1-espryt-review-int-one.log`). I confirmed the row is still absent on `p1/espryt`
(`f4ea84c5`) too, since that branch inherits `FillPoints.def` from `p1/contract`.
**Why this is a major rather than a note.** G3 requires zero `Fatal{UnmigratedPipeInput}` across the
`integration-verify` lane; with this row missing, 19 known entries abort the moment core and espryt
are integrated (D.1 order: core → espryt → magma → verify), i.e. the package's own acceptance gate
cannot pass. D7 designates `FillPoints.def` — package A's file — as the *only* place such a Fatal
may be fixed ("a `Fatal{UnmigratedPipeInput}` found there is fixed by adding the row to this table,
never by marking the field sticky"), so the fix belongs to A, and the lane that is the designated
oracle has already spoken. It was reported before this round's rework began and `core-v3.md`
neither fixes it nor records it (its "Unfinished" section says "Nothing in A's scope").
**In fairness to the implementer:** the brief's own D7 table for `kReadback` has the same hole, and
`FillPoints.def` reproduces the brief's 139 (class, field) rows exactly — the round-2 review's
`d7check.py` verified 139/139, and `FillPoints.def` is untouched since. A followed the specification
faithfully; the specification was derived from a scout reachability trace that missed one branch.
That makes it a *correct* implementation of a *wrong* table, which is still an open defect in A's
deliverable, not somebody else's.
**Fix, verified end to end in a `/tmp` copy** (`scratchpad/wf4/core-review3/fixsim.sh`): two rows in
`FillPoints.def`'s `kReadback` block plus a regenerate. `gen_pipe.py --check` correctly goes rc 1 on
the un-regenerated tree, and the regenerated mask is the only change:
```
- // kReadback: 22 fields (15 own + 7 sticky)
- {{0x5c50f3a041300541ull, 0x0000000000000000ull}},
+ // kReadback: 24 fields (17 own + 7 sticky)
+ {{0x5f50f3a041300541ull, 0x0000000000000000ull}},
```
I did **not** apply it (the tree is left as found). After applying, re-run the espryt reviewer's
lane on an integrated tree to confirm 441/441, and re-run my `probe` (it must print
`fresh(IsTransformFeedbackActive)=1` and exit 0).
---
## 4. Minors
1. **A `MOBILEGL_PIPE_VERIFY_CORRUPT` field outside every executed verb's mask arms, logs, and never
reports** — `MobileGL/MG_Impl/Pipe/PipeFill.cpp:416`
(`if (g_verify.Corrupt && MGPipeFieldMaskHas(mask, *g_verify.Corrupt))`). Observed:
`probe2 corrupt-outside-mask` (CORRUPT=`GetPixelStoreParameters`, verb `DrawArrays`) → **rc 0**,
log carries `verify corruption armed - GetPixelStoreParameters` and nothing else. Negative
control A is therefore green-by-omission whenever it is pointed at a field no executed verb
fills; only the unknown-name case is Fatal (D2). The CI step's `GetRenderStateParameters` happens
to be in kDraw/kClear/kBlitOrCopy/kReadback/kProgramOp, so today it works — but the control
cannot report its own inapplicability. One counter and a teardown `MGLOG_E` when a corruption was
armed and applied zero times would make it falsifiable.
2. **The push arm loses the pull arm's DEBUG bounds assertion on two texture accessors.**
`PipeInputs.h:518-533` (`GetImageTextureBinding`, both overloads) and `:549-556`
(`GetTextureUnitObject`) index the raw base pointer with no range check, while
`MG_State/GLState/TextureState/TextureState.cpp:157-172` guards both with
`MOBILEGL_ASSERT(unit >= 0 && unit < MAX_TEXTURE_IMAGE_UNITS, ...)`. In an INFO build the assert
is inert (`Defines.h:113-115`), so G1/D9 are unaffected and behaviour is identical; a DEBUG push
build silently reads out of bounds where the pull build would have said so. (`GetBufferBindingPoint`'s
`index` is unchecked on both sides — `PipeInputs.h:506` vs `BufferState.cpp:93` — so it is
symmetric and not part of this.)
3. **Nine fill points still bump the serial for a null table entry** — declared deviation 1, and I
re-audited all 83 statements against appendix B.7 rather than trusting the record. The nine are
`GL_Query.cpp:263,294,306,531,543,575,583` and `GL_Sync.cpp:179` (plus `GL_Drawing.cpp:1358`,
which is actually exact — it sits inside the `FenceSync && ClientWaitSync` guard). The **dangerous**
direction is absent everywhere: there is no call that can be reached without its fill. The
round-1 finding (`GL_Sync.cpp` `DeleteSync` in the orphan sweep) is fixed — `GL_Sync.cpp:233` is
now inside `if (backendDeleteSync && syncObject->backendHandle)`, matching its `GL_Query.cpp:930`
sibling. Placement relative to frontend mutation is right in every case that matters
(`BindImageTexture` after `.Bind`/`NoteTextureUnitTouched`, `PatchParameteri` after
`SetPatchVertices`, `Pause`/`Resume` after `SetTransformFeedbackPaused`, `BindTransformFeedback`
after `BindTransformFeedbackObject`, `EndTransformFeedback` *before* the frontend's own
`EndTransformFeedback()`, `ReadPixels` inside the `ScopedNeutralPackState` scope at
`GL_Texture.cpp:1078`).
4. **The env-var forms of both knobs are inert in the unit binary.** `MG_ConfigLoader` never runs
there, so `MOBILEGL_PIPE_VERIFY_CORRUPT` / `MOBILEGL_PIPE_POISON_OMIT` in the environment do
nothing to `ctest -R PipeInputsTest`; the unit-level controls set `MG_Config::Features` directly
(the same fields `ConfigLoader.cpp:247-252` writes, through the same parsers). That is the right
design, but "the negative controls at unit level" should be understood as the two tests, and the
env→`Features` hop is proven only by the lane runs. Worth one sentence in `MEASUREMENTS.md` so
nobody later "checks" the controls by exporting the variables around a unit run and reads green.
5. **The lane-level POISON_OMIT control is vacuous in this package** (declared): 5/5 green with only
`poison omission armed` in the log, because no backend on `p1/core` spells `MGB_CTX->`. Its real
coverage is the unit fork case plus E's `PoisonOmitted.` lanes on the integrated tree. Combined
with the v1 note that the brief's CI regex `-R 'DirectGLES\.Verify\..*Mipmap'` matches nothing,
this control is the one the integrator should watch most closely at D.3.
6. **`core-v3.md`'s "Unfinished: Nothing in A's scope" is not accurate** while M1 stands, and the
result file's deviation list does not mention the `kReadback` row at all even though the espryt
review named it as a core item before this round started. Bookkeeping, but it is the kind of
bookkeeping that lets a known-open item reach D.3 unowned.
---
## 5. Where the tree and the brief disagree (verified; the implementer's list stands)
Unchanged from v1/v2: `GL_Drawing.cpp:906` vs 907; `RenderStateParameters` 65 members not 67;
`CapabilityInput` 35 not 37; c5 regenerates 1 file not 7; `integration-gpu` 868 entries; the
`ctest -N` regex needs the padded form. New this round: the brief's **D7 `kReadback` field list is
itself incomplete** (M1) — when the row is added, `BRIEF-P1.md`'s D7 table and
`scout-pull-sites.md:893` should be corrected in the same pass, or the next reader will "fix" the
`.def` back to the brief.
## 6. Notes for the integrator (not A's findings)
- The magma reviewer's verify lane found a genuine `where=read` divergence,
`Fatal{PipeVerifyDiffer, "GetSamplingResolutionGeneration@DrawArrays", verb=3, where=read}` on
eight `DirectVulkan` scenarios (`magma-review-v1.md:99`): Magma reads that counter four times
inside one draw and the backend's own texture/sampler completion bumps it between the reads. Per
D.3 that is recorded in `MEASUREMENTS.md` and decided by the plan owner, not silenced — it is the
compare-at-read arm doing exactly its job, and it is not a core defect.
- Nobody has yet run the 40-trace retrace under `MOBILEGL_PIPE_VERIFY=1`. That is the half of G3
most likely to surface further `FillPoints.def` rows; budget the "one day of D.3 iteration" E's
risk table already names.
- `GetBufferBindingSlot(BufferTarget::Index)` and `IsCapabilityEnabledIndexed(cap ∉ {Blend, ScissorTest})`
remain the two accessors where "add the row" does not apply; the one-line `MEASUREMENTS.md` record
the implementer drafted is still owed.
## 7. Verdict
**Not approved.** One major: add `X(kReadback, IsTransformFeedbackActive)` and
`X(kReadback, IsTransformFeedbackPaused)` to `MobileGL/MG_Pipe/FillPoints.def`, regenerate, and
re-run the espryt verify lane (or, in this tree, `~/w7/p1-core-review3/probe`, which must then exit
0). Minors 1-2 are small code changes worth taking in the same pass; 3-6 are records.
@@ -1,82 +0,0 @@
# P1 package A (p1-core) — c2..c6 on top of the contract
Tree `~/w7/p1-core`, branch `p1/core`, base `feat/disaggregated @ 087685d1`, contract `bf86b1ed` (tag `p1/contract`, see `core-contract.md`). Nothing pushed. Working tree clean apart from the three untracked build directories.
## Commits (oldest first, all on `p1/core` after `p1/contract`)
| sha | subject |
|---|---|
| `3aa4d8af1ff2ca6f95c9ab3e047e70bc0e0cf65f` | `[Feat] (Pipe): fill PipeInputs per verb class from GLContext and stamp per-verb generations - a read of a field the verb did not fill is Fatal{UnmigratedPipeInput}` |
| `a196ada4c11b59f23587596486d265124ea06a6f` | `[Feat] (Impl): call MGP_FILL before every GLFunctionsTable entry - 83 statements over 69 verbs, a no-op in the pull build` |
| `275dd3edb4909fe2a23af0f9a2667fb8215d24be` | `[Feat] (Pipe): the MOBILEGL_PIPE_VERIFY shadow comparator - a per-verb entry compare over the fill set and a compare-at-read in every accessor, first differing field and verb serial, fatal by default` |
| `83b16561c20428dd15995ed3b2b4ad5496a97bab` | `[Feat] (Pipe): give the six value structs G4 field lists and assert the lists cover their members - the memcmp fallback is now a compile error, floats in vector types compare bitwise` |
| `440d3c52534e2c227b8b4d83251d8afcb0849e3f` | `[Test] (Pipe): pin the P1 poison and verify shapes - 63 fields, 69 verbs, the seven sticky fields, an omitted GenerateMipmap field leaves exactly that field stale, a corrupted snapshot names its field, reading an unfilled field aborts with SIGABRT` |
`git diff --stat p1/contract..HEAD`: 17 files changed, 1587 insertions(+), 72 deletions(-). Files touched (all inside A's ownership row of C.5): `MobileGL/MG_Backend/MGPipe/PipeInputs.{h,cpp}`, `MobileGL/MG_Impl/Pipe/PipeFill.{h,cpp}`, the seven `MobileGL/MG_Impl/GLImpl/{Drawing,Framebuffer,Texture,Getter,Program,Query,Sync}/*.cpp`, `MobileGL/MG_Pipe/PipeFields.def`, `MobileGL/MG_Pipe/generated/PipeVerify.inc`, `scripts/gen_pipe.py`, `MobileGL/MG_Test/Pipe/{CMakeLists.txt, PipeCatalogueTest.cpp, PipeInputsTest.cpp}`. Not touched: `MG_Backend/DirectGLES/**`, `MG_Backend/DirectVulkan/**`, `PipeCalls.def`, `Coverage.def`, `FillPoints.def`, `PipeInputsSwitch.h`, `CMakeLists.txt` (root), `Config.h`/`ConfigLoader.cpp`, fixtures. No signature in `PipeInputs.h` / `PipeFill.h` / `PipeInputsSwitch.h` that B/C/E code against changed (the accessor set, `MGB_CTX`, `MGP_FILL`, the knob names and log lines are as in the contract); the additions are listed under deviations 5-7.
## What each commit does
- **c2 filler** (`PipeFill.cpp`): `MGPipeFillForVerb` walks `kMGPipeClassFieldMask[kMGPipeVerbClass[verb]]`; `MGPipeFillAccess::CopyField` is one switch over the 56 stored fields, each branch calling the `GLContext` accessor of the same name (D4's fill column verbatim: loops of 8/16/32, `GlobalBufferTargets`/`BufferBindPointTargets` for the slot/point bases, `&ctx.GetTextureUnitObject(0)`/`&ctx.GetImageTextureBinding(0)` as array bases, Blend x8 + ScissorTest x16 for the indexed capabilities, all 35 capabilities incl. `FramebufferSrgb`'s constant false); every copied field is stamped with the new serial; the seven sticky fields get `FilledGen = 1` on the first live fill. `MOBILEGL_PIPE_POISON_OMIT` (`<Verb>:<Field>`) is parsed once at the first fill; `MGPipeSetPoisonOmission(verb, field)` is the programmatic form; the omitted pair keeps its value copy and loses only its stamp; unknown names are `Fatal{PipeVerifyBadKnob}`.
- **c3 fill points**: the 83 `MGP_FILL(X);` statements of B.7 (36/11/8/3/1/18/6 per TU) plus `#include <MG_Impl/Pipe/PipeFill.h>` after each TU's last `MG_State`/`MG_Backend` include, inserted by a patcher (`scratchpad/wf4/core/patch_c3.py`) that refused any target line not spelling its verb.
- **c4 comparator** (`PipeFill.cpp`, `PipeInputs.{h,cpp}`): entry compare at the end of every fill (`SnapshotFromGLContext` into a file-static second `PipeInputs`, `MOBILEGL_PIPE_VERIFY_CORRUPT` applied to the snapshot arm, `MGPipeVerifyInputs` over the mask, first differing field); compare-at-read through `MGP_INPUT_VERIFY_READ` -> `MGPipeVerifyReadHook(*this, field, i0, i1)` (re-reads the field from the live context into a scratch block and compares against the live block only); `MGLOG_F("MGPipe: Fatal{PipeVerifyDiffer, \"%s@%s\", verb=%llu, where=%s}")` + `abort()` unless `MOBILEGL_PIPE_VERIFY_FATAL=0` (counts, `MGLOG_E` summary at teardown); `MGLOG_I("MGPipe: verify armed - 63 fields, 69 verbs, fatal=N")`, `MGLOG_I("MGPipe: verify corruption armed - F")`, `MGLOG_I("MGPipe: poison omission armed - F@V")`; a push build without the comparator answers `MOBILEGL_PIPE_VERIFY=1` with one `MGLOG_W_ONCE`.
- **c5 G4 growth** (`PipeFields.def`, `gen_pipe.py`, regenerated `PipeVerify.inc`): the six field lists (RenderStateParameters 65, PixelStoreParameters 8, PerBufferBlendState 7, StencilFaceState 7, DynamicBackendParameters 85, MGHostSpan 4), `kMGPipeVerifiedPayloadCount` 63 -> 69; `MEMCMP_FALLBACK_TYPES` empty and the fallback branch `static_assert(sizeof(T) == 0, "no field list in PipeFields.def for this type")`; `Array<T,N>` overload; VecBase detected by a probe and compared bitwise over `data`; `check_field_lists_cover_struct_members()`, `scan_live_accessors()` (both modes), `--self-test` with six negative controls and a positive one.
- **c6 tests**: the four `PipeCatalogue.*` additions and the five `PipeInputsTest.*` cases (new unit target, own `main()` for `MOBILEGL_LOG_FILE_PATH`, fork/waitpid, never `EXPECT_DEATH`).
## Verification (WSL, `~/w7/p1-core`; logs under `~/w7/p1-core-*.log`)
Every command below was run on the final tree (`440d3c52`) unless a commit is named.
| command | actual output |
|---|---|
| `python3 scripts/gen_pipe.py --check` | `gen_pipe: 71 calls (11 screen, 60 context), 69 verify payloads, 63 PipeInputs fields (7 sticky), 69 verbs, 9 classes` / `inventory 477 rows: ... 0 UNMAPPED` / `1 accessor row(s) no backend reads: GetBoundTransformFeedbackName` / `generated files are up to date`, rc=0 |
| `python3 scripts/gen_pipe.py --self-test` | six controls "tripped as expected" (struct member without F, F that is not a member, payload with no struct, verb missing from FillPoints.def, verb not in GLFunctionsTable, field row naming a non-accessor), `positive control OK`, rc=0. Before the whitespace-tolerant fix the three FillPoints controls reported DID NOT TRIP and the run exited 1 - the "zero trips is an error" arm was exercised. |
| `cmake --build build-linux` + `ctest -L unit --no-tests=error` | rc=0; `100% tests passed, 0 tests failed out of 1475` (1466 before c6 + 9 additions) |
| `python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0` | `.text 10792579 -> 10792579 (+0, +0.000%)`, `.data +0`, `.bss +0`, `.rodata +0`, `Total +0`, `27799 -> 27799 defined symbols: 0 added, 0 removed, 0 resized, 0 renamed`, `27060 normalised names unchanged`. **G1 holds** after every commit (checked at c3, c4, c5, final). `readelf -S` section sizes identical. `cmp -l` shows 34 differing bytes: 20 in `.note.gnu.build-id`, 14 in `.rodata` = the `GIT@5d99ee4` -> `GIT@087685d` configure stamp and glslang's `Timestamp: 2026-09-05T23:14:30` -> `2026-09-06T01:32:05` string - build stamps of equal length, not code. (Markdown/JSON: `~/w7/p1-core-symbol-final.{md,json}`.) |
| `grep -rc "pGLContext" MobileGL/MG_Backend \| sort \| diff - ~/w7/p1-before-pglcontext.txt` | only the two contract files appear, both `:0` (`MG_Backend/MGPipe/PipeInputs.cpp:0`, `PipeInputs.h:0`); every catalogued file's count unchanged - A converts no site |
| `grep -c "pGLContext" MobileGL/MG_Backend/MGPipe/PipeInputs.h PipeInputs.cpp` | `0` `0` |
| `grep -c "MGP_FILL(" MobileGL/MG_Impl/GLImpl/*/*.cpp \| awk ...` | `83` (Drawing 36, Framebuffer 11, Texture 8, Getter 3, Program 1, Query 18, Sync 6) |
| `cmake --build build-push` + `ctest -L unit --no-tests=error` | rc=0; `100% tests passed, 0 tests failed out of 1475`; `MOBILEGL_PIPE_PUSH=1` on every compile command, `MOBILEGL_PIPE_VERIFY=1` on none |
| `cmake --build build-verify` + `ctest -L unit --no-tests=error` | rc=0; `100% tests passed, 0 tests failed out of 1475`; `MOBILEGL_PIPE_VERIFY=1` on all 497 compile commands |
| `ctest --test-dir build-push -L integration-gpu --no-tests=error -j 4` (at c3, `a196ada4`) | `99% tests passed, 1 tests failed out of 868`; the one failure `DirectVulkan.PointSizeDemotion.PointSizeDemotionScenario.TheDemotionIsActuallyArmedWhenTheEnvironmentPinsItOn` (0.23 s) passes alone in build-push AND in build-linux (`100% tests passed ... out of 4`) - a `-j 4` flake of an env-pinned lane, the case the integrator script's `--rerun-failed -j 1` exists for; zero `Fatal{` lines in the log |
| `ctest --test-dir build-push -L integration-gpu --no-tests=error -j 4` (final tree) | ITEST_FINAL_PLACEHOLDER |
| `ctest -N` name diff (pull): `comm -23 ~/w7/p1-before-ctest-names.txt -` | 2343 names, **0 removed**, 9 added (`PipeCatalogue.{VerbTableIsTheFunctionTable, StickyFieldsAreExactlyTheSeven, FloatVectorsCompareBitwise, SixValueStructsHaveFieldLists}`, `PipeInputsTest.{OmittingOneFieldForOneVerbLeavesExactlyThatFieldStale, ReadingAnOmittedFieldAbortsNamingTheVerb, ReadingAFilledFieldCompletes, CorruptedSnapshotFieldIsNamedWithItsSerial, EveryVerbFillsItsClassAndNothingElse}`); the same 9 names exist in all three configurations (skips are visible, not vanishing). The padding-tolerant regex `'^\s+Test\s+#[0-9]+:'` is used, as in the contract report. |
| **G4 unit** (`build-verify`, `PipeInputsTest.CorruptedSnapshotFieldIsNamedWithItsSerial`) | Passed: clean snapshot compares equal over `kDraw`'s mask; `MGPipeApplyVerifyCorruption(snapshot, GetRenderStateParameters)` -> `MGPipeVerifyInputs` false naming `GetRenderStateParameters`, whose stamp equals the fill serial; a corruption of a field outside the mask is not seen; a forwarded field cannot be corrupted. Skips visibly in build-push ("verify not compiled in") and build-linux ("push not compiled in"). |
| **G4 lane-level smoke** (`build-verify`, `MOBILEGL_PIPE_VERIFY=1 ctest -R 'DirectGLES\..*ClearThenReadPixels'`) | clean: `100% tests passed ... out of 5`, log has `MGPipe: verify armed - 63 fields, 69 verbs, fatal=1`, 0 `Fatal{`. With `MOBILEGL_PIPE_VERIFY_CORRUPT=GetRenderStateParameters`: `0% tests passed, 5 tests failed out of 5` (rc=8), log has `MGPipe: verify corruption armed - GetRenderStateParameters` and `Fatal{PipeVerifyDiffer, "GetRenderStateParameters@Clear", verb=1, where=entry}` |
| **G5 unit** (`build-verify`, `PipeInputsTest.{Omitting..., ReadingAnOmittedFieldAbortsNamingTheVerb, ReadingAFilledFieldCompletes}`) | all Passed: with `SetPoisonOmission("GenerateMipmap","GetActiveTextureUnit")` the GenerateMipmap fill leaves `GetTextureUnitObject` fresh and `GetActiveTextureUnit` stale, a following DrawArrays fill leaves it stale while `GetBoundVertexArray` is fresh, and a BindImageTexture fill (same class, different verb) heals it; the forked child that draws, reads a filled field, fills GenerateMipmap, reads the sibling and then the omitted field dies with `WTERMSIG == SIGABRT` and the log carries exactly `Fatal{UnmigratedPipeInput, "GetActiveTextureUnit@GenerateMipmap"}`, no `@DrawArrays`, no `GetTextureUnitObject@`; the sibling child without the omission `_exit(0)`s with no `Fatal{`. In build-push (Release/INFO, no POISON) the two poison cases skip visibly and `ReadingAFilledFieldCompletes` passes. |
| `nm -D --defined-only build-verify/libMobileGL.so \| grep -c MGPipeVerifyInputs` / same on build-push | `1` / `0` - the symbol E's retrace-verify job probes exists only in the verify library |
| `EveryVerbFillsItsClassAndNothingElse` (build-verify) | Passed: after each of the 69 fills a field is fresh iff its class bit is set (sticky included); `ContextIdentity()` is the live context address |
Not run: the 40-trace retrace under verify and the `integration-verify` lane (E's files; D.3 on the integrated tree). The verify-build integration-gpu was only smoked (5 `ClearThenReadPixels` entries) - on this tree no backend reads `gPipeInputs`, so its full run would only repeat build-push's proof.
## Deviations from the brief (with reasons)
1. **Nine fill points precede a guarded expression rather than the bare call** (D7 says "after every early return the call is behind; a verb whose table entry is null never bumps"): `GL_Query.cpp` 260/300 (`if (handle && getQueryResult64 && !getQueryResult64(...))`), 289 (`outValue = (!f || f(h)) ? 1 : 0`), 522/533/645 (`handle = f ? f() : nullptr`), 774 (`supported = ... && f && f()`), `GL_Sync.cpp` 177 (`signaled = !f || !h || f(h)`) and `GL_Drawing.cpp` 1331 (`if (auto sync = backendGL.FenceSync())`, inside the `FenceSync && ClientWaitSync` guard so this one is exact). At the other eight the fill precedes the statement that holds both the null guard and the call, so a null entry bumps the serial once with nothing to read it (kQuery fills one field; no backend read happens between two fills without a fill). Chosen over a comma-expression (`(MGP_FILL(X), f(...))`) or splitting the statements because either would touch the code shape of the pull build, and G1 asks for byte identity.
2. **Compare-at-read re-reads the WHOLE field, not only the indexed element** (D8: "re-reads the same accessor with the same indices"). The hook copies the field from the live context into a scratch block through the same `CopyField` the filler uses and compares with `MGPipeInputsFieldEqual`; the indices decorate the report (`MGLOG_E` before the Fatal). A superset: a divergence in an index the backend did not ask for is still a boundary-vs-live divergence. One copy switch instead of a second 56-way index-aware switch.
3. **`MGPipeVerifyReadHook` takes the block as its first parameter** (`(const PipeInputs& self, field, i0, i1)`; the brief spells `(f, i0, i1)`): the macro expands inside member functions of any `PipeInputs` (the snapshot's accessors run in the tests), and only the live block is verified; without `self` the hook could not tell them apart. No backend code spells the hook.
4. **VecBase bitwise compare is a probe inside the generic `MGPipeFieldEqual`, not an overload** (D8 says "two overloads ... partial ordering picks these over `const T&`"). For `FloatVec4` the overload on `const VecBase<D,T,N>&` needs a derived-to-base conversion and LOSES overload resolution to the exact-match generic template before partial ordering is consulted; the `Array<T,N>` overload is exact and does win, and is emitted as the brief says. `PipeCatalogue.FloatVectorsCompareBitwise` pins the behaviour (NaN equals itself, -0.0f != 0.0f, `a == b` is IEEE and disagrees).
5. **`MGPipeInputsFieldEqual` takes `const PipeInputs&`** (the contract had `PipeInputs&`), with a const `VisitStorage` overload added; nobody outside A calls it.
6. **`MGPipeVerifyInputs` carries `__attribute__((visibility("default")))`** (not in the brief): the library is built with hidden visibility, so without it E's `nm -D build-linux/libMobileGL.so | grep -q MGPipeVerifyInputs` step (C.4 (c)) could never pass. No MGPipe symbol was in the dynamic table before; this is the only one now.
7. **Pointer corruption flips the low bits instead of nulling** (D8 says "swap a pointer for nullptr"): a pointer that is already null (an O-class field before the first fill, or a null `GetProgramForDraw`) would make the corruption invisible to the compare; a `SharedPtr` becomes an aliasing pointer with no control block. The snapshot is only ever compared, never dereferenced.
8. **`SnapshotFromGLContext` and `MGPipeFillForVerb` share `CopyField`** rather than being two copies of the copy logic; the snapshot is still its own function (the branch that survives P13) with its own file-static block.
9. **`CurrentVertexAttributeValue` compares bitwise** in `PipeInputs.cpp` with a `sizeof == 48` static_assert: it is `MG_State` storage (three scalar `Array`s, no padding), not a payload, so it gets no `PipeFields.def` row and the struct-member check does not search `Core.h`.
10. **`PipeInputsTest` is a separate unit target** (the brief allowed it "if the verify-only tests need it"): the fork cases need their own `main()` to point `MOBILEGL_LOG_FILE_PATH` at a file before anything logs, and the fake-context cases need `MobileGL_s`; `PipeCatalogueTest` stays context-free. Its five cases are `GTEST_SKIP` in a pull build and the poison/verify cases skip in a push build without those switches.
11. **A push build without POISON acknowledges `MOBILEGL_PIPE_POISON_OMIT` with `MGLOG_W_ONCE`** ("no stamp exists to omit") instead of the `MGLOG_I("poison omission armed")` line, which is emitted only where the omission can act.
12. **The sticky one-time stamp moved from an unconditional loop into the mask walk** (every class mask carries the seven sticky bits, so the result is identical).
13. `gen_pipe.py --self-test` also runs the field-list coverage check on the real inputs first (`main()` order: calls -> payloads -> coverage check -> coverage -> self-test), so a broken real list fails before the canned controls run.
## Where the tree contradicted the brief's numbers
- **B.7 `GL_Drawing.cpp:907 MemoryBarrier (TextureBarrier)`**: line 907 is the closing brace; the `memoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT | GL_FRAMEBUFFER_BARRIER_BIT);` call is at **906**. Every other B.7 line number held (the patcher checks each target line for its verb; the six XFB sites use abbreviated captured names `beginXfb`/`endXfb`/`pauseXfb`/`resumeXfb`/`deleteXfb`/`bindXfb`, `GL_Getter.cpp:1176` spells `getIntegeri(`).
- **B.7 continuation lines**: seven listed lines are the call's continuation line of a multi-line statement (`GL_Query.cpp` 261, 301, 523, 534, 646, 775; `GL_Sync.cpp` 178 for the 177 entry) - the fill goes before the statement start (260, 300, 522, 533, 645, 774, 177).
- **D8 "all 67 members of `struct RenderStateParameters`"**: the struct has **65** direct data members (`MGPipeValueTypes.h:239-387`, `MAX_VIEWPORTS` is static). `DynamicBackendParameters` has 85 (brief gives no count).
- **D4 `IsCapabilityEnabled` "37 entries, `MGPipeValueTypes.h:168-204`"**: `CapabilityInput` has **35** enumerators before `CapabilityInputCount`; the storage is sized from the enum, so nothing depends on the number.
- **C.1 "7 files change" for c5's regeneration**: only `PipeVerify.inc` changes at c5 (the field lists feed G4 alone); the contract commit already regenerated `PipeFilled.inc` and created `PipeFillPoints.inc`.
- **The integration-gpu count**: 868 entries in build-push's `integration-gpu` label (the brief's "371 + 3 new cases" is E's post-integration figure).
- **`ctest -N` regex** (`'^\s+Test #'`, C.1): as recorded in the contract report, ctest right-aligns the test number, so the padding-tolerant regex is what produces the 2334/2343 name lists.
## Unfinished / notes for the integrator
- Nothing in A's scope is unfinished. The verify library's full `integration-gpu`, the `integration-verify` lane and the 40-trace retrace under verify are D.3 items on the integrated tree (they need B/C's sites on `MGB_CTX` and E's lanes to mean anything).
- `MGB_CTX_LIVE`-guarded `RecordError` and the two `InvalidateCompileEnv` calls at backend init run before any fill; they are sticky and pass the poison from the first live fill on, as designed. If the verify lane finds an `@<none>` Fatal for any other field, the answer is a fill point at that boundary, never a sticky flag.
- The `-j 4` flake of `PointSizeDemotionScenario.TheDemotionIsActuallyArmedWhenTheEnvironmentPinsItOn` reproduced neither alone nor in the pull build; it is not caused by this branch but the integrator's `--rerun-failed -j 1` step stays worth keeping.
- `scan_live_accessors()` will start reporting `MGB_CTX->` reads the day B/C land; today it reports one unread row (`GetBoundTransformFeedbackName`, dead by design).
@@ -1,80 +0,0 @@
# P1 package A (p1-core) — rework round 2 (v2)
Tree `~/w7/p1-core`, branch `p1/core`, base `feat/disaggregated @ 087685d1`, contract `bf86b1ed` (tag `p1/contract`). v1 HEAD was `440d3c52` (reviewed in `core-review-v1.md`: 1 major, 8 minors). Four new commits on top; nothing pushed; working tree clean apart from the three untracked build directories. `core-v1.md` remains the record of c2..c6; this file records the rework and the full re-verification on the new HEAD.
## Commits (oldest first, on top of `440d3c52`)
| sha | subject | review item |
|---|---|---|
| `510ecd92` | `[Fix] (Impl): move the DeleteSync fill of the orphan sweep inside its null-entry guard` | minor 1 |
| `77ecde15` | `[Fix] (Pipe): refuse an eighth sticky row at compile time - the forwarded count equals the generated sticky count` | minor 8 |
| `878db2c4` | `[Fix] (Pipe): re-parse the POISON_OMIT and VERIFY knobs when their Features value changes, not once per process` | minor 4 (enabler) |
| `d9f4698d` | `[Test] (Pipe): give every PipeInputsTest process its own log file, and cover the compare-at-read arm, the three knob parsers and VERIFY_FATAL=0 with forked children` | **M1**, minors 2, 3, 4 |
`git diff --stat 440d3c52..HEAD`: 4 files, +283/-37 — `MobileGL/MG_Backend/MGPipe/PipeInputs.h` (+4), `MobileGL/MG_Impl/GLImpl/Sync/GL_Sync.cpp` (+1/-1), `MobileGL/MG_Impl/Pipe/PipeFill.cpp` (+15/-2), `MobileGL/MG_Test/Pipe/PipeInputsTest.cpp` (rewritten). All inside A's C.5 rows; no B/C/E file, no fixture, no generated file (`gen_pipe --check` clean), no signature that B/C/E code against changed (`MGB_CTX`, `MGP_FILL`, the 63 accessors, the knob names and every log line are as in the contract).
## What was done per review item
- **M1 (shared log path)** — `PipeInputsTest::main()` names the file `mobilegl-pipeinputs-test-<pid>.log` (`ProcessId()` = `getpid`/`_getpid`) and removes it after `RUN_ALL_TESTS`; a forked child inherits the path on purpose (it is the same file the parent reads the delta from). Proof: `ctest --test-dir build-verify -R PipeInputsTest -j 8` × 40 → **0/40 red** (was 40/40 red at v1 per the review); build-push × 10 → 0/10 red; `/tmp/mobilegl-pipeinputs-test*` leftover count after the whole suite: see the verification table.
- **Minor 1 (`GL_Sync.cpp` DeleteSync sweep)** — the fill moved inside `if (backendDeleteSync && syncObject->backendHandle)`, the shape of `GL_Query.cpp`'s `DeleteBackendQuery` sweep; D7 now holds there (a null entry never bumps). Fill count still 83 (Sync 6). Pull build unaffected (`MGP_FILL` is `((void)0)`): G1 re-proven below.
- **Minor 2 (compare-at-read arm had no falsifier)** — `PipeInputsTest.MutatedFieldIsNamedAtRead` (verify build, fork): child sets `Features.PipeVerify = true`, fills `DrawArrays`, reads `GetLineWidth()` (completes, boundary == live) and `GetRenderStateParameters()`, then `pGLContext->SetLineWidth(boundary + 1)` and reads `GetLineWidth()` again; parent asserts `SIGABRT`, the arming line `verify armed - 63 fields, 69 verbs, fatal=1`, `verify read of GetLineWidth (index 0, 0) differs from the live context`, exactly `Fatal{PipeVerifyDiffer, "GetLineWidth@DrawArrays", verb=<parent serial+1>, where=read}` and no `where=entry`. Passes in build-verify; visible skip elsewhere.
- **Minor 3 (name overclaimed)** — `OmittingOneFieldForOneVerbLeavesExactlyThatFieldStale` now loops all 63 fields after the omitted `GenerateMipmap` fill: fresh iff the bit is in `kMGPipeVerbClass[GenerateMipmap]`'s mask and the field is not `GetActiveTextureUnit`.
- **Minor 4 (knob parsers unreachable from a unit test)** — the two latches in `PipeFill.cpp` now key on the VALUE rather than "parsed once": `ParsePoisonOmissionKnob` re-parses when `Features.PipePoisonOmit` differs from the last parsed string; `ArmVerify` re-arms when `Features.PipeVerify` differs from `g_verify.Enabled` (and resets `Corrupt` on re-arm). A lane loads `Features` before its first fill, so lane behaviour is one parse/arm per process as before; a forked test child that sets `Features` after its parent filled gets its own parse. Cost: one `String ==` (two empty strings in every shipped configuration) and one `Bool ==` per fill, push/verify builds only. Five new fork cases cover: the OMIT knob arming through `Features` (arming line + the exact `Fatal{UnmigratedPipeInput, "GetActiveTextureUnit@GenerateMipmap"}`), a bad verb in OMIT (`Fatal{PipeVerifyBadKnob, "MOBILEGL_PIPE_POISON_OMIT=NoSuchVerb:GetActiveTextureUnit": no such verb in kMGPipeVerbNames}`; this one runs in build-push too — the parser is switch-free), the CORRUPT knob through `Features` (`verify corruption armed - GetRenderStateParameters` + `Fatal{PipeVerifyDiffer, "GetRenderStateParameters@DrawArrays", verb=N, where=entry}`), a bad CORRUPT field (`Fatal{PipeVerifyBadKnob, "MOBILEGL_PIPE_VERIFY_CORRUPT=NoSuchField": no such field in kMGPipeInputFieldNames}` and no arming line), and `PipeVerifyFatal = false` (child exits 0 after two fills, log has both `PipeVerifyDiffer` lines at consecutive serials, `fatal=0` in the arming line). The `MGLOG_W_ONCE` for OMIT in a POISON-less push build and for `MOBILEGL_PIPE_VERIFY=1` in a comparator-less build stay lane-verified only (the review's table) — they are one-shot log lines and the review already exercised them.
- **Minor 5 (`IsCapabilityEnabledIndexed` asymmetry)** — record only (below, for the integrator's `MEASUREMENTS.md`); no code change: the push arm's Fatal for a cap other than Blend/ScissorTest is D6's rule for a field the block does not carry, and no backend asks another cap.
- **Minor 6 (GIT@ stamp)** — record: all three libraries still carry `GIT@83b1656` (the stamp is a configure-time value; no reconfigure happened in this round, only incremental builds, which relinked `build-linux/libMobileGL.so` because `GL_Sync.cpp` changed). The G1 comparison below is of the relinked library.
- **Minor 7 (3 vs 7 generated files)** — record only; `gen_pipe --check` clean.
- **Minor 8 (hand-written 7)** — `static_assert(kMGPipeForwardedFieldCount == kMGPipeInputStickyFieldCount)` in `PipeInputs.h` (the generated constant is visible through `MGPipe.h` → `generated/PipeFilled.inc`).
- **Integrator note in the review (vacuous `-R '...Mipmap'` CI regex)** — not A's file; recorded under "for the integrator" below.
## Verification (WSL, `~/w7/p1-core`, HEAD `d9f4698d`; logs `~/w7/p1-core-v2-*.log`, summary `~/w7/p1-core-v2-summary.txt`)
Builds: `cmake --build {build-linux,build-push,build-verify} -j 12` all rc=0 (`~/w7/p1-core-v2-build.log`), `CCACHE_BASEDIR=/home/swung/w7`.
| command | actual output |
|---|---|
| `python3 scripts/gen_pipe.py --check` | rc=0, `gen_pipe: generated files are up to date` |
| `python3 scripts/gen_pipe.py --self-test` | rc=0, 6 controls `tripped as expected`, `positive control OK` |
| `python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0` | rc=0; `.text 10792579 -> 10792579 (+0, +0.000%)`; `Total 17209819 -> 17209819 (+0)`; `27799 -> 27799 defined symbols: 0 added, 0 removed, 0 resized, 0 renamed, 27060 unchanged` (`~/w7/p1-core-v2-symbol.md`) |
| `cmp -l before after \| wc -l` / `readelf -SW` diff | 34 bytes (build-id + the two build stamps, as at v1); section table identical |
| `strings ... \| grep GIT@` | `GIT@83b1656` in all three libraries (configure-time stamp; see minor 6) |
| `grep -rc pGLContext MobileGL/MG_Backend \| sort \| diff - ~/w7/p1-before-pglcontext.txt` | only `MG_Backend/MGPipe/PipeInputs.{cpp,h}:0` appear; every catalogued count unchanged |
| `grep -c pGLContext MobileGL/MG_Backend/MGPipe/PipeInputs.{h,cpp}` | `0` `0` |
| `grep -c "MGP_FILL(" MobileGL/MG_Impl/GLImpl/*/*.cpp` | **83**: Drawing 36, Framebuffer 11, Getter 3, Program 1, Query 18, Sync 6, Texture 8 |
| `ctest --test-dir build-linux -L unit --no-tests=error -j 12` | rc=0, `100% tests passed, 0 tests failed out of 1481` |
| `ctest --test-dir build-push -L unit --no-tests=error -j 12` | rc=0, `100% tests passed, 0 tests failed out of 1481` |
| `ctest --test-dir build-verify -L unit --no-tests=error -j 12` | rc=0, `100% tests passed, 0 tests failed out of 1481` |
| `ctest -N` names vs `~/w7/p1-before-ctest-names.txt` (regex `'^\s+Test\s+#[0-9]+:'`) | 2349 names in each of the three dirs; `comm -23 before now` = **0 removed**; 15 added = the 4 `PipeCatalogue.*` of v1 + 11 `PipeInputsTest.*` (the v1 five + `MutatedFieldIsNamedAtRead`, `PoisonOmitKnobArmsTheOmission`, `BadPoisonOmitKnobIsFatalNamingTheKnob`, `VerifyCorruptKnobNamesTheFieldAtEntry`, `BadVerifyCorruptKnobIsFatalNamingTheKnob`, `VerifyFatalOffLogsTheDivergenceAndContinues`); push and verify name sets identical |
| `ctest -R PipeInputsTest -V`, skip visibility | build-linux 11 `***Skipped` ("push not compiled in"); build-push 9 skipped (5 "verify not compiled in", 4 "poison not compiled in"), `ReadingAFilledFieldCompletes` and `BadPoisonOmitKnobIsFatalNamingTheKnob` pass; build-verify 0 skipped, 11/11 pass |
| **M1 repro, fixed**: `ctest --test-dir build-verify -R PipeInputsTest -j 8` × 40 | **red=0/40** (`~/w7/p1-core-v2-stress-{1..40}.log`); v1 was 40/40 red per the review |
| `ctest --test-dir build-push -R PipeInputsTest -j 8` × 10 | red=0/10 |
| `nm -D --defined-only <lib> \| grep -c MGPipeVerifyInputs` | push 0, verify 1 |
| `ctest --test-dir build-push -L integration-gpu --no-tests=error -j 4` | PENDING-ITEST |
| leftover `/tmp/mobilegl-pipeinputs-test*` after the whole suite | PENDING-LEFTOVER |
| G4 unit (`CorruptedSnapshotFieldIsNamedWithItsSerial`, `VerifyCorruptKnobNamesTheFieldAtEntry`, `MutatedFieldIsNamedAtRead`) | pass in build-verify: entry compare names the corrupted field at its serial (block level and through the knob), and the compare-at-read arm names a mutated field `where=read` — both arms now have a falsifier |
| G5 unit (`OmittingOneField...`, `ReadingAnOmittedFieldAbortsNamingTheVerb`, `PoisonOmitKnobArmsTheOmission`, `ReadingAFilledFieldCompletes`) | pass in build-verify (the two poison-free ones also in build-push): the exact `Fatal{UnmigratedPipeInput, "GetActiveTextureUnit@GenerateMipmap"}`, no `@DrawArrays`, no `GetTextureUnitObject@`; the sibling exits 0 with no `Fatal{` |
| commit hygiene | 4 commits, `[Type] (Scope): ...` + blank + `- ` bullets, no Co-Authored-By/attribution, nothing pushed; `git status` clean; all LF |
Not run (unchanged from v1): the 40-trace retrace under verify and the `integration-verify` lane (E's files, D.3 on the integrated tree).
## Deviations from the brief (with reasons) — additions to v1's list 1-13
14. **The knob latches key on the value, not "once per process"** (`PipeFill.cpp`; the brief/contract said "parsed once at the first fill"). Reason: without it no unit test can reach the parsers or `Fatal{PipeVerifyBadKnob}` (review minor 4); lane behaviour is unchanged because `Features` is loaded before the first fill. Cost is one empty-string compare and one Bool compare per fill in push/verify builds only.
15. **`ArmVerify` resets `Corrupt` on re-arm** — a consequence of 14 (a stale corruption must not outlive the knob value that named it).
16. **v1 deviation 1's "nine guarded-expression sites" is now exactly nine**: the tenth, undeclared one (`GL_Sync.cpp` DeleteSync sweep) was moved inside its guard rather than added to the list, because the sibling `GL_Query.cpp` sweep already had the in-guard shape and D7 is satisfiable there at zero cost.
17. **`PipeInputsTest` has 11 cases, not the brief's/v1's 5**; the six additions are the review's minor 2 and minor 4 falsifiers. `PipeCatalogueTest` unchanged.
18. **`OmittingOneFieldForOneVerbLeavesExactlyThatFieldStale` asserts the whole class mask** (the brief's "verbatim shape" names two fields); superset of the brief's assertions.
## Where the tree contradicted the brief's numbers
Unchanged from v1 (`GL_Drawing.cpp:906` vs 907; `RenderStateParameters` 65 members not 67; `CapabilityInput` 35 not 37; c5 regenerates 1 file not 7; integration-gpu 868 not 371+3; the `ctest -N` regex needs the padded form). New in this round: none.
## Records for the integrator (not A's code)
- **`IsCapabilityEnabledIndexed` asymmetry (review minor 5)**: the push accessor is `Fatal` for a cap other than `Blend`/`ScissorTest` (`PipeInputs.h`, per D6 — the block carries only those two indexed caps), the pull arm returns `false` with `MGLOG_I` (`RenderState.cpp`). Unreachable today (`VulkanRenderer.cpp` asks `Blend` only); a `MEASUREMENTS.md` line is the right place, so that a future `glIsEnabledi`-driven backend read adds a field rather than tripping the Fatal.
- **CI negative-control regex (review section 5)**: `-R 'DirectGLES\.Verify\..*Mipmap'` matches no integration test name on this tree, and E's `PoisonOmissionScenario` name has no "Mipmap"; with `--no-tests=error` the inverted step passes vacuously. The step should also grep the lane log for `Fatal{UnmigratedPipeInput, "GetActiveTextureUnit@GenerateMipmap"}`. The unit-level G5 proof (`ReadingAnOmittedFieldAbortsNamingTheVerb`, `PoisonOmitKnobArmsTheOmission`) is independent of that regex.
- **Compare-at-read in D.3**: `MutatedFieldIsNamedAtRead` is the falsifier the review asked for; a D.3 run reporting zero `where=read` divergences is now known to have a hook that fires when a value diverges.
- The `GIT@` stamp in the three libraries will refresh at the integrator's reconfigure on `~/w7/pipe`.
## Unfinished
Nothing in A's scope. Every major and minor in `core-review-v1.md` is either fixed (M1, minors 1, 2, 3, 4, 8) or recorded above with the reason (minors 5, 6, 7 are bookkeeping/records by the reviewer's own classification).
@@ -1,62 +0,0 @@
# P1 package A (p1-core) — rework round 3 (v3)
Tree `~/w7/p1-core`, branch `p1/core`, base `feat/disaggregated @ 087685d1`, contract `bf86b1ed` (tag `p1/contract`). v2 HEAD was `d9f4698d` (reviewed in `core-review-v2.md`: 1 major, 5 minors). Four new commits on top; nothing pushed; working tree clean apart from the three untracked build directories. `core-v1.md` records c2..c6 and `core-v2.md` the round-2 rework; this file records round 3 and the full re-verification on the new HEAD.
## Commits (oldest first, on top of `d9f4698d`)
| sha | subject | review item |
|---|---|---|
| `30d72c5b` | `[Fix] (Pipe): refuse a stamp of 0 as fresh on both branches - a read before the first fill is Fatal{UnmigratedPipeInput, "<Field>@<none>"}, not default storage` | **M1** |
| `d0ff6475` | `[Fix] (Pipe): re-arm the verify comparator when any of its three knobs changes, not only when PipeVerify does` | minor 2 |
| `12b57055` | `[Docs] (Pipe): record why the forwarders carry no poison check, the InHook re-entry guard, and the Index slot no FillPoints.def row can fill` | minors 1, 3, 5 |
| `44ffafb2` | `[Test] (Pipe): pin the pre-fill window - every stamp of 0 is stale at serial 0, a read before any fill aborts naming "<none>", and the FATAL=0 child leaves through std::exit so the teardown summary is observed` | M1, minor 4 |
`git diff --stat d9f4698d..HEAD`: 6 files, +102/-15 — `scripts/gen_pipe.py` (+6/-2), `MobileGL/MG_Pipe/generated/PipeFilled.inc` (+6/-2, regenerated), `MobileGL/MG_Impl/Pipe/PipeFill.cpp` (+38/-11), `MobileGL/MG_Backend/MGPipe/PipeInputs.h` (+6), `MobileGL/MG_Test/Pipe/PipeCatalogueTest.cpp` (+6), `MobileGL/MG_Test/Pipe/PipeInputsTest.cpp` (+40/-2). All inside A's C.5 rows; no B/C/E file, no fixture. One generated file changed and is committed (`gen_pipe --check` clean). No signature B/C/E code against changed: `MGB_CTX`, `MGP_FILL`, the 63 accessors, the knob names and every log line are as in the contract; the only behavioural change visible to a backend is that a read before the first `MGP_FILL` is now the D6 Fatal instead of default storage.
## What was done per review item
- **M1 (serial-0 window read as fresh)** — `gen_pipe.py` `gen_filled` now emits, and `PipeFilled.inc` carries:
```
const Uint64 gen = state.FilledGen[index];
if (gen == 0) return false;
return kMGPipeInputFieldSticky[index] || gen == state.CurrentVerbSerial;
```
i.e. a stamp of 0 is "never filled" on both branches (the review's `FilledGen != 0 &&` in the non-sticky arm, written once for both). Proof, three layers: (1) the reviewer's own `prefill.cpp` recompiled and relinked against the rebuilt `build-verify` with the same ninja commands (`~/w7/p1-core-v3-prefill/`): `before-first-fill: serial=0 gen[GetLineWidth]=0 fresh=0 live=1`, **rc=134** (SIGABRT), log `Fatal{UnmigratedPipeInput, "GetLineWidth@<none>"}` — both plain and with `Features.PipeVerify = true` before the read (v2 was `fresh=1`, `stored=0 live=7`, rc=0, no log line); (2) `PipeCatalogue.PipeInputFieldsStartUnfilled` asserts every one of the 63 fields (sticky included) stale on a value-initialised `MGPipeFilledState` at serial 0, before its existing serial-1/serial-2 assertions; (3) the fork case `PipeInputsTest.ReadingBeforeAnyFillAbortsNamingNoVerb`: a live context with `SetLineWidth(7)`, no fill in the process (a visible `GTEST_SKIP` if another case of the same process already filled — `gtest_discover_tests` runs each case alone, so it never skips in ctest), the child reads `gPipeInputs.GetLineWidth()`; the parent asserts SIGABRT, exactly `Fatal{UnmigratedPipeInput, "GetLineWidth@<none>"}`, no `PipeVerifyDiffer`, no `verify armed`. In a verify build the child sets `Features.PipeVerify = true` first (the lane's shape). The read hook's arming-at-first-fill is left as is: `MGP_INPUT_CHECK` precedes `MGP_INPUT_VERIFY_READ` in every accessor and a verify build always defines `MOBILEGL_PIPE_POISON` (`PipeInputs.h:21-23`), so a pre-fill read is the poison's Fatal before the hook could matter; a `static_assert(MOBILEGL_PIPE_POISON, ...)` next to the hook in `PipeFill.cpp` pins that dependency so a future change to the POISON definition fails to compile rather than reopening the window. The comment at the serial bump now states the rule.
- **Minor 1 (forwarders carry no `MGP_INPUT_CHECK`)** — behaviour kept (correct per the review); the exception is now declared in the header above the seven forwarders (why: a forward is a live call, `InvalidateCompileEnv` is reached from backend initialisation before any fill and would be `Fatal{...@<none>}` on every start; the sticky stamp is consulted by no accessor and pinned only through `MGPipeInputFieldIsFresh` in tests), and recorded as deviation 19 below and in the integrator notes so P2's tracker does not "fix" it.
- **Minor 2 (`ArmVerify` re-armed only on a `PipeVerify` change)** — fixed rather than only recorded: `VerifyState` gained `CorruptKnob` (the last-parsed `PipeVerifyCorrupt` string) and the latch keys on all three values (`PipeVerify`, `PipeVerifyFatal`, `PipeVerifyCorrupt`). Lane behaviour unchanged (Features loaded before the first fill → one arm per process); cost two Bool compares and one String compare per fill in verify builds only. Deviation 14 is restated below to say exactly this; `878db2c4`'s subject is now true for all three verify knobs.
- **Minor 3 (`GetBufferBindingSlot(Index)`)** — no code change (the null-by-design Index slot and its poison Fatal are D6's rule); the `CopyField` comment now says why no `FillPoints.def` row can fill it (GLContext derives it through the bound VAO's element-buffer slot, `Core.cpp:98-106`) and that no backend reads it today. `MEASUREMENTS.md` is integrator-owned (C.5): the one-line record for both this and `IsCapabilityEnabledIndexed` is under "Records for the integrator" below.
- **Minor 4 (`VerifyFatalOffLogsTheDivergenceAndContinues` never saw the summary)** — the child now leaves through `std::exit(0)` instead of `_exit(0)`, so `VerifyState::~VerifyState` runs in the child, and the parent asserts `MGPipe: verify summary - 2 divergence(s) survived MOBILEGL_PIPE_VERIFY_FATAL=0` in the log delta. Passes in build-verify (the child's static destructors run against the forked copy of a fake context; stdio was flushed before the fork, so nothing is printed twice). The lane-level `summary=1` is still re-run below.
- **Minor 5 (hook re-reads the whole field; `InHook` guard)** — comment at the site: the per-read cost (`GetRenderStateParameters` re-copies and compares the struct, `GetProgramForDraw` re-joins the link) as a thing to keep in mind when reading the verify lane's wall time, and what `InHook` prevents (a `GetProgramForDraw`-triggered backend re-entry reaching another accessor becomes a plain load, never a second hook, never a report against a half-copied scratch). Recorded for D.3 below.
## Verification (WSL, `~/w7/p1-core`, HEAD `44ffafb2`; logs `~/w7/p1-core-v3-*.log`, summary `~/w7/p1-core-v3-summary.txt`, build/prefill log `~/w7/p1-core-v3-build.log`)
Builds: `cmake --build {build-linux,build-push,build-verify} -j 12` after the patch, all rc=0 (`CCACHE_BASEDIR=/home/swung/w7`); the verification pass re-ran them (`ninja: no work to do` × 3).
VERIFICATION_TABLE
Not run (unchanged from v1/v2): the 40-trace retrace under verify and the `integration-verify` lane (E's files, D.3 on the integrated tree). Not built per intermediate commit: the split of `PipeFill.cpp` between `30d72c5b` / `d0ff6475` / `12b57055` was checked hunk by hunk (each commit's hunks are self-contained: the static_assert and comments in A, the `CorruptKnob` member and its uses together in B, comments only in C); only the final tree was compiled.
## Deviations from the brief (with reasons) — additions/restatements to v1's 1-13 and v2's 14-18
14. **(restated)** The knob latches key on the value, not "once per process": `ParsePoisonOmissionKnob` on `Features.PipePoisonOmit`; `ArmVerify` on all three of `Features.PipeVerify`, `PipeVerifyFatal`, `PipeVerifyCorrupt` (as of `d0ff6475`; v2 keyed on `PipeVerify` alone and latched the other two). Reason and cost as in v2.
19. **The seven F-class forwarders carry no `MGP_INPUT_CHECK` / `MGP_INPUT_VERIFY_READ`** (D4: "every accessor body"). Reason: a forward is a live call with no stored value; `InvalidateCompileEnv` is reached from backend initialisation (`BackendObject_DirectVulkan.cpp:388-390,786-788`) before any verb fills, where a check would be `Fatal{InvalidateCompileEnv@<none>}` on every start. Consequence: the sticky stamp (`FilledGen = 1` on the first live fill) and the `Sticky → FilledGen != 0` branch are consulted by no accessor; they are pinned only by `PipeCatalogue.PipeInputFieldsStartUnfilled` / `StickyFieldsAreExactlyTheSeven` and `PipeInputsTest.OmittingOneField...` / `EveryVerbFills...` through `MGPipeInputFieldIsFresh` directly. Declared in the header (`12b57055`).
20. **`MGPipeInputFieldIsFresh` refuses a stamp of 0 on the sticky branch too** (D6 words the sticky branch as `FilledGen != 0`, which it still is; the non-sticky arm gained the same guard). No semantic change to the sticky branch.
21. **The read hook still arms at the first fill** (D8: "Arming, once, at the first fill under verify" — unchanged); the pre-fill window is covered by the poison, and `static_assert(MOBILEGL_PIPE_POISON)` in the verify block makes that dependency a build-time fact. The review's alternative (arm inside the hook when `!Parsed`) was not taken: in every build that compiles the hook the poison is on, so it would be dead code.
22. **`PipeInputsTest` has 12 cases** (v2: 11; brief: 5): `ReadingBeforeAnyFillAbortsNamingNoVerb` added.
23. **`VerifyFatalOffLogsTheDivergenceAndContinues`'s child exits via `std::exit(0)`**, the one child in the file that runs static destructors on purpose (to observe the summary line); every other child still `_exit`s.
## Where the tree contradicted the brief's numbers
Unchanged from v1/v2 (`GL_Drawing.cpp:906` vs 907; `RenderStateParameters` 65 members not 67; `CapabilityInput` 35 not 37; c5 regenerates 1 file not 7; integration-gpu 868 entries; the `ctest -N` regex needs the padded form). New in this round: none. One brief sentence that the tree did not honour before this round and does now: D6's "starts at 1 so `FilledGen == 0` means never filled" — true of the stamp values since c2, true of the read predicate only since `30d72c5b`.
## Records for the integrator (not A's code)
- **`MEASUREMENTS.md` one-liner for the two accessors where "add the row" does not apply**: `GetBufferBindingSlot(BufferTarget::Index)` (polymorphic on `GLContext` — the bound VAO's element-buffer slot, `Core.cpp:98-106`; null in the block by design) and `IsCapabilityEnabledIndexed(cap ∉ {Blend, ScissorTest})` (the block carries only those two indexed caps) are push-arm `Fatal{UnmigratedPipeInput, ...}` that no `FillPoints.def` row can repair; both unreachable today (every backend slot read is DrawIndirect/DispatchIndirect/Parameter/PixelPack; `VulkanRenderer.cpp` asks `Blend` only). A future backend read of either adds a field, not a row.
- **D.3 gains a failure mode** (the review's section 5, now real): any backend read reached from EGL/init before the first verb is `Fatal{UnmigratedPipeInput, "<Field>@<none>"}` in the verify lane. Per E's risk table the answer is a fill point at that boundary (an EGL virtual), never a sticky flag or a `FillPoints.def` row. The scout catalogue finds no such read on this tree (the two out-of-verb pulls are the forwarded, unchecked `InvalidateCompileEnv` calls), so no lane is expected to trip today.
- **D.3 wall-time reading**: the compare-at-read hook re-reads and compares the whole field per backend accessor call (`GetRenderStateParameters` = a struct copy + 65-member compare per read; `GetProgramForDraw` = a link join per read); within the 5-10× verify budget by design, but the verify lane's time is not the poison's cost.
- **The forwarders' missing check is deliberate** (deviation 19): P2's tracker should not add one.
- The v2 records stand: the vacuous `-R 'DirectGLES\.Verify\..*Mipmap'` CI regex (grep the lane log for the exact Fatal instead), the `GIT@` stamp refresh at reconfigure.
## Unfinished
Nothing in A's scope. M1 is fixed with the three proofs above; minors 1, 3, 5 are recorded in code comments and here (the `MEASUREMENTS.md` line is the integrator's file); minors 2 and 4 are fixed in code and covered by tests.
@@ -1,70 +0,0 @@
# P1 package B — p1-espryt — adversarial review v1
Reviewed: tree `~/w7/p1-espryt`, branch `p1/espryt`, HEAD `f4ea84c5` (one commit on top of `p1/contract` = `bf86b1ed`). Implementer's result: `p1-results/espryt-v1.md`. Brief: `BRIEF-P1.md` A, B (D1–D13), C.2, C.5, D, E.
Stance: I tried to refute correctness, completeness and the G1/G2/G7 gate claims. Every number below was re-derived by me; logs under `~/w7/p1-espryt-review-*` and `~/w7/p1-espryt-review-int-*`; scripts under `scratchpad/wf4/espryt-review/`. The tree was left exactly as found (`git status`: only `build-linux/`, `build-push/` untracked; `git diff --stat` empty). The one throwaway worktree I created (`~/w7/p1-espryt-review-int`, branch `tmp/p1-espryt-review-int`) was removed afterwards.
## Verdict
**Approved — zero majors.** The package is a textually pure conversion of exactly the 122 lines the brief assigns to it, in exactly the four files it owns, and the pull build is symbol- and size-identical to the `087685d1` baseline. The one deviation from D9 (the hoisted `auto& live = *MGB_CTX;` in the fb-slot cache refill) is declared, justified with a bisect, semantically equivalent in both arms, and is the shape that yields `.text +0` where the literal D9 text does not.
## What I re-ran (commands + observed output)
| check | command (in `~/w7/p1-espryt`) | observed |
|---|---|---|
| diff scope | `git diff --stat p1/contract..HEAD` | 4 files, +129/−124: `DirectGLES.cpp` 190, `Managers.cpp` 47, `MultiDraw.cpp` 11, `Utils.cpp` 5 — nothing outside C.5's B row; no fixture touched |
| textual purity of every changed line | `scratchpad/wf4/espryt-review/diffcheck.py` over `git diff p1/contract..HEAD` (pairs `-`/`+` lines per hunk; a pair is "pure" iff `+` with `MGB_CTX->`→`MG_State::pGLContext->` equals `-`) | 86 hunks, **112 pure arrow substitutions**; the only non-pure pairs are the 4 include insertions, the `:143` decltype line (an arrow inside `decltype`, pure by the same rule), the 143–155 block, and the 8 Managers.cpp D9 lines (`if (MG_State::pGLContext)`→`if (MGB_CTX_LIVE)` ×3, `&& MG_State::pGLContext &&`→`&& MGB_CTX_LIVE &&`, `if (MG_State::pGLContext && `→`if (MGB_CTX_LIVE && `, `!= nullptr`→`MGB_CTX_LIVE` ×3). No accessor renamed, no argument changed, no evaluation order moved, no `const&` binding lost. |
| the touched old-line set equals the brief's site list | `scratchpad/wf4/espryt-review/linecheck.py` (old-side line numbers of every `-` line vs C.2's table + D9's 144/147/150) | `DirectGLES.cpp` removed 94 = brief 94, `Managers.cpp` 23 = 23, `MultiDraw.cpp` 5 = 5, `Utils.cpp` 2 = 2; `removed-not-in-brief []` and `brief-not-removed []` for all four |
| G2 (this package's share) | `grep -rc "pGLContext" MobileGL/MG_Backend/DirectGLES \| grep -v ":0$"` | empty (all 10 files 0) |
| no site outside ownership touched | `grep -rc "pGLContext" MobileGL/MG_Backend \| sort \| diff ~/w7/p1-before-pglcontext.txt -` | only the four DirectGLES lines change (92/23/5/2 → 0) plus the two contract-created `MGPipe/PipeInputs.{h,cpp}:0` rows; every DirectVulkan count identical to the baseline |
| MGB_CTX counts | per-file `grep -o` | arrows 91/15/5/2 (brief: 91 15 5 2); `MGB_CTX` tokens DirectGLES.cpp 93 (= 91 + `*MGB_CTX` + `MGB_CTX_IDENTITY`), `MGB_CTX_LIVE` Managers.cpp 8 (brief: 8), `MGB_CTX_IDENTITY` 1 |
| include placement (D3) | `grep -n` | `DirectGLES.cpp:18` Core.h → `:19` switch; `MultiDraw.cpp:11`→`:12`; `Utils.cpp:19`→`:20`; `Managers.cpp:9` `"Managers.h"` → `:10` switch (Managers.cpp does not include Core.h directly, per D3) |
| CRLF | `grep -c $'\r'` ×4 | 0 0 0 0 |
| gen_pipe | `python3 scripts/gen_pipe.py --check` | rc=0, "generated files are up to date" (63 fields, 7 sticky, 69 verbs, 9 classes) |
| pull build | `cmake --build build-linux -j 12` | rc=0 |
| **G1** | `python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0 --json … --markdown …` | `.text 10792579 -> 10792579 (+0)`, `.data/.bss/.rodata +0`, `27799 -> 27799 defined symbols: 0 added, 0 removed, 0 resized, 0 renamed`, `27060 normalised names, 27060 unchanged` |
| nm set | `nm --defined-only … \| awk '{print $NF}' \| sort` before/after, `diff` | 0 lines |
| raw `.text` bytes | `objcopy -O binary --only-section=.text` ×2, `cmp -l` | sizes equal; **39 bytes differ**, deltas +1 (23 bytes) and +2 (16 bytes); mapped through `nm -S` to exactly the 6 functions the implementer names (`SyncMipmapsToBackend` 9, `SyncBuiltinSamplerToBackend` 8, `CopyTexSubImage2D` 7, `SyncTextureParamsToBackend` 6, `CopyTexImage2D` 5, `GetTexImage` 4) — the `__LINE__` immediates in `ErrorInfo` constructions shifted by the inserted include (+1) and, after `:148`, the hoisted line (+2). Sizes unchanged, so G1 as decoded ("`.text` byte delta of zero" = size) holds; see minor 1 for the wording |
| push build | `cmake --build build-push -j 12` | rc=0; `nm -C …/DirectGLES.cpp.o`: `gPipeInputs` refs 2, `pGLContext` 0 |
| **push arm at DEBUG level** (never built by anyone: both INFO builds compile out `DirectGLES.cpp:4200-…`, which holds the converted site at `:4217`) | `scratchpad/wf4/espryt-review/10_debugpush.sh`: the four TUs' `build-push/compile_commands.json` commands with `-DMOBILEGL_LOG_ACTIVE_LEVEL=MOBILEGL_LOG_LEVEL_DEBUG` and `-fsyntax-only` (this also arms `MOBILEGL_PIPE_POISON` and the `MGP_INPUT_CHECK` bodies) | `DirectGLES.cpp rc=0 errors=0`, `Managers.cpp 0/0`, `MultiDraw.cpp 0/0`, `Utils.cpp 0/0` (twice each: static + shared targets) |
| G7 names | width-tolerant regex `grep -E '^\s*Test\s+#[0-9]+:'` | 2334 = 2334, `comm -23` empty, `comm -13` empty. The brief's own regex `'^\s+Test #'` yields **1335** on this build (confirmed: ctest pads to `Test #1:` above 999 tests) — the implementer's "tree vs brief" item 2 is correct and the integrator's D.1 step needs the tolerant form |
| unit, pull | `ctest --test-dir build-linux -L unit --no-tests=error -j 8` | rc=0, 1466 (3 skipped by design) |
| unit, push (contract tree) | `ctest --test-dir build-push -L unit --no-tests=error -j 8` | rc=8, 18 failed / 1466 — the same 18 the implementer lists (contract filler copies nothing; expected per C.2 step 4) |
| integration lane, pull | `ctest --test-dir build-linux -L integration-gpu -R '^DirectGLES\.' --no-tests=error -j 4` | **441/441 passed, rc=0**. The implementer's run had 2 failures (`UnlocatedIoBlockScenario.TheEmulationIsActuallyArmedWhenTheEnvironmentPinsItOn`, `PointSizeDemotionScenario.TheDemotionIsActuallyArmedWhenTheEnvironmentPinsItOn`); on the identical binary they pass here, which is consistent with the "shared per-lane log file under `-j 4`" flake they diagnosed (`UnlocatedIoBlockScenario.cpp:362-371`: the case trusts bytes after `LibraryLogSize()` in a file every process of the lane appends to). Pre-existing, not this package's |
| D10 / PipeStats constraints | `git diff -U0 p1/contract..HEAD \| grep -c "SyncPersistentMappedRange\|SyncGpuWrites"` / `\| grep -c AddCalls` | 0 / 0 |
| commit hygiene | `git log -1 --format=%B`; `git branch -r \| grep p1/` | subject exactly the C.2 step-5 text, blank line, four `- ` bullets; no attribution lines; no remote branch (not pushed) |
## Integrated-tree check (throwaway, `p1/core` HEAD `83b16561` = c1…c5 incl. the 83 fill points + `f4ea84c5` cherry-picked as `4c92f727`)
INTEGRATED_SECTION_PLACEHOLDER
## Deviations from the D-decisions, audited
1. **D9 `:150` shape** — declared. Committed: `auto& live = *MGB_CTX;` once, then `&live.GetFramebufferBindingSlot(i)` in the loop. Pull arm: `*MG_State::pGLContext` is `UniquePtr::operator*` → `GLContext&`, the same object the old `ctx` pointed at; behaviour when no context is live is identical to before (both the old `ctx->…` on a null `get()` and the new `*pGLContext` on a null pointer are only reached when the cached identity differs, i.e. never in that state). Push arm: `*(&gPipeInputs)` → `PipeInputs&`, whose `GetFramebufferBindingSlot` (`PipeInputs.h:494-500`) returns the live slot reference the filler stored; the identity key stays `MGB_CTX_IDENTITY` = `gPipeInputs.ContextIdentity()` so a recreated context still invalidates. I verified the committed shape is `.text +0` (above); I did **not** independently rebuild the literal D9 variant — the implementer's `~/w7/p1-espryt-bisect.txt` (v4/v5: +32, `SyncCurrentProgram` 1494→1510, `ForceBindCurrentFBO` 181→190, `BlitNamedFramebuffer` 592→593; v8 = committed: 189968 = baseline) is internally consistent and the TBAA explanation is the standard one for a pointer store next to a `unique_ptr` load. The deviation is the better reading of D9's own "if `.text` moves, this is the first suspect".
2. **`:143` keeps `std::remove_reference_t<…>`** — D9 abbreviated it; the alias must be the slot type, not a reference. Correct.
3. **Push lane not demonstrated in the package's own tree** — correct at the time (c3 had not landed); now demonstrated by me on the integrated throwaway tree, see above.
Undeclared deviations found: **none**.
## Majors
None.
## Minors
1. **Wording "pull build byte-identical" (commit subject, brief-dictated) vs. 39 differing `.text` bytes.** G1 is size/symbol based and holds (0/0/0/0, `.text +0`), and the body of the commit discloses the `__LINE__` immediates, but the integrator's `MEASUREMENTS.md` P1 attribution line ("expected: 0 bytes; 58 lines converted, none code-bearing", brief D.5) should say "sizes identical; 39 bytes of `__LINE__` immediates in 6 `DirectGLES.cpp` functions from the inserted include (+1) and the hoisted cache line (+2)" rather than "0 bytes". Integrator doc item, not a code change.
2. **Push-build unit tests that drive backend helpers directly** (`DirectGLESSanity.*`, `DirectGLESTextureSync.*`, `FramebufferTest.*`, `TextureTest.*` families, 18 on the contract tree) read `gPipeInputs` with no verb ever filled — they bypass `GLFunctionsTable` and therefore every `MGP_FILL`. Whatever their state on the integrated tree (recorded in the section above), this is a design consequence of D7's placement rule, not of this package's textual conversion; the implementer flagged it for A/integrator (D.2 expects "unit + integration-gpu green" under push). Recording so it is tracked.
3. **Brief D.1 / C `ctest -N` regex** (`'^\s+Test #'`) undercounts to 1335 on a 2334-test build; the implementer's tolerant form (`'^\s*Test\s+#[0-9]+:'`) is the one the integrator must use, or `comm -23` reports 999 phantom losses.
4. The two `ActuallyArmedWhenTheEnvironmentPinsItOn` itests are a `-j 4` flake in package E's file set (`MG_IntegrationTest/**`); the ambient lanes share one `MOBILEGL_LOG_FILE_PATH` per lane. Not this package's; noted for E/integrator.
## Where the tree contradicted the brief
- Only the `ctest -N` regex (minor 3). Every site count, line number and per-file total in C.2 matched the tree exactly (line check above).
## Hunted for and not found
- A converted site with a different accessor / dropped null check / moved evaluation / lost `const&`: none (112 pure substitutions + 1 decltype; the only `GetRenderStateParameters()` binding that is not `const auto&` is `DirectGLES.cpp:4158`'s `const FloatVec4& cc = …ClearColor`, a member reference — no 1168-byte copy).
- A site left on `pGLContext` behind a macro: the four files have 0 tokens; the one converted site under a preprocessor conditional (`DirectGLES.cpp:4217`, `LOG_LEVEL_DEBUG` block) compiles under the push arm at DEBUG.
- A site touched in a shared or unowned file: none (diff is the four owned files).
- Reformatting beyond touched lines: none (diff = 122 site lines + 4 includes + 1 hoisted line + the `:150` `&ctx->`→`&live.` line).
- A `PipeStats` literal or D10 sync site on a changed line: none.
@@ -1,79 +0,0 @@
# P1 package B — p1-espryt — result v1
Tree `~/w7/p1-espryt`, branch `p1/espryt`, branched from tag `p1/contract` (`bf86b1ed`). Working tree clean after the commit. Nothing pushed.
## Commits (p1/contract..p1/espryt)
| hash | subject |
|---|---|
| `f4ea84c5f786ff556e8c41508072ad3782bee3ca` | `[Refactor] (Espryt): route every frontend read through MGB_CTX - 113 arrow sites sed'd, 9 non-arrow lines converted (the fb-slot cache keys on MGB_CTX_IDENTITY); pull build byte-identical` |
Files: `MobileGL/MG_Backend/DirectGLES/{DirectGLES.cpp, Managers.cpp, MultiDraw.cpp, Utils.cpp}` only (4 files, +129/−124). No other file touched; no fixture binary touched.
## What was done (brief C.2 steps 1–5)
1. `#include <MG_Pipe/PipeInputsSwitch.h>` inserted per D3: `DirectGLES.cpp` after its `Core.h` include (old :18 → new :19), `MultiDraw.cpp` after :11 (→ :12), `Utils.cpp` after :19 (→ :20), `Managers.cpp` after its `Managers.h` include (old :9 → new :10). Includes were inserted after all line-number-addressed edits, so every brief line number was applied against the unshifted file.
2. Mechanical `MG_State::pGLContext->` → `MGB_CTX->` over the four files: 91 + 15 + 5 + 2 = **113 occurrences on 113 lines**, matching the brief's per-file arrow table exactly (verified line-for-line before the sed: DirectGLES.cpp 143…9510, Managers.cpp 3645…8751, MultiDraw.cpp 45,51,52,87,95, Utils.cpp 2297,2301).
3. The 9 non-arrow lines per D9: `Managers.cpp` 3644, 3844, 8750 (`if (MG_State::pGLContext) {` → `if (MGB_CTX_LIVE) {`), 3773 (`&& MG_State::pGLContext &&` → `&& MGB_CTX_LIVE &&`), 4735 (`if (MG_State::pGLContext && ` → `if (MGB_CTX_LIVE && `), 7192/7200/7203 (`MG_State::pGLContext != nullptr` → `MGB_CTX_LIVE`; their `?` arms 7193/7201/7204 took the sed); `DirectGLES.cpp` 143–155 block: `:144` → `static const void* g_fbSlotCacheContext = nullptr;`, `:147` → `const void* ctx = MGB_CTX_IDENTITY;`, `:150` → see deviation 1.
4. Pull build, symbol report, push build, lanes — below.
5. One commit, message per brief plus `- ` bullets.
## Verification (WSL, `~/w7/p1-espryt`; logs under `~/w7/p1-espryt-*`)
| command | result |
|---|---|
| `grep -rc "pGLContext" MobileGL/MG_Backend/DirectGLES \| grep -v ":0$"` | **empty** (all 10 files report 0) |
| `for f in …; do grep -o 'MGB_CTX->' … \| wc -l; done` | DirectGLES.cpp **91**, Managers.cpp **15**, MultiDraw.cpp **5**, Utils.cpp **2** (the brief's "91 15 5 2"; `MGB_CTX` tokens total in DirectGLES.cpp = 93 = 91 arrows + `*MGB_CTX` in the cache refill + `MGB_CTX_IDENTITY`) |
| `grep -c "MGB_CTX_LIVE" MobileGL/MG_Backend/DirectGLES/Managers.cpp` | **8** |
| `grep -c "MGB_CTX_IDENTITY" MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp` | 1 |
| `cmake --build build-linux -j 12` | rc=0 (`[49/49] Linking … MobileGLIntegrationTest`) |
| `python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0 --json … --markdown ~/w7/p1-espryt-symbol.md` | `.text 10792579 -> 10792579 (+0)`, `.data/.bss/.rodata +0`, `27799 -> 27799 defined symbols: 0 added, 0 removed, 0 resized, 0 renamed`, `27060 normalised names, 27060 unchanged` — **G1: 0/0/0/0, .text +0** |
| `nm --defined-only` name set, before vs after | diff **empty** (27799 = 27799) |
| raw `.text` byte compare (`objcopy -O binary --only-section=.text` + `cmp -l`) | 39 bytes differ in 6 DirectGLES.cpp functions (`SyncMipmapsToBackend`, `SyncBuiltinSamplerToBackend`, `SyncTextureParamsToBackend`, `CopyTexSubImage2D`, `CopyTexImage2D`, `GetTexImage`), function sizes unchanged. Disassembly diff: every difference is a `movl $0xNNN,0x8(%rax)` immediate = a `__LINE__` value stored into an `ErrorInfo` (e.g. `0xf0e`→`0xf0f` = 3854→3855): 23 bytes are +1 (lines after the inserted include), 16 are +2 (DirectGLES.cpp lines after the include *and* the hoisted `auto& live` line). The object built with **only** the include already shows these; the seds and the D9 rewrites add no byte. Not a gate item (G1 is symbol/size based), recorded for completeness. |
| `ctest --test-dir build-linux -L unit --no-tests=error --output-on-failure -j 8` | rc=0, **100% tests passed, 0 failed out of 1466** (on the final `.so`) |
| `ctest --test-dir build-linux -L integration-gpu -R '^DirectGLES\.' --no-tests=error --output-on-failure -j 4` | 441 tests; **439 passed, 2 failed**: `DirectGLES.UnlocatedIoBlocks.UnlocatedIoBlockScenario.TheEmulationIsActuallyArmedWhenTheEnvironmentPinsItOn`, `DirectGLES.PointSizeDemotion.PointSizeDemotionScenario.TheDemotionIsActuallyArmedWhenTheEnvironmentPinsItOn` — both are "text appended to the lane's `MOBILEGL_LOG_FILE_PATH` log after the case started" assertions (`UnlocatedIoBlockScenario.cpp:516`, `PointSizeDemotionScenario.cpp:512`). Re-run of the 10 `ActuallyArmedWhenTheEnvironmentPinsItOn` cases: `-j 1` **10/10 pass**, `-j 4` **10/10 pass**. The same two cases also failed identically in the push lane of a tree that did **not** contain this commit (bare `p1/core` c2, see below), and the pull `.so` is symbol- and size-identical to the baseline, so this is a pre-existing parallel-lane flake of the shared per-lane log file, not a regression of this package. Lane label used: `integration-gpu` (the tree has only `integration-gpu` and `unit`; the `-R '^DirectGLES\.'` selects the DirectGLES entries). |
| `ctest -N` name diff vs `~/w7/p1-before-ctest-names.txt` | `comm -23` **empty**, `comm -13` **empty**, 2334 = 2334 — see "tree vs brief" item 2 for the regex. |
| `cmake --build build-push -j 12` (`MOBILEGL_PIPE_PUSH=ON`) | rc=0 (`[55/55] Linking …`); the DirectGLES.cpp object references `gPipeInputs` and no `pGLContext` (`nm`: 0 / 2) |
| `ctest --test-dir build-push -L unit` on the **contract** tree | 18 failed / 1466 (expected on the contract tree: the c1 filler copies nothing, C.2 step 4 note) |
| `ctest --test-dir build-push -L integration-gpu -R '^DirectGLES\..*ClearThenReadPixels'` on the contract tree | 0/5 pass, as the brief predicts for the contract tree |
| D10: `git diff -U0 … \| grep -c "SyncPersistentMappedRange\|SyncGpuWrites"` on changed lines | **0** — the 8 SPMR + 3 SGW Espryt sites are untouched (they are not on any converted line) |
| `git diff -U0 … \| grep -c AddCalls` on changed lines | 0 — `PipeStats` literals untouched |
| CRLF check on the four files | none |
### Push-build proof against the real filler (throwaway, removed afterwards)
Because `p1/core` had progressed to c2 (`3aa4d8af`, the per-class filler) while this package ran, `p1/espryt` was cherry-picked onto `p1/core@3aa4d8af` in a throwaway worktree (`~/w7/p1-espryt-onto-core`, branch `tmp/p1-espryt-onto-core`; **both deleted after the run**, logs kept as `~/w7/p1-espryt-onto-core-*.log`):
- cherry-pick applied cleanly (disjoint files); `cmake --build build-push` rc=0.
- `ctest -L unit` (push): 18 failed / 1466 — the same 18 as on the contract tree: `DirectGLESSanity.{BindsAMultisampleTextureDespiteTheDefaultMipmapFilter, BindingZeroClearsPreviousNativeTextureBinding}`, `NegativeApiErrorsTest.MultiBindTextures{RejectsBadRangesAndNames, BindsToTheTexturesOwnTarget}` (aborted), `FramebufferTest.{DrawIntoAWidenedDrawBuffer…, ClearIntoAWidenedDrawBuffer…, ApplicationAlphaMaskOff…, DualSourceBlendFactorsReachTheDriver…, DualSourceBlendIsDeclined…, DualSourceFactorsAreDeclinedEvenWithBlendingDisabled, DualSourceFactorsWithBlendingDisabledStillReachACapableDriver}`, `TextureTest.StorePackedWordsToClientCopiesWordsVerbatimUnderPackParams` (aborted), + 6 more of the same families (full list in `~/w7/p1-espryt-onto-core-unit.log`).
- `ctest -L integration-gpu -R '^DirectGLES\.'` (push): **68 passed / 373 failed** (SegFault or `Subprocess aborted`). A single case run with `MOBILEGL_LOG_FILE_PATH` shows the reason: `MGPipe: Fatal{UnmigratedPipeInput, "GetImageTextureBinding@<none>"}` — the verb name is `<none>`, i.e. **no verb was ever filled in the process**. Cause: `p1/core` at c2 (and at its current head `275dd3ed`, c4) carries **0** `MGP_FILL(` statements in `MobileGL/MG_Impl/GLImpl` (c3, the 83 fill points, has not landed yet). So the push lane cannot be green on any tree yet; this is not a package-B defect and not a fill-table gap (those would name a real verb). **The brief's "rerun after rebasing onto p1/core c2+ and it must be green" has to be re-run by the integrator once c3 is on `p1/core`** (D.2).
- The 18 push-build unit failures are the same phenomenon in the unit binaries (backend helpers driven directly by the tests, never through a fill point); with c3 landed most should turn green, but tests that call backend entry points without going through `GLFunctionsTable` will still read `@<none>` and are an A/integrator item (recorded here so it is not a surprise in D.2).
## Deviations from the brief (with reason)
1. **D9 line 150 (`DirectGLES.cpp` cache refill loop).** D9 spells `g_fbSlotCache[i] = &MGB_CTX->GetFramebufferBindingSlot(static_cast<FramebufferTarget>(i));`. Built that way the pull build is **not** byte-identical: `.text +32`, 3 resized symbols (`PrgramImpl::SyncCurrentProgram` 1494→1510, `ForceBindCurrentFBO` 181→190, `BlitNamedFramebuffer` 592→593) — exactly the "first suspect" D9 names. Bisected by rebuilding only the DirectGLES.cpp object per cumulative variant (`~/w7/p1-espryt-bisect.txt`): include alone 0, +91 arrow seds 0, +`const void*` cache (144) 0, **+line 150 via `MGB_CTX->` = +32**, +line 147 `MGB_CTX_IDENTITY` 0. Reason: `g_fbSlotCache[i] = …` stores a pointer, and under clang's TBAA any pointer store may alias the `unique_ptr`'s own pointer, so `MGB_CTX->` inside the loop re-loads `pGLContext` per iteration (the original read through the local `ctx`). Committed shape hoists the dereference once:
```cpp
const void* ctx = MGB_CTX_IDENTITY;
if (ctx != g_fbSlotCacheContext) {
auto& live = *MGB_CTX;
for (SizeT i = 0; i < g_fbSlotCache.size(); ++i) {
g_fbSlotCache[i] = &live.GetFramebufferBindingSlot(static_cast<FramebufferTarget>(i));
}
g_fbSlotCacheContext = ctx;
}
```
Measured: `.text +0`, 0/0/0/0. Semantics identical in both arms (pull: `GLContext&`; push: `PipeInputs&`, the identity compare still uses `MGB_CTX_IDENTITY`, so a recreated context invalidates the cache under push too). One extra line inside the touched 143–155 block; no `pGLContext` token. If the integrator prefers the literal D9 text, the cost is the attributed +32 above (both variants' numbers are in the bisect file) — the "no reformatting beyond the touched lines" constraint is respected either way.
2. **Line 143** keeps `std::remove_reference_t<decltype(MGB_CTX->GetFramebufferBindingSlot(FramebufferTarget::Draw))>` (D9 abbreviates it as `decltype(MGB_CTX->…)`); it is the sed result and the `remove_reference_t` is required for the alias to be the slot type.
3. **Push-lane green not demonstrated** (see above): impossible on any tree until c3 lands; the brief's step-4 expectation of a `Fatal{UnmigratedPipeInput}` on the contract tree was reproduced instead.
## Where the tree contradicted the brief's numbers
1. None for the site counts: DirectGLES.cpp 92 lines / 91 arrows, Managers.cpp 23 / 15, MultiDraw.cpp 5 / 5, Utils.cpp 2 / 2, 9 non-arrow lines at exactly the listed line numbers; `~/w7/p1-before-pglcontext.txt` per-file numbers match.
2. **Baseline `ctest -N` name file vs the brief's own extraction regex.** `~/w7/p1-before-ctest-names.txt` holds 2334 names; the brief's pipeline `grep -E '^\s+Test #'` applied to the same build lists only 1335 (both in `~/w7/pipe/build-linux` today and in this tree) because with 2334 tests ctest pads the number to four columns (`Test #1:` … `Test #1000:`), so the single-space regex matches only #1000–#2334. Width-tolerant form used here: `ctest --test-dir build-linux -N | grep -E '^\s*Test\s+#[0-9]+:' | sed -E 's/^\s*Test\s+#[0-9]+: //' | sort` → 2334 names, `comm` both ways empty. The integrator's D.1 `comm -23` step needs the same regex or it reports 999 "lost" names (all of `TextureTest.*`, `ProgramUtilTest.*`, … i.e. tests #1–#999).
3. `SyncCurrentProgram` (the symbol the literal D9 line 150 grows) lives in `DirectGLES.cpp` (`PrgramImpl::SyncCurrentProgram`), not `Managers.cpp`; the brief's `Managers.cpp:7193-7204` reference in D7 is `AttachPassthroughTessControlStage`'s ternaries (converted per D9, byte-neutral).
4. `p1/core` moved during this package: c2 `3aa4d8af`, then c4 `275dd3ed` (comparator) — c3 (83 fill points) not yet present at the time of writing.
## Unfinished
- Push-lane green (`ctest --test-dir build-push -L integration-gpu -R '^DirectGLES\.'`) — blocked on `p1/core` c3; re-run at integration (D.2). Everything else in the package's verification list is done.
- The two `ActuallyArmedWhenTheEnvironmentPinsItOn` itests are a pre-existing `-j 4` flake (pass serially and in isolation, fail identically without this commit); not fixed here (`MG_IntegrationTest/**` is package E's file set).
@@ -1,260 +0,0 @@
# Adversarial review — package `fix-core` (P1 lane findings F1 + F2)
Reviewer ran everything independently in WSL `~/w7/p1-fix-core` (branch `p1/fix-core`, HEAD
`9bd6d394`, three commits on top of `feat/disaggregated@97b997d5`). Tree left exactly as found
(`git status --porcelain` clean apart from the three untracked build directories, HEAD unchanged).
**Verdict: approved — 0 majors, 7 minors.** Every claim in `fix-core-v1.md` reproduced. The
central attack ("zero divergences was bought by disabling the read hook / by silencing the
comparator") is refuted by direct experiment below.
---
## 1. What was re-run, and what came back
Diff under review (`git diff 97b997d5..HEAD`, 371 lines, 6 files, nothing under `MG_Backend/`,
nothing under `tools/trace_replay/fixtures/`):
```
MobileGL/MG_Impl/Pipe/PipeFill.cpp | 28 ++
MobileGL/MG_Pipe/FillPoints.def | 31 +-
MobileGL/MG_Pipe/PipeMutation.h | 42 ++ (new)
MobileGL/MG_Pipe/generated/PipeFillPoints.inc | 12 +-
MobileGL/MG_State/GLState/TextureState/TextureState.h | 31 +-
MobileGL/MG_Test/Pipe/PipeInputsTest.cpp | 105 ++
```
| check | command | observed |
|---|---|---|
| G1 pull build | `python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0` | `.text 10792579 -> 10792579 (+0, +0.000%)`, `.data/.bss/.rodata +0`, `27799 -> 27799 defined symbols: 0 added, 0 removed, 0 resized, 0 renamed`; file size identical (19100448 both sides) |
| generator | `python3 scripts/gen_pipe.py --check` | `71 calls, 69 verify payloads, 63 PipeInputs fields (7 sticky), 69 verbs, 9 classes`, `0 UNMAPPED`, `generated files are up to date`; `git status` clean afterwards |
| generator self-test | `python3 scripts/gen_pipe.py --self-test` | `6 negative-control trip(s), positive control OK` |
| unit, pull | `ctest --test-dir build-linux -L unit --no-tests=error -j 8` | `100% tests passed, 0 tests failed out of 1485` |
| unit, push | `ctest --test-dir build-push -L unit ...` | `11 failed out of 1485` — exactly the F3 list owned by `p1/fix-tests` (`DirectGLESSanity` ×2, `DirectGLESTextureSync` ×1, `FramebufferTest` ×7, `TextureTest` ×1) |
| unit, verify | `ctest --test-dir build-verify -L unit ...` | same 11, same names |
| `ctest -N` | `comm` vs `~/w7/p1-before-ctest-names.txt` | 0 removed, 29 added; vs `~/w7/pipe/build-linux` names: 0 removed, **exactly 3 added**, all `PipeInputsTest.*` from this package. `build-linux` and `build-push` name lists are identical (`diff` empty) |
| integration-verify | `ctest --test-dir build-verify -L integration-verify --no-tests=error -j 4` | `rc=0`, `100% tests passed, 0 tests failed out of 818`, `grep -c "Fatal{UnmigratedPipeInput"` = 0, `grep -c "Fatal{PipeVerifyDiffer"` = 0. All eight formerly-aborting `DirectVulkan.Verify.{UnboundImageDescriptorScenario,SampledSetStalenessScenario}.*` entries pass |
| the four controls | `ctest --test-dir build-verify -R 'PoisonOmitted\.\|VerifyCorrupted\.'` | 4/4 pass (`DirectGLES/DirectVulkan.VerifyCorrupted.PipeVerifyArmingScenario.CorruptedFieldIsReported`, `...PoisonOmitted.PoisonOmissionScenario.OmittedFieldAbortsOnThatVerb`) |
| 79-case retrace | `MOBILEGL_PIPE_VERIFY=1 python3 ~/w7/retrace_gate.py --tree ~/w7/p1-fix-core --lib .../build-verify/libMobileGL.so --out ~/w7/fcr-retrace -j 4` | `passed 79 / 79; failed: []` |
| retrace arming | in `~/w7/fcr-retrace`: `ls *.log` = 79; `grep -l "armed, zero divergences, zero unmigrated reads" *.log` = **79**; `grep -l "Fatal{" *.log` = 0; `grep -rn "UnmigratedPipeInput\|PipeVerifyDiffer" .` = nothing |
| include closure | `python3 scripts/check_include_closure.py` | `3 probes, 0 skipped, 0 problem(s)` |
The arming assertion is not decorative: `tools/trace_replay/run_trace_case.cmake:164` does
`string(FIND "${pipe_verify_log}" "MGPipe: verify armed" ...)` and `:174` greps the case log for
`Fatal\{(PipeVerifyDiffer|UnmigratedPipeInput|PipeVerifyBadKnob)`. Spot-checked a case log
directly: `improved-transparency-minecraft-26.3/DirectGLES/output/mobilegl.log:329` carries
`MGPipe: verify armed - 63 fields, 69 verbs, fatal=1`.
Note the `build-push` incremental build had 50 targets to relink when I started
(`[50/50] Linking ... MobileGLIntegrationTest`), i.e. the implementer's `build-push` was one step
stale when their table (c) was produced. Re-running after a full rebuild reproduces their numbers
exactly, so the claim stands.
---
## 2. The attacks that were tried and failed
### 2a. "Zero divergences was achieved by disabling the read hook"
Refuted three ways.
1. `MobileGL/MG_Impl/Pipe/PipeFill.cpp` gains **only** the new `MGPipeNoteFrontendMutation`
(+ one `#include`). `MGPipeVerifyReadHook` (`PipeFill.cpp:439-462`) is byte-identical to
`97b997d5`: it still re-reads the whole field out of the live context
(`MGPipeFillAccess::CopyField(g_readScratch, *ctx, field)`) and still calls
`ReportDivergence(field, "read")`.
2. Every `integration-verify` entry still carries `MOBILEGL_PIPE_VERIFY=1` in its ctest
`ENVIRONMENT` property (verified in
`build-verify/MobileGL/MG_IntegrationTest/MobileGLIntegrationTest[17]_tests.cmake`), so the
comparator is armed for all 818.
3. **Direct falsification.** I inserted `return;` as the first statement of
`MGPipeNoteFrontendMutation` (`PipeFill.cpp:479`), rebuilt `build-verify`, and re-ran:
```
ctest --test-dir build-verify -L integration-verify \
-R 'UnboundImageDescriptorScenario|SampledSetStalenessScenario' -j 4
-> 8 tests failed out of 30, all Subprocess aborted:
DirectVulkan.Verify.SampledSetStalenessScenario.{AFilterChange,ASamplerObject}CompletesTheTexture
DirectVulkan.Verify.UnboundImageDescriptorScenario.* (6)
ctest --test-dir build-verify -R 'PipeInputsTest\.(AFrontendMutation|TheMutationNotice)'
-> 2 of 3 fail; child log carries
MGPipe: Fatal{PipeVerifyDiffer, "GetSamplingResolutionGeneration@DrawArrays", verb=1, where=read}
```
That is the lane failure from `P1-LANE-FINDINGS.md` §F2, reproduced exactly, and it proves the
read hook is live and that the notice is the thing carrying the fix. The edit was reverted
(`git checkout --`), `build-verify` rebuilt, and the three tests are green again;
`git status --porcelain` is clean.
### 2b. "The F2 mechanism silences the comparator / makes it compare a value against itself"
The notice refreshes the pushed **value at the point of the frontend write**, not at read time.
The read hook still compares the stored value against a fresh live read at every accessor call, so
any mutation path added later without a notice still reds the lane — demonstrated by 2a.3. No
compare is skipped, no field is excluded, `kMGPipeInputFieldSticky[]` is untouched, and the poison
stamp is deliberately not written (`PipeFill.cpp:479-491` copies the value only), so negative
control B and `Fatal{UnmigratedPipeInput}` both survive — confirmed by the four control entries
passing and by `PipeInputsTest.TheMutationNoticeRefreshesTheValueButNotTheStamp`.
This is the findings' explicitly preferred option, so it is not an undeclared deviation.
### 2c. "The enumeration missed fields" — re-derived from the code, independently
The result file's Step 1–3 was not taken on trust. Re-derivation:
* **Backends cannot reach any `GLContext` mutator.** Gate G2 holds (`grep -rc pGLContext
MobileGL/MG_Backend` is empty on the integrated tree), so the only context-level calls a backend
can make are the `PipeInputs` accessors, and the only non-const ones there are the three
forwarders `RecordError`, `InvalidateCompileEnv`, `ValidateProgramName`
(`MG_Impl/Pipe/PipeFill.cpp:537-551`) — all F-class/sticky with no storage. So a backend can only
move a pushed value *through a frontend object that calls back into the context*.
* **That callback surface is exactly five call sites, on three methods.**
`grep -rn "pGLContext->" MobileGL/MG_State/ | grep -v Core.cpp` yields, excluding comments:
- `MG_State/GLState/SamplerState/SamplerObject.cpp:34` → `BumpSamplingResolutionGeneration()`
- `MG_State/GLState/TextureState/TextureObject.cpp:37` → `BumpSamplingResolutionGeneration()`
- `MG_State/GLState/TextureState/TextureObject.cpp:96` → `BumpTextureBindGeneration()`
- `MG_State/GLState/TextureState/TextureUnit.cpp:39` → `BumpTextureBindGeneration()`
plus `MG_State/GLState/TextureState/TextureState.cpp:142` → `BumpTextureBindGeneration()`.
All five land in `TextureState::BumpSamplingResolutionGeneration` (`TextureState.h:131`) or
`TextureState::BumpTextureBindGeneration` (`TextureState.h:109`), both hooked. The only other
writes to the three counters in the whole tree are inside `TextureState::NoteUnitTouched`
(`TextureState.h:78-100`), also hooked on both branches. Verified by
`grep -rn "m_textureBindGeneration\|m_samplingResolutionGeneration\|m_maxTouchedUnit"`: no write
outside `TextureState.h`.
* **Three fields re-derived, one field ruled out.**
1. `GetSamplingResolutionGeneration` — moved by `SamplerObject::BumpVersion`
(`SamplerObject.cpp:34`) and `TextureObjectBase::BumpShapeVersion` (`TextureObject.cpp:37`);
hook at `TextureState.h:131-134`. Covers all sampler-setter and storage-shape writers.
2. `GetTextureBindGeneration` — moved by `TextureUnit.cpp:39` (sampler unbind),
`TextureObject.cpp:96` (a context default texture becoming defined) and
`TextureState.cpp:142` (delete-unbind), plus the `bindingChanged` branch of `NoteUnitTouched`;
hooks at `TextureState.h:97-99` and `:109-112`.
3. `GetMaxTouchedTextureUnit` — moved only by the high-water branch of `NoteUnitTouched`
(`TextureState.h:79-86`); hook is inside that branch, after the assignment.
4. **`GetTouchedBufferBindingPointCount` ruled out** (the one V-class high-water counter the
result file does *not* discuss by name): its only mutator is
`GLContext::TouchBufferBindingPoint` (`Core.h:83`) and its only callers are
`MG_Impl/GLImpl/Buffer/GL_Buffer.cpp:1499,1622` — frontend entry points, never a backend.
* **Everything else checks out.** `GetRenderStateParameters*`/`GetPipelineStateVersion` move only
through `RenderState` setters (`RenderState.cpp`), and `RenderState` is a private member of
`GLContext` with no backend-reachable handle; `DirectGLES`'s `ScopedEmulationDrawState`
(`DirectGLES.cpp:5226-5345`) saves/restores **native** GL through `g_GLESFuncs.glGetIntegerv`
only — no frontend write, so the `IsTransformFeedbackPaused` worry the `kReadback` comment
raises is not a mutation. The transform-feedback counters move only through `GLContext` methods
(`Core.h:308-357`), unreachable from a backend. The `*Impl::` namespaces the backends use
(`BufferImpl`, `TextureImpl`, `SamplerImpl`, `FramebufferImpl`, `RenderStateImpl`) are
**backend-local** (`MG_Backend/DirectGLES/Managers.cpp:494,2751,5078,8490`,
`DirectGLES.cpp:352,1299,1882,1983`), not `MG_Impl`. The one genuine `MG_Impl` helper a backend
calls, `MG_Impl::GLImpl::CopyTextureImageToClientOrPBO_State` (`VulkanRenderer.cpp:10768`,
defined `GL_Texture.cpp:5375`), only reads and `RecordError`s. No `MGP_FILL` is reachable from
inside a verb (no nested fill).
Conclusion: the enumeration is complete for this tree. I could not find a fourth field.
### 2d. "A fill row that hides a divergence instead of fixing it"
A `FillPoints.def` row can only suppress `Fatal{UnmigratedPipeInput}` for that (class, field); the
value it then makes available is still compare-at-read verified against the live context, so a row
cannot hide a `PipeVerifyDiffer`. The two lane-driven rows are correctly derived:
`VkClearManager.cpp:58` reads `MGB_CTX->IsCapabilityEnabled(FramebufferSrgb)` inside
`PreCompensateSrgbClearColor`, reached from `VulkanRenderer::MaterializePendingClearForTexture`
(`:7865`, calls at `:7967,7995`), which `GenerateMipmap` calls at `:11000` (kTextureOp) and
`PrepareStorageImageTextures` (`:5763`) calls from `DispatchCompute` (`:7054`) /
`DispatchComputeIndirect` (`:7106`) (kDispatch). Verified. The other `IsCapabilityEnabled`
consumers (`MaterializeMultisamplePendingClear` `:8038`, `MaterializePendingClearForRenderbuffer`
`:8109`) are reached from `CopyImageSubData` (`:9513`), `ReadPixels` (`:9928`) and
`ReadDepthStencilPixels` (`:10307`) — classes `kBlitOrCopy`/`kReadback`, which already carry the
row. The `kReadback` "reformat" is genuinely row-neutral: the generated `kReadback` mask
(`0x5f50f3a041300541`) is unchanged in the `.inc` diff, and the class own-counts move by exactly
+1/+4/+3 = the 8 added rows.
### 2e. "A test helper that makes tests pass unconditionally / tests that cannot fail"
No helper was added or changed; the three tests use the existing `PipeInputsTest` fixture,
`Fresh()`, `RunInChild()`, `ExitedWith()`. Two of the three fail under 2a.3's perturbation. Both
value tests carry their own "the mutation actually took" guards
(`ASSERT_NE(ctx.GetSamplingResolutionGeneration(), samplingBefore)` at `PipeInputsTest.cpp:551`,
and `::_exit(7)` in the child at `:610`), so they cannot pass for the wrong reason. All three exist
as visible `GTEST_SKIP`s in the pull arm (`:173,176,179`) and skip visibly where their switch is
off — confirmed per build: `build-linux` 3 skipped, `build-push` 1 pass + 2 skipped (POISON and
VERIFY are both off there), `build-verify` 3 pass.
### 2f. "Something moved the pull build"
`.text`, `.data`, `.bss`, `.rodata`, total size and all 27799 symbols identical, and the `.so` is
the same number of bytes on disk. The `MG_State` header edit is three `MGP_NOTE_MUTATION`
statements plus an include that expands to nothing under `MOBILEGL_PIPE_PUSH=OFF`.
---
## 3. Majors
**None.**
---
## 4. Minors
1. **The notice keeps firing between verbs.** `m_currentVerb` is never reset at verb end
(`PipeInputs.h:616` initialises it to `kVerbCount`, and only `MGPipeFillForVerb` writes it), so
after any verb the last verb's mask stays installed and every subsequent frontend
`glBindTexture` / sampler edit made by the *application* runs the full notice
(`PipeFill.cpp:479-491`, including the `CopyField` switch) even though no verb is in flight.
Harmless for correctness — the value only becomes *more* equal to the live context and the stamp
is untouched — but `PipeMutation.h:33` ("a verb has been filled … in that verb class's may-read
mask") reads as if the guard meant "inside a verb", which it does not, and the push build now
pays the notice on the application's bind hot path. A `MGP_FILL`-side reset (or a
`verb-in-flight` flag) would make the comment true and the cost proportional. Worth naming for P2.
2. **Six of the eight added `FillPoints.def` rows are static over-approximation, not lane-driven.**
Only `X(kDispatch, IsCapabilityEnabled)` (`:179`) and `X(kTextureOp, IsCapabilityEnabled)`
(`:246`) were forced by an observed Fatal. `X(kBlitOrCopy, GetViewportIndexed|
GetDepthRangeIndexed|GetProvokingVertexMode|GetBufferBindingPoint)` (`:228-231`) and
`X(kTextureOp, GetFramebufferBindingSlot|GetBufferBindingPoint)` (`:247-248`) come from a
hand-verified but unexercised path (`TryBlitToDefaultFramebufferWithShader`,
`GenerateDepthMipmapWithShader`). Each such row permanently weakens the poison for that
(class, field) pair. The result file admits this for one row; it applies to five more.
3. **The notice's mask guard is untested.** `if (!MGPipeFieldMaskHas(mask, field)) return;`
(`PipeFill.cpp:489`) has no covering assertion.
`TheMutationNoticeRefreshesTheValueButNotTheStamp` (`PipeInputsTest.cpp:563-587`) says its
`FenceSync` half proves "the notice stamped a field the verb class never fills", but the notice
never stamps *any* field, so that half re-tests the stamp invariant rather than the mask branch;
removing the mask guard entirely would leave all three tests green.
4. **`MG_State` now has a link-time dependency on a symbol defined in `MG_Impl`.**
`TextureState.h:11` includes `MG_Pipe/PipeMutation.h`, whose `MGPipeNoteFrontendMutation` is
defined in `MG_Impl/Pipe/PipeFill.cpp`. Fine today (one static library, one `SOURCE_FILES`
list), and the header itself only depends on `MG_Pipe`, but it inverts the `MG_State < MG_Impl`
layering at link time and `PipeMutation.h` is not one of `check_include_closure.py`'s three
probed headers, so nothing gates what that include may drag in later.
5. **"Every case armed" is not provable per entry for the 818 integration entries.** All
`Verify` entries share one log file per backend
(`MOBILEGL_LOG_FILE_PATH=…/pipe-verify-DirectGLES.log`); after the full lane run that file
contains no `MGPipe` line at all (each process truncates it). Per-entry arming rests on the two
dedicated `PipeVerifyArmingScenario` entries plus the fact that the eight F2 aborts reproduce on
demand (2a.3). Pre-existing lane design, not this package's doing, but the result file's "(d)"
should not be read as per-entry arming evidence. The 79-case retrace *is* per-case armed (79/79).
6. **`ctest -L integration-verify` also reports 77 `Skipped` entries** among the 818 (741 real
passes). Not caused by this package (no `MG_IntegrationTest` file is touched), but the "818
passed" figure in the result file is 741 executed + 77 skipped.
7. **Two small undeclared deviations.** (a) `build-linux/CMakeCache.txt` in this tree carries
`CMAKE_CXX_COMPILER:UNINITIALIZED=clang++` while the reference `~/w7/pipe/build-linux` and this
tree's own `build-push`/`build-verify` carry `CMAKE_CXX_COMPILER:STRING=/usr/sbin/clang++`; the
`.text` byte-identity shows it resolves to the same compiler, but the G1 comparison was made
across a differently-spelled cache entry and deviation 2 does not mention it.
(b) `MobileGL/MG_Pipe/PipeMutation.h` is a new file in a directory the P1 brief's D5 table
enumerates; the new row is not called out as a deviation (it is implied by the findings'
preferred option, so this is bookkeeping only).
---
## 5. Follow-ups for the integrator (not blocking)
- The F2 enumeration in `fix-core-v1.md` still has to land in `docs/Disaggregated/MEASUREMENTS.md`
(the package correctly left it alone; the findings asked for the enumeration to exist, and it does).
- Minor 1 (verb-end reset) and minor 3 (mask-guard coverage) are natural P2 items when the tracker
takes over the filler.
- `GetFramebufferBindingSlotFast`'s five bypassing reads (`DirectGLES.cpp:1611,1905,2743,2858,2933`)
remain outside both the poison and the compare-at-read; unchanged, and correctly recorded.
@@ -1,284 +0,0 @@
# P1 lane fixes — package `fix-core` (F1 + F2)
Tree: WSL `~/w7/p1-fix-core`, branch `p1/fix-core`, branched from the integrated
`feat/disaggregated` @ `97b997d5`. Not pushed.
## Commits
| sha | subject |
|---|---|
| `80a6b390` | `[Fix] (Pipe): fill the capability set on a texture op and a dispatch, and the shader blit's viewport, provoking vertex and buffer bindings` |
| `6b681c4a` | `[Fix] (Pipe, State): refresh a pushed PipeInputs field when the frontend moves it inside a verb` |
| `9bd6d394` | `[Test] (Pipe): pin the push-on-mutation shape - a frontend write inside a verb refreshes the pushed field, and only its value` |
Files touched: `MobileGL/MG_Pipe/FillPoints.def`,
`MobileGL/MG_Pipe/generated/PipeFillPoints.inc` (regenerated),
`MobileGL/MG_Pipe/PipeMutation.h` (new), `MobileGL/MG_Impl/Pipe/PipeFill.cpp`,
`MobileGL/MG_State/GLState/TextureState/TextureState.h`,
`MobileGL/MG_Test/Pipe/PipeInputsTest.cpp`. No backend file, no other package's file.
---
## F1 — missing fill rows
### What the lane proved
`~/w7/retrace-out/p1-verify/` aborted four cases with
`Fatal{UnmigratedPipeInput, "IsCapabilityEnabled@GenerateMipmap"}` (3) and
`"IsCapabilityEnabled@DispatchCompute"` (1), all `DirectVulkan`.
Root cause, traced in the tree: `VulkanRenderer::MaterializePendingClearForTexture`
(`VulkanRenderer.cpp:7865`) calls `VkClearManager::PreCompensateSrgbClearColor`, which reads
`IsCapabilityEnabled(FramebufferSrgb)` (`VkClearManager.cpp:58`). It is reached from
`GenerateMipmap` (`:11000`, a `kTextureOp` verb) and from `DispatchCompute` through
`PrepareStorageImageTextures` (`:5763`, a `kDispatch` verb). `kDraw`, `kClear`, `kBlitOrCopy`
and `kReadback` already named the field; those two classes did not.
### The audit that followed
Not stopped at the two rows. A static verb-class → field reachability pass over `MG_Backend`
(name-based call graph, roots taken from both `GetBackendFunctions()` tables;
`scratchpad/wf4/fix-core/reach.py`) produced candidate rows with their call paths, and each
candidate was then hand-verified against the tree — the pass merges same-name functions, so
most candidates were collisions (`Clear`, `SyncToBackend`, `GetOrCreatePipeline` on
`PipelineFactory` vs `VulkanRenderer`) and were dropped. Two real families survived:
| class | rows added | verified path |
|---|---|---|
| `kDispatch` | `IsCapabilityEnabled` | `DispatchCompute` → `PrepareStorageImageTextures` → `MaterializePendingClearForTexture` → `PreCompensateSrgbClearColor` |
| `kTextureOp` | `IsCapabilityEnabled` | `GenerateMipmap` (`VulkanRenderer.cpp:11000`) → the same |
| `kTextureOp` | `GetFramebufferBindingSlot`, `GetBufferBindingPoint` | `GenerateMipmap` → `GenerateDepthMipmapWithShader` (`:11069`) → `BindProgramUniformBuffers` (`:4755`) → `ResolveSamplerDescriptor` (`UniformManager.cpp:555`, the feedback-loop check) / `ResolveStorageBufferDescriptor` (`:1194`) |
| `kBlitOrCopy` | `GetViewportIndexed`, `GetDepthRangeIndexed` | `BlitNamedFramebuffer` → `TryBlitToDefaultFramebufferWithShader` (`:8671`) → `ApplyGLViewportState` (`:8502`) → `ComputeGLViewport` |
| `kBlitOrCopy` | `GetProvokingVertexMode` | same → `GetOrCreateBlitPipeline` (`:8511`) → `SelectProvokingVertexMode` (`:4434`) |
| `kBlitOrCopy` | `GetBufferBindingPoint` | same → `BindProgramUniformBuffers` (`:8576`) → the buffer-block resolvers |
Every added row carries its derivation in a comment in `FillPoints.def`. The commit also
unfolds the `kReadback` transform-feedback rows that `9087f133` landed on one 1200-column
line; no row changed there.
---
## F2 — the backend mutates frontend state inside a verb
### Option chosen: **push on mutation** (the findings' preferred option)
Justification:
- It keeps the comparator's invariant — "the pushed block equals the live context at every
read" — literally true, so the push build's semantics stay equal to the pull build's. The
fallback (a volatile-in-verb class) would instead have made the push build read the
boundary value where the pull build reads the moved one, i.e. it would have *kept* the
behavioural difference and hidden it.
- The compare-at-read arm is the only comparator arm that is real in P1 (the entry compare is
tautological until P2's tracker fills the first arm, per brief D8). The fallback's mechanism
is precisely "skip compare-at-read for this field", which would blind the P1 gate on the one
field that found the bug.
- It is the shape P2's tracker needs anyway (findings, F2 bullet 1).
### Mechanism
`MobileGL/MG_Pipe/PipeMutation.h` (new, leaf layer that both `MG_State` and `MG_Impl` may
include) declares `MGP_NOTE_MUTATION(Field)`. In the pull build the macro is `((void)0)` and
the header includes nothing. Under `MOBILEGL_PIPE_PUSH` it calls
`MGPipeNoteFrontendMutation(field)`, defined in `MG_Impl/Pipe/PipeFill.cpp` next to the filler
whose `MGPipeFillAccess::CopyField` it reuses. The notice refreshes one field's **value** when
1. a context is live,
2. a verb has been filled (`m_currentVerb != kVerbCount`),
3. the field is not sticky (a forwarded field has no storage), and
4. the field is in the current verb class's `kMGPipeClassFieldMask`.
It never touches the poison stamp, so a stamp `MOBILEGL_PIPE_POISON_OMIT` withheld stays
withheld (negative control B survives) and a field the verb never filled stays
`Fatal{UnmigratedPipeInput}` on the next read instead of being healed by an unrelated write.
### The enumeration asked for
**Step 1 — what a backend can write into the frontend.** `scout-pull-sites.md` §2.6 lists the
sites; re-derived live on this tree by matching every non-const `MG_State` method declaration
against every call in `MG_Backend/**` (`scratchpad/wf4/fix-core/scan.py`). Nothing is reached
through `MGB_CTX` itself: the only non-read accessors the backends call are `RecordError`,
`InvalidateCompileEnv` and `ValidateProgramName`, all three F-class/sticky with no storage.
Everything else is a method call on an object the backend obtained by handle or created itself.
| written frontend object | mutators the backends call | pushed field it can move |
|---|---|---|
| `SamplerObject` | `SetMinFilter`, `SetMagFilter`, `SetMipmapMode`, `SetWrapS/T/R`, `SetLodRange`, `SetCompareMode`, `SetSamplerCompareFunc` (`VulkanRenderer.cpp:4270-4276`) — each ends in `SamplerObject::BumpVersion()` (`SamplerObject.cpp:34`) | **`GetSamplingResolutionGeneration`** |
| `ITextureObject` | `AllocateStorage`, `MarkStorageDirty`, `TruncateMipmapLevels`, `SetInternalFormat`, `SetSamples`, `SetFixedSampleLocations` (`UniformManager.cpp:1484-1498,1625-1635` fallback-texture creation; `DirectGLES.cpp:6326-6327`) — each ends in `TextureObjectBase::BumpShapeVersion()` (`TextureObject.cpp:37`); `SetInternalFormat` on a context default texture additionally bumps the bind generation (`TextureObject.cpp:96`) | **`GetSamplingResolutionGeneration`**, **`GetTextureBindGeneration`** |
| texture unit / texture state | any bind path (`TextureState::NoteUnitTouched`), `TextureUnit::SetSamplerObject`, `TextureState::MarkTextureObjectForDeletion` | **`GetTextureBindGeneration`**, **`GetMaxTouchedTextureUnit`** |
| `BufferObject` | `MarkGpuWritten`, `SetBackendResource`, `EnsureGpuResidentStorage`, `WritebackFromBackend`, `SyncPersistentMappedRange`, `SyncGpuWrites` | none — buffers are reached through the O-class binding slots/points, which are live pointers into the context, so a content or resource change is visible to the backend without any copy |
| `ProgramObject` | `SetDrawID`, `SetBaseVertex`, `SetBaseInstance`, `SetViewportPassMask`, `AttachShader`, `Link`, `MarkUBOContentDirty`, `SetBackendHashMemo` | none — `GetProgramForDraw`/`ForDispatch`/`TransformFeedbackProgram` are O-class `SharedPtr` copies; the pointee is shared, so its mutations are seen live and the handle itself never moves inside a verb |
| `VertexArrayObject` | `SetBackendHashMemo`, `SetBackendStateMemo`, `SetBackendAuxMemo` | none — same reason (`GetBoundVertexArray` is O-class) |
| `GLContext` | `RecordError`, `InvalidateCompileEnv` | none — both are sticky F-class with no storage |
**Step 2 — the frontend mutators that bump a pushed value.** Only six `PipeInputs` fields are
*derived* counters rather than plain state copies: `GetSamplingResolutionGeneration`,
`GetTextureBindGeneration`, `GetMaxTouchedTextureUnit`, `GetTextureContextId` (immutable per
context), `GetRenderStateParametersVersion` / `GetPipelineStateVersion` (moved only by
`RenderState`'s setters, which no backend calls — the scan finds no `RenderState` mutator in
`MG_Backend`, and `DirectGLES`'s `ScopedEmulationDrawState` / `ScopedRestartIndexSubstitution`
save and restore *native* GL state, never frontend state), plus the transform-feedback
counters (`AddTransformFeedback*`, `EndTransformFeedback` — `GLContext` mutators no backend
calls).
**Step 3 — the intersection, i.e. what is handled.** Three fields:
| field | hook site |
|---|---|
| `GetSamplingResolutionGeneration` | `TextureState::BumpSamplingResolutionGeneration()` |
| `GetTextureBindGeneration` | `TextureState::BumpTextureBindGeneration()` and the `bindingChanged` branch of `TextureState::NoteUnitTouched()` |
| `GetMaxTouchedTextureUnit` | the high-water branch of `TextureState::NoteUnitTouched()` |
The hooks sit on the **counters**, not on the individual writers, so every path in the table
above (and any writer added later) is covered by three notices rather than forty.
---
## Verification (all run in `~/w7/p1-fix-core`)
Build directories configured to the brief's C recipe: `build-linux` (pull),
`build-push` (`MOBILEGL_PIPE_PUSH=ON`), `build-verify` (`MOBILEGL_PIPE_VERIFY=ON`,
`MOBILEGL_ITEST_REQUIRE_GPU=ON`); `CCACHE_BASEDIR=/home/swung/w7`; all three build clean.
**(a) pull build symbol-identical**
```
python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so \
--after build-linux/libMobileGL.so --threshold 0
.text 10792579 -> 10792579 (+0, +0.000%)
.data/.bss/.rodata/Total all +0
27799 -> 27799 defined symbols: 0 added, 0 removed, 0 resized, 0 renamed
Removed (0) / Added (0) / Resized (0) / Renamed only (0)
```
**(b) generator**
```
python3 scripts/gen_pipe.py --check -> "generated files are up to date"
71 calls, 69 verify payloads, 63 fields (7 sticky),
69 verbs, 9 classes, 0 UNMAPPED
python3 scripts/gen_pipe.py --self-test -> "6 negative-control trip(s), positive control OK"
```
**(c) `ctest -L unit`**
| build | result |
|---|---|
| `build-linux` | **100% tests passed, 0 failed out of 1485** |
| `build-push` | 11 failed out of 1485 |
| `build-verify` | 11 failed out of 1485 |
The 11 in push/verify are **exactly** the F3 list owned by the other package
(`DirectGLESSanity.{BindsAMultisampleTextureDespiteTheDefaultMipmapFilter,
BindingZeroClearsPreviousNativeTextureBinding}`, `DirectGLESTextureSync.UnitMemoRefusesToDrive
ATwinFromAnotherTexture`, the seven `FramebufferTest.*`, `TextureTest.StorePackedWordsToClient
CopiesWordsVerbatimUnderPackParams`) — they construct a `GLContext` by hand and call a backend
helper with no verb in flight, and they are not mine to fix.
**(d) `ctest -L integration-verify` in `build-verify`**
```
ctest --test-dir build-verify -L integration-verify --no-tests=error -j 4
exit=0
100% tests passed, 0 tests failed out of 818
grep -c "Fatal{UnmigratedPipeInput" -> 0
grep -c "Fatal{PipeVerifyDiffer" -> 0
```
The eight `DirectVulkan.Verify.{UnboundImageDescriptorScenario,SampledSetStalenessScenario}.*`
aborts of F2 are gone. The four poison/verify control entries
(`DirectGLES|DirectVulkan.{VerifyCorrupted.PipeVerifyArmingScenario.CorruptedFieldIsReported,
PoisonOmitted.PoisonOmissionScenario.OmittedFieldAbortsOnThatVerb}`) still pass, i.e. the gate
can still go red for its reason.
**(e) full 79-case retrace under verify**
```
cp .../wf2/retrace_gate.py ~/w7/retrace_gate.py # byte-identical to the one already there
MOBILEGL_PIPE_VERIFY=1 python3 ~/w7/retrace_gate.py \
--tree ~/w7/p1-fix-core --lib ~/w7/p1-fix-core/build-verify/libMobileGL.so \
--out ~/w7/retrace-out/fix-core -j 4
79 tests selected of 79
passed 79 / 79; failed: []
```
```
cd ~/w7/retrace-out/fix-core
ls *.log -> 79
grep -l "armed, zero divergences, zero unmigrated reads" -> 79
grep -l "Fatal{" *.log -> 0
grep -r "Fatal{|UnmigratedPipeInput|PipeVerifyDiffer" . -> 0 each
```
Sample summary line: `-- MGPipe verify: improved-transparency-minecraft-26.3 DirectGLES armed,
zero divergences, zero unmigrated reads`.
**(f) `ctest -N` name diff**
```
ctest --test-dir build-linux -N | grep -E '^\s+Test +#[0-9]+: ' \
| sed -E 's/^ *Test +#[0-9]+: //' | sort > ~/w7/fc-ctest-names.txt
comm -23 ~/w7/p1-before-ctest-names.txt ~/w7/fc-ctest-names.txt | wc -l -> 0 (removed)
comm -13 ~/w7/p1-before-ctest-names.txt ~/w7/fc-ctest-names.txt | wc -l -> 29 (added)
```
26 of the 29 came in with the merged P1 packages; the 3 new ones are this package's.
**Extra: include-closure gate**
```
python3 scripts/check_include_closure.py -> 3 probes, 0 skipped, 0 problem(s)
```
**Extra: falsification of the new tests.** With `MGPipeNoteFrontendMutation`'s body
short-circuited and `build-verify` rebuilt,
`PipeInputsTest.AFrontendMutationInsideAVerbRefreshesThePushedField` and
`...DoesNotDivergeAtRead` both FAIL (the second by `SIGABRT` on
`Fatal{PipeVerifyDiffer, "GetSamplingResolutionGeneration@DrawArrays", where=read}` — the lane
failure reproduced in a unit test); `...TheMutationNoticeRefreshesTheValueButNotTheStamp` stays
green, which is correct for a guard case. The edit was reverted and the build restored before
committing (`git diff` clean on that file).
---
## Deviations
1. **Tree path.** The brief names the tree `~/w7/fix-core`; the worktree that exists is
`~/w7/p1-fix-core` on branch `p1/fix-core` (`git worktree list` at `97b997d5`). Tree wins
for facts; everything was done there.
2. **Build directories did not exist.** The brief says the tree "has three configured build
directories". `build-linux`, `build-push` and `build-verify` were absent; they were
configured from the brief's C recipe (matching `~/w7/p1-core`'s `CMakeCache.txt` flags:
Release, `/usr/sbin/clang++`, ccache, INFO, `MOBILEGL_BUILD_TEST=ON`,
`MOBILEGL_BUILD_INTEGRATION_TEST=ON`, `MOBILEGL_BUILD_BENCHMARK=OFF`,
`MOBILEGL_BUILD_TRACE_REPLAY=OFF`, mesa EGL vendor, lvp ICD;
`MOBILEGL_ITEST_REQUIRE_GPU=ON` only for verify).
3. **A fourth file under `MG_State`.** The brief allows `MG_State/**` "only if F2's chosen
mechanism needs a frontend hook" — it does; `TextureState.h` is the only `MG_State` file
touched, and only by three macro statements plus one include that expands to nothing in the
pull build (`.text` delta 0 confirms it).
4. **`ctest -L integration-verify` counts 818 entries**, not the brief's 742. The label's
membership grew with the merged P1 packages; nothing was excluded.
5. **Reformatting inside `FillPoints.def`.** The `kReadback` transform-feedback rows that
`9087f133` landed on a single 1200-column line were unfolded to the file's one-row-per-line
shape. No row was added, removed or moved between classes by that edit.
6. **The static reachability pass is a helper, not a gate.** `scratchpad/wf4/fix-core/reach.py`
over-approximates through same-name functions; it was used to generate candidates, each of
which was then confirmed or rejected by reading the tree. It is not wired into CI.
## Unfinished / known gaps
- **F3 is not fixed here** (it is the other package's): 11 `ctest -L unit` entries still fail
in `build-push` and `build-verify` on this branch, and they will keep failing until
`p1/fix-tests` lands. `build-linux` is 1485/1485.
- **`GetFramebufferBindingSlotFast`** (`DirectGLES.cpp:1611,1905,2743,2858,2933`) still
bypasses the accessor once its cache is warm, so those five reads are neither poison-checked
nor compare-at-read verified. That is the known P2 gap recorded in brief D4, untouched here.
- **The notice is single-threaded**, exactly like the filler it shares state with: both write
`gPipeInputs` with no synchronisation. Unchanged risk profile, but worth naming before P2
puts a tracker behind the same global.
- **`GetBufferBindingPoint` on `kTextureOp`/`kBlitOrCopy` is a "may-read" row**, not one the
lane exercised: the helper programs those two verbs draw with declare no SSBO today, so the
resolver that reads the binding points is reachable in code but not hit by the 79 traces or
the 818 integration entries. It was added because the path exists; if the table is ever
trimmed for fill cost, that is the first row to re-examine.
- Nothing was pushed, and `docs/Disaggregated/MEASUREMENTS.md` was not edited (not in this
package's file list); the F2 enumeration above is the material an integrator would land there.
@@ -1,272 +0,0 @@
# Adversarial review — P1 package `fix-tests` (F3), branch `p1/fix-tests` @ `c67c47f7`
Reviewer ran independently in WSL `~/w7/p1-fix-tests` (the tree; the task text's `~/w7/fix-tests`
does not exist — the implementer declared this, deviation 1, and it is correct).
Tree state at start and at end: `git status --porcelain` shows only the three untracked build
directories; `git log -1` is `c67c47f7`. Nothing was left changed (two temporary mutations were
made for negative controls and reverted with `git checkout --`; verified clean afterwards).
**Verdict: approved. 0 majors, 6 minors.**
I set out to refute "correct and complete" and could not. Every claim in
`fix-tests-v1.md` reproduced, and two of them reproduce *stronger* than claimed.
---
## 1. What was re-run independently (command + observed output)
### 1.1 The diff is what it says it is
```
$ git -C ~/w7/p1-fix-tests diff --name-only 97b997d5..HEAD
MobileGL/MG_Test/Framebuffer/FramebufferTest.cpp
MobileGL/MG_Test/SanityTest.cpp
MobileGL/MG_Test/ScopedPipeVerb.h
MobileGL/MG_Test/Texture/TextureTest.cpp
```
128 insertions / 5 deletions, all inside `MobileGL/MG_Test/**`. No production source, no
`scripts/`, no CMake, no `.def`/generated file, no fixture, no `MG_Test/Pipe/**` (the other
package's area), no `MG_IntegrationTest/**`. The full diff was read line by line.
Commit message shape checked against the lane rule (subject + blank line + `- ` bullets, no
`Co-Authored-By`): conforms.
### 1.2 Build configurations are the reference ones (deviation 2/3 verified, not taken on trust)
Diffing every `MOBILEGL_*` / `CMAKE_BUILD_TYPE` / `CMAKE_CXX_COMPILER` cache entry against
`~/w7/pipe/<dir>/CMakeCache.txt`:
```
--- build-linux --- IDENTICAL to pipe/build-linux
--- build-push --- only CMAKE_CXX_COMPILER:STRING vs :UNINITIALIZED (same value)
--- build-verify --- only CMAKE_CXX_COMPILER:STRING vs :UNINITIALIZED (same value)
```
`MOBILEGL_BUILD_BENCHMARK:BOOL=OFF` is present in `~/w7/pipe`'s three caches too, so
deviation 3 reproduces the reference trees rather than changing them. Compile definitions
confirmed from `build.ninja`: `build-linux` has neither, `build-push` has
`-DMOBILEGL_PIPE_PUSH=1`, `build-verify` has `-DMOBILEGL_PIPE_PUSH=1 -DMOBILEGL_PIPE_VERIFY=1`.
`cmake --build {build-linux,build-push,build-verify} -j 12` → all three `ninja: no work to do`,
i.e. the committed tree is exactly what was tested.
### 1.3 Pull-build symbol report, `--threshold 0`
```
$ python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so \
--after build-linux/libMobileGL.so --threshold 0
symbol-report: .text 10792579 -> 10792579 (+0, +0.000%)
symbol-report: .data 76824 -> 76824 (+0) .bss 1296872 -> 1296872 (+0) .rodata 1534938 -> 1534938 (+0)
symbol-report: 27799 -> 27799 defined symbols: 0 added, 0 removed, 0 resized, 0 renamed
```
G1 holds. (Trivially, by construction — the helper is header-only test code — but re-run.)
### 1.4 `gen_pipe.py --check` / `--self-test`
```
gen_pipe: 71 calls (11 screen, 60 context), 69 verify payloads, 63 PipeInputs fields (7 sticky), 69 verbs, 9 classes
gen_pipe: generated files are up to date rc=0
gen_pipe: self-test: 6 negative-control trip(s), positive control OK rc=0
```
`scripts/check_include_closure.py` also clean (3 probes, 0 forbidden) — the new header does not
break the layering gate.
### 1.5 `ctest -L unit` in all three build directories
```
build-linux rc=0 100% tests passed, 0 tests failed out of 1482
build-push rc=0 100% tests passed, 0 tests failed out of 1482
build-verify rc=0 100% tests passed, 0 tests failed out of 1482
```
### 1.6 `ctest -N` name diff
```
build-linux 2360 names, build-push 2360, build-verify 3178
removed vs ~/w7/p1-before-ctest-names.txt: 0 added: 26
vs the integrated tree ~/w7/pipe/build-linux (2360): 0 removed, 0 added <-- exact match
```
The 26 additions are the other P1 packages' (already at the branch point); **this package adds
none, removes none, renames none.** The `build-verify` surplus is confirmed by label census:
`integration-verify` 818 + `integration-gpu` 1696; `~/w7/pipe/build-verify` also lists 3178.
So the surplus is the configuration, not a name change.
---
## 2. The four things I tried to catch it on
### 2.1 "A test helper that makes tests pass unconditionally" — refuted, twice
**Control A (mine, stronger than the implementer's): neutralise the helper entirely.**
`sed -i 's/^#if MOBILEGL_PIPE_PUSH$/#if defined(MGL_REVIEW_NEUTRALISE) \&\& MOBILEGL_PIPE_PUSH/'`
on `MobileGL/MG_Test/ScopedPipeVerb.h` (all four guards, so ctor, `Renew()` and dtor become
no-ops in every build), rebuild `build-verify`, `ctest -L unit -j 8`:
```
99% tests passed, 11 tests failed out of 1482
5 DirectGLESSanity.BindsAMultisampleTextureDespiteTheDefaultMipmapFilter (Subprocess aborted)
6 DirectGLESSanity.BindingZeroClearsPreviousNativeTextureBinding
82 DirectGLESTextureSync.UnitMemoRefusesToDriveATwinFromAnotherTexture
310 FramebufferTest.DrawIntoAWidenedDrawBufferReachesTheDriverWithAlphaWritesMaskedOff
311 FramebufferTest.ClearIntoAWidenedDrawBufferKeepsAlphaWritableAndSubstitutesOne
312 FramebufferTest.ApplicationAlphaMaskOffIsStillHonouredOnANativeDrawBuffer
313 FramebufferTest.DualSourceBlendFactorsReachTheDriverWhenTheExtensionIsThere
314 FramebufferTest.DualSourceBlendIsDeclinedRatherThanThrownWhenTheExtensionIsMissing
315 FramebufferTest.DualSourceFactorsAreDeclinedEvenWithBlendingDisabled
316 FramebufferTest.DualSourceFactorsWithBlendingDisabledStillReachACapableDriver
471 TextureTest.StorePackedWordsToClientCopiesWordsVerbatimUnderPackParams
```
Exactly eleven, and exactly F3's eleven — every declaration in the diff is load-bearing (none is
decorative), and no *other* test in the 1482 depends on the helper. So the helper cannot be
making anything pass that was not already failing for the F3 reason, and none of these eleven is
a test that cannot fail.
**Control B (mine): substitute the WIDEST verb class for a narrow one.** In
`MobileGL/MG_Test/Texture/TextureTest.cpp:4481` change `MGPipeVerb::ReadPixels` →
`MGPipeVerb::DrawArrays` (kDraw, 47 fields, the largest mask there is) and run that one test in
`build-verify` with `MOBILEGL_LOG_FILE_PATH` set:
```
exit=134 (SIGABRT)
[Linux TextureTest/FATAL]: MGPipe: Fatal{UnmigratedPipeInput, "GetPixelStoreParameters@DrawArrays"}
```
This is the decisive anti-rubber-stamp result: the ctor runs the *production*
`MGPipeFillForVerb` (`MobileGL/MG_Impl/Pipe/PipeFill.cpp:528-575`), which stamps only
`kMGPipeClassFieldMask[class of verb]` — so a read outside the declared verb's may-read set is
still `Fatal{UnmigratedPipeInput}`, naming the field *and* the declared verb, even when the
declared verb is the broadest one. `FillPoints.def` remains the only thing that says what a verb
may read. It also proves the test binary and the backend share one `gPipeInputs`: the abort came
out of the backend's accessor, on the block the test's ctor stamped.
Both were reverted with `git checkout --` and the affected targets rebuilt; the restored tests
pass and `git status --porcelain -- MobileGL` is empty.
### 2.2 "Fields / call sites the enumeration missed" — refuted
Enumerated every direct backend-helper call in the unit tree myself
(`awk` over the three files, plus a repo-wide grep):
* `MobileGL/MG_Test/Framebuffer/FramebufferTest.cpp` — 11 `SyncRenderState(` calls at
`:1238,1271,1283,1323,1356,1377,1395,1422,1440,1453,1471`; **every one** sits inside a
`ScopedPipeVerb` scope or after a `Renew()`.
* `MobileGL/MG_Test/SanityTest.cpp` — 4 `BindCurrentTextures()` (`:329,372,380,391`) and
2 `SyncNeccessaryTextures()` (`:3025,3046`); all covered.
* `MobileGL/MG_Test/Texture/TextureTest.cpp` — 2 `StorePackedWordsToClient(` (`:4482,4508`);
both covered.
* `grep -rlE 'MG_Backend::(DirectGLES|DirectVulkan)::[A-Za-z_]+::[A-Za-z_]+\('
MobileGL/MG_Test --include=*.cpp` returns exactly those three files and no others.
* The same grep over `MobileGL/MG_IntegrationTest` returns **nothing** — integration scenarios
drive GL entry points only, so `MGP_FILL` always fires there. The implementer's stated reason
for not touching `MG_IntegrationTest/**` is factually right, not an excuse.
### 2.3 "A mechanism that silences the comparator" — refuted, and the package under-claims
The unit lane in `build-verify` runs with `Features.PipeVerify` **off** unless
`MOBILEGL_PIPE_VERIFY=1` is in the environment, so the implementer's green `ctest -L unit` only
exercised the poison, not the compare-at-read hook. That was the one place a wrongly *placed*
declaration (fill before a mutation the helper must see) could hide: the push value would go
stale against the live context and nobody would look. So I armed it:
```
$ MOBILEGL_PIPE_VERIFY=1 ctest --test-dir build-verify -L unit --no-tests=error -j 8
rc=0 100% tests passed, 0 tests failed out of 1482
```
and proved the arming was real rather than a silent no-op:
```
$ MOBILEGL_PIPE_VERIFY=1 MOBILEGL_LOG_FILE_PATH=/tmp/mgl-verify.log \
./build-verify/.../FramebufferTest --gtest_filter='*DrawIntoAWidened*'
[Linux FramebufferTest/INFO]: MGPipe: verify armed - 63 fields, 69 verbs, fatal=1
# same run without the env var: 0 occurrences of "MGPipe: verify armed"
```
With the comparator genuinely armed, every accessor read in all eleven tests returned exactly
what a live pull would have returned. That is a stronger statement than the result file makes,
and it closes the placement question completely: no `ScopedPipeVerb` in this diff is placed
before a mutation its helper is meant to see.
### 2.4 "The pull build moves" / "a global escape hatch" / "the poison is weakened" — refuted
* Symbol report 0/0/0/0, `.text` +0 (§1.3). The class body is `#if MOBILEGL_PIPE_PUSH`-gated to
nothing (`MobileGL/MG_Test/ScopedPipeVerb.h:46,62,67`), the ctor signature is identical in
both arms, so call sites cannot rot.
* No global escape hatch: no `#define`, no env knob, no weakening of `MGP_INPUT_CHECK`, no
change to `PipeInputs.h`/`PipeFill.cpp`/`FillPoints.def`. The whole mechanism is "call the
production filler for a named verb".
* Whole-binary single-process runs reproduce (the destructor re-arm's stated purpose):
`SanityTest` exit=0 82 tests, `FramebufferTest` exit=0 61 tests, `TextureTest` exit=0
192 tests, 0 `[ FAILED ]` lines each. With the helper neutralised the same three binaries
are 134/1/1 with 11 and 3 failures — i.e. the re-arm is not covering anything up.
---
## 3. Minors
1. **Nested scopes silently invalidate the enclosing declaration, and the header does not say
so.** `MobileGL/MG_Test/ScopedPipeVerb.h:68` — the destructor bumps `CurrentVerbSerial`, so
closing an inner scope makes the *outer* scope's stamps stale. The two current sites survive
only because a `draw.Renew()` happens to follow
(`FramebufferTest.cpp:1453` after the `Clear` scope at `:1439-1441`). The header's guidance
at `:38-42` documents `Renew()` as "a second verb of the same kind begins" and nested scopes
as the way to handle another class, but never states the interaction. A future author who
nests a scope and then calls the outer helper again gets an abort. One sentence in the
`Renew()` comment would fix it.
2. **The exit fill makes the next poison Fatal name a misleading verb.**
`ScopedPipeVerb.h:74` picks `MGPipeVerb::GetGpuTimestampNs` as the leave-verb, so a test that
forgets a declaration *after* another scope closed aborts with
`Fatal{UnmigratedPipeInput, "<Field>@GetGpuTimestampNs"}` — reading as "a timestamp query
tried to read this", which is not what happened. The implementer's own demo A produced the
clearer `@<none>` only because that test declared nothing at all. A dedicated
"left the verb" sentinel (or documenting the string) would keep the diagnostic honest.
3. **Only one of the verb classes that reach each helper is exercised.**
`SanityTest.cpp:3025,3046` declare `DrawArrays` for `SyncNeccessaryTextures()`, but that
helper is reached in production from `kReadback` too — `DirectGLES.cpp:9020` (`ReadPixels`)
and `:9191` (`GetTexImage`), among 14 call sites. Choosing the class the helper "belongs to"
is exactly what F3 asks for, and the retrace / integration lanes are the oracle for the other
classes (that is F1's job), so this is not a defect — but the result file's table reads as if
the declared verb were the only class involved, and it is not.
4. **The known `GetFramebufferBindingSlotFast` poison gap is what produced the pre-fix push
SEGFAULT, and it is worth recording.** `DirectGLES.cpp:147-157`: when the block is unfilled,
`MGB_CTX_IDENTITY` is `nullptr` and `g_fbSlotCacheContext` is also `nullptr`, so the cache is
treated as warm and `*g_fbSlotCache[target]` dereferences null. This is the documented D4
gap (brief line 151, closed in P2), not this package's, but it means a push-build test that
reaches that path can crash or read a stale slot without the poison ever firing — the one
place where "green" is not proof. No such test exists today (§2.2).
5. **A brief-vs-tree fact, recorded per the standing instruction.** The brief (G3) calls
`integration-verify` "the 742-entry lane" and `P1-LANE-FINDINGS.md` says 878 integration
entries; the tree says **818** `integration-verify` and 1696 `integration-gpu`
(`ctest --test-dir build-verify -N -L <label>`), identical in `~/w7/pipe/build-verify`. The
result file's 818 is right; the brief's number is stale. Tree wins.
6. **The result file under-reports its own strongest evidence.** It does not mention that the
verify build's unit lane is also green with the comparator actually armed
(`MOBILEGL_PIPE_VERIFY=1`, §2.3). That is the result that rules out mis-placed declarations,
and it belongs in the record.
## 4. Declared deviations — all six check out
1. tree `~/w7/p1-fix-tests` (confirmed: `~/w7/fix-tests` does not exist; branch, branch point
`97b997d5` and ownership are as briefed);
2. the three build dirs did not exist and were configured by the implementer (confirmed
equivalent to `~/w7/pipe`'s, §1.2);
3. `-DMOBILEGL_BUILD_BENCHMARK=OFF` (confirmed present in all three reference caches);
4. `~/w7/p1-before-ctest-names.txt` as the `-N` baseline (I additionally diffed against the
integrated tree: 0/0);
5. the extra wrong-verb demonstration (I reproduced an independent, stronger variant);
6. the destructor's re-arm as an unbriefed design choice (reproduced; see minors 1 and 2).
No undeclared deviation found. F1, F2 and F4 are untouched, as stated; the
`integration-verify` lane and the 79-case retrace were not run here, which is correct — they are
red for F1/F2 reasons this package does not own, and nothing in this diff can reach them
(no `MG_IntegrationTest/**`, no production source, no fill table).
@@ -1,214 +0,0 @@
# P1 package `fix-tests` — F3 only (`p1/fix-tests`, WSL `~/w7/p1-fix-tests`)
Branch `p1/fix-tests`, branched from the integrated `feat/disaggregated @ 97b997d5`.
Owns finding **F3** and nothing else. F1, F2 and F4 belong to other packages and were not touched.
## Commits
| sha | subject |
|---|---|
| `c67c47f7` | `[Test] (Pipe): let a test that drives a backend helper directly declare the verb it stands in` |
Diff against the branch point (`git diff --stat 97b997d5..HEAD`):
```
MobileGL/MG_Test/Framebuffer/FramebufferTest.cpp | 30 ++++++++-
MobileGL/MG_Test/SanityTest.cpp | 18 +++++-
MobileGL/MG_Test/ScopedPipeVerb.h | 78 ++++++++++++++++++++++++
MobileGL/MG_Test/Texture/TextureTest.cpp | 7 +++
4 files changed, 128 insertions(+), 5 deletions(-)
```
Nothing outside `MobileGL/MG_Test/**` was touched; `MG_Test/Pipe/**` (the other package's) was
not touched either; no production source, no `scripts/`, no CMake, no fixture.
`MG_IntegrationTest/**` was not touched: the helper is a header-only class used only by unit
targets, and every one of them already has `${MGL_ROOT}/MobileGL` on its include path, so no
shared helper needed to move there.
## What the fix is
`MobileGL/MG_Test/ScopedPipeVerb.h` — `MobileGL::MG_Test::ScopedPipeVerb`, an RAII
"this test is standing inside verb X" object:
* **ctor** calls the real `MG_Pipe::MGPipeFillForVerb(verb)` — the exact call `MG_Impl` makes
before that verb reaches a backend. Nothing is bypassed and nothing is faked: the block is
filled out of the live `GLContext` through the production filler.
* **`Renew()`** re-fills the same verb, for a test that drives the helper again after moving
frontend state — that is what a second GL entry point's `MGP_FILL` would have done.
* **dtor** re-arms the poison with a `kQuery` fill (`GetGpuTimestampNs`, whose class mask is a
single field): the serial bumps and every field the scope stamped goes stale. This matters
when the suite runs as one process — a developer running `./FramebufferTest` directly rather
than one ctest entry per case — where otherwise one case's declaration would silently cover a
later case that forgot to make one.
* **pull build**: the whole class body is `#if MOBILEGL_PIPE_PUSH`-gated to nothing; the
constructor still takes an `MGPipeVerb` (the enum is unconditional in `MGPipe.h`), so call
sites are identical in both arms and cannot rot.
Placement rule, copied from the brief's D7 for `MGP_FILL`: the declaration goes **immediately
before** the backend call, after every frontend mutation that call is meant to see. A call of a
different verb *class* in the same test gets its own nested scope (`{ ScopedPipeVerb clear(Clear); ... }`).
It is not a global escape hatch, the poison was not weakened, and no test name changed.
### Where it is used (exactly the eleven failing entries, no others)
| file | test | verb declared | why |
|---|---|---|---|
| `MG_Test/SanityTest.cpp` | `DirectGLESSanity.BindsAMultisampleTextureDespiteTheDefaultMipmapFilter` | `DrawArrays` | `DirectGLES::BindCurrentTextures()` is the per-draw unit walk — it reads `GetProgramForDraw`, a `kDraw`-only field |
| `MG_Test/SanityTest.cpp` | `DirectGLESSanity.BindingZeroClearsPreviousNativeTextureBinding` | `DrawArrays` + 2×`Renew()` | three walks = three draws; the third stands after `glBindTexture(GL_TEXTURE_2D, 0)` |
| `MG_Test/SanityTest.cpp` | `DirectGLESTextureSync.UnitMemoRefusesToDriveATwinFromAnotherTexture` | `DrawArrays` + `Renew()` | `SyncNeccessaryTextures()` is the per-draw unit walk; the second fill re-reads the memo keys, which is the premise (the silent slot swap moved none of them) |
| `MG_Test/Framebuffer/FramebufferTest.cpp` | `DrawIntoAWidenedDrawBufferReachesTheDriverWithAlphaWritesMaskedOff` | `DrawArrays` | `SyncRenderState(forColorClear=false)` is the draw arm |
| `…` | `ClearIntoAWidenedDrawBufferKeepsAlphaWritableAndSubstitutesOne` | `DrawArrays`, then `Clear` (nested scopes) | the test issues a draw then a clear; the clear half must go through on `kClear`'s fill set alone |
| `…` | `ApplicationAlphaMaskOffIsStillHonouredOnANativeDrawBuffer` | `DrawArrays` | |
| `…` | `DualSourceBlendFactorsReachTheDriverWhenTheExtensionIsThere` | `DrawArrays` | |
| `…` | `DualSourceBlendIsDeclinedRatherThanThrownWhenTheExtensionIsMissing` | `DrawArrays` + `Renew()` | two draws, `glBlendFunc` between them |
| `…` | `DualSourceFactorsAreDeclinedEvenWithBlendingDisabled` | `DrawArrays`, `Clear` (nested), `Renew()` | draw / clear / draw |
| `…` | `DualSourceFactorsWithBlendingDisabledStillReachACapableDriver` | `DrawArrays` | |
| `MG_Test/Texture/TextureTest.cpp` | `TextureTest.StorePackedWordsToClientCopiesWordsVerbatimUnderPackParams` | `ReadPixels` + `Renew()` | `ReadbackImpl::StorePackedWordsToClient` reads the PACK block; two stores with `glPixelStorei` between |
## Verification — commands and actual output
Environment: WSL Arch, `CCACHE_BASEDIR=/home/swung/w7`, `cmake --build <dir> -j 12`.
### Baseline before the fix (the failure being fixed, reproduced)
```
ctest --test-dir build-linux -L unit --no-tests=error -j 8 # rc=0 100% passed, 0 failed out of 1482
ctest --test-dir build-push -L unit --no-tests=error -j 8 # rc=8 99% passed, 11 failed out of 1482
ctest --test-dir build-verify -L unit --no-tests=error -j 8 # rc=8 99% passed, 11 failed out of 1482
```
The 11 in both are exactly the F3 list (push reports `Failed` / one `SEGFAULT` — that build has
`MOBILEGL_PIPE_POISON == 0`, so it reads the *zeroed* block rather than aborting; verify reports
`Subprocess aborted`, the poison Fatal).
### (a) `ctest -L unit` green in all three build dirs
```
cmake --build build-linux -j 12 # 0
cmake --build build-push -j 12 # 0
cmake --build build-verify -j 12 # 0
ctest --test-dir build-linux -L unit --no-tests=error -j 8 # rc=0 100% tests passed, 0 tests failed out of 1482
ctest --test-dir build-push -L unit --no-tests=error -j 8 # rc=0 100% tests passed, 0 tests failed out of 1482
ctest --test-dir build-verify -L unit --no-tests=error -j 8 # rc=0 100% tests passed, 0 tests failed out of 1482
```
Additionally, each affected binary run **whole, in one process** (verify build), which is the
case the destructor's re-arm protects:
```
build-verify/MobileGL/MG_Test/SanityTest exit=0 82 tests, PASSED
build-verify/MobileGL/MG_Test/Framebuffer/FramebufferTest exit=0 61 tests, PASSED
build-verify/MobileGL/MG_Test/Texture/TextureTest exit=0 192 tests, PASSED
```
### (b) pull build symbol-identical to `~/w7/p1-before-libMobileGL.so`
```
python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so \
--after build-linux/libMobileGL.so --threshold 0
```
```
symbol-report: before: /home/swung/w7/p1-before-libMobileGL.so (19100448 bytes on disk)
symbol-report: after : build-linux/libMobileGL.so (19100448 bytes on disk)
symbol-report: .text 10792579 -> 10792579 (+0, +0.000%)
symbol-report: .data 76824 -> 76824 (+0) .bss 1296872 -> 1296872 (+0) .rodata 1534938 -> 1534938 (+0)
symbol-report: 27799 -> 27799 defined symbols: 0 added, 0 removed, 0 resized, 0 renamed
```
**0 / 0 / 0 / 0, `.text` delta 0.** (Expected by construction: the library contains no test code,
and the helper is a no-op header in the pull build anyway.)
### (c) `ctest -N` name diff
```
ctest --test-dir build-linux -N > ft-N-raw.txt
sed -n 's/^ *Test *#[0-9]*: //p' ft-N-raw.txt | sort > ft-names-linux.txt # 2360 names
comm -23 ~/w7/p1-before-ctest-names.txt ft-names-linux.txt | wc -l # 0 removed
comm -13 ~/w7/p1-before-ctest-names.txt ft-names-linux.txt # 26 added
```
**Zero removed.** The 26 additions are all from the earlier P1 packages, already merged at the
branch point — **this package adds none**:
`DirectGLES|DirectVulkan.PipeVerifyArmingScenario.{Armed,CorruptedFieldIsReported}`,
`DirectGLES|DirectVulkan.PoisonOmissionScenario.{OmittedFieldAbortsOnThatVerb,TheSequenceThePoisonControlsRun,WithoutOmissionCompletes}`,
`PipeCatalogue.{FloatVectorsCompareBitwise,SixValueStructsHaveFieldLists,StickyFieldsAreExactlyTheSeven,VerbTableIsTheFunctionTable}`,
and the 13 `PipeInputsTest.*`.
`build-push` registers the same 2360 names (0 added / 0 removed vs `build-linux`). `build-verify`
registers 3178 — the extra 818 are the `integration-verify` lane that `MOBILEGL_ITEST_REQUIRE_GPU=ON`
turns on in that configuration, not a name change from this package.
### (d) the helper is not a rubber stamp
Two mutations of `FramebufferTest.DrawIntoAWidenedDrawBufferReachesTheDriverWithAlphaWritesMaskedOff`
in `build-verify`, run directly with `MOBILEGL_LOG_FILE_PATH` set so the Fatal line is readable:
**A — the declaration deleted from that one test:**
```
exit=134 (SIGABRT)
Fatal{UnmigratedPipeInput, "GetRenderStateParametersVersion@<none>"}
```
**B — the declaration kept but naming the WRONG verb class** (`GenerateMipmap`, `kTextureOp`,
whose mask does not carry the render-state fields):
```
exit=134 (SIGABRT)
Fatal{UnmigratedPipeInput, "GetRenderStateParametersVersion@GenerateMipmap"}
```
B is the stronger half: the helper does not make the poison tolerant, it fills exactly the named
verb's class mask, and a read outside that mask still aborts naming the field **and the declared
verb**. The fill table remains the only thing that says what a verb may read.
**C — restored:** `exit=0`, `100% tests passed, 0 tests failed out of 1`, and
`git status --porcelain -- MobileGL/ scripts/ CMakeLists.txt` is empty. The tree ends clean at
`c67c47f7`.
## F2 enumeration
Not owned by this package. F1, F2 and F4 were not touched.
## Deviations
1. **Tree path.** The tree is `~/w7/p1-fix-tests` (the task text said `~/w7/fix-tests`). Branch,
branch point (`97b997d5`) and ownership are as briefed. Tree wins.
2. **The three build directories did not exist.** The task said the tree has `build-linux`,
`build-push` and `build-verify` configured; it had none. I configured them myself, copying
`~/w7/pipe`'s cache flags exactly (Release, `/usr/sbin/clang++`, ccache, INFO, `BUILD_TEST=ON`,
`BUILD_INTEGRATION_TEST=ON`, mesa EGL vendor + lavapipe ICD, `CMAKE_POLICY_VERSION_MINIMUM=3.5`;
`MOBILEGL_PIPE_PUSH=ON` for push, `MOBILEGL_PIPE_VERIFY=ON` + `ITEST_REQUIRE_GPU=ON` for verify,
matching `~/w7/pipe/build-verify`).
3. **`-DMOBILEGL_BUILD_BENCHMARK=OFF` added to all three configures.** With benchmark left at its
default the configure dies in the fetched Google Benchmark sub-project
(`CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage` from its
`check_cxx_compiler_flag`). `~/w7/pipe`'s three caches all carry
`MOBILEGL_BUILD_BENCHMARK:BOOL=OFF`, so this reproduces the reference trees rather than
changing anything. A transient `googletest` clone failure on the first `build-verify` configure
was cleared by deleting `build-verify/_deps/googletest-{src,subbuild}` and re-configuring.
4. **`ctest -N` baseline.** Acceptance (c) does not name a baseline file; I used
`~/w7/p1-before-ctest-names.txt` (the pre-P1 list), which is the strictest available and shows
both that nothing was removed and that the only 26 additions in the whole lane came from the
other packages.
5. **Extra demonstration.** Acceptance (d) asks only for the removal case (A). I also ran the
wrong-verb case (B), because "removing it makes the test fail" alone would also hold for a
rubber stamp that filled everything; B is what shows it does not.
6. **Destructor behaviour is a design choice not spelled out in the brief.** Leaving the scope
re-arms the poison (a one-field `kQuery` fill) rather than doing nothing. Rationale in the
header and above; without it a single-process run of a test binary would let one case's
declaration cover a later case that made none. It uses only the public filler — no production
source, and no new API, was needed.
## Unfinished
Nothing in this package's scope.
Out of scope, and still open where the findings file left them: **F1** (missing `FillPoints.def`
rows), **F2** (`GetSamplingResolutionGeneration` going stale mid-verb) and **F4** (the
integrator's command corrections). Consequently the `integration-verify` lane and the 79-case
verify retrace were **not** run here — they are still red for F1/F2 reasons this package does not
own, and running them would prove nothing about F3. The only lane this package's change can
affect is `ctest -L unit`, which is green in all three build directories.
@@ -1,87 +0,0 @@
# P1 package C — p1-magma — adversarial review v1
Reviewed: tree `~/w7/p1-magma`, branch `p1/magma` @ `fad8636cb6b423e27c815ca2e4ed2b6ef8613e92` (one commit on top of `p1/contract` = `bf86b1ed`). Result file: `scratchpad/wf4/p1-results/magma-v1.md`. Brief: `scratchpad/wf4/BRIEF-P1.md` sections A, B (D1–D13), C.3, C.5, D, E.
Review scripts and the saved patch: `scratchpad/wf4/magma-review/` (`01_state.sh` … `11_check.sh`, `classify.py`, `ppscan.py`, `dbgcompile.py`, `diff.patch`). Logs: `~/w7/p1-magma-review-*`. The tree was left exactly as found (`git status --porcelain` shows only the untracked `build-linux/`, `build-push/`); the only thing I created is my own throwaway worktree `~/w7/p1-magma-review-int` (detached merge of `p1/magma` + `p1/core`, see §5), which is not a package tree.
**Verdict: approved — zero majors, four minors (none code-affecting).**
---
## 1. What I re-ran independently (every gate reproduces)
| check | command (WSL, `~/w7/p1-magma`, `CCACHE_BASEDIR=/home/swung/w7`) | observed |
|---|---|---|
| tree state | `git log --oneline p1/contract..HEAD`; `git status --porcelain` | exactly one commit `fad8636c`; clean apart from `?? build-linux/ build-push/`; both build dirs are Release / INFO / clang / LTO off, `build-push` has `MOBILEGL_PIPE_PUSH=ON`, `build-linux` OFF/OFF |
| G1 symbol report | `python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0 --markdown ~/w7/p1-magma-review-symbols.md --json ~/w7/p1-magma-review-symbols.json` (after `cmake --build build-linux -j 12` → `ninja: no work to do`) | `Total 17209819 -> 17209819 (+0)`, `27799 -> 27799 defined symbols: 0 added, 0 removed, 0 resized, 0 renamed`, `27060 normalised names, 27060 unchanged` |
| G1 raw | `readelf -S` `.text` size before/after; `nm --defined-only` name-set diff | `0xa4ae83` both; diff `0` lines |
| G2 (owned files) | `grep -rc "pGLContext" MobileGL/MG_Backend \| sort \| diff ~/w7/p1-before-pglcontext.txt -` | the only differences are the eight DirectVulkan files going `4/47/23/1/1/3/2/129 → 0` plus the two contract-created `MG_Backend/MGPipe/PipeInputs.{h,cpp}:0` lines; **every DirectGLES count is unchanged** (`DirectGLES.cpp:92, Managers.cpp:23, MultiDraw.cpp:5, Utils.cpp:2`) — no site outside the package's ownership was touched |
| ownership | `git diff --name-only p1/contract..HEAD` | exactly the eight files of C.5's Magma row; nothing else |
| gen_pipe | `python3 scripts/gen_pipe.py --check` | `generated files are up to date`, rc=0 (`--self-test` does not exist on the contract; it is core c5) |
| unit (pull) | `ctest --test-dir build-linux -L unit -j 12 --no-tests=error` | `100% tests passed, 0 tests failed out of 1466` |
| unit (push) | `ctest --test-dir build-push -L unit -j 12 --no-tests=error` | `100% tests passed, 0 tests failed out of 1466` |
| G7 name diff | `ctest -N \| grep -E "^\s+Test +#" \| sed -E "s/^ *Test +#[0-9]+: //" \| sort` vs `~/w7/p1-before-ctest-names.txt` | `after=2334 before=2334 removed=0 added=0` |
| DV integration lane (pull) | `ctest --test-dir build-linux -L integration-gpu -R '^DirectVulkan\.' -j 4 --no-tests=error --output-on-failure` | `100% tests passed, 0 tests failed out of 427` on the first `-j 4` pass (the implementer's two `*ArmedWhenTheEnvironmentPinsItOn` flakes did not reproduce for me; `~/w7/pipe-int-itest-failures.txt` confirms the PrimGenReroute one flaked on the baseline too) |
| push arm selected | `nm -C build-push/libMobileGL.so \| grep -c "MG_Pipe::PipeInputs::"` vs pull | `13` vs `0`; `ctest --test-dir build-push -N -L integration-gpu -R '^DirectVulkan\.'` → `Total Tests: 427` (the push build registers the lane) |
| include gate | `python3 scripts/check_include_closure.py --mode both --compiler clang++ --self-test --require-all` | rc=0, `6 negative-control trip(s)`, `3 probes, 0 skipped, 0 problem(s)` |
## 2. Independent classification of every changed line (`classify.py` over `git diff -U0 p1/contract..HEAD`)
The script pairs each removed line with its added line and accepts a pair only if applying the D9 rewrite set verbatim to the old line yields the new line; anything else is reported.
```
categories: {'guard': 2, 'arrow': 160, 'assert': 43, 'nenull': 2, 'arrow+ternary': 1, 'eqnull': 1}
pure additions: 7 (the seven #include <MG_Pipe/PipeInputsSwitch.h> lines)
BAD count: 1 (VertexInputStateFactory.h:133 — the comment rewrite, the one intentional non-mechanical line; text equals D9's wording)
arrow occurrences per file: BackendObject 2, DirectVulkan 12, UniformManager 14, VkClearManager 1, VkRenderPassManager 3, VkTextureManager 2, VulkanRenderer 130 — total 164 on 161 lines
non-arrow lines: 49 (DirectVulkan.cpp 34 asserts + 1236 + 1284; UniformManager 9 asserts; VulkanRenderer 11267, 12766; BackendObject 388, 786) + the comment
```
- Old line numbers of every arrow line and every non-arrow line equal the C.3 / D9 lists **verbatim** (printed by the script; compared list-for-list, including the three double-occurrence lines `VulkanRenderer.cpp:9214,10719,10963`).
- No pure deletions; no reordering; `git diff --check` clean; CR count 0 in all eight files (LF preserved).
- `PipeStats` `AddCalls` literals and every other non-`pGLContext` line untouched (follows from the classification: the only non-rewrite changes are the 7 includes and the comment).
- D10: `SyncPersistentMappedRange` / `SyncGpuWrites` counts identical to `~/w7/pipe` per file (`DirectVulkan.cpp 3/0, UniformManager.cpp 1/0, VulkanRenderer.cpp 6/3, VkBufferManager.cpp 2/0` = 12 + 3).
- Include placement matches D3: line immediately after the single `"MG_State/GLState/Core.h"` include in the six TUs that have one (`DirectVulkan.cpp:13`, `BackendObject_DirectVulkan.cpp:15`, `UniformManager.cpp:13`, `VkClearManager.cpp:16`, `VkTextureManager.cpp:14`, `VulkanRenderer.cpp:17`); `VkRenderPassManager.cpp:16` closes its only include block (`:10-15`) and is followed by the blank line and the namespace.
- The six code-bearing rewrites, verbatim (`git diff -U1`):
```
BackendObject_DirectVulkan.cpp:388,786 - if (MG_State::pGLContext) { → if (MGB_CTX_LIVE) {
DirectVulkan.cpp:1236 - !query->pausedPrimitivesCountedByGpu && MG_State::pGLContext != nullptr) { → && MGB_CTX_LIVE) {
DirectVulkan.cpp:1284 - MG_State::pGLContext ? MG_State::pGLContext->GetTransformFeedbackPausedPrimitiveCounter() : 0 → MGB_CTX_LIVE ? MGB_CTX->...() : 0
VulkanRenderer.cpp:11267 - if (!m_transformFeedbackFeatureEnabled || MG_State::pGLContext == nullptr || → || !MGB_CTX_LIVE ||
VulkanRenderer.cpp:12766 - return (MG_State::pGLContext != nullptr && → return (MGB_CTX_LIVE &&
```
Operand order, short-circuit order and the accessor called are unchanged in every one; no null check dropped, no `const&` lost (the sed cannot touch the left-hand side of a site and the classification proves nothing else moved).
## 3. Hunts that came back empty
| hunt | method | result |
|---|---|---|
| site left behind a macro / in a shared file | `grep -rn pGLContext MobileGL/MG_Backend` minus DirectGLES; `grep -rn "MG_State::"` in DirectVulkan excluding `MG_State::GLState` | nothing; no other `MG_State::` global is read |
| site inside a preprocessor region the INFO push build never compiled | `ppscan.py`: every `MGB_CTX` line with a non-empty `#if` stack | none — all 210 lines are unconditionally compiled, so the push build's successful compile checks every site |
| DEBUG-level build breaks on the new spelling (`MOBILEGL_ASSERT` becomes real) | `dbgcompile.py`: each of the seven TUs compiled `-fsyntax-only` with `-DMOBILEGL_LOG_ACTIVE_LEVEL=MOBILEGL_LOG_LEVEL_DEBUG` from `compile_commands.json`, in both `build-linux` and `build-push` | 14/14 `rc=0 errors=0` |
| an accessor Magma names that the D12 `scan_live_accessors()` gate (core c5) will reject | set of `MGB_CTX->(\w+)` in DirectVulkan (56 names) `comm -23` the `X(...)` rows of `MG_Pipe/Coverage.def` (65 rows) | empty — every one of the 56 has a row; the seven F-class names are among them, as the brief expects |
| the push-arm guards change meaning (`MGB_CTX_LIVE` at backend init before any fill) | read the contract: `PipeFill.cpp:33 Bool PipeInputs::IsLive() const { return LiveContext() != nullptr; }` | `MGB_CTX_LIVE` under push is literally `pGLContext.get() != nullptr`, so `BackendObject_DirectVulkan.cpp:388/786` (`InvalidateCompileEnv` at init) and the four XFB guards keep today's meaning in both arms; the brief's D9 [deviation] paragraph ("always true once a context exists") is true of the contract as landed |
| lane green because it never ran | `ctest -N` counts in both builds; `LastTest.log` timestamps | 427 entries registered and executed in both arms |
| other packages' trees touched | heads of `~/w7/p1-espryt` (`f4ea84c5`), `~/w7/p1-verify` (`bf86b1ed`), `~/w7/pipe` (`087685d1`, clean apart from its own untracked build dirs) | untouched by this package |
## 4. Where the tree and the brief disagree (and what wins)
- None on counts: every per-file count, line list and the D10 site count re-measured on the tree equals the brief and the result file.
- `ctest -N` recipe: the brief's `grep -E '^\s+Test #'` matches only four-digit test numbers on this ctest (`Test #1:` / `Test #999:` / `Test #1000:`). The baseline file `~/w7/p1-before-ctest-names.txt` nevertheless holds all 2334 clean names (verified head/tail and `grep -c '^ *[0-9]*:'` = 0), so the integrator's `wsl_p1_verify_all.sh` (which already uses `Test +#`) is fine; the brief's recipe line in D.1/C is the stale one. The implementer recorded this correctly.
- D13 says commits are single-line; the orchestrator's commit rule (subject + `- ` bullets) wins for this package and the implementer declared it. Subject line equals C.3's prescribed text character for character.
## 5. The one verification the result file could not do: the push-build DV lane on a tree that fills
The pull-build lane is a tautology for this package (the `.so` is byte-identical to the baseline), so the only functional test that can fail because of Magma's converted sites is the push build with core's filler and fill points present. The implementer deferred it because `p1/core` had no commit past the contract at 01:49; by review time `p1/core` was at `275dd3ed` (c2 filler `3aa4d8af`, c3 83 fill points `a196ada4`, c4 comparator `275dd3ed`), touching no Magma-owned file, `git merge-tree` conflict-free. I built a throwaway detached merge (`~/w7/p1-magma-review-int` @ `72a919b2`, `p1/magma` + `p1/core`, same configure flags as `wsl_p1_tree.sh`) and ran:
MERGED_RESULTS_PLACEHOLDER
## 6. Minors (none require a code change in this package)
1. **Push-smoke abort mischaracterised.** The result file (item 11) reports the contract-tree push lane as `12/12 Subprocess aborted` and calls it the expected poison. The actual reason (reproduced: `MOBILEGL_LOG_FILE_PATH=... ctest --test-dir build-push -R '^DirectVulkan\.OrientationScenario\.OffscreenPassRendersUpright$'`) is `[FATAL]: MGPipe: Fatal{UnmigratedPipeInput, "GetFramebufferBindingSlot@<none>"}` — the **unconditional** null-storage check in `PipeInputs.h:475-478` (`m_bufferBindingSlot[index] == nullptr → MGPipeInputPoisonFatalForVerb`), fired before any fill point ran (`@<none>`; c3 was not on the contract). The D6 per-verb poison (`MGP_INPUT_CHECK`) is compiled out in a Release/INFO push build (`MOBILEGL_PIPE_POISON 0`, `PipeInputs.h:25`), so "the poison working" (C.2 step 4's wording, which C.3 inherits) is not what was observed. Harmless for this package; worth correcting in the brief's C.2/C.3 text so the integrator does not read a `<none>` Fatal as a table gap.
2. **The result file's "Lane green by name: 427/427" rests on a serial rerun of two flaky entries** rather than a clean `-j 4` pass. My `-j 4` pass was 427/427 first time; the baseline's failure list carries the same PrimGenReroute entry. Not a package defect, but the integrator's D.1 lane should keep `--rerun-failed -j 1` in its recipe (it already does).
3. **Commit-message form** deviates from D13's single-line rule (declared; the orchestrator's rule wins). No action.
4. **Cross-package observation, not Magma's:** the contract keeps a `Bool m_live` that `MGPipeFillForVerb` writes (`PipeFill.cpp:84,88`) but `IsLive()` ignores it (`PipeFill.cpp:33`). Magma's six `MGB_CTX_LIVE` sites are correct *because* `IsLive()` forwards; if core ever switches `IsLive()` to `m_live`, `BackendObject_DirectVulkan.cpp:388/786` (backend init, before any verb) would silently skip `InvalidateCompileEnv` under push. Record for the core reviewer / integrator.
## 7. Majors
None.
@@ -1,72 +0,0 @@
# P1 package C — p1-magma — result v1
Tree `~/w7/p1-magma`, branch `p1/magma`, branched from tag `p1/contract` (= `bf86b1ed`, the contract commit).
Scripts used: `scratchpad/wf4/magma/00_tree.sh` … `10_pushsmoke.sh`; logs under `~/w7/p1-magma-verify-*`.
## Commits (not pushed)
| hash | subject |
|---|---|
| `fad8636cb6b423e27c815ca2e4ed2b6ef8613e92` | `[Refactor] (Magma): route every frontend read through MGB_CTX - 164 arrow sites sed'd, 49 non-arrow lines converted (43 asserts keep their meaning as MGB_CTX_LIVE); pull build byte-identical` (+ `- ` bullets: per-file counts, D9 categories, D10 untouched, the G1 proof) |
`git diff --stat p1/contract HEAD`: 8 files changed, 217 insertions(+), 210 deletions(-) — 210 rewritten lines (the brief's 210) + 7 `#include <MG_Pipe/PipeInputsSwitch.h>` lines.
## What was converted (all under `MobileGL/MG_Backend/DirectVulkan/`)
| file | `MGB_CTX->` (arrow occurrences) | `MGB_CTX_LIVE` | include placed |
|---|---|---|---|
| `DirectVulkan.cpp` | 12 | 36 (34 asserts + `:1236` + the `:1284` ternary) | after `Core.h` (`:13`) |
| `BackendObject_DirectVulkan.cpp` | 2 | 2 (`:388`, `:786` guards) | after `Core.h` (`:15`) |
| `Renderer/UniformManager.cpp` | 14 | 9 (asserts) | after `Core.h` (`:13`) |
| `Renderer/VulkanRenderer.cpp` | 130 (127 lines) | 2 (`:11267` → `!MGB_CTX_LIVE`, `:12766`) | after `Core.h` (`:17`) |
| `Renderer/VkClearManager.cpp` | 1 | 0 | after `Core.h` (`:16`) |
| `Renderer/VkRenderPassManager.cpp` | 3 | 0 | after its include block (`:16`, after `TextureMetrics.h`; never included `Core.h`) |
| `Renderer/VkTextureManager.cpp` | 2 | 0 | after `Core.h` (`:14`) |
| `Renderer/VertexInputStateFactory.h` | — | — | comment `:133` → "they live on the frontend context's VAOs" |
Total 164 arrow occurrences on 161 lines + 49 non-arrow lines = 213 occurrences / 210 lines, exactly D1/C.3. The old line numbers of every removed non-arrow line were extracted from the diff and equal the D9 lists verbatim (DirectVulkan.cpp 337…1008 + 1236; UniformManager 812…1968; VulkanRenderer 11267, 12766; BackendObject 388, 786).
Rewrites used (D9): `MG_State::pGLContext->` → `MGB_CTX->`; `MOBILEGL_ASSERT(MG_State::pGLContext, ` → `MOBILEGL_ASSERT(MGB_CTX_LIVE, `; `MG_State::pGLContext != nullptr` → `MGB_CTX_LIVE` (covers the 9 UniformManager asserts, `DirectVulkan.cpp:1236`, `VulkanRenderer.cpp:12766`); `MG_State::pGLContext == nullptr` → `!MGB_CTX_LIVE`; `if (MG_State::pGLContext) {` → `if (MGB_CTX_LIVE) {`; `MG_State::pGLContext ? ` → `MGB_CTX_LIVE ? ` (`:1284`). No other qualified spelling (`::MG_State::pGLContext`, `MobileGL::MG_State::pGLContext`) existed (checked before the sed).
D10: the 12 `SyncPersistentMappedRange` + 3 `SyncGpuWrites` Magma sites are untouched (token counts 13 / 3 before and after, identical to `~/w7/pipe`). `PipeStats` `AddCalls` literals untouched (no non-`MGB_CTX` line changed besides the 7 includes and the comment — verified by filtering the diff).
## Verification commands and actual output
All in WSL, `~/w7/p1-magma`, `CCACHE_BASEDIR=/home/swung/w7`, build flags = `wsl_p1_tree.sh` (Release/INFO, clang, ccache, tests+itests on, lavapipe ICD, `MOBILEGL_BUILD_BENCHMARK=OFF`).
1. Tree creation `wsl_p1_tree.sh magma p1/contract`: `build-linux build rc=0 [955/955]`, `build-push build rc=0 [959/959]`.
2. `grep -rc "pGLContext" MobileGL/MG_Backend/DirectVulkan | grep -v ":0$"` → **empty** (all 43 files report 0).
3. `cmake --build build-linux -j 12` (after `touch` of the 8 files, to prove the objects come from the converted sources): rc=0, 21 objects rebuilt. Same for `build-push`: rc=0, 21 objects rebuilt.
4. `python3 scripts/symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0 --markdown ~/w7/p1-magma-verify-symbols.md --json ~/w7/p1-magma-verify-symbols.json`:
```
.text 10792579 -> 10792579 (+0, +0.000%) .data +0 .bss +0 .rodata +0 Total 17209819 -> 17209819 (+0)
27799 -> 27799 defined symbols: 0 added, 0 removed, 0 resized, 0 renamed
27060 -> 27060 normalised names, 27060 unchanged
```
Run twice (before and after the touch-rebuild): identical. `nm --defined-only` name-set diff: 0 lines. (The `.so` sha256 differs — build path / build-id — sections and symbols do not.) **G1: 0/0/0/0, .text delta 0; no attribution needed.**
5. `ctest --test-dir build-linux -L unit --no-tests=error --output-on-failure` → `100% tests passed, 0 tests failed out of 1466`.
6. `ctest --test-dir build-linux -L integration-gpu -R '^DirectVulkan\.' --no-tests=error -j 4 --output-on-failure` → 425/427 first pass; the two failures, `DirectVulkan.PrimGenReroute.PrimitivesGeneratedNoXfbScenario.TheRerouteIsActuallyArmedWhenTheEnvironmentPinsItOn` and `DirectVulkan.PointSizeDemotion.PointSizeDemotionScenario.TheDemotionIsActuallyArmedWhenTheEnvironmentPinsItOn`, both "quirk pinned ON but the log never reported engaging it". Rerun serially (`-j 1`) twice → **both Passed** each time (0.2–0.3 s). The PrimGenReroute one is also the single entry in the baseline's own failure list `~/w7/pipe-int-itest-failures.txt` (same `-j 4` run shape); the PointSizeDemotion sibling passed in the baseline's run. Both are the "read the log file appended after the case started" scenarios and race under `-j 4`; not a Magma-conversion effect. **Lane green by name: 427/427.**
7. `ctest --test-dir build-push -L unit --no-tests=error` → 1466/1466 (push build compiles, links, and its unit set is green).
8. `ctest -N` name diff: `ctest --test-dir build-linux -N | grep -E '^\s+Test\s+#' | sed 's/^ *Test *#[0-9]*: //' | sort` → 2334 names; `comm -23 ~/w7/p1-before-ctest-names.txt -` → **empty**, `comm -13` → empty.
9. `python3 scripts/check_include_closure.py --mode both --compiler clang++ --self-test --require-all` → rc=0, `3 probes, 0 skipped, 0 problem(s)` (the new backend→`MG_Pipe/PipeInputsSwitch.h` include does not trip the include gate).
10. Push arm really selected: `nm -C build-push/libMobileGL.so | grep -c "MG_Pipe::PipeInputs::"` = 13 vs 0 in `build-linux`; `VulkanRenderer.cpp.o` in `build-push` references `gPipeInputs` (2).
11. Informational only (not a P1-C gate): `ctest --test-dir build-push -L integration-gpu -R '^DirectVulkan\.' -I 1,12 -j 4` → 12/12 `Subprocess aborted`. Expected on the contract tree: the contract's `MGPipeFillForVerb` only bumps the serial and copies no field (C.2 step 4 predicts this run is red until `p1/core` c2+ lands). `p1/core` currently has **no commit beyond `p1/contract`**, so the "rerun after rebasing onto p1/core c2+" half could not be done in this package.
## Where the tree contradicted the brief's numbers
None. Every count re-measured on the tree equals the brief: per-file `pGLContext` counts (4/47/23/1/1/3/2/129 = `~/w7/p1-before-pglcontext.txt`), arrow occurrences (12/2/14/1/3/2/130), the 49 non-arrow line numbers, the three double-occurrence lines (`VulkanRenderer.cpp:9214,10719,10963`), the D10 site count (12 + 3), the Core.h include line numbers used for D3 placement.
One brief-vs-brief detail: the C.3 header says "49 non-arrow lines" and the D9 table for C sums to 35 + 2 + 9 + 2 + 1 = 49 including the comment line — consistent; `:1284` is counted as an arrow line (it takes both the sed and the `MGB_CTX_LIVE ?` rewrite) and is not double-counted.
The brief's `ctest -N` recipe (`grep -E '^\s+Test #'`) misses tests #1–#999 on this ctest (they print as `Test #999`, padded); the baseline file `~/w7/p1-before-ctest-names.txt` has all 2334, so the diff was taken with `Test\s+#` (same `sed`). Noted so the integrator's D.1 step does not report a false 999-name loss.
## Deviations from the brief
None in the code. Process notes:
- The edits were applied while the initial `wsl_p1_tree.sh` build was still running (after `git worktree add`, before `build-linux/` existed); to remove any doubt about stale objects, all 8 files were `touch`ed and both configurations rebuilt (21 objects each) before the final symbol report and test runs.
- The commit message carries the prescribed subject plus `- ` bullets (per the task's commit rules), not the single-line form of D13.
## Unfinished / for the integrator
- The push-build DirectVulkan lane on a tree that actually fills (`p1/core` c2+) has not been run — `p1/core` had no commit past the contract at the time of this result. After the D.1 rebase, `cmake --build build-push && ctest --test-dir build-push -L integration-gpu -R '^DirectVulkan\.' -j 4` is the first thing to run on this branch.
- The two `*ArmedWhenTheEnvironmentPinsItOn` scenarios are `-j 4`-flaky on lavapipe (baseline included); if the integrator's D.1 lane run trips on one, a serial rerun of that entry is the check.
@@ -1,97 +0,0 @@
# Adversarial review — package E `p1-verify` (v1)
Tree `~/w7/p1-verify`, branch `p1/verify` = `1a5252b6`, four commits on `p1/contract` (`bf86b1ed`). Tree left exactly as found (only the untracked `build-*` directories the implementer created; no file touched). Scripts and raw outputs: `scratchpad/wf4/verify-review/s0*.sh`, `~/w7/p1-verify-review/`.
**Verdict: NOT approved — 3 majors.** The package's mechanical gates all hold (G1 0/0/0/0 +0, G2 untouched, G7 additions only, `gen_pipe --check` clean, unit 1466/1466 in all three builds, lane counts as claimed, `trace_cases.py` formats byte-identical to the contract, YAML parses, the `run_trace_case.cmake` block does what it says on synthetic logs). What fails is the CI mode itself: two of its always-on steps cannot pass on the integrated tree for reasons unrelated to the comparator, and the G1 job's gate is weaker than G1's check column.
## 1. What was re-run independently (command → observed)
| # | command (in `~/w7/p1-verify`) | observed |
|---|---|---|
| 1 | `git diff --name-only p1/contract..HEAD` | the 9 files of the result file; every one is in E's row of C.5. Nothing under `MG_Backend/**`, `MG_Test/**`, root `CMakeLists.txt`, `MG_Pipe/**` touched. |
| 2 | `grep -rc pGLContext MobileGL/MG_Backend \| sort \| diff - ~/w7/p1-before-pglcontext.txt` | only the two `:0` lines for `MG_Backend/MGPipe/PipeInputs.{h,cpp}` (files the contract commit created after the baseline was captured; both 0). E converts no site and touches no site. |
| 3 | `python3 scripts/gen_pipe.py --check` | rc 0, `63 verify payloads, 63 PipeInputs fields (7 sticky), 69 verbs, 9 classes`, `0 UNMAPPED`, up to date. |
| 4 | `cmake --build build-{linux,push,verify} -j 12` | `ninja: no work to do` ×3 (the trees were current). |
| 5 | `symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0 --fail-on-symbol-set-change --fail-on-added-bytes 0` | rc 0; `.text 10792579 -> 10792579 (+0)`, `27799 -> 27799: 0 added, 0 removed, 0 resized, 0 renamed`. G1 holds for E. |
| 6 | `ctest -L unit --no-tests=error -j 12` in build-linux / build-push / build-verify | `100% tests passed, 0 tests failed out of 1466` ×3. |
| 7 | `ctest --test-dir build-linux -N` vs `~/w7/p1-before-ctest-names.txt` | removed 0, added 10 (the five new cases × 2 backends). |
| 8 | `ctest --test-dir build-verify -N -L integration-verify` | 816; `VerifyCorrupted.`/`PoisonOmitted.` = #3157-3160; control-A filter selects 5. |
| 9 | `ctest --test-dir build-linux -L integration-verify --no-tests=error` | `Total Tests: 0`, rc 8 (G8 half two holds). |
| 10 | `ctest --test-dir build-retrace -N -L retrace` | 80. |
| 11 | `grep -ho "MOBILEGL_PIPE_[A-Z_]*=…" build-verify/MobileGL/MG_IntegrationTest/*.cmake \| uniq -c` | 816 `PIPE_VERIFY=1`, 2 each of `CORRUPT`, `FATAL=0`, `POISON_OMIT` — the ambient entries name neither control knob. |
| 12 | `trace_cases.py --format {cmake,names,fixture-files,github-test-matrix}` HEAD vs contract, same directory | all four byte-identical; `github-verify-matrix` = 16 (OpenRA first), `github-test-matrix` = 77. |
| 13 | `python3 scripts/symbol_report.py --self-test` | `OK (2 canned transcripts, 5 buckets, 2 gates)`. |
| 14 | Windows `yaml.safe_load` on a copy (BOM kept) | 17 jobs; `retrace-verify` needs/if as stated; `remove-artifact-clutter` needs `[retrace-summary, retrace-verify]`, `if: always()`; dispatch input `baseline_sha`; `trace-cases` outputs incl. `verify-matrix`; `pipe-gates` has both `--self-test` steps. Job-level diffs of `build-linux-verify`/`retrace-verify`/`integration-verify` against their originals show only the declared changes plus the two items in minors 5 and 6. |
| 15 | `run_trace_case.cmake:150-186` extracted and driven with `cmake -P` against 9 synthetic logs | unset→0, `=0`→0, armed→0, no-arming→1, missing log→1, `Fatal{PipeVerifyDiffer`→1, `Fatal{UnmigratedPipeInput`→1, `=true` armed→0, `Fatal{PipeVerifyBadKnob}`→0 (see minor 7). |
| 16 | `ctest --test-dir build-verify -R 'DirectGLES\.Verify\.PipeVerifyArmingScenario\|VerifyCorrupted\.\|PoisonOmitted\.\|Verify\.PoisonOmissionScenario\.WithoutOmissionCompletes'` | `Armed` ***Failed, `CorruptedFieldIsReported` (ambient) ***Skipped, both `WithoutOmissionCompletes` Passed (0.43/0.45 s), the four control entries ***Failed — exactly the contract-tree shape the result file reports. |
| 17 | `python3 scripts/gen_pipe.py --self-test` | `unrecognized arguments: --self-test`, rc 2 — the declared dependency on core c5. |
## 2. Majors
### M1 — Both `nm -D` gates can never pass: the Release library exports no MGPipe symbol
`test.yml:393-394` (`build-linux-verify`, "The verify library really carries the comparator") and `test.yml:1161` (`retrace-verify`, "Unpack the VERIFY runtime") do `nm -D --defined-only libMobileGL.so | grep -q MGPipeVerifyInputs` / `MGPipeFillForVerb`. The library is built with `CXX_VISIBILITY_PRESET hidden` for every non-Debug configuration (root `CMakeLists.txt:600-604`), and the MGPipe functions are plain namespace functions with no export attribute, so they are local (`t`) symbols and absent from the dynamic table. Reproduced on this tree with the symbol that already exists:
```
$ nm -D --defined-only build-verify/libMobileGL.so | grep -c MGPipeFillForVerb
0
$ nm --defined-only build-verify/libMobileGL.so | grep MGPipeFillForVerb
0000000000648d80 t _ZN8MobileGL7MG_Pipe17MGPipeFillForVerbENS0_10MGPipeVerbE
$ nm -D --defined-only build-verify/libMobileGL.so | grep -c MGPipe # 0 of 11930 exported
0
```
Consequence: `build-linux-verify` fails at its check step on every run, so `integration-verify` (needs it) never runs and every `retrace-verify` matrix entry is skipped by its `if:`. The result file attributes the red to "`MGPipeVerifyInputs` does not exist until core c4"; that is not the failure mode — `MGPipeFillForVerb` exists today and is not found either, and c4 will not change visibility. The fix is one of: `nm --defined-only` (static symtab; the runtime artifact is not stripped, and the job's own MG_Remote check at `test.yml:1301` already uses that spelling), or an exported probe symbol. The step's comment ("a typo'd -D is not an error in CMake") is right about the need; the spelling defeats it.
### M2 — "Every verify process really armed" (`test.yml:504-517`) reds a healthy lane, and checks one process, not every process
The step greps `pipe-verify-*.log` for the arming line after the whole lane ran. Each ambient lane shares ONE log path (`MG_IntegrationTest/CMakeLists.txt:670,674`), and the library opens it with `fopen(path, "w")` at each process's first write (`MG_Util/Debug/Log.cpp:73`), so after 406 serial processes the file holds only the LAST one. The last registered entry of each ambient lane is `PoisonOmissionScenario.WithoutOmissionCompletes` (ctest #2750 / #3156, from `ctest -N -L integration-verify`), and that parent process never reaches a verb: its body is `Ready()` → `fork()+execve()` → `waitpid` → read files (`PoisonOmissionScenario.cpp:344-380`); the fixture `SetUp` brings up a context via `RunEglBringUp` (`HeadlessGL.cpp:205-297`: EGL + `glGetString`), which contains no `GLFunctionsTable` verb; the child writes its own `.poison-child` file. Arming is latched at the first fill (brief D8), so this process's log carries no arming line by construction.
Reproduced on this tree:
```
$ ctest --test-dir build-verify -R '^DirectGLES\.Verify\.PoisonOmissionScenario\.WithoutOmissionCompletes$' # rc 0
$ wc -l < build-verify/MobileGL/MG_IntegrationTest/pipe-verify-DirectGLES.log
317
$ head -1 …/pipe-verify-DirectGLES.log ; tail -1 …/pipe-verify-DirectGLES.log
[…] Initializing MobileGL...
[…] MobileGL closing...
```
(317 lines of init/teardown; no verb, no fill.) On the integrated tree, therefore, `grep -q "MGPipe: verify armed"` on this file fails and the step exits 1 — a red for a non-reason, immediately after a green 816-entry run. Even with a different last entry the step proves only "the last process armed", not "every process" (the name and the `::error::` text both claim the latter); the per-process proof is `PipeVerifyArmingScenario.Armed`, which already exists. Either drop the step or make it honest (e.g. count processes that wrote, or give the arming entry its own log path and grep that).
### M3 — The G1 gate (`symbol_report.py:244-257`) passes a shrunk `.text` and resized symbols; G1's check column requires all four buckets and the delta to be zero
Brief A/G1: "`added == removed == resized == renamed == 0`, `.text` delta 0". `gate_failures` has no `resized` (or `renamed`) input at all, and `--fail-on-added-bytes N` fires only on `text_delta > N`:
```
$ python3 -c "import sys; sys.path.insert(0,'scripts'); import symbol_report as s
print(s.gate_failures([], [], -4096, 0, True)); print(s.gate_failures.__code__.co_varnames[:5])"
[]
('added', 'removed', 'text_delta', 'fail_on_added_bytes', 'fail_on_symbol_set_change')
```
So `monolith-symbol-report` with `--threshold 0 --fail-on-symbol-set-change --fail-on-added-bytes 0` (`test.yml:1306-1314`) is green for a P1 tree whose pull `.text` shrank, or whose functions were resized with zero net delta (the exact shape the D9 guard rewrites can produce: "if `.text` moves, this is the first suspect"). Deviation 10 says "`--threshold` already governs resizes" — it governs only the report's bucket (`bucket(..., args.threshold)`), never the exit code. A one-line fix each: `text_delta != 0` under `--fail-on-added-bytes 0` (or a `--fail-on-text-delta`), and `resized` in the set-change gate; the self-test then needs the corresponding canned cases. (With `--strip-scope`, renames are additionally folded out of `added`/`removed` at `:193` and escape the gate; the CI invocation does not pass it, so that is a documentation hole only.)
## 3. Minors
1. **The re-exec'd child discards its own assertions.** `PoisonOmissionScenario.cpp:274-281`: `RunSequence(); … _exit(0);` unconditionally. If `ASSERT_NE(program, 0u)` (`:142`) or any earlier fatal assertion fires, `RunSequence` returns before the draw and the mipmap, the child exits 0, and `WithoutOmissionCompletes` passes without the sequence having run (the `"Fatal{"`-absent check is satisfied by any log). Fails safe for CI control B (it would go red), but the G5 sibling entry can pass vacuously. `_exit(::testing::Test::HasFailure() ? 1 : 0)` and a `glGetError()` after the mipmap close it.
2. **Shared per-lane log vs the brief's `-j 4`.** D.3 runs `ctest -L integration-verify -j 4`; with 405 siblings truncating `pipe-verify-<backend>.log`, `Armed`'s whole-file arming grep (`PipeVerifyArmingScenario.cpp:184`) can miss the line during a neighbour's bring-up window (false red), and `LibraryLogSince(before)` (`:192`) reads past EOF after a truncation (Fatal scan vacuous — harmless only because `FATAL=1` aborts anyway). The existing lanes that use this idiom are one-entry filtered lanes. `RUN_SERIAL`/`RESOURCE_LOCK` on the ambient registrations, or a dedicated arming lane with its own log, removes the race; at minimum the result file should tell the integrator to run the arming entries serially.
3. **`remove-artifact-clutter` sweeps a failed verify retrace's fixture.** `test.yml:1364` keeps `trace-fixture-*` only for jobs whose name `startswith("retrace (")`; `retrace verify (…)` failures are not consulted. The `needs:` was extended; the keep-on-failure filter was not (the commit message implies both).
4. **Retrace negative control overwrites the verified run's output.** `test.yml:1188-1200` reruns OpenRA into the same case directory; `Upload actual image` (`:1209`) then ships the corrupted run's images for OpenRA/DirectGLES.
5. **`integration-verify` drops the second `MOBILEGL_ESPRYT_DISABLE_INVALIDATE_FLUSH=1` pass** the `integration` job runs (`test.yml:290-294`), so the staged-copy upload tier is never exercised under the comparator. Not required by C.4; worth a sentence in the docs so "every integration entry" is not read as "every configuration".
6. **`build-linux-verify` hardcodes Release** where `build-linux` switches to Debug under `ACTIONS_STEP_DEBUG` (the original's `BUILD_TYPE` block). Declared in the step comment and correct (a Debug build would flip visibility and the poison arm), but it is an undeclared difference from "copy of `build-linux:12-147`"; the "Show installed toolchain" step is also dropped.
7. **`run_trace_case.cmake:170-171` scans only `PipeVerifyDiffer|UnmigratedPipeInput`.** `Fatal{PipeVerifyBadKnob}` (a typo'd knob) is not in the regex; it is caught only because D2 makes it abort. Fine if that stays true; a comment would do.
8. **D.3's G5 line as written in the brief (`-R 'Mipmap'` without `--no-tests=error`) prints rc=0 on this tree** because nothing matches (`ctest -N -R Mipmap` → 0). Deviation 4 fixes CI but the result file does not hand the integrator the corrected local line (`-R 'DirectGLES\.Verify\.PoisonOmissionScenario\.WithoutOmissionCompletes' --no-tests=error`).
9. Result-file wording: "`MGPipeVerifyInputs` … does not exist until core c4 … the check is the point" reads as if the check will turn green at c4; per M1 it will not.
## 4. Brief vs tree (facts recorded, tree wins)
- Lane size 816 (not 742/752), pull `integration-gpu` 878 — as the result file measured; the `comm` parity is trivially true (fold of `Verify.`/`VerifyCorrupted.`/`PoisonOmitted.`), not a statement about coverage.
- `LABELS "a\;b"` escaping, `include(GoogleTest)` at `:395`, `'^\s+Test #'` regex — confirmed as the result file states.
- `gen_pipe.py --self-test` does not exist on this tree (rc 2) — the `pipe-gates` step is red until core c5, as declared.
- `retrace` label count 80 (build-retrace registers the non-CI case pair too).
## 5. What was not re-run
The full 816-entry lane, any real retrace under `MOBILEGL_PIPE_VERIFY`, and any CI dispatch — same as the implementer, for the same reasons (no comparator on the contract tree; no push). M1 and M2 are demonstrable without them; M3 is a pure-function property.
@@ -1,69 +0,0 @@
# Adversarial review — package E `p1-verify` (v2)
Tree `~/w7/p1-verify`, branch `p1/verify` = `eec8cf2c`, eight commits on `p1/contract` (`bf86b1ed`): the four of v1 plus `6060690a`, `01300e6a`, `ce26029c`, `eec8cf2c`. Tree left exactly as found (the four untracked `build-*` directories the implementer created; no file touched; the only side effect of this review is a rebuilt-and-relinked `MobileGLIntegrationTest` in `build-linux`/`build-push`, see minor 4, and fresh `pipe-*.log*` files under `build-verify/MobileGL/MG_IntegrationTest/`). Scripts and raw outputs: `scratchpad/wf4/verify-review2/s01.sh … s11.sh`, `jobdiff.py`, and `~/w7/p1-verify-review2/`.
**Verdict: APPROVED — 0 majors, 5 minors.** The three v1 majors are fixed and the fixes were re-derived independently (not just re-read): the static-symtab gate finds `MGPipeFillForVerb` today and `MGPipeVerifyInputs` exists in `p1/core`; the arming assertion has a one-process lane and the CI step reads only those logs; `gate_failures` now fails on all four buckets and on a `.text` that moved either way. Everything else the package claims holds under re-run, and the deeper hunts (the `.so` swap's linkage, `ctest --timeout` vs a `TIMEOUT` property, log flushing before `std::abort()`, both backends reading `GetActiveTextureUnit` at `GenerateMipmap`, the ambient `Verify.` lanes being functionally green on this tree, the per-job YAML diffs against their originals) found nothing that can make a lane red or green for the wrong reason.
## 1. What was re-run independently (command → observed)
All in `~/w7/p1-verify` unless stated; `CCACHE_BASEDIR=/home/swung/w7`.
| # | command | observed |
|---|---|---|
| 1 | `git status --short`; `git log --oneline p1/contract..HEAD`; `git diff --stat p1/contract..HEAD` | clean apart from `build-*`; 8 commits; 9 files, +1738/−14 — exactly E's row of C.5. Nothing under `MG_Backend/**`, `MG_Test/**`, `MG_Pipe/**`, root `CMakeLists.txt`, `Config.h`, `ConfigLoader.cpp`. Every touched file is LF (`grep -c $'\r'` = 0 ×9). |
| 2 | `cmake --build build-{linux,push,verify} -j 12` | `build-verify`: no work; `build-linux`/`build-push`: `[2/2] Linking CXX executable MobileGL/MG_IntegrationTest/MobileGLIntegrationTest` (minor 4). The library itself did not change (row 3). |
| 3 | `symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0 --fail-on-symbol-set-change --fail-on-added-bytes 0` | rc 0; `.text 10792579 -> 10792579 (+0)`; `27799 -> 27799: 0 added, 0 removed, 0 resized, 0 renamed`. G1 holds under the now-strict gate. |
| 4 | `grep -rc pGLContext MobileGL/MG_Backend \| sort \| diff - ~/w7/p1-before-pglcontext.txt` | only the two `:0` lines for the contract's `MGPipe/PipeInputs.{h,cpp}`. E converts no site, touches no site (G2 is B/C's). |
| 5 | `python3 scripts/gen_pipe.py --check` | rc 0: `63 verify payloads, 63 PipeInputs fields (7 sticky), 69 verbs, 9 classes`, `0 UNMAPPED`, up to date. `--self-test` → rc 2 here (contract tree); on `~/w7/p1-core` (read-only, `d9f4698d`) → `6 negative-control trip(s), positive control OK`, rc 0 — the `pipe-gates` step E added will be green once core lands. |
| 6 | `python3 scripts/symbol_report.py --self-test` | `OK (2 canned transcripts, 5 buckets, 3 gates)`. |
| 7 | `ctest -L unit --no-tests=error -j 12` in build-linux / build-push / build-verify | `100% tests passed, 0 tests failed out of 1466` ×3 (after the relink of row 2). |
| 8 | `ctest --test-dir build-linux -N` vs `~/w7/p1-before-ctest-names.txt` (`comm`) | removed 0, added 10 (the five new cases × 2 backends). G7 additions only. |
| 9 | `ctest --test-dir build-verify -N -L integration-verify` / `-L integration-gpu`; build-linux `-L integration-gpu` | **818** / 1696 / 878. The 16 non-ambient-or-new names listed: `Verify.` ×10, `VerifyArming.` ×2, `VerifyCorrupted.` ×2, `PoisonOmitted.` ×2. |
| 10 | `ctest --test-dir build-linux -L integration-verify --no-tests=error` | `Total Tests: 0`, rc 8 — G8 half two holds. |
| 11 | `ctest --test-dir build-retrace -N -L retrace` | 80. |
| 12 | env-knob census over `build-verify/MobileGL/MG_IntegrationTest/*.cmake` | `818 MOBILEGL_PIPE_VERIFY=1`, `2 …_CORRUPT=GetRenderStateParameters`, `2 …_FATAL=0`, `2 …_POISON_OMIT=GenerateMipmap:GetActiveTextureUnit`, `2 MGITEST_PIPE_ARMING_LANE=1`. No ambient entry names a control knob or the arming marker — the C.4 ENVIRONMENT constraint holds. |
| 13 | `ctest --test-dir build-verify -R 'PipeVerifyArmingScenario\|PoisonOmissionScenario'` (26 entries) | pull-prefixed ×10: all ***Skipped**; ambient `Verify.` ×10: 8 ***Skipped**, both `WithoutOmissionCompletes` **Passed** (0.44/0.39 s); `VerifyArming.` ×2, `VerifyCorrupted.` ×2, `PoisonOmitted.` ×2: all ***Failed**. **The arming case skips or fails on the contract tree; it never passes.** |
| 14 | `ctest … -R '^DirectGLES\.VerifyArming\.' --output-on-failure` | fails at `PipeVerifyArmingScenario.cpp:211` with "the library never reported arming the comparator" — the right reason (no comparator until core c4), not a GPU/harness failure. `pipe-verify-arming-{DirectGLES,DirectVulkan}.log` exist (318/330 lines, 0 arming lines) — so the CI arming step would red this tree for the right reason too. |
| 15 | `ctest --test-dir build-verify -L integration-verify -E 'VerifyArming\.\|VerifyCorrupted\.\|PoisonOmitted\.' -j 8 --no-tests=error` (the two ambient `Verify.` lanes, 812 entries, **not run by the implementer**) | rc 0, `100% tests passed, 0 tests failed out of 812`, 77 skipped. The registration itself (per-lane `MOBILEGL_LOG_FILE_PATH`, `TIMEOUT 900`, `-j 8` on a shared log path) breaks no existing scenario. |
| 16 | control filters: `ctest -N -L integration-verify -R 'DirectGLES\.Verify\..*ClearThenReadPixels'` / `-R 'DirectGLES\.Verify\.PoisonOmissionScenario\.WithoutOmissionCompletes'` | 5 entries (all five `ClearThenReadPixelsScenario` cases, each issues a clear on DirectGLES) / 1 entry. Neither control can pass on an empty selection. |
| 17 | `trace_cases.py --ci --format github-verify-matrix` | 16 entries over exactly the 8 named cases; `github-test-matrix` 77. |
| 18 | `readelf -d build-verify/libMobileGL.so \| grep -E NEEDED\|RUNPATH` | NEEDED = `libvulkan.so.1 libstdc++.so.6 libm.so.6 libgcc_s.so.1 libc.so.6 ld-linux-x86-64.so.2`; no RUNPATH. The `cp build-verify/libMobileGL.so build-linux/libMobileGL.so` swap in `retrace-verify` is sound — the library pulls nothing from its own build tree (`libSPIRV-Tools-shared.so`/`libEGL.so` in the tree are not NEEDED). `build-retrace`'s `CTestTestfile.cmake` freezes `MOBILEGL_LIBRARY=<tree>/build-verify/libMobileGL.so` here (local configure) / `build-linux/` in CI, as the step assumes. |
| 19 | `grep -c TIMEOUT build-retrace/tools/trace_replay/CTestTestfile.cmake` → 0; empirical: a scratch project with `TIMEOUT 1` on a 3 s test under `ctest --timeout 100` → `***Timeout 1.00 sec`, the property-less sibling passes | `--timeout` only governs tests WITHOUT a `TIMEOUT` property, and the retrace tests have none (`timeout_seconds` in the manifest is not emitted as a property), so `--timeout 10800` in `retrace-verify` is effective. Not a defect; recorded because the opposite would have been a lane that cannot pass. |
| 20 | `MG_Util/Debug/Log.cpp:81-84` | every write is `fputs` + `fflush(s_logFile)`, so the `MGLOG_F` line precedes `std::abort()` in the child log the omission scenario reads. `p1/core` prints `MGPipe: Fatal{PipeVerifyDiffer, "%s@%s", verb=%llu, where=%s}` unconditionally and aborts only when `g_verify.Fatal` (`PipeFill.cpp:384-391`), `Fatal{UnmigratedPipeInput, "%s@%s"}` at `PipeFilled.inc:308`, `MGPipe: verify armed - …` at `PipeFill.cpp:377`, `poison omission armed - %s@%s` at `:452` — every string E greps for is the string core prints. |
| 21 | `VulkanRenderer.cpp:10963` and `DirectGLES.cpp:6932` | both backends' `GenerateMipmap` read `pGLContext->GetActiveTextureUnit()` first, so `<backend>.PoisonOmitted.` can go green on both once the poison exists; `grep -rln glGenerateMipmap MobileGL/MG_IntegrationTest` → only `PoisonOmissionScenario.cpp` (the "only possible target" claim holds). |
| 22 | `jobdiff.py`: per-job YAML diffs `build-linux`→`build-linux-verify`, `integration`→`integration-verify`, `retrace`→`retrace-verify`; `yaml.safe_load` with BOM | only the declared changes: BUILD_DIR/artifact names, `timeout-minutes`, `-DMOBILEGL_PIPE_VERIFY=ON` + `BENCHMARK=OFF` + Release-always, the nm gate, the arming step, the two controls, the log upload; `retrace-verify` drops only the iterationrp exports (that case is not in the verify set) and adds `MOBILEGL_PIPE_VERIFY=1` + `--timeout 10800`. `retrace` (pull) is byte-identical to the contract's. `trace-cases`, `remove-artifact-clutter`, `pipe-gates` changed as declared. 17 jobs. |
| 23 | `bash -eo pipefail -c 'matched=$(echo "" \| grep -cE "^ *Test *#[0-9]+:"); echo reached'` | rc 1, nothing printed (minor 2). |
| 24 | `git ls-tree p1/contract scripts/symbol_report.py` vs `git ls-files -s` | `100755` → `100644` (minor 1). |
## 2. Majors
None.
The three v1 majors, each re-tested rather than re-read:
- **M1 (nm -D)** — `test.yml` `build-linux-verify` "The verify library really carries the comparator" and `retrace-verify` "Unpack the VERIFY runtime" now use `nm --defined-only`; `nm --defined-only build-verify/libMobileGL.so | grep -c MGPipeFillForVerb` → 1 here, and `MGPipeVerifyInputs` is a defined function in `p1/core` (`PipeInputs.cpp:160`), so both greps turn green at integration. The added "looks stripped" floor (`< 1000` defined symbols) closes the third silent way the gate could red.
- **M2 (arming step)** — `PipeVerifyArmingScenario.Armed` now runs only where `MGITEST_PIPE_ARMING_LANE` is set (`DirectGLES.VerifyArming.` / `DirectVulkan.VerifyArming.`, own log path), skips in the ambient lanes (row 13), and the CI step greps only `pipe-verify-arming-*.log` and requires one per backend. Reproduced the fix's premise (row 14) and the old failure (the ambient lane's last entry writes a 317-line log with no verb). The step's name and text now claim per-lane arming, which is what it proves.
- **M3 (gate_failures)** — `gate_failures([],[],[],[],-4096,0,True)` → one reason; resized-only and renamed-only under `--fail-on-symbol-set-change` → one reason each; the gates read threshold-0 buckets regardless of `--threshold`; the self-test drives all three shapes (row 6). The CI invocation is unchanged and now means G1.
## 3. Minors
1. **`scripts/symbol_report.py` lost its executable bit** (`100755` at `p1/contract` → `100644` at HEAD, introduced in `09804491`, carried by `01300e6a`). Undeclared; inert for CI (`python3 scripts/symbol_report.py` everywhere, `test.yml:1398,1506`) but a mode regression the integrator's rebase will carry into `feat/disaggregated`. `git update-index --chmod=+x` before or at integration.
2. **The two negative-control steps die before their diagnostic when the filter matches nothing.** `test.yml` control A/B: `matched=$(ctest -N … | grep -cE '^ *Test *#[0-9]+:')` under GitHub's default `bash -eo pipefail` — `grep -c` exits 1 on zero matches, the assignment fails, `set -e` ends the step before `if [ "${matched}" -lt 1 ]` prints `::error::negative control … selected 0 tests`. Reproduced (row 23). The outcome is still red (correct), so this is a message defect only; `grep -cE … || true` fixes it.
3. **The full 79-case verify sweep "on `workflow_dispatch`" (brief E, "Verify cost" row) is not implemented and not declared.** `retrace-verify`'s matrix is always `verify-matrix` (8 cases); there is no dispatch input or job that runs the 77-entry matrix under the verify library. C.4 itself asks only for the subset, so this is a documentation gap against the risk table rather than against the file list; the D.3 WSL run covers the P1 exit.
4. **`build-linux` and `build-push` were not current with HEAD on arrival** — `cmake --build` relinked `MobileGLIntegrationTest` in both (row 2), so the result file's row 1 "rc 0 ×3" and the unit rows were measured before the final scenario edit landed in those two trees (the library was unchanged, and the unit suites pass after the relink, row 7). Cosmetic; noted so the integrator does not read the implementer's table as the final-tree state for those two builds.
5. **Verify-cost arithmetic on the retrace subset.** The eight `"verify": true` cases include two `timeout_seconds: 1800` cases (`minecraft-1.21.4-fabric-sodium-in-world`, `improved-transparency-minecraft-26.3`) and one default-900 (`minecraft-1.21.4-in-world`); at the design's 5-10× a 1800 s case is 9000-18000 s against `--timeout 10800` and `timeout-minutes: 240` (14400 s). Both numbers are the brief's (C.4/E), and `--timeout` is effective here (row 19), so nothing is mis-wired — but the first real run may show the budget itself is short for those two cases, and the fix then is a `trace_cases.json` decision, not E's plumbing.
Carried from v1 as observations, not defects: deviation 5 (`integration-verify` does not repeat the `MOBILEGL_ESPRYT_DISABLE_INVALIDATE_FLUSH=1` pass) is now written into the step comment; the `Fatal{PipeVerifyBadKnob` regex addition in `run_trace_case.cmake` is correct and matches core's spelling (`PipeFill.cpp:284`).
## 4. Brief vs tree (facts recorded; tree wins)
- `integration-verify` is **818** entries (2 × 406 ambient + 2 arming + 2 corrupted + 2 omitted), not the brief's 742/752; the pull `integration-gpu` set is 878; the fold parity holds trivially.
- `LABELS "integration-gpu\;integration-verify"` escaping, the verify block after `include(GoogleTest)` at `:395`, the `'^ *Test *#[0-9]+:'` count regex — as the result file states.
- The brief's D.3 G5 line `-R 'Mipmap'` selects nothing (row 16 shows the only matching name is `…WithoutOmissionCompletes`); the result file hands the integrator the corrected line.
- The brief's C.4 has the arming case ride the ambient lanes; the tree gives it a lane (deviation 3 in the result file). Justified: the ambient log path is truncated by every process, so the brief's own design would have been unsound.
- `gen_pipe.py --self-test` is a core c5 deliverable; present and green in `~/w7/p1-core` today (row 5).
- `timeout_seconds` in `trace_cases.json` is not a ctest `TIMEOUT` property (row 19) — the brief's "1800 s cases already sit above ctest's 1500 s default" is the right mental model and `--timeout 10800` is the right knob.
## 5. What was not re-run
The full 818-entry lane with the controls (six entries are red by design on this tree; the 812 ambient entries were run, row 15), any real retrace under `MOBILEGL_PIPE_VERIFY` (no comparator on the contract tree; `run_trace_case.cmake`'s block was driven by the implementer on synthetic logs and its `pipe_verify_fatals` regex and arming `string(FIND)` were re-read), and any CI dispatch (no push). None of the approved claims depends on those: the CI mode's correctness on the integrated tree is D.3's job, and every mechanism it needs from E has been shown here to red for its stated reason and to green under the strings core actually prints.
@@ -1,84 +0,0 @@
# P1 package E (p1-verify) — the third CI mode, its lanes and its negative controls
Tree `~/w7/p1-verify`, branch `p1/verify`, base `p1/contract` = `bf86b1ed` (`feat/disaggregated@087685d1` + package A's contract commit). Created with `wsl_p1_tree.sh verify p1/contract verify`; `build-linux` / `build-push` / `build-verify` all configured and green at the base (955/955, 959/959, 959/959). Not pushed.
## Commits (4, on `p1/verify`)
| sha | subject |
|---|---|
| `62783e4f` | `[Test] (Pipe): the integration-verify lanes and their two always-on negative controls` |
| `c4170e56` | `[Test] (Retrace): make a retrace under MOBILEGL_PIPE_VERIFY prove it armed, and give the lane a label` |
| `09804491` | `[Feat] (Tooling): give symbol_report.py the two hard gates G1 needs, with the report written first` |
| `1a5252b6` | `[CI] (Pipe): the third CI mode - a verify build, its integration and retrace lanes, and the two negative controls as always-on steps` |
`git diff --stat p1/contract..HEAD`: 9 files, +1498 / −12 — `.github/workflows/test.yml` (+574), `MobileGL/MG_IntegrationTest/CMakeLists.txt` (+134), `Scenarios/PipeVerifyArmingScenario.cpp` (new, 243), `Scenarios/PoisonOmissionScenario.cpp` (new, 395), `scripts/symbol_report.py` (+66/−12), `tools/trace_replay/{CMakeLists.txt, run_trace_case.cmake, trace_cases.json, trace_cases.py}`. Nothing outside E's row of the C.5 ownership table was touched; `git status` clean apart from the three untracked build directories and `build-retrace/` (configured for the label check below).
## What landed
**v1 — the lanes.** Six `gtest_discover_tests` registrations inside one `if (MOBILEGL_PIPE_VERIFY)` block at the end of `MG_IntegrationTest/CMakeLists.txt`, all labelled `integration-gpu;integration-verify`, all `TIMEOUT ${MGL_ITEST_VERIFY_TIMEOUT}` (900): ambient `DirectGLES.Verify.` / `DirectVulkan.Verify.` (`MOBILEGL_PIPE_VERIFY=1` + a per-lane `MOBILEGL_LOG_FILE_PATH`), `*.VerifyCorrupted.` (adds `MOBILEGL_PIPE_VERIFY_CORRUPT=GetRenderStateParameters MOBILEGL_PIPE_VERIFY_FATAL=0`, filter `PipeVerifyArmingScenario.CorruptedFieldIsReported`), `*.PoisonOmitted.` (adds `MOBILEGL_PIPE_POISON_OMIT=GenerateMipmap:GetActiveTextureUnit`, filter `PoisonOmissionScenario.OmittedFieldAbortsOnThatVerb`). Every list appends `${MGL_ITEST_COMMON_ENV}` / `${MGL_ITEST_VULKAN_ENV}`. Two new scenario files, added unconditionally to `add_executable`.
**v2 — retrace.** `run_trace_case.cmake` gains a verify block (arming line present; `Fatal{PipeVerifyDiffer` and `Fatal{UnmigratedPipeInput` absent; log must exist), inert unless `MOBILEGL_PIPE_VERIFY` is set to something other than `0`/`false`. `LABELS retrace` on both `set_tests_properties`. `"verify": true` on eight cases and `--format github-verify-matrix`.
**v3 — `symbol_report.py`.** `--fail-on-added-bytes N` implemented, `--fail-on-symbol-set-change` added, decision isolated in a pure `gate_failures()` the `--self-test` drives, report written before any gate fires, default behaviour (no flag → exit 0) unchanged.
**v4 — `test.yml`.** `build-linux-verify`, `integration-verify` (+2 always-on negative-control steps + an arming-line grep over the lane logs), `retrace-verify` (+ an inverted OpenRA step), `monolith-symbol-report` (dispatch-only, `baseline_sha` input, both gates, MG_Remote refusal), `remove-artifact-clutter` waits for `retrace-verify`, `trace-cases` exports `verify-matrix`, `pipe-gates` gains `gen_pipe.py --self-test` and `symbol_report.py --self-test` and its dirty-surface comment now says P2.
## Verification — every command and its actual output
All in WSL on `~/w7/p1-verify` unless marked. Logs under `~/w7/p1-verify-*.log` / `~/w7/p1-verify-*.txt`.
| # | command | result |
|---|---|---|
| 1 | `python -c "import yaml,sys; yaml.safe_load(open(sys.argv[1]))" test.yml.copy` (**Windows python**, on a copy) | parses; 17 jobs. `build-linux-verify` timeout 120 / 15 steps; `integration-verify` needs `build-linux-verify`, timeout 180, 12 steps; `retrace-verify` needs `[build-linux-verify, build-retrace, trace-cases, trace-fixtures]`, timeout 240, 13 steps; `monolith-symbol-report` timeout 180, 11 steps; `remove-artifact-clutter` needs `['retrace-summary','retrace-verify']`; dispatch inputs `['baseline_sha']`; `trace-cases` outputs `['matrix','names','verify-matrix']`; `pipe-gates` steps now include both `--self-test`s. The file's UTF-8 BOM is preserved byte for byte (`efbbbf 6e616d65...`). |
| 2 | `trace_cases.py --ci --format github-verify-matrix` | **16** entries (8 cases × 2 backends), first three `OpenRA/DirectGLES`, `OpenRA/DirectVulkan`, `minecraft-1.21.4-startup/DirectGLES`. `--format github-test-matrix` still **77**; `--format cmake` and `--format names` unchanged in content (the `verify` key is not one of the emitter's keys). |
| 3 | `python3 scripts/symbol_report.py --self-test` | `self-test: OK (2 canned transcripts, 5 buckets, 2 gates)`, rc 0. |
| 4 | `cmake --build build-{linux,push,verify} -j 12` | rc 0, rc 0, rc 0. |
| 5 | `ctest -L unit --no-tests=error -j 12` | `build-linux` `100% tests passed … out of 1466`; `build-verify` idem. |
| 6 | `ctest --test-dir build-verify -N -L integration-verify \| grep -c 'Test #'` | **816** = 2 × 406 ambient `Verify.` + 2 `VerifyCorrupted.` + 2 `PoisonOmitted.` |
| 7 | `ctest -N -L integration-gpu` folded (`s/\.(Verify\|VerifyCorrupted\|PoisonOmitted)\./\./`, `sort -u`) | verify build 878 unique names, pull build 878 — `comm` empty in **both** directions: exact parity with the pull registration set. Raw counts: verify 1694, pull 878. |
| 8 | `ctest --test-dir build-verify -R 'DirectGLES\.Verify\.PipeVerifyArmingScenario' --output-on-failure` (REQUIRE_GPU=ON) | rc 8. `…Armed ***Failed` with "MOBILEGL_PIPE_VERIFY=1 is set for this process and a frame was cleared, drawn and read back, and the library never reported arming the comparator"; `…CorruptedFieldIsReported ***Skipped` (its knob is not set in that lane). **The arming case fails and never passes on the contract tree** — G8 half one. |
| 9 | `ctest --test-dir build-verify -R 'VerifyCorrupted\.\|PoisonOmitted\.' --no-tests=error` | rc 8, **4/4 red**, each naming its own reason ("the comparator is not comparing…", "It exited with status 0 instead - the poison is not armed…"). Correct for the contract tree: the comparator lands in core `c4`, the filler in `c2`. |
| 10 | `ctest --test-dir build-verify -R 'Verify\.PoisonOmissionScenario\.WithoutOmissionCompletes'` | **2/2 pass** (0.48 s / 0.42 s) — the sibling control is green on both backends, so control B has a green entry to turn red. |
| 11 | `ctest --test-dir build-linux -N -L integration-verify` / `ctest --test-dir build-linux -L integration-verify --no-tests=error` | `Total Tests: 0`; rc **8**. The lanes exist only under the option, and `--no-tests=error` reds a build that lost it — G8 half two. |
| 12 | the two CI control steps, simulated locally in `build-verify` | control A selects **5** entries, control B selects **1**. With the knob exported in the job environment both still exit 0 on the contract tree, i.e. **the CI step would `exit 1` and say "the comparator is not comparing" / "the poison is not armed"** — correct, and the check that the knob reaches the process is below. |
| 13 | `grep -ho "MOBILEGL_PIPE_[A-Z_]*=…" build-verify/MobileGL/MG_IntegrationTest/*.cmake \| sort \| uniq -c` | `816 MOBILEGL_PIPE_VERIFY=1`, `2 MOBILEGL_PIPE_VERIFY_CORRUPT=…`, `2 MOBILEGL_PIPE_VERIFY_FATAL=0`, `2 MOBILEGL_PIPE_POISON_OMIT=…`. Only the four dedicated entries name the two control knobs, so the job environment reaches the 812 ambient ones — the ENVIRONMENT-property trap is avoided by construction and measured. |
| 14 | `run_trace_case.cmake`'s verify block, driven standalone against seven synthetic logs | env unset → silent, rc 0 · `=0` → "no verify assertions", rc 0 · armed log → "armed, zero divergences, zero unmigrated reads", rc 0 · **no arming line → rc 1** · **missing log → rc 1** · **`Fatal{PipeVerifyDiffer` → rc 1** (offending line echoed) · **`Fatal{UnmigratedPipeInput` → rc 1**. |
| 15 | `cmake -S . -B build-retrace -DMOBILEGL_BUILD_TRACE_REPLAY=ON …` then `ctest -N -L retrace` | configure rc 0; **80** cases listed under the new label (was: not selectable by label at all). |
| 16 | `symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0 --fail-on-symbol-set-change --fail-on-added-bytes 0` | rc **0**. `.text 10792579 -> 10792579 (+0, +0.000%)`, `27799 -> 27799 defined symbols: 0 added, 0 removed, 0 resized, 0 renamed`, `27060 unchanged`. G1 holds — E adds no C++ to the pull build. |
| 17 | the same gates against `build-verify/libMobileGL.so` (a deliberately different library) | rc **1**, `FAIL --fail-on-symbol-set-change: 43 symbol(s) added, 0 removed`, `FAIL --fail-on-added-bytes 0: .text grew by 10416 bytes` — the gate can go red for its reason. Ungated run on the same pair: rc 0. |
| 18 | `python3 scripts/gen_pipe.py --check` | rc 0: `63 verify payloads, 63 PipeInputs fields (7 sticky), 69 verbs, 9 classes` / `0 UNMAPPED` / `generated files are up to date`. |
| 19 | `ctest --test-dir build-linux -N` vs `~/w7/p1-before-ctest-names.txt` | **removed 0**, added 10 — the four new scenario cases plus the child-worker case, × 2 backends. Additions only. |
## Deviations from the brief, and why
1. **`LABELS integration-gpu integration-verify` does not work; the list must be escaped.** With the brief's spelling (and with a plain `"a;b"`) the second label is lost: `ctest -N -L integration-verify` listed **0** entries while `-L integration-gpu` listed 1690. The file's own `mgl_itest_join_environment` documents the same hazard for `ENVIRONMENT`. Landed as `LABELS "integration-gpu\;integration-verify"`, measured 816.
2. **`set(MGL_ITEST_VERIFY_TIMEOUT 900)` and the whole block sit at the end of the file, not "after `:393`".** `gtest_discover_tests` needs `include(GoogleTest)`, which is at `:395`; a block at `:394` would not configure. The timeout is set inside the `if (MOBILEGL_PIPE_VERIFY)` block, next to the registrations that use it.
3. **The `PoisonOmitted.` lanes filter `PoisonOmissionScenario.OmittedFieldAbortsOnThatVerb`, not `PoisonOmissionScenario.*`.** The brief says both, in the same row; the single-case spelling is what its own "+2 PoisonOmitted" count requires, and `*` would register a guaranteed skip beside it.
4. **CI negative control B targets `DirectGLES\.Verify\.PoisonOmissionScenario\.WithoutOmissionCompletes`, not `DirectGLES\.Verify\..*Mipmap`.** Measured: **no** integration entry in the tree matches `Mipmap` (`ctest -N -R 'DirectGLES\.Verify\..*Mipmap'` → 0), and `glGenerateMipmap` appears in exactly one scenario file — the new one. With the brief's filter the step would select nothing, `--no-tests=error` would exit non-zero, and the `if ctest …; then error` shape would read that as "the control worked". **Both** control steps therefore now count their selection with `ctest -N` first and fail loudly on an empty one.
5. **`WithoutOmissionCompletes` does not skip when `MOBILEGL_PIPE_POISON_OMIT` is set** (C.4 says it should). It is the only entry control B can turn red; an entry that skips itself reports green either way. Its failure message says explicitly when the failure is the control doing its job.
6. **The poison sequence runs in `fork()` + `execve()` of the test binary, not a bare `fork()`.** With a bare fork (the brief's shape, following `HeadlessGL.cpp`) the DirectVulkan child wedged: `DirectVulkan.…WithoutOmissionCompletes` took **121.57 s** and timed out while DirectGLES passed in 0.33 s — the pre-flight forks *before* any context exists, this case cannot, and a fork of a process holding a live Vulkan device inherits driver mutexes with no threads to release them. After the change both backends pass in ~0.45 s. The child gets its **own** `MOBILEGL_LOG_FILE_PATH` (`<lane log>.poison-child`) because `MG_Util/Debug/Log.cpp` opens the log with `fopen(path, "w")` and a shared path would truncate the file the parent is about to read.
7. **The arming assertion searches the whole log file**, not only the bytes appended after the case started (the `UnlocatedIoBlockScenario` idiom the brief cites). Two tree facts: the log is truncated at each process's first write (`fopen(…, "w")`), so the whole file *is* this process's; and the arming line is latched at the first fill, which may be the harness bring-up rather than the case's own draw. The divergence checks (`Fatal{PipeVerifyDiffer`, `Fatal{UnmigratedPipeInput`) stay scoped to the appended bytes.
8. **A third case, `PoisonOmissionScenario.TheSequenceThePoisonControlsRun`**, is the child's body (it skips in every process without the re-exec marker). Hence 10 new ctest names in the pull build rather than 8.
9. **`trace_cases.py` has no "existing self-checks"** to extend (the brief's C.4 wording). The `verify` flag is validated in `load_trace_case_manifest` instead — non-boolean, or `verify` on a case excluded from CI, is a `ValueError` in every consumer including the cmake emitter.
10. **`--fail-on-added-bytes N` is defined as ".text grew by more than N"**, and `--fail-on-symbol-set-change` as "added or removed is non-empty" (renamed-only folds and resized do not count; `--threshold` already governs resizes).
11. **`retrace-verify` artifacts are named `retrace-verify-result-*`**, which `remove-artifact-clutter`'s `retrace-result-*` sweep does not match, so a failed verify retrace keeps its images. The brief only asked for a `-verify` suffix.
12. **`build-linux-verify` has no `needs:`** (it is a copy of `build-linux`, which has none) and builds with `MOBILEGL_BUILD_BENCHMARK=OFF` — the verify lanes need no benchmark target.
13. **`monolith-symbol-report`** builds the baseline in a `git worktree` of `inputs.baseline_sha` (so `fetch-depth: 0` on the checkout) and spells the MG_Remote check as `if nm … | grep -q MG_Remote; then exit 1; fi` rather than the brief's `grep -q … && exit 1`, which under GitHub's `bash -e` fails the step on the *healthy* path.
## Where the tree contradicted the brief's numbers
| brief | tree (measured) |
|---|---|
| "the 742-entry `integration-verify` lane"; "752 = 2 × (371 + 3 new cases) + 2 + 2" | 406 cases per backend → **816** entries (812 ambient + 4 controls). The pull build's `integration-gpu` set is **878**, not 742. |
| C.4: `ctest -N -L integration-gpu \| sed 's/\.Verify\././' \| sort -u` "parity with the pull registration set" | holds exactly once `VerifyCorrupted.`/`PoisonOmitted.` are folded too: 878 = 878, `comm` empty both ways. |
| "40 trace + 79 desktop cases"; D.4 "retrace (77)" | `--ci --format github-test-matrix` = **77** entries (39 CI cases × 2 minus the DirectVulkan-only `iterationrp`). The verify subset is 16, as predicted. |
| `MGPipeHostSpan.h`, `MGL_ITEST_TIMEOUT` etc. line numbers | `set(MGL_ITEST_TIMEOUT 120)` is at `:393` and `include(GoogleTest)` at `:395`, as the brief says; `run_trace_case.cmake` is 129 lines, as the brief says. |
| brief's ctest-name regex `'^\s+Test #'` | matches only test numbers ≥ 1000 (ctest pads smaller ones); every count above uses `grep -cE '^ *Test *#[0-9]+:'`. Package A recorded the same. |
## Unfinished / known dependencies on package A
- **`nm -D … | grep -q MGPipeVerifyInputs`** (in `build-linux-verify`'s "The verify library really carries the comparator" step and in `retrace-verify`'s unpack step) is the contract name from D8/D13 and **does not exist until core `c4`**; the contract tree exports only `MGPipeInputsFieldEqual` / `MGPipeApplyVerifyCorruption`. Both steps will fail in CI until `p1/core` c4 lands. Deliberate: the check is the point.
- **`pipe-gates` runs `python3 scripts/gen_pipe.py --self-test`**, which core `c5` adds (brief C.1 step 5). The step is red until then.
- **The four control lanes and `PipeVerifyArmingScenario.Armed` are red on this tree by design** (no filler, no comparator). They go green with core `c2`+`c4` merged; the brief defers E's full functional verification to the integrated tree (D.3).
- **Not run here:** the full `ctest -L integration-verify` (816 entries; the ambient `Armed` entries are red by design), any retrace under `MOBILEGL_PIPE_VERIFY` (no trace-replay binary or fixtures budget in this tree — the gate was driven against seven synthetic logs instead), and any CI dispatch (no push).
- **`build-retrace/`** was configured in this tree only to prove the `retrace` label registers; it is untracked and no retrace binary was built.
@@ -1,202 +0,0 @@
# P1 package E (p1-verify) — v2, the rework of the three majors and eight minors
Tree `~/w7/p1-verify`, branch `p1/verify`, base `p1/contract` = `bf86b1ed`. Four **new** commits on top of
v1's four; nothing rebased, nothing pushed. `git status` clean apart from the four untracked build
directories (`build-linux`, `build-push`, `build-verify`, `build-retrace`).
Review answered: `scratchpad/wf4/p1-results/verify-review-v1.md`. Scripts and raw outputs of this round:
`scratchpad/wf4/verify2/s0*.sh` … `s19.sh`.
## Commits
| sha | subject |
|---|---|
| `62783e4f` | `[Test] (Pipe): the integration-verify lanes and their two always-on negative controls` (v1) |
| `c4170e56` | `[Test] (Retrace): make a retrace under MOBILEGL_PIPE_VERIFY prove it armed, and give the lane a label` (v1) |
| `09804491` | `[Feat] (Tooling): give symbol_report.py the two hard gates G1 needs, with the report written first` (v1) |
| `1a5252b6` | `[CI] (Pipe): the third CI mode - a verify build, its integration and retrace lanes, and the two negative controls as always-on steps` (v1) |
| **`6060690a`** | `[Test] (Pipe): give the arming assertion a lane and a log of its own, and stop the poison child calling a sequence it never ran a success` |
| **`01300e6a`** | `[Fix] (Tooling): gate symbol_report on all four buckets and on a .text that moved in either direction` |
| **`ce26029c`** | `[Test] (Retrace): scan a verify retrace's log for the third MGPipe Fatal too` |
| **`eec8cf2c`** | `[CI] (Pipe): read the verify library's static symtab, grep only the arming lane's log, and stop the two retrace lanes overwriting each other's evidence` |
`git diff --stat p1/contract..HEAD`: 9 files, +1738 / −14 — the same nine files as v1 (E's row of C.5); no file
outside it was touched in either round.
## What each finding got
### M1 — `nm -D` can never find an MGPipe symbol (fixed, `eec8cf2c`)
Confirmed on this tree, and the reviewer's diagnosis is exact:
```
nm --defined-only build-verify/libMobileGL.so | wc -l -> 30557
nm -D --defined-only build-verify/libMobileGL.so | wc -l -> 11930
MGPipeFillForVerb static:1 dynamic:0
MGPipeVerifyInputs static:0 dynamic:0 (does not exist until core c4)
```
Both gates (`build-linux-verify` "The verify library really carries the comparator", `retrace-verify`
"Unpack the VERIFY runtime as the library under test") now use `nm --defined-only`, name in their error
text what a miss means, and the build-side one first counts the defined symbols and refuses an artifact
that looks stripped — otherwise a stripped library would fail the greps for a third, silent reason. The
comment at each site says why `-D` is wrong (hidden visibility in every non-Debug configuration,
`CMakeLists.txt:600-604`), so nobody re-adds it. **The v1 result file's wording was wrong** and is corrected
below (see "Dependencies on package A"): `MGPipeFillForVerb` exists today and `-D` did not find it either.
### M2 — "Every verify process really armed" (fixed, `6060690a` + `eec8cf2c`)
Reproduced verbatim: after running the last ambient entry
(`DirectGLES.Verify.PoisonOmissionScenario.WithoutOmissionCompletes`, rc 0) the shared lane log is 317 lines
with **0** arming lines, because that parent forks/execve()s/waits and issues no verb. The step would have
red a healthy lane, and in any case spoke about the last writer.
Fix, in two halves:
* `PipeVerifyArmingScenario.Armed` moved into a lane of its own — `DirectGLES.VerifyArming.` /
`DirectVulkan.VerifyArming.`, `TEST_FILTER PipeVerifyArmingScenario.Armed`, own
`pipe-verify-arming-<backend>.log`, marker `MGITEST_PIPE_ARMING_LANE=1` (a harness variable; the library
never reads it). The case skips wherever the marker is unset, so it no longer runs in the ambient lane at
all. This is the shape every other log-reading scenario in the file already uses, and it also closes
**minor 2** (the `-j 4` truncation race): nothing else writes that path.
* the CI step is now "The verify lanes armed the comparator", greps only those two logs, requires one per
backend, and states what it proves — arming is a property of (library, environment), and these two
processes share both with their ~400 ambient siblings; a per-process census is not available through a
log every process truncates. The false claim is gone from the step name, the step text, the CMake comment
and the scenario's header comment.
Driven against real and synthetic logs (`s06.sh`): contract-tree logs (no comparator) → rc 1 naming the log;
same logs with the arming line appended → rc 0; one backend's log removed → rc 1 naming the count.
### M3 — `symbol_report.gate_failures` ignored `resized`/`renamed` and shrinks (fixed, `01300e6a`)
`gate_failures(added, removed, resized, renamed, text_delta, fail_on_added_bytes, fail_on_symbol_set_change,
fail_on_text_delta=False)`:
* `--fail-on-symbol-set-change` fires on any of the four buckets;
* `--fail-on-added-bytes 0` means byte-identical (a shrink fails it); a positive budget keeps the old
one-sided meaning; `--fail-on-text-delta` is the explicit spelling; a negative budget is a `parser.error`;
* the gates always read **threshold-0** buckets, whatever `--threshold` says (a gate that read the
thresholded resize list would weaken itself the day someone raised the threshold), and the run prints that
it did when `--threshold` is non-zero;
* the self-test drives the three shapes that used to pass. The reviewer's counterexample now answers:
`gate_failures([],[],[],[],-4096,0,True)` → `['--fail-on-added-bytes 0: .text moved by -4096 bytes …']`.
The CI invocation is unchanged (`--threshold 0 --fail-on-symbol-set-change --fail-on-added-bytes 0`) — it is
the brief's spelling and it now means what G1 says.
### Minors
| # | disposition |
|---|---|
| 1 | **Fixed** (`6060690a`). The child exits `HasFailure() ? 1 : 0` and checks `glGetError()` after the mipmap; the parent's message explains that status 1 is the child's own assertion. A/B proven below. |
| 2 | **Fixed** by M2's dedicated arming lane (own log, one process). No `RUN_SERIAL` was needed and the ambient lane keeps `-j 4`. |
| 3 | **Fixed** (`eec8cf2c`). `remove-artifact-clutter` now selects `retrace (` **and** `retrace verify (` jobs and strips both prefixes, longest first (verified on both job-name shapes). |
| 4 | **Fixed** (`eec8cf2c`). The control copies the verified `OpenRA/` output to `${RUNNER_TEMP}` first, captures ctest's status, restores the good output, and only then decides — so the restore happens on both paths and `Upload actual image` ships the verified run. |
| 5 | **Documented, not implemented** (`eec8cf2c`, in the step comment, and here). The second `MOBILEGL_ESPRYT_DISABLE_INVALIDATE_FLUSH=1` pass is 186 entries under `-L integration-verify` on this tree; at the 5-10x the comparator costs that is ~23% more wall time on a lane already budgeted at 180 min, and C.4 does not ask for it. "Every integration entry" is not "every configuration": the staged-copy tier stays covered by `integration`, unverified. |
| 6 | **Fixed/declared** (`eec8cf2c`). `build-linux-verify` regains `Show installed toolchain`; the deliberate Release-always divergence is now written into the Configure step's comment (a Debug build flips visibility and arms `MOBILEGL_PIPE_POISON` through a different `#if` arm, i.e. it would measure a different library). |
| 7 | **Fixed** (`ce26029c`), and more than a comment: `Fatal{PipeVerifyBadKnob` is in the regex. D2's abort is exactly what `MOBILEGL_PIPE_VERIFY_FATAL=0` — the supported triage configuration — takes away, so relying on it was a hole. |
| 8 | **Fixed here.** The corrected local G5 line for the integrator is in "For the integrator" below. |
| 9 | **Fixed here** (see M1 and "Dependencies on package A"). |
## Verification — every command and its actual output
WSL, `~/w7/p1-verify`, this round. (v1's table still holds for everything untouched; these are re-runs.)
| # | command | result |
|---|---|---|
| 1 | `cmake --build build-{verify,linux,push} -j 12` | rc 0 ×3 (scenario + CMake changes rebuilt). |
| 2 | `ctest -L unit --no-tests=error -j 12` in all three builds | `100% tests passed, 0 tests failed out of 1466` ×3. |
| 3 | `python3 scripts/gen_pipe.py --check` | rc 0 — `63 verify payloads, 63 PipeInputs fields (7 sticky), 69 verbs, 9 classes`, `0 UNMAPPED`, up to date. |
| 4 | `symbol_report.py --before ~/w7/p1-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0 --fail-on-symbol-set-change --fail-on-added-bytes 0` | rc **0**. `.text 10792579 -> 10792579 (+0)`, `27799 -> 27799: 0 added, 0 removed, 0 resized, 0 renamed`. G1 holds with the *stricter* gate. |
| 5 | `symbol_report.py --self-test` | `OK (2 canned transcripts, 5 buckets, 3 gates)`, rc 0. |
| 6 | `gate_failures([],[],[],[],-4096,0,True)` / resized-only / renamed-only / clean | 1 reason / 1 / 1 / `[]` — the reviewer's three counterexamples now fail, a clean pair still passes. |
| 7 | `ctest --test-dir build-linux -N` vs `~/w7/p1-before-ctest-names.txt` | **removed 0, added 10** (the five new cases × 2 backends). Additions only (G7). |
| 8 | `ctest --test-dir build-verify -N -L integration-verify` | **818** = 812 ambient + 2 `VerifyArming.` + 2 `VerifyCorrupted.` + 2 `PoisonOmitted.` (was 816; the two arming entries are the delta). |
| 9 | `ctest --test-dir build-linux -L integration-verify --no-tests=error` | `Total Tests: 0`, rc **8** — G8 half two still holds. |
| 10 | `ctest -N -L integration-gpu` folded (`s/\.(Verify\|VerifyArming\|VerifyCorrupted\|PoisonOmitted)\./\./`) | verify **878** unique names, pull **878**, `comm` empty both ways. |
| 11 | `ctest --test-dir build-verify -R '…Arming…\|VerifyCorrupted\.\|PoisonOmitted\.\|WithoutOmissionCompletes'` | `DirectGLES.Verify.…Armed` ***Skipped**, `DirectGLES.Verify.…CorruptedFieldIsReported` ***Skipped**, both `VerifyArming.…Armed` ***Failed**, both `VerifyCorrupted.` ***Failed**, both `PoisonOmitted.` ***Failed**, both ambient `WithoutOmissionCompletes` Passed (0.45/0.41 s). **The arming case skips or fails; it never passes on the contract tree.** |
| 12 | the arming step body vs the real `pipe-verify-arming-*.log` | rc 1, `::error::…pipe-verify-arming-DirectGLES.log carries no arming line` (correct: no comparator until core c4). Both logs exist, 318/330 lines, 0 arming lines. |
| 13 | the same body with the arming line appended to both logs | rc 0, `arming line present in all 2 arming-lane log(s)`. |
| 14 | the same body with one backend's log deleted | rc 1, `::error::found 1 pipe-verify-arming-*.log (expected one per backend)`. |
| 15 | the old failure mode: run only the last ambient entry, then look at the shared log | entry rc 0; `pipe-verify-DirectGLES.log` = 317 lines, **0** arming lines — M2 reproduced, and the new step no longer reads that file. |
| 16 | **A/B on minor 1**: ablate the child's first `ASSERT_NE(program, 0u)` **and** restore v1's `_exit(0)` | both `WithoutOmissionCompletes` **Passed** — the vacuous green. |
| 17 | same ablation with the fix in place (`_exit(HasFailure()?1:0)`) | both **Failed**; ablation reverted, both Passed again (0.42/0.40 s). |
| 18 | `run_trace_case.cmake`'s verify block driven with `cmake -P` against 8 synthetic logs | unset→0 · `=0`→0 · armed→0 · no arming line→1 · missing log→1 · `Fatal{PipeVerifyDiffer`→1 · `Fatal{UnmigratedPipeInput`→1 · **`Fatal{PipeVerifyBadKnob`→1** (was 0). |
| 19 | `nm` census on `build-verify/libMobileGL.so` | 30557 static / 11930 dynamic defined symbols; `MGPipeFillForVerb` static 1, dynamic 0. M1 reproduced and the fix's premise measured. |
| 20 | Windows `python -c "import yaml,sys; yaml.safe_load(…)"` on a copy of `test.yml` | parses. 17 jobs; `build-linux-verify` 16 steps / timeout 120, `integration-verify` 12 steps / needs `build-linux-verify` / 180, `retrace-verify` 13 steps / needs `[build-linux-verify, build-retrace, trace-cases, trace-fixtures]` / 240, `remove-artifact-clutter` needs `[retrace-summary, retrace-verify]`. BOM preserved. |
| 21 | `bash -n` on all 33 `run:` blocks of the six touched jobs | 0 syntax errors. |
| 22 | `remove-artifact-clutter`'s prefix stripping, on both job-name shapes | `retrace (DirectGLES, OpenRA)` → `OpenRA`; `retrace verify (DirectVulkan, minecraft-1.21.4-startup)` → `minecraft-1.21.4-startup`. |
| 23 | `trace_cases.py --format {cmake,names,fixture-files,github-test-matrix}` HEAD vs the contract script, same directory and manifest | **byte-identical** ×4 (21145 / 1928 / 46 / 6422 bytes), and `--ci --format github-test-matrix` identical too. `github-verify-matrix` = **16**, `github-test-matrix` = **77**. |
| 24 | `ctest --test-dir build-retrace -N -L retrace` | **80** (the label from v1's `c4170e56` still registers). |
| 25 | `grep -rc pGLContext MobileGL/MG_Backend \| sort \| diff - ~/w7/p1-before-pglcontext.txt` | only the two `:0` lines for the contract's new `MGPipe/PipeInputs.{h,cpp}`. E converts no site (G2 is B and C's). |
| 26 | env-knob census in the generated `*.cmake` | `818 MOBILEGL_PIPE_VERIFY=1`, `2 MOBILEGL_PIPE_VERIFY_CORRUPT`, `2 MOBILEGL_PIPE_VERIFY_FATAL=0`, `2 MOBILEGL_PIPE_POISON_OMIT`, `2 MGITEST_PIPE_ARMING_LANE=1`. No ambient entry names a control knob — the ENVIRONMENT-property trap stays avoided, and the new marker is on the arming lane only. |
## Deviations from the brief (v1's, still standing, plus this round's)
v1's deviations 1-3, 5-9, 11-13 are unchanged and still apply; the ones this round touched or added:
1. *(v1 #4, restated)* CI negative control B targets
`DirectGLES\.Verify\.PoisonOmissionScenario\.WithoutOmissionCompletes`, not the brief's
`DirectGLES\.Verify\..*Mipmap`: nothing in the tree matches `Mipmap`, and with an empty selection
`--no-tests=error` exits non-zero, which the `if ctest …; then error` shape would read as success. Both
controls count their selection with `ctest -N` first.
2. *(v1 #10, superseded)* `--fail-on-added-bytes N` is "grew by more than N" **only for N > 0**; `0` means
"byte-identical, in either direction", `--fail-on-symbol-set-change` covers all four buckets, and both
gates read threshold-0 buckets. v1's claim that "`--threshold` already governs resizes" was wrong —
`--threshold` only shortens the report.
3. **New.** `PipeVerifyArmingScenario.Armed` runs in a dedicated `VerifyArming.` lane per backend and skips
in the ambient `Verify.` lanes; the brief's C.4 registers only six lanes and expects the arming case to
ride the ambient ones. The lane count is therefore 8, and `integration-verify` is 818 rather than 816.
Reason: the shared lane log cannot be read soundly by a lane member (M2, minor 2).
4. **New.** The arming CI step proves "the arming lane's process armed", not "every verify process armed".
The honest per-process statement is not obtainable from a log every process truncates; the step, its
name and the CMake comment all say so.
5. **New.** `integration-verify` still does not run `integration`'s second
`MOBILEGL_ESPRYT_DISABLE_INVALIDATE_FLUSH=1` pass (minor 5) — 186 entries at 5-10x, and C.4 does not ask
for it. Recorded in the step comment so a green lane is not read as "every configuration".
6. **New.** `run_trace_case.cmake` scans for three Fatal families, not the brief's two
(`Fatal{PipeVerifyBadKnob` added).
7. **New.** `build-linux-verify` keeps Release under `ACTIONS_STEP_DEBUG` where `build-linux` switches to
Debug, and this is now declared rather than implied by "copy of `build-linux:12-147`".
## Where the tree contradicted the brief's numbers
Unchanged from v1, with the lane count updated:
| brief | tree (measured) |
|---|---|
| "the 742-entry `integration-verify` lane"; "752 = 2 × (371 + 3 new) + 2 + 2" | **818** = 2 × 406 ambient + 2 arming + 2 corrupted + 2 poison-omitted. The pull build's `integration-gpu` set is 878. |
| C.4's `-L integration-gpu` fold "parity with the pull registration set" | holds once `Verify.`/`VerifyArming.`/`VerifyCorrupted.`/`PoisonOmitted.` are all folded: 878 = 878, `comm` empty both ways. |
| "40 trace + 79 desktop cases"; D.4 "retrace (77)" | `--ci --format github-test-matrix` = 77; `github-verify-matrix` = 16, as predicted. |
| brief's ctest-name regex `'^\s+Test #'` | matches only numbers ≥ 1000 (ctest pads); every count here uses `grep -cE '^ *Test *#[0-9]+:'`. |
| `LABELS integration-gpu integration-verify` (C.4 spelling) | must be `LABELS "integration-gpu\;integration-verify"` or the second label is silently dropped (v1 deviation 1, measured again: 818 under the label). |
| C.4 "after `:393`" for the verify block | must sit after `include(GoogleTest)` at `:395`; the block is at the end of the file. |
## For the integrator
* D.3's G5 line as written in the brief (`-R 'Mipmap'`) selects **nothing** on this tree and prints rc=0.
The line that works locally is
`MOBILEGL_PIPE_POISON_OMIT=GenerateMipmap:GetActiveTextureUnit ctest --test-dir build-verify -L integration-verify -R 'DirectGLES\.Verify\.PoisonOmissionScenario\.WithoutOmissionCompletes' --no-tests=error ; echo rc=$?`
(expect non-zero once the poison is armed).
* D.3's arming grep should read the arming lane's logs:
`grep -c "MGPipe: verify armed" build-verify/MobileGL/MG_IntegrationTest/pipe-verify-arming-*.log` (> 0 in
both). The ambient `pipe-verify-<backend>.log` holds only the lane's last process and must not be used as
evidence.
* D.3's lane count is 818, not 752.
## Dependencies on package A, and what is still unfinished
* `nm --defined-only … | grep -q MGPipeVerifyInputs` (both jobs) is red until core **c4** lands the
comparator, and **that is the only reason left**: with the `-D` removed the check now measures what it
claims, and `MGPipeFillForVerb` — which exists today — is found. (v1's wording implied `-D` would start
working at c4; it would not have.)
* `pipe-gates` runs `python3 scripts/gen_pipe.py --self-test`, which core **c5** adds; red until then
(`unrecognized arguments: --self-test`, rc 2, re-confirmed).
* The six control/arming entries are red and the two ambient arming entries skip on this tree by design (no
filler, no comparator). They go green with core c2+c4 merged; C.4 defers E's functional verification to
the integrated tree (D.3).
* **Not run here**: the full 818-entry lane, any retrace under `MOBILEGL_PIPE_VERIFY` (no trace binary or
fixtures in this tree — the gate was driven against synthetic logs), and any CI dispatch (no push). The CI
steps were exercised by extracting and running their exact bodies locally (rows 12-14, 21, 22).
* `build-retrace/` remains a throwaway configure used only to prove the `retrace` label registers.