[Docs] (.claude/skills, .github/workflows, CMakeLists.txt, docs/archive, docs/Disaggregated, docs/MobileVA, docs/Performance, MG_Backend, MG_Backend/DirectGLES, MG_Backend/DirectVulkan, MG_Backend/Record, MG_Gbm, MG_Impl, MG_Impl/EGLImpl, MG_Impl/GLImpl, MG_Impl/GLXImpl, MG_Impl/Pipe, MG_IntegrationTest, MG_IntegrationTest/Harness, MG_IntegrationTest/Scenarios, MG_Pipe, MG_Pipe/generated, MG_Remote, MG_Remote/Client, MG_Remote/Server, MG_Remote/Transport, MG_Remote/Wire, MG_State/GLState, MG_Test/Pipe, MG_Test/Util, MG_Test/Wire, MobileGL, scripts, scripts/data, tools/device_bench, userguide): archive the planning notes and agent contracts under docs/archive

- DEBTS.md and OPEN-QUESTIONS.md stay maintained, now in docs/Disaggregated.
This commit is contained in:
2026-10-15 20:01:45 -04:00
parent 0e3e2b7761
commit aabca3c171
1035 changed files with 410 additions and 398 deletions
+82
View File
@@ -0,0 +1,82 @@
# P3b / P4b — Espryt 深化(P7 的并行流 wave 2-D)
> 本页是该阶段的**阶段汇总**:阶段表行、实测与落地形状的完整文本(2026-09-24 从上层索引移入,原文照录)都在这里;上层只留摘要——[`ROADMAP.md`](../../../Disaggregated/ROADMAP.md)、[`MEASUREMENTS.md`](../../../Disaggregated/MEASUREMENTS.md)、[`ARCHITECTURE.md`](../../../Disaggregated/ARCHITECTURE.md)。文中 `file:line` 与"今天""当前"按各段写成时的头理解;文中的 `MEASUREMENTS.md §N` / `ARCHITECTURE.md §17.x` 编号保留,对照表见 [`../README.md`](../README.md)。
## 摘要
- 2026-09-22 审计([`../p7/PLAN-PH-P34B-P7.md`](../p7/PLAN-PH-P34B-P7.md) §1.2)后作为 P7 的并行流推进,与 P7 文件零重叠。
- 已落地(`origin@22761a69`):**D1** XFB 两洞(孤儿目标保留、回写事件切片)+ 回调 10 → 9 + 四个 resolver 具名启动期 stop + readback 家族三臂;**D2** `TextureViewAliasScenario`、`TextureUploadShape` 由记录升为门(零补丁 red-once)、`espryt_memo_purity.py`、`SubsystemDeps.def`、12 场景 split 普查;**D3** view 在属主上传后陈旧的产品缺陷修复 + D-K2 六处读者读同一张表。
- 余:R-3 另一半(`MGPSamplerView::Target` 谓词)、`KHR-GL46.texture_view.coherency` 的 split 读数、CTS AFTER;Iris trace 普查已有头上结果([`../p7/iris-census-1135c664.md`](../p7/iris-census-1135c664.md))。
## 阶段表行(原 `ROADMAP.md`)
- **阶段**:**P3b / P4b** 深化(Espryt)
- **状态**:**已审计(2026-09-22,`notes/p7/PLAN-PH-P34B-P7.md` §1.2)**;Espryt 项与 P7 文件零重叠,作为 P7 的并行流(wave 2-D)推进。**D1 / D2 / D3 已落地(`origin@22761a69`,2026-09-22)**:D1 = XFB 两洞(孤儿目标保留 varyings、回写事件切片)+ 回调 10→9 + 四个 resolver 具名启动期 stop + readback 家族三臂(+39/臂,readback 半边其实早已关,ID-P7-24);D2 + 返工 = `TextureViewAliasScenario`、`TextureUploadShape` 成门(散点内缩后零补丁 red-once)、`espryt_memo_purity.py`、`SubsystemDeps.def`(R-5)、12 场景 split 普查(+76/臂)(ID-P7-26/29);D3 = view 在 owner 上传后陈旧的产品缺陷修复(clean gate 读 storage record,三臂 3 红→14/14)+ D-K2 六处读者读同一张表(ID-P7-28/30)。**余**:R-3 另一半(`MGPSamplerView::Target` 谓词)、`KHR-GL46.texture_view.coherency` 的 split 读数、CTS AFTER(wave 4);~~Iris trace 普查结果(wave 3)~~ 已有头上结果(`3c80cd62`,[`notes/p7/iris-census-1135c664.md`](../p7/iris-census-1135c664.md));逐日状态见 [`CURRENT_STAGE_STATUS.md`](../../../Disaggregated/CURRENT_STAGE_PROGRESS.md)
- **落地什么 / 范围**:view/属主发射游标**别名场景**(代码半已由 P4a `TextureEmit.h` 属主键控游标 + `TextureObjectView::ToOwner*` + P5e tx2 落地,欠验证);`g_fboTextureSyncList`(分离安全——记录臂先返回、退路是具名 Fatal;四个 resolver 改启动期具名 stop,文本删除受 P5e 裁定 1 约束归 P13);memo 重键**已落地**(P4a/P5f),补纯度 grep 门;~~XFB scatter 搬到 client~~(P5c/P5f 以 server staged shadow + `OnBufferWriteback` 落地;剩两处真洞:孤儿捕获目标被静默丢弃、回写事件无界——>128 KiB 即 `Fatal{EventRingOverflow}`);删 fragColor 重推导 workaround 与 `g_broadcastMemo*`(动 pull `.text`,归 P13,只改注释);raw-depth-fetch sampler 的 monolith 清理(可选);**回读收口**(pack 半已关:`set_pixel_pack_state` APPLIER_DERIVED + server 中性读 + client 侧 PACK-PBO 散射;readback 半开:`get-tex-image-shadow` / `copy-image-shadow-mirror` 非 monolith 下仍 abort、split 零覆盖);P4a 的 R-5(D-K2 规则合一处)/ R-11 必须,R-3 / R-4 / R-7 / R-10 可选;~~`ProgramArtifacts.h` 的 NDK 尺寸钉~~(P6.5 portable archive v2 + 布局指纹取代);链接实验分给它的 **14 个符号**(D12,棘轮落地后 Tier 1)
- **验收门 / 证据**:纹理 / program 场景(split 三臂零覆盖,先普查首阻塞再注册);CTS `texture_*` / `shader_image_*` / `packed_pixels` + P4a 欠的 `direct_state_access.framebuffers*` 在 0.5 pp 内(caselist 入库 + monolith 基线 + delta 工具,今天三者皆无);每一个 Iris trace(CI 管道 P6 已建;**`3c80cd62` 主机结果**:39 例 × 双后端 × {monolith, inproc, spawn} 231 次全活,split 与 monolith 逐字节相同 70 / 77 行,7 行分歧均过阈值、无 Fatal;`texture-remint-pull` 未到达,**P9 例外表为空**——[`notes/p7/iris-census-1135c664.md`](../p7/iris-census-1135c664.md) §3–§4);`TextureUploadShapeScenario` 升级成门(Mali 增量无设备,按 Adreno 记录)
## 实测:P3b/P4b wave 2-D 包 D2(`cf7ca59f`,WSL 桌面 lavapipe/llvmpipe)(原 `MEASUREMENTS.md` §13)
### 13.1 上传形状金标(R-11 / D-D4,`TextureUploadShapeScenario` 由记录升为门)
工作负载常量 `kScatteredRects=40`、`kFrames=3`、一条连续带、**三张**纹理(第三张经
`glTextureView` 的 level 1 上传,使 view/属主重映射落在被计数的窗口内)。
| 臂 | emit | box | rect | jobs | client emitter |
|---|---|---|---|---|---|
| `DirectGLES.TextureUploadShape.`(monolith) | 9 | 9 | 0 | 9 | 9 |
| `DirectGLES.Split.`(inproc) | 9 | 9 | 0 | 9 | 9 |
| `DirectGLES.Spawn.` | 9 | 9 | 0 | 9 | 9 |
| `DirectGLES.Tcp.` | 9 | 9 | 0 | 9 | 9 |
P4a 的记录是两张纹理、无 client emitter 的 `emit=6 box=6 rect=0 jobs=6`(`ctu=0`),与本行
**不可比**:工作负载不同。
`rect=0` 是 **unpack-ring 策略的既定输出**:client 确实建出 30 个 rect(2 texel 间隙,
`RegionsTouch` 不合并;summed area 120 远低于 union box 的 3/4,两道 client 侧谓词都不取 box 臂),
记录把 30 个 region 全部带过去;是 server 在 `Managers.cpp:8649` 的
`if (UnpackRingAvailable()) dirtyRectCount = 0;` 决定取 box——"One box, one job",Mali 悬崖的既有
缓解。门钉的就是这个策略的输出。
**散点图案本身是被修过的(评审 fable 指出)**:原来的 stride `x=((i*7)%32)*2` / `y=((i*5)%32)*2`
在 64 px 图集里会打到 x=62、y=62,union box 覆盖整个 level,而 server 的 `subRectEligible`
(`Managers.cpp:8486-8491`)要求 `!dirtyRegion.CoversWholeLevel`(`MipmapStorage.h:30-33`,**包围盒**
判据)——两张散点纹理在 ring 策略之前就已经 rect-ineligible,金标数字一样但量的不是同一件事。
内缩一个 rect(`kScatterMargin`)后 union box 落在 (2,2)..(62,54),决策点才真正带电。
红一次因此是**零补丁**的:`MOBILEGL_ESPRYT_DISABLE_UNPACK_RING=1` 一个环境变量就把两张散点纹理
从 box 翻成 rect——`box=3 rect=6 jobs=183`(3 = 连续带 x3 帧;6 = 两张散点 x3 帧;183 = 3 + 6x30),
`bytes/f[tex]` 同时从 104448 降到 9024,而 26 个像素用例全绿。内缩之前同一个变量是全绿的,这正是
`CoversWholeLevel` 把决策点短路掉的证据。
### 13.2 client 半边的读法(本包的修正)
`ctu=` 与 `tex[]` 是否在同一个窗口里,按传输分:
| 臂 | `tex[]` 在哪 | `ctu=` 在哪 |
|---|---|---|
| monolith | 唯一日志 | 同一行 |
| inproc | **server** 日志(两个文件、一个进程、一套计数器) | 同一行 |
| spawn / tcp | **server** 日志 | client 进程自己的计数器,**Present 节奏不同**——实测 `ctu=13` 对 `emit=9`,且用例读取时通常还没写出 |
这与 §12.7 最后一条"spawn client 的窗口化字段仍不可信(是结构不是缺陷)"是同一件事,从集成用例
这一侧再次证实。因此断言改读**进程内的 `MGPipeTextureEmitter::SubDataCount()`**(同一个计数器的源
头,测试进程在四个臂下都是 client),`ctu=` 只在窗口对齐时断言;是否对齐由
`PeekSplitRuntime()` 回答的传输决定,**不是**由数值是否 >= 0 决定——spawn 下 server 会发布一个
完全可读的 `ctu=0`,按数值判会把比较悄悄变成 `0 == 9`。
### 13.3 未跑项 / 不可调度项
- **Mali 帧时增量(D-D4 要求与金标并列)不可调度。** 本阶段只有一台 Redmi(Adreno 830v2),
**无任何 Mali 设备**。按 Adreno 记录形状,偏差在此与场景头部注明:**Adreno-only; Mali delta
deferred**。不建模、不从 2026 年那次测量的条件推算。形状是悬崖的**因**,帧时是它在某一家硬件
上的**果**——门守的是因。
## 本目录
| 文件 | 内容 |
|---|---|
| [`espryt-d1.md`](espryt-d1.md) | espryt D1 — the Espryt (DirectGLES) stream, part 1 |
| [`espryt-d2.md`](espryt-d2.md) | P3b/P4b wave 2-D package D2 — the Espryt stream, part 2 |
| [`espryt-d3.md`](espryt-d3.md) | espryt D3 — the Espryt (DirectGLES) stream, part 3 |
| [`split-scenario-census.md`](split-scenario-census.md) | Texture / program split-scenario census (P3b/P4b wave 2-D, package D2) |
+388
View File
@@ -0,0 +1,388 @@
# espryt D1 — the Espryt (DirectGLES) stream, part 1
P3b/P4b items landing under the P7 program (`notes/p7/PLAN-PH-P34B-P7.md` §1.2 rows XFB /
回读 / `g_fboTextureSyncList`, §3 wave 2-D). Base `feat/disaggregated@ec3ba00a`, branch
`p7/espryt-d1`.
Per-slice red-once notes (R-16). A slice is not done until the case it adds has been seen RED
against the tree without that slice's fix and GREEN with it, on the arm the fix is for.
---
## slice 1 — the orphaned XFB capture target
**The hole.** `ScatterCapturedRecords` (`MG_Backend/DirectGLES/DirectGLES.cpp`) is a
read-modify-write of the capture destination's PRE-CAPTURE bytes: a `gl_SkipComponents` hole
has to come back holding whatever the application left there, so the scatter stages the old
range, patches the captured varyings into it, and uploads the whole range once. Under a
transport the old bytes are the SERVER's staged shadow (`GLESBufferResource::hostBytes`)
rather than a frontend `MappedData()`, and the split arm read a null shadow as *"this target
has no pre-capture bytes, discard it"*:
```
if (splitResource == nullptr || hostBytes == nullptr) { MGLOG_E_ONCE(...); continue; }
```
A null shadow is not an error. `MGPResourceDesc.HasDefinedContent == 0` — the store the
application ORPHANED with `glBufferData(size, NULL)` — declares every byte it has not staged
since to be UNDEFINED, and `Managers.cpp`'s own M-3 comment says so in as many words. So the
`continue` threw away a whole capture for the ordinary streaming idiom (orphan, upload part of
it, capture into it), leaving the application's buffer holding its pre-draw bytes under
`GL_NO_ERROR` — the exact silent-loss class the preamble above `ReadbackCapturedRanges` exists
to close.
The partly-uploaded shape did not even reach the `continue`: it has a shadow, so it went on to
`RequireStagedCoverage` over the WHOLE bound range and died on
`Fatal{StageSnapshotTooNarrow, "xfb_scatter_pre_capture"}`.
**The fix.** Monolith has always been right here, and it is right by construction:
`Vector<Uint8> staged(rangeBytes)` is value-initialised, so scattering over an unreadable
source means scattering over zeroes and uploading them — byte for byte what a fresh
`MappedData()` hands back. So the split arm skips only the `Memcpy`, never the target:
* `splitResource == nullptr` keeps discard-with-log. That one really is impossible (the target
was recorded against a handle the applier had already minted a twin for) and there is no
`backendId` to upload into either.
* a null `hostBytes` falls through with `staged` left zeroed.
* `RequireStagedCoverage` is guarded by `BufferImpl::ResourceContentIsDeclared(res)`, exactly
as `Managers.cpp`'s pool-reuse ladder guards its own whole-store `MGL_SERVER_STAGED_REQUIRE`.
A declared store still Fatals on a coverage gap (a missing record is still a missing record);
an orphaned one does not.
`ResourceContentIsDeclared` moved out of `Managers.cpp`'s anonymous namespace to namespace
scope beside `RequireStagedCoverage` and is declared in `Managers.h`: the two callers must not
be able to answer "did the application declare these bytes" differently. Both are inside
`#if MOBILEGL_BUILD_DISAGGREGATED`, so the pull build compiles neither (G1).
**Red-once (R-16).** `XfbAfterClipDistanceScenario.OrphanedCaptureTarget*`, two cases, on the
split arms:
| case | store | without the fix |
|---|---|---|
| `…WithAPartialUploadKeepsItsVaryings` | `glBufferData(size, NULL)` + `glBufferSubData` over the first half | `Fatal{StageSnapshotTooNarrow, "xfb_scatter_pre_capture"}` |
| `…WithNoUploadAtAllKeepsItsVaryings` | `glBufferData(size, NULL)`, nothing staged | silent discard: every captured component is still the pre-fill |
Both assert the captured varyings everywhere and the preserved `gl_SkipComponents` holes only
inside the uploaded region — past it the application declared the bytes undefined and nobody
may check them. The ambient monolith registrations of the same two cases are the control that
says the expectation is right rather than the arm's.
**RESULT — red once, then green.** With the `continue` and the unguarded `RequireStagedCoverage`
restored (fix reverted, everything else identical), `ctest -R 'DirectGLES.*OrphanedCaptureTarget'`
gave 4/10 passed, 6 failed — and the six are exactly the six split-arm entries:
```
3736 DirectGLES.Split.Xfb …WithAPartialUploadKeepsItsVaryings (Subprocess aborted)
3737 DirectGLES.Split.Xfb …WithNoUploadAtAllKeepsItsVaryings (Failed)
3738 DirectGLES.Spawn.Xfb …WithAPartialUploadKeepsItsVaryings (Subprocess aborted)
3739 DirectGLES.Spawn.Xfb …WithNoUploadAtAllKeepsItsVaryings (Failed)
3740 DirectGLES.Tcp.Xfb …WithAPartialUploadKeepsItsVaryings (Subprocess aborted)
3741 DirectGLES.Tcp.Xfb …WithNoUploadAtAllKeepsItsVaryings (Failed)
```
The abort is the one the row predicted, verbatim from the lane log:
```
MGPipe: Fatal{StageSnapshotTooNarrow, "xfb_scatter_pre_capture"} - the server's ladder wants
[0, 696) of a buffer whose staged coverage does not include it.
```
and the failure is the silent one:
`captured varying at index 1 (past the uploaded region): got 0, expected 1`. The two ambient
monolith entries (2471 / 2472) PASSED in the same red run, which is what makes the six a
transport fact rather than a wrong expectation.
With the fix: 10/10.
**Gates.** `integration-split` 188/188 (base 186 + these 2), `integration-spawn` 104/104
(base 102), `integration-tcp` 105 labelled + 2 fixtures = 107/107 (base 103 + 2),
`ctest -L unit` 2408/2408, the monolith `DirectGLES.` XFB + readback families 66/66,
`spawn_lane_parity.py build-split` RC 0 (split 105 / 102 comparable, spawn 102),
`fatal_census.py` RC 0 (79 abort sites, 0 unmarked), `link_ratchet.py --assert-monotone`
unchanged at 186 symbols. G1: `.text` `0xa52203`, `nm --defined-only` and `nm --defined-only -D`
both byte-identical to `~/w7/p7-before/`.
---
## slice 2 — the unbounded writeback event
**The hole.** Both XFB writeback producers posted ONE unbounded `OnBufferWriteback` covering the
whole bound range: `ScatterCapturedRecords` from its staged vector, `ReadbackCapturedRanges` from
a live `glMapBufferRange` mapping. `ServerOnBufferWriteback` turns each into one SEG_EVENT record
of `sizeof(EventBufferWritebackHead) + bytes`, and `RingProducer::Reserve` refuses any record
above `Capacity()/2` **outright** — not "when full", but always, because above half a capacity a
record is placeable at some head offsets and not at others and waiting for room would be a hang.
`EventRingBytes` defaults to 256 KiB. So any capture target wider than ~128 KiB was
`Fatal{EventRingOverflow}` and the **server process died** — on a buffer size, with nothing else
wrong. The producers' own Fatal text already said what to do: *"Raise MOBILEGL_IPC_EVENT_KB or
slice the event at its producer, as the writeback path already does"* — which was true of the
client's request path and of nothing on this side.
**The fix.** `MG_Pipe` grows the one number, published the way `gMGPipeSegmentResolver` is
published: `gMGPipeEventRingCapacityBytes`, installed by `ServerSession::Accept` beside the four
reverse-channel producers and released at `Close` only if still ours, and
`MGPipeBufferWritebackSliceBytes()` which turns it into a per-record width (a quarter of the ring,
4 KiB floor — the same number and the same reasoning as the client's `BufferWritebackSliceBytes`).
The backend cannot reach `MG_Remote::Client` (wrong linkage) or `ServerSession` (wrong layer), so
the hook is the seam. 0 means "do not slice": monolith has no ring under the callback.
Both producers loop against one helper, `XfbWritebackSliceStep`, so a second spelling of the width
cannot leave one of them still killing the server. `:1782` slices INSIDE its mapping and still
unmaps once; `:1969` slices the staged vector and keeps the single `glBufferSubData` whole,
because the ES store has no ring and cutting it would change how many backend calls one
application call makes. In-order delivery makes the last slice's landing imply every earlier one,
so the client needs nothing new to reassemble them.
**Red-once (R-16).** `XfbAfterClipDistanceScenario.{AScatteredCapture,APlainCapture}IntoAMegabyteRangeReachesTheApplication`
— a 1 MiB bound range (≈8× what one record can ever be) with the same six capture records; it is
`glBindBufferBase` over the whole store that makes the mirrored range a megabyte. Two cases
because there are two producers: the `gl_SkipComponents` layout is not expressible on ES and goes
through the scatter, the plain single-varying layout is and goes through the readback.
With `XfbWritebackSliceStep` returning the whole range (fix reverted), all six split entries went
red and both monolith controls stayed green:
```
3744 DirectGLES.Split.Xfb …AScatteredCapture… (Subprocess aborted)
3745 DirectGLES.Split.Xfb …APlainCapture… (Subprocess aborted)
3753/3754 DirectGLES.Spawn.Xfb … (Failed — the server process died)
3762/3763 DirectGLES.Tcp.Xfb … (Failed — the server process died)
```
```
MGPipe: Fatal{EventRingOverflow} - kEventBufferWriteback needs 1048600 bytes and SEG_EVENT caps
ONE record at 131072 (half its capacity).
```
inproc aborts the test process (the server is in it); spawn and tcp lose the peer instead, which
is the same defect seen from the other side of a socket.
**Also registered here**: `XfbAfterClipDistanceScenario.*` and `XfbRepeatedCaptureScenario.*` in
full on the three split arms (slice 1 had only `OrphanedCaptureTarget*`, because the rest could
not survive the unsliced event). `XfbRepeatedCaptureScenario`'s `gl_NextBuffer` compacted-target
shape is the first thing outside the census to exercise the archive-served stride and varyings
(`ProgramArchive->Link`'s xfb fields) on the server — **it passed on all three arms with no
further change**, so there was nothing of D1's to fix behind it.
**Gates.** `integration-split` 202/202, `integration-spawn` 118/118, `integration-tcp` 121/121,
`ctest -L unit` 2408/2408, the monolith + split XFB families 120/120,
`spawn_lane_parity.py build-split` RC 0, `fatal_census.py` RC 0 (79 sites, 0 unmarked),
`link_ratchet.py --assert-monotone` unchanged at 186. G1: `.text` `0xa52203`, both nm lists
byte-identical.
## slice 3 — the dead `OnXfbScatterReady` declaration
Plan B's section 7.1 named ten reverse-channel callbacks. The tenth, `OnXfbScatterReady`,
belonged to a design the tree does not have: plan B put the XFB scatter on the CLIENT — the
server would hand back the packed scratch and the client would run the patch loop over its own
shadow — so something had to tell the client the layout. P5c/P5f went the other way. The
declaration was left behind with **zero producers, zero consumers and no `EventKind`**, and the
`static_assert` beside `kMGPipeCallbackCount` made it look load-bearing.
Deleted; `kMGPipeCallbackCount` 10 → 9. Three pieces of prose that still described the old design
go with it:
* `MGPipeCallbacks.h`'s own header — "ten callbacks" → nine, with the reason the tenth went.
* `MGPipeTypes.h`'s `MGPXfbAccounting` comment, which said the scatter "is a read-modify-write of
the client's shadow and lives there". It lives on the server's staged shadow.
* `ARCHITECTURE.md` §8.5, retitled from 「XFB scatter 搬到 client」 and rewritten to what the tree
does: server staged shadow, one `OnBufferWriteback` carrying the reconciled range (sliced —
slice 2), orphaned targets legal (slice 1). Its `OnXfbScatterReady` row in §8.1's table goes too,
since leaving it would be a new staleness rather than an inherited one.
`PipeCatalogue.ReverseChannelHasTenCallbacks` now asserts 9. **The case name is deliberately not
renamed**: G2/G14 say the ctest name set only grows, so renaming would delete a name the gate
watches. The count it asserts is what has to be right; the comment carries the number.
**RESULT — red once, then green.** With the member and the count restored (everything else as
committed), `PipeCatalogue.ReverseChannelHasTenCallbacks` fails:
```
PipeCatalogueTest.cpp:1111: Failure
Expected equality of these values:
kMGPipeCallbackCount Which is: 10
9u Which is: 9
```
which is what makes the struct's shrink a measured fact rather than a claim — the `static_assert`
beside the constant only proves the two agree with each other.
**Gates.** `integration-split` 202/202, `integration-spawn` 118/118, `integration-tcp` 121/121,
`ctest -L unit` 2408/2408, parity / census / ratchet (186) green. **G1 run for this slice in
particular**, because `MGPipeCallbacks.h` is included from MG_Backend and the struct is *not*
behind `MOBILEGL_BUILD_DISAGGREGATED`, so `sizeof(gMGPipeCallbacks)` really does shrink by 8 bytes
in the pull build: `.text` still `0xa52203` and both nm lists still byte-identical. The shrink is
in `.bss` and nothing indexes the table by count.
*(One unrelated flake seen and cleared: `DirectGLES.Tcp.PrimitiveRestartScenario.TheFixedIndex
ValueTakesTheForwardingPath` failed once in the tcp lane and passed on re-run, and the full lane
was re-run clean at 121/121.)*
## slice 4 — readback close-out
The plan's 回读 row had four parts. The headline is part (a): **the census came back clean**, which
is not what the row expected ("Expect reds — that is the point").
### (a) the readback lane census
Registered on the three split arms (`integration-split` / `-spawn` / `-tcp`), 22 cases per arm:
| family | cases/arm | result |
|---|---|---|
| `F1WireScenario.TextureAndFramebufferReadsPreservePackBufferPadding` | 1 | green |
| `F1WireScenario.TextureReadbackRejectsPackedDestinationOverflowBeforeWriting` | 1 | green |
| `PixelStoreSweepScenario.*` | 2 (+1 new, below) | green |
| `FramebufferChurnScenario.*` | 1 | green |
| `PackedWordReadbackScenario.*` | 3 | green |
| `LayeredTextureReadbackScenario.*` | 2 | green |
| `DepthStencilReadbackMatrixScenario.*` | 12 | green |
**No case needed a fix and no case needed a named deferral.** The first run was 65/65 (63 cases +
the two TCP fixture entries), before any of this slice's code changes. That is a real finding and
it is worth stating plainly: the 回读 half was assumed open because nothing had ever run it under a
transport, and the assumption, not the code, was what was wrong. `ScatterTightReadbackIntoPackState`
and the server's neutral-pack read were already carrying it.
Two honest caveats, because a skip is not coverage:
* `DepthStencilReadbackMatrixScenario.SeparateDepthAndStencilAttachmentsAreBothReadable` **SKIPS on
all three arms** — and on monolith too. It is a driver fact, named by the case itself: *"this
driver cannot host separate DEPTH_COMPONENT24 and STENCIL_INDEX8 attachments"*. Not a transport
fact, nothing deferred.
* `DepthStencilReadbackMatrixScenario` needs `MOBILEGL_ESPRYT_FORCE_DS_READBACK_EMULATION=1`
mirrored into the split arms, which the registration macro cannot carry, so it gets its own
per-arm block (`DirectGLES.{Split,Spawn,Tcp}.ForcedDs.`). Without the pin the scenario is
unfalsifiable here: ES has no core depth/stencil readback, Mesa accepts the reads anyway, and on
llvmpipe every case goes green through a path the Adreno device does not have — deleting the
whole emulation left all of them passing. A split arm inheriting the ambient default would have
measured the same non-path three more times.
### (b) the two `std::abort` emulations
The row said both *"still `std::abort` under any non-monolith transport"*. Checked rather than
assumed, and the tree disagrees on one of them:
* **`copy-image-shadow-mirror` already cannot abort.** `MirrorCopyImageIntoDestinationShadow`
returns under `if (MG_Config::Transport != Monolith)` **before** reaching
`MGPipeUnmigratedEmulation`, and has since P5b package i1 (its own comment names the ruling and
the two backstop Fatals that bound what the skip loses). Nothing to do; the row is stale.
* **`get-tex-image-shadow` is retired here**, and the interesting part is *why* it was there. P4a's
comment reads "a split server holds no shadow to convert" — but the level storage this function
converts **is the server's own**, fed by the staged texture store. When `MapMipmapData` answers,
the conversion reads bytes that exist on this side and the answer is right; the emulation was
never reaching across the split, it only looked as though it must. So: convert when the shadow
is there, and decline by name (rule I: `MGLOG_E_ONCE` + `GL_INVALID_OPERATION`, destination
untouched) when it is not. `std::abort` inside a server answering a client's readback takes the
whole session down for a texture level it happens not to hold, and it bypasses `Session::Fail`,
which is the funnel the census gate watches.
**The funnel keeps its teeth for the other four sites** — `generate-mipmap-storage`,
`generate-mipmap-cpu-fallback`, `generate-mipmap-cpu-filter`, `texture-remint-pull` — which
really do reach into a client address space. Only this call site is retired, and only because its
own premise did not hold. `fatal_census.py` is unchanged at 79 abort sites, because the abort
lives in `MGPipeUnmigratedEmulation` and that function stays.
**Reachability, said out loud**: no case in the armed census reaches this site under a transport,
and the analysis says why — the client emits `MGPWireOp::GetTextureImage` and the server answers
it with `ReadTextureImageWire` (a scratch-FBO read), never through the backend's `GetTexImage`
slot. So this change is defence in depth and **has no integration-level red-once of its own**;
saying otherwise would be inventing one.
### (c) the case nothing covered
`PixelStoreSweepScenario.ReadPixelsIntoAPackBufferHonoursPackStateAndLeavesTheGapsAlone`:
`glReadPixels` into a bound `GL_PIXEL_PACK_BUFFER` at a non-zero buffer offset, with
`PACK_ALIGNMENT`/`ROW_LENGTH`/`SKIP_ROWS`/`SKIP_PIXELS` all non-default, read back with
`glMapBufferRange`. This is the only thing that drives `EmitTables.cpp`'s `if (pbo)` branch — the
client servicing the pack PBO itself after the reply lands, uploading tight rows one at a time at
the stride the pack state implies. The existing sweep case reads into a client POINTER, which is
`ScatterTightReadbackIntoPackState`'s half and has unit cover; the PBO half had none, and it is
pure arithmetic (stride, alignment round-up, two skips, a buffer offset).
Every number is chosen to make a term matter: `ROW_LENGTH` 5 × 4 bpp = 20, which `ALIGNMENT` 8
rounds up to a **24**-byte stride; `SKIP_ROWS` 1 + `SKIP_PIXELS` 2 put the first pixel at image
byte 32; the read is issued at buffer offset 16, so it lands at **48**. The whole buffer starts
`0xCD` and the case asserts both halves: the rows land where the pack state says, and **every other
byte is still poison**.
**RESULT — red once, then green.** Dropping just the buffer-offset term from
`EmitTables.cpp:1001` (`start = pixels + …` → `start = …`) and rebuilding:
```
3794 DirectGLES.Split.PixelStoreSweepScenario.ReadPixelsIntoAPackBuffer… (Failed)
3797 DirectGLES.Spawn.… (Failed)
3800 DirectGLES.Tcp.… (Failed)
```
`PixelStoreSweepScenario.cpp:353: readback[at] Which is: '\xCD' (205)` — the destination is still
poison because the rows landed 16 bytes early. The ambient monolith entries passed in the same run
(the driver services its own PBO there), so the three reds are a transport fact. `EmitTables.cpp`
was restored immediately and is **not** part of this commit.
### (d) the stale comment
`SplitReadbackPackBuffer`'s comment claimed *"The client refuses PACK_BUFFER before emission, so no
frontend pack binding can affect this destination."* The client does no such thing — it **keeps**
the PBO and services it after the reply. The conclusion (the server must see no pack buffer) was
right; the reason was backwards, and a refusal would have been observable as a GL error. Rewritten
to the actual reason, with ID-49's split of the work named.
**Gates.** `integration-split` 225/225 (base 186), `integration-spawn` 141/141 (base 102),
`integration-tcp` 144/144 (142 labelled + 2 fixtures; base 103 + 2), `ctest -L unit` 2408/2408,
`integration-magma-split` 73/73, parity / census (79 sites, 0 unmarked) / ratchet (186) green.
G1 `.text` `0xa52203`, both nm lists byte-identical.
## slice 5 — four transport-aware resolvers
**The hole.** `ResolveFramebufferSubsystemArm` and its three siblings
(`ResolveTextureResourceSubsystemArm`, `ResolveSampler…`, `ResolveProgram…`) classify a family's
arm as `Handles`, `Legacy` or `NoArm`, and stop only on `NoArm`. Under a transport `Legacy` is not
a slower answer, it is a **postponed crash**: all four pre-handle arms reach frontend state through
accessors that are BARRIER_PULLED rows (`FieldOwnership.def`), and under an active transport that
state belongs to a client that is no longer parked behind this apply — so the accessor's honest
answer is `Fatal{UnmigratedPipeInput, "<field>@<verb>"}` on the first verb that reaches it.
This is the audit's own claim about `g_fboTextureSyncList` — "separation-safe, because the record
arm returns first" — which is true **only while the record arm is armed**, and nothing checked
that. The row is in the plan (§1.2, `g_fboTextureSyncList`) precisely because the argument had
never been run.
**The fix.** Each of the four, under `#if MOBILEGL_BUILD_DISAGGREGATED`, now stops when
`MG_Config::Transport != Monolith && verdict != Handles`, through one shared
`StopOnTransportWithoutRecordArm(bit, detail)` that formats both causes and hands them to
`BufferImpl::StopOnArmlessPipeSubsystem` — this file's existing single voice for "the
configuration left no arm to run". A transport with the record arm off *is* that condition with a
different cause: the legacy arm is present but unreachable. Reusing the voice keeps the census's
family word (`PipeLegacyMemosDisabled`) and the cause travels in the message rather than in a new
word the census would have to learn.
**Red-once (R-16).** `MOBILEGL_PIPE_PUSH=0x1dff` (the Handles lane's `0x1fff` minus `0x200`,
`kMGPipeSubsystemFramebuffer`) with `MOBILEGL_TRANSPORT=inproc`, running
`ClearThenReadPixelsScenario.ClearWithNoDrawIsVisibleToDefaultFramebufferReadPixels`. Both runs
abort (exit 134) — what changes is *what the abort says*:
*without the stop (fix reverted):*
```
Fatal{UnmigratedPipeInput, "GetFramebufferBindingSlot@Clear"}
```
a mid-frame Fatal naming an accessor and a verb, from which nothing points at the mask.
*with it:*
```
Fatal{PipeLegacyMemosDisabled, "MOBILEGL_TRANSPORT is not monolith and
kMGPipeSubsystemFramebuffer (bit 9) is clear (or refused), so the record arm is off and the
legacy arm is unreachable: the pre-handle g_fboSynced* / g_fboTextureSyncList arm reads the
framebuffer binding slots, and under a transport GetFramebufferBindingSlot is a BARRIER_PULLED
row belonging to a client that is not parked behind this apply - so the first verb to reach it
would raise Fatal{UnmigratedPipeInput, "GetFramebufferBindingSlot@<verb>"} mid-frame instead"}
```
**"Resolve time", not "startup"** — said precisely, because the difference matters and the plan's
wording ("启动期具名 stop") is looser than the tree. The four resolvers are function-local statics
resolved lazily at first use, deliberately (`Managers.cpp`'s own comment: a stop inside
`eglMakeCurrent` reads to the harness as "no usable GPU" and SKIPS). So the stop still lands in a
scenario body where ctest reports it. What it no longer does is wait for a verb to dereference the
client's state and then blame the accessor.
**Gates.** `integration-split` 202/202, `integration-spawn` 118/118, `integration-tcp` 121/121,
`ctest -L unit` 2408/2408, `integration-magma-split` 73/73, parity / census (79 sites, 0 unmarked)
/ ratchet (186) green. G1 `.text` `0xa52203`, both nm lists byte-identical — the four blocks are
inside `MOBILEGL_BUILD_DISAGGREGATED` and the pull build compiles none of them.
+354
View File
@@ -0,0 +1,354 @@
# P3b/P4b wave 2-D package D2 — the Espryt stream, part 2
The verification gates P3b/P4b owes, plus the texture / program split-scenario census.
Base `cf7ca59f` (`feat/disaggregated`), worktree `~/w7/p7-espryt-d2`, branch `p7/espryt-d2`.
Package D1 owns `MG_Backend/DirectGLES/{DirectGLES.cpp,Managers.cpp}`, the XFB/readback
scenarios and their split-arm registrations. Nothing here touches those; every
`MG_IntegrationTest/CMakeLists.txt` edit sits in a block headed `package D2`.
---
## Slice 1 — `TextureViewAliasScenario`
The verification half of "按存储属主键控的发射游标与 view 索引重映射". The code half landed in
P4a/P5e: the drain cursor is owner-keyed (`MG_Impl/Pipe/TextureEmit.h`, `NoteLevelDirty` +
`DrainTextureSubData`), the index remap is `TextureObjectView::ToOwnerLevel` /
`ToOwnerUploadTarget` / `ToOwnerRegionOffset`, the wire half is `MGPSamplerView` +
`MGPResourceDesc::ViewOf`.
Four cases, each asserting on TWO channels at once — sampled texels AND
`MGPipeTextureEmitter::SubDataCount()` / `RefusedSubDataCount()` / `DrainListSize()`, read through
the new `Harness/TextureEmitPeek.{h,cpp}`:
| case | direction | drains |
|---|---|---|
| `SubImageThroughAViewIsSampledThroughTheOwner` | view upload → owner sample | 1 |
| `SubImageThroughTheOwnerIsSampledThroughTheView` | owner upload → view sample | 1 |
| `TheViewUploadDrainRunsAgainAfterADrawBoundary` | view upload → owner sample | 3 |
| `TheOwnerUploadDrainRunsAgainAfterADrawBoundary` | owner upload → view sample | 3 |
### Red-once (R-16)
`TextureObjectView::MarkStorageDirtyRegion` patched to call `PipeNoteLevelDirty` on ITSELF instead
of forwarding to the storage owner — the two-cursor shape the design rejects.
```
DirectGLES.TextureViewAliasScenario.TheViewUploadDrainRunsAgainAfterADrawBoundary FAILED
the first view write, through the owner: 11408 of 11408 pixels disagree;
first at (2, 2) is rgba(50,160,30,255), expected rgba(255,0,255,255)
Expected: (window.SubDataDelta()) > (0u), actual: 0 vs 0
the SECOND drain (first view write after a draw boundary): the client texture emitter
described 0 texture(s) across this draw and put NO resource_subdata on the wire.
... and the same pair again for the THIRD drain.
```
**Both channels red simultaneously**, which is the property the file was written for: stale texels
AND a drain that emitted nothing.
**Deviation from the plan's prescription, recorded rather than papered over.** The plan says
"case (a) must go red". It does not — case (c) does. Case (a) creates the texture, writes through
the view and drains ONCE, and that first drain of a texture's life carries the whole level anyway
(the storage definition already marked it dirty), so a cursor keyed on the wrong object still
ships the right texels by accident. It is the SECOND and THIRD drains, where only the sub-region
written since the last validate point is owed, that can lose a record. Cases (c)/(d) exist for
exactly that and are where the red lands. The scenario header states this; case (a) is kept
because it is the cheapest statement of the remap itself.
### A defect this slice FOUND: owner writes are invisible through a sampled view under split
`TheOwnerUploadDrainRunsAgainAfterADrawBoundary` is **red on inproc, spawn and tcp, green under
monolith**, on the unmodified tree.
Once a view has been SAMPLED, a later `glTexSubImage` through the OWNER's own name never becomes
visible through the view. The client half is provably correct — the case's own counter assertions
pass, so the records were emitted and the applier accepted them.
* The server's per-texture clean gate `BackendTextureObject::IsDrawSyncCleanByRecord`
(`Managers.cpp:15433`) compares the VIEW's `record.Serial` and `record.PendingUploads`.
* An owner-side `resource_subdata` moves only the OWNER's (`MG_Pipe/PipeApply.cpp:1175`).
* Nothing propagates a serial bump from a storage owner to the records that view it.
`MGPResourceDesc::ViewOf` is a forward edge with no reverse index, and the applier reads it only
in the descriptor-equality helper (`PipeApply.cpp:666`).
* Under monolith the same gate reads `GetContentVersion()` THROUGH the view, which
`TextureObjectView` forwards to the owner (`TextureObjectView.cpp:100-102`). The split gate has
no equivalent of that forwarding.
* `MG_Remote/CONTRACT-P5E.md:387-395` states the split gate in full and has the same hole, so the
implementation is faithful to the contract. **The contract is what is wrong.**
`KHR-GL43.texture_view.coherency` is exactly this test and reads Pass in the CTS baseline — which
is a **monolith** reading (`notes/p7/device-window-1/CTS-base/README.md:16`).
**Not fixed here.** The fix is either at the gate (`Managers.cpp` — package D1's file) or at the
publisher (`MG_Pipe/PipeApply.cpp`'s `ApplyTextureUpload`, outside D2's declared footprint), and
the publisher-side form needs either an O(#texture records) scan per `resource_subdata` or a new
reverse index on `MGPipeResourceRecord` — a design decision with a contract amendment attached.
The case is **excluded by name from the three split arms** with the cause stated in the CMake
comment, kept in the monolith lanes where it is the regression net for the forwarding that works,
and listed in `split-scenario-census.md`. G14: the name still exists in every lane.
### The tcp arm was green-skipping everything
`MOBILEGL_ESPRYT_ENABLE_TEXTURE_VIEW=1` on `MGL_ITEST_GLES_TCP_ENVIRONMENT` is not enough: the tcp
lane's server is **pre-started by the `TcpServer.Start` fixture**, not spawned from a client that
carries the lane environment, so the server withheld `GL_ARB_texture_view` and all four cases
SKIPPED while the identical Split and Spawn arms ran. Fixed by putting the knob on the fixture
entry's own `ENVIRONMENT` property (`tcp_server_fixture.py` builds the supervisor's environment
from `os.environ` and strips only the transport keys). A feature knob that reaches two arms of
three is the worst of the three states: the lane is green and tests nothing.
---
## Slice 2 — `TextureUploadShapeScenario` promoted from record to gate (R-11 / D-D4)
`RecordProperty` → `EXPECT_EQ` against a gold row measured on this cursor, plus a third texture
uploaded through a `glTextureView` so the view/owner remap is inside the counted workload.
### The gold row
Workload constants `kScatteredRects=40`, `kFrames=3`, one contiguous band, three textures.
| | emit | box | rect | jobs | client emitter |
|---|---|---|---|---|---|
| **gold (this cursor)** | **9** | **9** | **0** | **9** | **9** |
| P4a's record (two textures, no client emitter) | 6 | 6 | 0 | 6 | ctu=0 |
Identical on all four arms — `DirectGLES.TextureUploadShape.` (monolith), `.Split.`, `.Spawn.`,
`.Tcp.`.
### The client half is read from the emitter, not from `ctu=`
Measured, and it is a correction rather than a preference:
| arm | where `tex[]` is | where `ctu=` is |
|---|---|---|
| monolith | the one log | same line |
| inproc | the SERVER's log (two files, one process, one counter set) | same line |
| spawn / tcp | the SERVER's log | the CLIENT process's own counters, on a **different Present cadence** — measured `ctu=13` against `emit=9`, and usually not yet written at all when the case reads |
So `ctu == emit` is not a well-posed comparison under spawn/tcp from the summary lines. The log
field is kept as a RECORD and asserted only where the two are window-aligned (decided by asking
`PeekSplitRuntime()` which transport resolved — **not** by testing whether the number is >= 0,
which was this case's first mistake: the server publishes a perfectly readable `ctu=0` under
spawn and the comparison silently became `0 == 9`). The ASSERTION reads
`MGPipeTextureEmitter::SubDataCount()` in-process, which is the same counter's source and is the
client's true count in every arm, because the test process is the client under all four.
`Harness/PipeStatsWindow.h` gains `LastFromClientLog()` / `LastFromServerLog()` for this.
### Red-once (R-16)
**The prescribed flip does not reach this workload — but not for the reason this note first
gave.** Flipping `summedArea * 4 >= unionArea * 3` in `MipmapStorage::GetDirtyRects` leaves the
gate green, and so do two other client-side mutations:
1. flip `summedArea*4 >= unionArea*3` -> green
2. `rects.size() < 2` -> `rects.empty()` -> green
3. remove the union-box re-seed in `MarkDirtyRegion` -> green
4. `MOBILEGL_ESPRYT_DISABLE_UNPACK_RING=1` alone -> green **(before the geometry fix)**
The first three are green because they are mutations of a decision the CLIENT has already made
correctly: with the inset scatter the client hands over thirty rects, and none of those three
predicates is the one that takes the box arm. Attempt 4 was green for a completely different and
much worse reason, and finding it is the reviewer's (fable, ID-P7-8):
> the original stride `x = ((i*7) % 32) * 2`, `y = ((i*5) % 32) * 2` reaches x=62 (rect 9) and
> y=62 (rect 19) in a 64-px atlas, so the rects' union box covered the WHOLE LEVEL — and the
> server's `subRectEligible` (`Managers.cpp:8486-8491`) requires
> `!dirtyRegion.CoversWholeLevel`, a **bounding-box** test (`MipmapStorage.h:30-33`). Both
> scatter textures were rect-INELIGIBLE before `:8649`'s ring policy was consulted.
So the gate's numbers were right and its subject was wrong: the box-versus-rect decision it
exists to pin was never reached for the two textures the workload scatters into, and the only
texture that could move under any red-once was the contiguous control band. The first
substitute red-once's `box=6 rect=3 jobs=12` was exactly that band (64x8, cut in two, three
frames) — **neither scatter texture moved**, which is what gave the wrong explanation away.
**The fix** is `kScatterMargin`: inset the scatter by one rect so the union box bounds at
`(2,2)..(62,54)` and covers no level. Same 40 writes, same coarse stride, decision point live.
The gold row is UNCHANGED at `emit=9 box=9 rect=0 jobs=9` — but it now means what it says, and
`rect=0` is genuinely the unpack-ring policy's output rather than a bounding-box accident.
**The red-once after the fix is ZERO-PATCH**, which is stronger than any throwaway source edit:
```
MOBILEGL_ESPRYT_DISABLE_UNPACK_RING=1
tex[emit=9 box=3 rect=6 jobs=183] bytes/f[tex=9024, was 104448]
the BOX/RECT split moved: 3 box emissions against a gold of 9
the BOX/RECT split moved: 6 rect-list emissions against a gold of 0
the JOB count moved: 183 against a gold of 9
```
**Which texture moved: BOTH SCATTER TEXTURES.** `box=3` is the contiguous control band alone
(one contiguous region -> one rect -> not >= 2 -> box), `rect=6` is the plain scatter atlas AND
the atlas written through the `glTextureView`, three frames each, and `jobs=183 = 3 + 6 x 30`
confirms thirty rects per scatter emission. All 26 pixel cases of `TextureView` /
`TextureViewAlias` / `SampledSetStaleness` / `ImageSizeAfterRespec` / `CopyImageLevelRange` /
`ClearThenReadPixels` stay GREEN under the same knob — the required property, and the point of
the gate: every pixel assertion is blind to a shape that inverted.
### The Mali frame-time delta is NOT published
D-D4 asks for the +6 ms/frame reading beside the gold. **Not schedulable**: this phase has one
device, a Redmi with an Adreno, and no Mali part. Recorded as a declared deviation in the scenario
header and in `docs/Disaggregated/MEASUREMENTS.md` as "Adreno-only; Mali delta deferred" rather
than modelled or copied from the 2026 measurement's conditions. What the gate pins is the SHAPE,
on the reasoning that the shape is the cliff's cause and the frame time is its consequence on one
vendor's hardware.
### Stale prose corrected
All three said the client emitter had not landed. `MG_Impl/Pipe/TextureEmit.h`'s `EmitOneLevel`
increments `CallClass::ClientTextureUploadEmissions` on every piece it emits, and the build's own
probe hits (`MGITEST_PIPE_CLIENT_TEXTURE_UPLOAD_EMITTER_PRESENT=1` is in every lane's environment).
* `Scenarios/TextureUploadShapeScenario.cpp` header and the client-half comment block
* `MG_IntegrationTest/CMakeLists.txt`, the probe's comment ("Once package B's texture emitter
lands"). The `else()` arm is KEPT — it is what makes the arming decision falsifiable in both
directions — but it is unreachable on this tree and now says so.
* `notes/p4a/p4a-results/gates-v1.md`'s re-run table
---
## Slice 3 — the memo purity gate
`scripts/ci/espryt_memo_purity.py`, a sibling of `link_seam_purity.py`, wired into `test.yml`
beside it. Scoped to the BRACES of the families the plan names (`ResolvedTextureBindingMemo`,
`SamplerPassMemo`, `UnitSamplerLookupMemo`, `TwinLookupMemo`, `StateBackendObjectRegistry`) plus
the image sweep's seven file statics, because these two files pass frontend pointers around
legitimately in hundreds of places and a file-wide grep would be a list of exceptions.
Guard-awareness is a small conditional walker, not a preprocessor: it recognises
`#if MOBILEGL_PIPE_LEGACY_MEMOS`, `#if !MOBILEGL_BUILD_DISAGGREGATED` and the `#else` of
`#if MOBILEGL_BUILD_DISAGGREGATED`, which is every spelling these files use.
**Six allow-list entries, each with its reason.** The two that matter:
`StateBackendObjectRegistry`'s `UnorderedMap<StateObject*, Entry>` (`Managers.h:330`, and the
`m_entries` member behind it) and `ResolvedTextureBindingMemo`'s type-erased `const void* program`
are the PULL build's only arms — deleting them moves pull `.text` and fails G1, so they retire
with the pull path (P13). The other four are memo VALUES rather than keys.
**Red-once (R-16)**: 7 negative controls in `--self-test`, 4 positive controls (a
`LEGACY_MEMOS` arm, the `#else` of a `DISAGGREGATED` arm, the allow-listed type-erased key, and a
frontend pointer outside every memo family) — plus one taken against the real tree: injecting
`MG_State::GLState::ProgramObject* regressionKey` into the actual `ResolvedTextureBindingMemo`
reddens the gate and names `DirectGLES.cpp:7266`.
**What the sweep found that is NOT in scope**: seven unguarded frontend-pointer-keyed containers
under `MG_Backend/DirectVulkan` (`VkTextureManager`'s five `TextureIdentity`-keyed containers,
`VkClearManager`'s two, `VkRenderPassManager`'s two raw `RenderbufferObject*` maps, and
`VulkanRenderer::VaoDrawMemo`'s `vaoKey`+`vaoLifetimeId` pair sitting beside the correctly fenced
handle key). Magma's key inventory is P7 wave 2's, so the gate does not look there; recorded here
so the next pass meets a known list.
---
## Slice 4 — R-5 (D-K2's dependency rule in one place) and R-3
### R-5
The rule had **six** statements and nothing compared them, and **two of the four prose ones were
wrong in the same way**: `MG_Pipe/MGPipe.h:115-125` and `MG_Backend/DirectGLES/Managers.h:690-695`
both said "THREE OF THEM HAVE A DEPENDENCY" (there are six rows) and both said "the mirror pairs
(10 without 11, ...) are all fine" — when 10-without-11 is precisely D-K2's FOURTH row
(ID-14/ID-15), refused by the server and withheld by the client, with `PipeFill.cpp` saying so out
loud: "The brief's original 'bit 10 without 11 is fine' is WITHDRAWN for P4a as built." Neither
wrong comment could fail anything. `Managers.h`'s copy is in the header of the file that
implements the refusal.
**The rows, once**, in `MG_Pipe/SubsystemDeps.def` (X-macro, `FatalFamilies.def`'s convention),
expanded by `MGPipe.h` into `kMGPipeSubsystemDependencies[]` / `MGPipeSubsystemRequires()` /
`MGPipeSubsystemDependenciesAreSet()`, with four `static_assert`s over it:
| family | requires |
|---|---|
| bit 8 VertexInput | bit 7 |
| bit 9 Framebuffer | bit 10 |
| bit 10 TextureResources | bit 7 **and bit 11** |
| bit 11 Samplers | bit 10 |
| bit 12 Programs | — (a ROW, not an absence) |
| bit 13 BufferBindings | bit 7 |
Bits 8 and 13 were the two the old comment did not know about; bit 13's row lived fifteen lines
further down in `MGPipe.h`, which is how "THREE OF THEM" survived two phases.
**The two readers do NOT yet read it, deliberately.** `MG_Impl/Pipe/PipeFill.cpp` is the contract
package's file for the whole phase (`TextureEmit.h` states that rule) and
`MG_Backend/DirectGLES/Managers.cpp` belongs to package D1 while it is in flight. Switching them
is two one-line changes for the integrator. **The anti-drift property does not wait for it**:
`MG_Test/Backend/DirectGLES/SubsystemDepsTest.cpp` is the first thing in the tree that calls BOTH
readers at the same mask, sweeping the phase constants, the two documented refusal lanes and one
mask per row, and compares each against the `.def`. It is in that binary because that binary is
the one that links both sides.
Both comparisons are **one-directional**, and each for a measured reason:
* the server resolvers also fold in the family's own bit and (for the framebuffer one) D-C3's
separate wire-caps refusal, so a resolver may say NO for a reason of its own but may never say
YES at a mask the table refuses;
* `MGPipeP4aFamilyEmits` is a QUADRUPLE — the operator's bit, the wired constant, a registered
consumer, and the dependency rule — and the first version of this case asserted equality and
reddened at `0x1fff` on the sampler and program families because a bare unit binary registers no
consumer. That was the assertion being wrong, not the product; it is recorded because the
temptation to assert equality here is strong and wrong.
**Red-once (R-16), twice:**
1. drop D-K2's fourth row from the `.def` → **compile-time** failure, `MGPipe.h:225` and `:230`
("D-K2's fourth row (bit 10 requires bit 11) has gone missing again").
2. make the SERVER's `ResolveSamplerSubsystemArm` stop checking bit 10 (throwaway patch to
`Managers.cpp`, reverted) → `TheServerConsumerGateNeverArmsAFamilyTheTableRefuses` reds and
names the mask: "at MOBILEGL_PIPE_PUSH=0x9ff the SERVER's ResolveSamplerSubsystemArm ARMED the
handle arm for family 0x800 while MG_Pipe/SubsystemDeps.def says its dependency bits are not
all set." `0x9ff` is exactly the lane `CMakeLists.txt` already pins for G12.
Stale prose corrected in `MGPipe.h` (both blocks), `MG_Impl/Pipe/PipeFill.h` and
`MG_Impl/Pipe/TextureEmit.h`. **`MG_Backend/DirectGLES/Managers.h:690-695` is NOT corrected here**
— it is package D1's file. Its two defects are named above so the integrator can take them in one
line.
### R-3 (the cheap half)
`MG_Remote/CONTRACT-P5.md` already claimed the image-access, sampler-view-target and draw-buffer
encodings as contract, but did so **by pointing at package-header line ranges, and all three had
drifted** — `ImageEmit.h:146-159` no longer holds the encoding at all, `SamplerEmit.h:900` is off
by six lines, `FramebufferEmit.h:146-163` by one. That is the exact failure the table's own
`MGPSubData::Target` row warns about.
All three rows now state the encoding **by enumerator and function name** rather than by line, and
the two confusable siblings are named out loud: `MGPImageBind::Access` carries the raw GL token
(not this encoding), and `SamplerEmit.h`'s `SamplerTarget[]` is a different, biased encoding of the
same enum living 200 lines from the wire one.
**The remaining half of R-3 is stated, not closed**: `MGPSamplerView::Target` has no `Count`
bound, no `...IsValid` predicate and no `Fatal{ProtocolCorruption}` for an out-of-range value,
unlike `MGPipeResourceTarget`. Giving it the `MGPipeImageAccess` treatment in
`MGPipeValueTypes.h` is a `MG_Pipe` change outside this package's declared footprint.
---
## Slice 5 — the raw-depth-fetch sampler, step 1 only
Step 1 done: `ContextEpochTest` gains a case that drives `GetRawDepthFetchSampler()` on BOTH arms
in one process and asserts they are two different `BackendSamplerObject`s — the observable form of
`DirectGLES.cpp:334-336`'s prose claim that the legacy pair "is not constructed or consulted by
the server".
**Step 2 NOT done, and the package's own condition is why.** Every deletion candidate — the two
file-static `SharedPtr`s (`DirectGLES.cpp:82-83`), the monolith arm (`:361-371`),
`NeedsRawDepthFetchSampler` (`:393-399`) and the pre-handle sampler-pass branch (`:8015-8024`) —
is UNCONDITIONAL code. None sits behind `#if !MOBILEGL_BUILD_DISAGGREGATED`; the pull build
(`DISAGGREGATED=OFF`, `PIPE_PUSH=OFF`) compiles and links all of it, and the monolith arm is the
ENTIRE body `GetRawDepthFetchSampler` has there. Deleting any of it moves pull `.text` and fails
G1's 0/0/0/0 — `ARCHITECTURE.md:340` states that rule for exactly this class of
retired-but-compiled code. Filed as **P13**, beside the existing S7 entry in
`notes/p5f/f0-statics.md`.
---
## Slice 6 — the census
`notes/p34b/split-scenario-census.md` carries the table. Twelve scenarios newly gating in the
three GLES split arms; `ProgramPipelineScenario`'s nine non-storage-block cases deliberately not
registered (ScenarioFixture's armed-lane rule); DirectVulkan arms deliberately none, with the
tier-2 informational replay named as the reason it is not a coverage hole.
+385
View File
@@ -0,0 +1,385 @@
# espryt D3 — the Espryt (DirectGLES) stream, part 3
The defect package D2 found and could not fix, plus the two D-K2 loose ends D2 left for
whoever owned `MG_Backend/DirectGLES/` next. Base `p7/espryt-d2 @ a7c06f4f`, worktree
`~/w7/p7-espryt-d3`, branch `p7/espryt-d3`.
Per-slice red-once notes (R-16 / rule J). A slice is not done until the case it turns on has
been seen RED against the tree without that slice's fix and GREEN with it, on the arms the fix
is for — and for this package that means the two-process arms, not only inproc.
Four commits, in cherry-pick order:
| # | files | what is true after it |
|---|---|---|
| 1 | `MG_Test` | the pull build compiles again — `SubsystemDepsTest`'s server half is `MOBILEGL_PIPE_PUSH`-only |
| 2 | `MG_Backend`, `MG_IntegrationTest`, `MG_Remote`, `docs` | an owner-side upload shows through a sampled texture view, because the split clean gate resolves to the storage record |
| 3 | `MG_Backend`, `MG_Pipe`, `MG_Impl` | D-K2's dependency rule has one statement, and every reader reads it |
| 4 | `docs` | this note, and the census row the fix falsified |
Commit 1 is not a deliverable and is first for a reason: without it `ninja -C build-linux` exits
1 at D2's head, so every later commit would be measured on a tree whose pull build does not
build.
---
## slice 0 — the pull build compiles again
Not a deliverable; a prerequisite for this package's own G1, and worth stating first because it
means D2's head does not pass gate C as it stands.
D2's new `MG_Test/Backend/DirectGLES/SubsystemDepsTest.cpp` guards its CLIENT case with
`#if MOBILEGL_PIPE_PUSH` + `GTEST_SKIP` and does not guard its two SERVER cases, which take the
addresses of `ResolveFramebufferSubsystemArm` / `ResolveTextureResourceSubsystemArm` /
`ResolveSamplerSubsystemArm` / `ResolveProgramSubsystemArm`. `Managers.h` declares all four
inside `#if MOBILEGL_PIPE_PUSH` and `Managers.cpp` defines them inside it, so with the pull
flags the file does not compile:
```
../MobileGL/MG_Test/Backend/DirectGLES/SubsystemDepsTest.cpp:200:11:
error: use of undeclared identifier 'ResolveFramebufferSubsystemArm'
... 9 errors generated.
ninja: build stopped: subcommand failed.
```
`libMobileGL.so` has already linked by then, so G1's `.text` and symbol numbers are still
readable — but `~/w7/logs/p7-gate-c-inner.sh` reports `=== linux build rc= ===` and it was 1.
The two cases get the same guard and the same skip the client case already carries. Nothing
else moves; `ninja -C build-linux` rc 0.
---
## slice 1 — an owner-side upload is visible through a sampled view
### The hole
`TextureViewAliasScenario.TheOwnerUploadDrainRunsAgainAfterADrawBoundary`, registered by D2 and
excluded by name from the three split arms with the cause in the CMake comment: once a
`glTextureView` has been SAMPLED, a later `glTexSubImage` through the OWNER's own name never
becomes visible through the view. Red on inproc, spawn and tcp; green under monolith.
The mechanism, end to end:
* A view owns no texels, and the client keeps **one emission cursor per storage**. An upload
through a view's own name is remapped onto its storage owner before it is emitted
(`MG_Impl/Pipe/TextureEmit.h`, `MGPipeTextureEmitter`; `TextureEmitTest.cpp`'s
`AnUploadThroughAViewKeysOnTheStorageOwner` pins it). So every `resource_subdata` for either
name is keyed on the OWNER.
* `MG_Pipe/PipeApply.cpp`'s `ApplyTextureUpload` accumulates into that record and does
`++stored->Serial` on it — the owner's. Nothing moves the view's.
* `BackendTextureObject::IsDrawSyncCleanByRecord` (`MG_Backend/DirectGLES/Managers.cpp`) read
`record.Serial` and `record.PendingUploads` **of the record it was handed**, which for a bound
view is the view's. A view's `Serial` is moved by nothing an upload does, so after the view's
first sample the gate answered CLEAN forever and `SyncTextureViewToBackendByRecord` — the only
thing that drains the owner's pending uploads on a view's behalf, because it syncs the storage
twin by handle at its head — never ran again.
* Under monolith the same gate reads `GetContentVersion()` THROUGH the view, which
`TextureObjectView` forwards to its owner (`TextureObjectView.cpp:100-102`). The split gate
had no equivalent of that forwarding.
* `CONTRACT-P5E.md` §5.2 stated the split gate in full, `rec->Serial` and all, so the code was
faithful to a wrong contract. **The contract is amended, not restated.**
The client half was never at fault, and the red run proves it rather than arguing it: the
case's own `MGPipeTextureEmitter::SubDataCount()` / `RefusedSubDataCount()` / `DrainListSize()`
assertions PASS on the red run. Only the pixel channel is red.
### The decision: resolve the predicate, not index the reverse edge
**Chosen (a): the gate's two STORAGE clauses resolve through `Desc.ViewOf` to the storage
record.** `PipeTextureStorageRecordForRecord` (new, `Managers.cpp`, beside
`PipeTextureRecordForHandle`) answers with the record itself for a texture that owns its texels
and with the record `Desc.ViewOf` names for a view. `IsDrawSyncCleanByRecord` asks it for
`Serial` and `PendingUploads`; the three PARAMETER clauses and `Desc.StorageKind` stay the
view's own record's, because a view has its own texture parameters and its own built-in sampler
and that is the whole reason the second name exists. `SyncTextureViewToBackendByRecord` stamps
that same storage serial at both its arms — the steady one and the one after the native view
call — so the stamp and the gate name one quantity rather than two.
**Rejected (b): a reverse index owner → views, so an owner-side `resource_subdata` bumps every
viewing record's `Serial`.** Three reasons, in increasing order of how much they would have
cost to discover later:
1. It puts new mutable state in `MG_Pipe`'s applier, which BOTH backends read, to answer a
question one backend's gate asks. Magma does not need it (below).
2. It makes `ApplyTextureUpload` write a record other than the one the call names. The
applier's serial discipline is stated in that function's own comment — the twin stamps its
synced serial from inside the sync that reads THIS record — and a bump arriving from a
different record's apply is exactly the shape that comment exists to forbid.
3. **Deletion ordering, which is what actually decided it.** The index has to be pruned when a
VIEW dies, or an owner upload bumps a slot that has since been recycled to an unrelated
texture — a silent cross-texture serial skew with no assertion anywhere that would catch it.
The resolve direction needs no pruning at all, and it is checked at every use:
`PipeTextureRecordForHandle` tests `Live` and `Gen`, so a recycled slot answers null rather
than a stranger's record.
**Deletion ordering for the chosen shape: the walk's `Live`/`Gen` test is the guarantee, not
the emit order** (the review corrected an earlier draft of this paragraph that claimed the
ordering alone was enough). A view may outlive its owner's GL NAME — `glDeleteTextures(owner)`
while the view is alive is legal and the storage must survive — and it cannot outlive the owner's
STORAGE: `TextureObjectView::m_storageOwner` is a strong `SharedPtr`, and
`MGPipeEmitTextureDestroyAndFree` is called from `TextureObjectBase`'s DESTRUCTOR, whose own
comment says why — *"the last SharedPtr to this object dropping, not the glDelete* that only
marks the name and leaves a still-bound object very much alive"* (`TextureObject.cpp:63`). But
`m_storageOwner` is a member of the derived class and there is no user destructor on the view,
so when the view holds the owner's last reference C++ destroys the member first: the wire
carries `resource_destroy(owner)` and then `resource_destroy(view)`, and for exactly one apply
the view record is live with `Desc.ViewOf` naming a freed slot. No draw can land between two
destroys from one destructor chain, and the walk tests `Live`/`Gen`, so that window answers
null — and **a null answer is NOT clean**, the direction that re-syncs, never the direction that
shows stale texels. It is not a refusal and raises nothing (rule I: no new abort site, no new
`Fatal` family word).
**Views of views resolve transitively.** One hop always reaches storage in practice —
`glTextureView` composes a view-of-a-view onto the ROOT at creation, which is what the spec's
additive min-level rule means; the client's emitter says so in as many words
(`TextureEmit.h EmitResourceRespecify`) and `TextureObjectView`'s own invariant is that its
owner "is never a view itself". The walk is written transitively anyway and BOUNDED, because
this side may not depend on a client invariant to terminate: a chain the wire could forge into a
cycle ends as a null answer rather than as a hang.
**The tree already agreed with (a), on the other backend.** `VkTextureManager::
ResolveWireTextureStorage` (`MG_Backend/DirectVulkan/Renderer/VkTextureManager.cpp:2603`) is the
same walk — follow `Desc.ViewOf`, bound the hops, check `Live`/`Gen`, return null on failure —
and its comment states the same two reasons: *"Production views point directly to their root.
The bound also makes a corrupt or future multi-hop record graph terminate without ever following
client data."* Magma therefore never had this defect: it resolves the storage at every use
instead of memoising a per-view serial. Picking (b) would have given the two backends two
different answers to one question.
### Red-once (rule J)
At D2's head `a7c06f4f`, with the CMake exclusion lifted and **nothing else changed**:
```
$ ctest -R 'DirectGLES\.(Split|Spawn|Tcp)\.TextureViewAliasScenario' -j 3
79% tests passed, 3 tests failed out of 14
The following tests FAILED:
4042 - DirectGLES.Split.TextureViewAliasScenario.TheOwnerUploadDrainRunsAgainAfterADrawBoundary (Failed) integration-gpu integration-split
4046 - DirectGLES.Spawn.TextureViewAliasScenario.TheOwnerUploadDrainRunsAgainAfterADrawBoundary (Failed) integration-gpu integration-spawn
4050 - DirectGLES.Tcp.TextureViewAliasScenario.TheOwnerUploadDrainRunsAgainAfterADrawBoundary (Failed) integration-gpu integration-tcp
```
and the failure itself, verbatim from the Split entry:
```
../MobileGL/MG_IntegrationTest/Scenarios/TextureViewAliasScenario.cpp:328: Failure
the first owner write, through the view: 11408 of 11408 pixels disagree;
first at (2, 2) is rgba(50,160,30,255), expected rgba(0,0,255,255) +/- 2
../MobileGL/MG_IntegrationTest/Scenarios/TextureViewAliasScenario.cpp:328: Failure
the second owner write, through the view: 11408 of 11408 pixels disagree;
first at (2, 2) is rgba(50,160,30,255), expected rgba(255,255,0,255) +/- 2
```
`rgba(50,160,30,255)` is the LAYER SEED — what the view was minted holding. Both writes are
lost, not one, which is the signature of a gate that latched rather than of a record that got
dropped. The drain's counter assertions are silent in the failure list: they passed.
The MONOLITH control in the same tree is 4/4:
```
$ ctest -R 'DirectGLES\.TextureViewAliasScenario'
100% tests passed, 0 tests failed out of 4
```
With the fix, the same invocation on the three arms:
```
$ ctest -R 'DirectGLES\.(Split|Spawn|Tcp)\.TextureViewAliasScenario' -j 3
100% tests passed, 0 tests failed out of 14
```
Rule J is satisfied on spawn AND tcp, not only inproc: entries 4046 and 4050 are the
two-process arms and both went red and then green.
---
## slice 2 — D2's D-K2 loose ends, now in-partition
D1 has landed on `feat/disaggregated`, so `MG_Backend/DirectGLES/` is free and the two items
D2 listed as the integrator's are taken here.
### The stale prose in the header of the file that implements the refusal
`MG_Backend/DirectGLES/Managers.h`'s resolver block said **"THREE OF THEM CARRY A DEPENDENCY"**
(there are six rows; bits 8 and 13 were the two it did not know about) and listed
**"10 without 11"** among the mirror pairs that are FINE — when 10-without-11 is precisely
D-K2's fourth row (ID-14/ID-15), refused twenty lines below by
`ResolveTextureResourceSubsystemArm` and withheld by the client. `MGPipe.h` lost the identical
pair of defects with R-5; this copy was left behind because the file belonged to a package in
flight. It does not restate the rows again: the file that states them is the file the code
reads.
### Both readers read the table
More than the two one-line changes D2 estimated, because the rule had **six** executable and
prose statements and the estimate counted two:
| reader | was | now |
|---|---|---|
| `MG_Impl/Pipe/PipeFill.cpp` `P4aFamilyDependencyBits` | its own `kMGPipeP4aFamilyDependencies[]`, four rows | `MGPipeSubsystemRequires()`; the local table is deleted |
| `MG_Impl/Pipe/PipeFill.cpp` `P5eFamilyIsLive` | hand-coded `(pushMask & kMGPipeSubsystemResources) == 0` | `MGPipeSubsystemDependenciesAreSet(bit 13, mask)` |
| `MG_Backend/DirectGLES/Managers.cpp` `PipeSubsystemDependencyMissing` | took a literal dependency BIT per call site | takes the FAMILY and asks the table |
| …its `Resolve<Family>SubsystemArm` call sites | four calls with four hand-written sentences (`ResolveProgramSubsystemArm` never called it) | three calls, one per family that has a row, naming only the family |
| `MG_Backend/DirectGLES/Managers.cpp` `ResolveVertexInputSubsystemArm` | hand-rolled `bitSet && !resourcesBitSet` | the table |
| `MG_Backend/DirectGLES/DirectGLES.cpp` `ResolveBufferBindingSubsystemArm` | hand-rolled `bitSet && !resourcesBitSet` | the table |
`MGPipe.h` gains one accessor, `MGPipeSubsystemDependencyWhy()`, so a reader that refuses
prints the ROW'S OWN sentence instead of a copy of it — the `.def` has carried a `Why` column
since R-5 and nothing read it.
**One behaviour improvement falls out of it rather than being designed in.** The texture family
is the only row with two required bits, and it used to be two guarded calls here, so a mask
missing bit 11 but carrying bit 7 was reported with the bit-7 sentence. One call now computes
`required & ~mask` from the row, so the refusal names whichever bit is actually missing.
**What this does to the anti-drift property, said out loud because it is a real weakening.**
`SubsystemDepsTest` used to compare two COPIES of the rule; it now compares two READERS of one
table, which cannot catch a typo in a row. It is kept, and the `.def`'s prose now says why: the
two sides still fold in reasons of their own — the server's own family bit and D-C3's wire-caps
refusal, the client's consumer and wired conjuncts — and those can still disagree at a mask. The
compile-time half of D2's red-once (drop the fourth row from the `.def` → `MGPipe.h:225`/`:230`
fail) is untouched and is now the load-bearing one.
`SubsystemDepsTest` 5/5 after the switch, including D2's two refusal-lane cases at `0x1fff`
and `0x7ff`.
---
## Gates
Measured on `p7/espryt-d3 @ HEAD`, `build-split` configured by `p7_worktree.sh`, `build-linux`
configured with the same compilers and `DISAGGREGATED=OFF PIPE_PUSH=OFF PIPE_LEGACY_MEMOS=ON`
to match `~/w7/pipe/build-linux`.
### G1 — the pull build is byte-identical
| | value |
|---|---|
| `readelf -S -W build-linux/libMobileGL.so` `.text` | **`0xa52203`** (required `0xa52203`) |
| `nm --defined-only` symbols | 30570 |
| vs `~/w7/p7-before/pull-syms.txt` | **0 added / 0 removed** |
| `nm --defined-only -D` vs `pull-dynsyms.txt` | **0 added / 0 removed** |
| `ninja -C build-linux` | rc 0 (rc 1 at base — slice 0) |
Measured three times: after slice 1, after slice 0, and after slice 2. Identical every time.
**Why nothing this package touches reaches the pull build**, per file:
| file | where the change sits |
|---|---|
| `Managers.cpp` `PipeTextureStorageRecordForRecord`, `PipeSubsystemDependencyMissing`, the four resolvers, `ResolveVertexInputSubsystemArm` | inside `#if MOBILEGL_PIPE_PUSH` |
| `Managers.cpp` `IsDrawSyncCleanByRecord` | inside `#if MOBILEGL_PIPE_PUSH` |
| `Managers.cpp` `SyncTextureViewToBackendByRecord` | inside `#if MOBILEGL_BUILD_DISAGGREGATED` |
| `Managers.h` the declaration and the prose | inside `#if MOBILEGL_PIPE_PUSH` |
| `DirectGLES.cpp` `ResolveBufferBindingSubsystemArm` | inside `#if MOBILEGL_BUILD_DISAGGREGATED` |
| `MGPipe.h` `MGPipeSubsystemDependencyWhy` | `inline constexpr`, unreferenced in the pull build |
| `PipeFill.cpp` | `MOBILEGL_PIPE_PUSH`-only translation unit content |
| `SubsystemDepsTest.cpp`, `MG_IntegrationTest/CMakeLists.txt`, the two `.md` files | not `libMobileGL.so` |
The numbers are the proof; the table is what makes them checkable.
### The three scripts
```
python3 scripts/ci/fatal_census.py rc 0
79 abort sites over 20 files of the split server image, 44 distinct family words,
3 refusal words, 0 unmarked (79 is D1's number; this package adds none — rule I)
python3 scripts/link_ratchet.py --build-dir build-split \
--baseline scripts/data/link_ratchet_baseline.txt --assert-monotone rc 0
ratchet: unchanged at 186 symbol(s)
python3 scripts/ci/spawn_lane_parity.py build-split rc 0
```
### Lanes
All five at 100%, each run on its own so that "The following tests FAILED" belongs to the lane
that printed it:
| lane | base (`a7c06f4f`) | D3 | delta |
|---|---|---|---|
| `unit` | 2418 | **2418 / 2418** | 0 |
| `integration-split` | 263 | **264 / 264** | +1 |
| `integration-spawn` | 179 | **180 / 180** | +1 |
| `integration-tcp` | 182 | **183 / 183** | +1 |
| `integration-magma-split` | 75 | **75 / 75** | 0 |
**Names only grow, and the growth is named.** The base column is a real `ctest -N -L` taken on
this worktree with `MG_IntegrationTest/CMakeLists.txt` reverted to `a7c06f4f` and nothing else,
not an arithmetic guess. Set difference, per lane:
```
unit added=0 removed=0
integration-split added=1 removed=0
+ DirectGLES.Split.TextureViewAliasScenario.TheOwnerUploadDrainRunsAgainAfterADrawBoundary
integration-spawn added=1 removed=0
+ DirectGLES.Spawn.TextureViewAliasScenario.TheOwnerUploadDrainRunsAgainAfterADrawBoundary
integration-tcp added=1 removed=0
+ DirectGLES.Tcp.TextureViewAliasScenario.TheOwnerUploadDrainRunsAgainAfterADrawBoundary
integration-magma-split added=0 removed=0
```
Three names, one per arm, and they are the un-exclusion. Nothing was removed from any lane.
**The DirectVulkan arms of the same scenario: 30 / 30.** `ctest -R
'DirectVulkan\..*TextureViewAliasScenario'` covers the monolith entry plus the six informational
Magma tiers (`integration-magma-{all,full}-{split,spawn,tcp}`), four cases each, and every one
passes on this head — as they did at base. Magma never had this defect, because
`VkTextureManager::ResolveWireTextureStorage` resolves the storage at every use instead of
memoising a per-view serial. They are informational, not gating: `integration-magma-split` (75)
does not carry this scenario.
**One tcp-lane flake, already on record and not this package's.** The FIRST full gate run had
`integration-tcp` at 182/183; the lane is clean on re-run and clean in the final run above.
`split-scenario-census.md`'s own "`SampledSetStalenessScenario` on tcp" section records the same
shape from D2's measurements and attributes it to the tcp lane serialising through one
supervisor (`RESOURCE_LOCK mobilegl-tcp`) that serves one session at a time. Recorded here so the
count is not quietly a best-of-two.
---
## What remains
**1. `KHR-GL46.texture_view.coherency` has no SPLIT reading.** It is exactly slice 1's test
(`tools/cts/caselists/p7-texture-gl46.txt:1050`), and the device-window baseline confirms D2's
claim case by case — `report-texture.json`'s results map has
`"KHR-GL46.texture_view.coherency": "Pass"`. That is a **monolith** reading; 門 5's split
comparison is the device window's, so on host hardware the integration case is the only thing
standing behind this fix. When the window runs, `texture_view.coherency` is the row to read
first. Two corrections to the citation while it is being read:
* the block is `KHR-GL46`, not `KHR-GL43` as `espryt-d2.md` and `split-scenario-census.md` write
it. The caselist, the baseline and `CONTRACT-P7.md` §7.3 all say GL46;
* `texture_view` is **1/7 fail** in that baseline (`report-texture.txt:24`) and the failing case
is `KHR-GL46.texture_view.view_sampling`, NOT `coherency`. It is a pre-existing monolith
Magma conformance failure, on the list `CTS-base/README.md` calls "monolith Magma 的既有一致性
状态", and it is not this defect — worth naming so that a 6/7 reading after the fix is not
mistaken for a regression this package caused.
**2. The Magma arms of `TextureViewAliasScenario` are informational, not gating.** Magma has no
defect to fix, but nothing in `integration-magma-split` watches the property on that backend
either. Promoting the four cases by name into the gating tier is a `test.yml` `require_green`
edit, which is not this package's file.
**3. `SubsystemDepsTest` compares two READERS now, not two copies.** Stated in slice 2 and in the
`.def`, repeated here because it is the one thing D3 made weaker: a typo in a `.def` row can no
longer be caught by that case. The compile-time half of D2's red-once (`MGPipe.h:225`/`:230`) is
what carries the anti-drift weight, and the four `static_assert`s over the table are what stand
behind the rows themselves.
**4. The remaining half of D2's R-3, untouched.** `MGPSamplerView::Target` still has no `Count`
bound, no `...IsValid` predicate and no `Fatal{ProtocolCorruption}` for an out-of-range value,
unlike `MGPipeResourceTarget`. It is an `MG_Pipe/MGPipeValueTypes.h` change and nothing in this
package needed it.
**5. D2's own note is not rewritten.** `espryt-d2.md` still says `Managers.h:690-695` "is NOT
corrected here" and that switching the readers "is two one-line changes for the integrator". Both
were true of D2 and are the record of what D2 did; a package note is not a live statement of the
tree. The tree's own live statements — `SubsystemDeps.def`'s "WHO READS IT", `Managers.h`'s
resolver block and `split-scenario-census.md`'s exclusion row — are the ones corrected, and
`split-scenario-census.md` says so in a quoted block above D2's original text rather than by
overwriting it.
**6. The seven unguarded frontend-pointer-keyed containers under `MG_Backend/DirectVulkan`** that
D2's memo-purity sweep listed are still there. They are wave 2 A/B/C's territory and this package
did not look at them.
@@ -0,0 +1,174 @@
# Texture / program split-scenario census (P3b/P4b wave 2-D, package D2)
`PLAN-PH-P34B-P7.md` §1.2, row **门:纹理 / program 场景 split 覆盖**: "~20 个候选场景…先在
inproc 跑一遍记首阻塞,按 P7/P8/P9 归属决定注册或具名排除".
Head `cf7ca59f`, build `~/w7/p7-espryt-d2/build-split` (Release, clang, lavapipe ICD, WSL
desktop). Every candidate was run under `MOBILEGL_TRANSPORT=inproc` first; the ones that passed
were then registered through `mgl_itest_register_split_arms` and re-run under all three
transports, which is the reading in the table.
Package D1 owns `PixelStoreSweep`, `DepthStencilReadbackMatrix`, `PackedWordReadback` and
`LayeredTextureReadback`. They are not in this census.
## Summary
| | registered | excluded by name | blocked, not registered |
|---|---|---|---|
| texture family | 7 scenarios | ~~1 case~~ **0** (package D3 fixed the defect) | 0 |
| program family | 5 scenarios | 9 cases (one scenario's remainder) | 0 |
**12 scenarios newly carry `integration-split` / `-spawn` / `-tcp` entries**, **72 cases per
arm** (the table below sums to 72; an earlier draft said 71 and was simply wrong). With
`TextureViewAliasScenario` (this package's own; 3 of its 4 cases registered by D2, **all 4 since
D3**) and the `TextureUploadShape` gate's one case, this package adds **76 new
`DirectGLES.{Split,Spawn,Tcp}.` entries per arm** — 72 + 3 + 1 — counted from the generated
ctest include files against the pinned `~/w7/p7-before/ctest-names-split.txt` baseline (D3's
un-exclusion makes it 77 on the integration tree, one per arm).
The raw diff against that baseline reports **77** per arm at D2's head, not 76. The extra one is
`DirectGLES.<arm>.Ct.CtWireScenario.TheServerPublishesTheResidentSubDataCapabilityFromItsOwnTable`,
registered by the pre-existing `foreach(ctCase ...)` loop and added by `1255caa2f` ("the server
publishes kCapResidentSubData off its own wire resource table") — one of the five P7 commits
between the `p7-before` baseline and this package's base. No file under `CtWireScenario` is
touched here.
An earlier draft of this note said "+37 entries per split arm". That number came from
differencing against `~/w7/pipe/build-split`, which is the integrator's LIVE build directory and
had already moved past this package's base (`cf7ca59f` -> `ae3f43ab`); it matched nothing and is
withdrawn. The split-arm registration count recorded for the tier-2 Magma replay went from 33 to
46.
**Updated by package D3** (`notes/p34b/espryt-d3.md`): the one excluded case is the only row of
this census that has moved, and it moved because the defect behind it was fixed rather than
because the exclusion was widened or narrowed. Everything else below is as D2 measured it.
## Texture family
| scenario | cases | inproc | spawn | tcp | first blocker |
|---|---|---|---|---|---|
| `TextureViewScenario` | 10 | pass | pass | pass | — (needed `MOBILEGL_ESPRYT_ENABLE_TEXTURE_VIEW=1` on the three arm environments AND on the `TcpServer.Start` fixture; without it every case green-skipped) |
| `TextureParamsWithoutASamplerViewScenario` | 4 | pass | pass | pass | — |
| `SampledSetStalenessScenario` | 2 | pass | pass | pass* | one lane-interaction flake, see below |
| `ImageSizeAfterRespecScenario` | 1 | pass | pass | pass | — |
| `ImageTargetKindScenario` | 29 | pass (24 run, 5 skip) | pass | pass | — the 5 skips are `*Texture2DMultisample*` capability skips that also skip under monolith |
| `IntegerBorderColorScenario` | 6 | pass | pass | pass | — |
| `SwizzleAccessRoutineScenario` | 4 | pass | pass | pass | — |
| `TextureViewAliasScenario` (this package) | 4 | 4 pass | 4 pass | 4 pass | ~~`TheOwnerUploadDrainRunsAgainAfterADrawBoundary`, excluded by name~~ — **fixed by package D3**, see below |
### The debt-table 待核 row: is the P6 inspection forwarder debt closed?
`PLAN-PH-P34B-P7.md` §1.3 carries "债务表「22 → P4b/P7 texture readback」…待核" and names
`TextureParamsWithoutASamplerView` as the case that settles it. **It is closed for this half.**
All four G9 cases pass under inproc, spawn and tcp on the current head — the parameter sync does
not depend on a sampler view existing, under a transport any more than under monolith, and the
white-box half (`PipeApplyPeek`) agrees with Espryt's applied value in every arm. The scenario is
now registered in the three arms, so the answer is re-taken on every CI run rather than by
inspection.
### `TextureViewAliasScenario.TheOwnerUploadDrainRunsAgainAfterADrawBoundary` — ~~excluded by name~~ FIXED (package D3)
> **D3's resolution, at the head of D2's own diagnosis because the diagnosis was right.** The
> fix is at the GATE: `IsDrawSyncCleanByRecord`'s two STORAGE clauses resolve through
> `Desc.ViewOf` to the storage record (`PipeTextureStorageRecordForRecord`), and
> `SyncTextureViewToBackendByRecord` stamps the same storage serial, so the stamp and the gate
> name one quantity. The three PARAMETER clauses stay the view's own record's. The publisher-side
> reverse index was rejected: it needs pruning on VIEW death or an owner upload bumps a recycled
> slot's `Serial`, and `VkTextureManager::ResolveWireTextureStorage` already resolves the same way
> on the Magma side, so the index would have given the two backends two answers to one question.
> The case is un-excluded and green on all three arms; `CONTRACT-P5E.md` §5.2 now states the rule
> the code implements. Everything from here to the end of this section is D2's finding as written.
Red on inproc, spawn AND tcp; green under monolith. **Not a lane problem — a product defect this
package found.** After a view has been SAMPLED once, a later `glTexSubImage` through the OWNER's
name never becomes visible through the view.
* client half provably correct: the case's own emitter-counter assertions pass, so the records
were emitted and the applier accepted them;
* `BackendTextureObject::IsDrawSyncCleanByRecord` (`Managers.cpp:15433`) compares the VIEW's
`record.Serial` / `record.PendingUploads`;
* an owner-side `resource_subdata` moves only the OWNER's (`MG_Pipe/PipeApply.cpp:1175`);
* nothing propagates a serial bump from a storage owner to the records that view it —
`MGPResourceDesc::ViewOf` is a forward edge with no reverse index, read only by the
descriptor-equality helper (`PipeApply.cpp:666`);
* monolith works because the same gate reads `GetContentVersion()` THROUGH the view, which
`TextureObjectView` forwards to the owner (`TextureObjectView.cpp:100-102`);
* `MG_Remote/CONTRACT-P5E.md:387-395` states the split gate in full and has the same hole.
**Owner**: not P7/P8/P9 — a new finding. The fix is at the gate (`Managers.cpp`, package D1's
file) or at the publisher (`MG_Pipe/PipeApply.cpp`'s `ApplyTextureUpload`, outside D2's
footprint), and the publisher form needs an O(#texture records) scan or a reverse index on
`MGPipeResourceRecord`, plus a `CONTRACT-P5E` amendment. `KHR-GL43.texture_view.coherency` is
exactly this test and reads Pass in the CTS baseline, which is a **monolith** reading.
> **D3**: taken at the gate. `KHR-GL43.texture_view.coherency` still has no SPLIT reading on this
> tree — the CTS baselines are monolith and the split comparison is the device window's (門 5) —
> so the integration case is the only thing standing behind the fix on host hardware. Listed in
> `espryt-d3.md`'s "what remains".
### `SampledSetStalenessScenario` on tcp
`AQueuedClearIsMaterialisedWhenAFilterChangeCompletesTheTexture` aborted once in a full
`ctest -L integration-tcp -j 1` run (182 entries, 1 failure) and passes when run alone and on a
re-run of the whole lane. The tcp lane serialises through one supervisor
(`RESOURCE_LOCK mobilegl-tcp`) that serves one session at a time, so a subprocess abort there is a
session-reuse interaction rather than a property of this scenario. **Recorded as informational,
not excluded**; if it recurs it belongs with the tcp supervisor's own work, not with the texture
family.
## Program family
| scenario | cases | inproc | spawn | tcp | first blocker |
|---|---|---|---|---|---|
| `PostLinkAttachScenario` | 2 | pass | pass | pass | — |
| `RelinkStageSetScenario` | 3 | pass | pass | pass | — |
| `UniformInitializerScenario` | 3 | pass | pass | pass | — |
| `Glsl420DeclarationScenario` | 6 | pass (5 run, 1 skip) | pass | pass | — the skip is `AnArrayOfSamplerArraysIsHonouredOrDeclinedCleanly`, a capability skip that also skips under monolith |
| `IoBlockNameCollisionScenario` | 2 | pass | pass | pass | — |
| `ProgramPipelineScenario` beyond `*StorageBlock*` | 9 | **not registered** | | | **ScenarioFixture's armed-lane rule.** The two storage-block cases are already registered by the P5e i1 block. The other nine are pure name/state cases that draw nothing, and an armed `DirectGLES.Split.` case whose workload produced no record is RED by design (`ScenarioFixture.h:84-97`: the client encoder's record ordinal must move). That is the rule working, not a blocker to retire — registering them would be asserting "records crossed" about cases that have no records to send. |
## DirectVulkan arms: none, deliberately
No `DirectVulkan.Split.` / `.Spawn.` / `.Tcp.` **gating** entry is added for any of these.
It is not an omission and it is not a coverage hole either: `mgl_itest_register_split_arms`
records every call, and the informational tier-2 block replays all 46 of them on DirectVulkan
under `integration-magma-all-{split,spawn,tcp}` — so every scenario in this census DOES get a
Magma × three-transport reading the day it is registered. What it does not get is a **gate**.
Gating them would assert P7 wave 2's exit gate 1 ("集成 + trace 在 Magma push 与 split 下全绿")
from inside a P3b/P4b package, on a backend whose own `@P7` named refusals are still being retired
in waves A/B/C — the vertex-layout split, the blit/copy/mip cluster and the alignment cluster are
all in flight. A red there would be wave 2's to fix and would block this package's lane for
reasons it cannot act on. The tier-2 replay is exactly the right instrument for that: it produces
the red list without making it a gate.
## Gates
Taken on `~/w7/p7-espryt-d2/build-split` (Release, clang, lavapipe ICD) and
`~/w7/p7-espryt-d2/build-linux` (the pull configuration) at the head of this package, after the
review rework. Lane totals are whole-label runs, not filtered subsets.
| gate | reading |
|---|---|
| `ctest -L unit` | 2418 / 2418 |
| `ctest -L integration-split` | 263 / 263 |
| `ctest -L integration-spawn` | 179 / 179 |
| `ctest -L integration-tcp` | 182 / 182 |
| `integration-gpu`, DirectGLES monolith, the touched families | 89 / 89 |
| G1 pull `.text` | 10822147 = `0xa52203` |
| G1 `nm --defined-only` | identical to `~/w7/p7-before/pull-syms.txt`, 30570 symbols |
| G14 ctest name set | 4155 -> 6615; 0 names removed by this package |
| `scripts/ci/spawn_lane_parity.py build-split` | rc 0 |
| `scripts/ci/fatal_census.py` | rc 0, 0 unmarked |
| `scripts/ci/espryt_memo_purity.py --self-test` | PASS, 5 families anchored, 1 allow entry, all consulted |
| `scripts/ci/link_seam_purity.py --self-test` | PASS |
| `scripts/link_ratchet.py --self-test` | OK |
The one name the G14 diff reports as removed,
`CapsMirrorTest.APlaceholderMirrorConsumesNothing`, is absent from the base build too and is
referenced only by a comment in `RemoteClientTest.cpp:590` explaining that it was retired; it
predates this package's base.
Per-slice readings, red-once transcripts and the two findings this package made are in
`espryt-d2.md`.