Two things land together: the plan and contract draft P6 needs before it starts, and the
working notes that until now existed on exactly one machine.
1. P6's plan and contract draft (neither started; not one line of code)
docs/Disaggregated/P6-SPAWN-PLAN.md the package plan
docs/Disaggregated/P6-CONTRACT-DRAFT.md the contract draft (moves to
MG_Remote/CONTRACT-P6.md when c6 lands)
The three findings that mattered, all written into the documents:
a. P6 is SMALLER than its roadmap cell suggests. The transport primitives are already in
the tree and already tested: SocketDoorbell including hangup detection and the two
lost-wakeup fences (Doorbell.cpp:211-360, four cases in FdPassingTest), SCM_RIGHTS fd
passing, ShmSegment::Adopt, and the SurfaceOp / WindowKind schema already defined in
protocol.fbs. inproc uses a real second shm mapping rather than an alias, and
SessionRings.h:22-28 says that was done so today is not the first time it runs. P6 is
assembly plus a control plane plus a process, not "write a socket transport".
b. The evidence for "P6 is only a transport swap" has EXPIRED. It was bought by P5c, whose
audit found 59 direct memory accesses in a tree that already looked clean. P5e changed
the tree again. So the first package, a6, is a read-only audit that writes no code, and
every contract row that depends on it is marked PENDING a6 rather than decided in
advance.
c. P6 does not get a game running on the phone. ANativeWindow* is meaningless in the child,
and protocol.fbs:186-196's own comment says Android transfers the window out of band -
that band is P12. P6 lands pbuffer / surfaceless / offscreen, which is what HeadlessGL,
the split-equivalent lane and trace replay need, and which is exactly what P6's own exit
gate measures. A real window reaching the server is a named refusal. This gets its own
section because "P6 is done" would otherwise read as "the game runs now".
The contract adds rule G: a role may not name a process-local handle. It extends P5c's
rule E (a role may not name the other role's memory) from memory to identity - EGLDisplay /
EGLSurface / EGLContext / ANativeWindow* / fd number / pid / mapped address either cross as
a token this contract defines or they do not cross, and a descriptor crosses only through
SCM_RIGHTS, where the kernel renumbers it.
What P5e left for P6 gets its own section. The latch semantics are already designed
(ARCHITECTURE.md:504) and are copied unchanged. What is new is that after run-ahead the
client no longer waits while the peer process can DIE: the client holds records that were
published and will never be applied, and Android's freezer suspends the child without
closing anything. So slow and dead must be distinguishable WITHOUT a timeout threshold.
That is P6's only new design; everything else is carriage. It shares a predicate with E1's
outstanding re-specification (ID-122), and the two should be designed together.
Two gates carried over from P5e's lessons: G2 requires integration-spawn's test-name set to
match integration-split's name for name, because a differing set means the lane is quietly
running less; and the arm-proof gate requires every entry to record the child pid and
transport=spawn in its OWN private log - ID-124 established that this kind of false green
really happens, and a spawn lane that actually ran monolith would pass every other gate.
S2's shape must be settled before it is written, and the document says why: E1 is the
cautionary case.
2. The working notes move into the repository (docs/Disaggregated/notes/, 415 .md files)
ROADMAP / CURRENT_STAGE_PROGRESS / MEASUREMENTS cite ruling numbers, audit line numbers and
the provenance of gate figures from ~/w7/notes/, a directory that exists on one machine and
is under no version control. A record cited hundreds of times that lives only locally is not
a record, so it moves in whole, with its directory structure intact.
Only .md moves. Scripts, run logs, census and gate result JSON, patches, APKs and nm dumps
stay where they are: they are evidence DATA rather than documents - large, regenerated per
run, and mostly carrying absolute paths and device serials that mean something only on the
machine that produced them. The mapping and this split are written in
docs/Disaggregated/notes/README.md.
Two exceptions are recorded there too: P6's BRIEF has been promoted to a first-class
document and keeps no copy under notes/, so the two cannot drift apart; and recovered/ holds
material salvaged from failed workflow runs, which may duplicate the like-named phase
directories and is kept because a few of those were the only complete version at the time.
CI's citation lint takes docs/Disaggregated/*.md only (non-recursive), and notes/ is
deliberately outside it: those notes' file:line citations were written against their own
code heads, and resolving them against today's HEAD would fail wholesale - which is not an
error, it is their correct state as a historical record. To check one, use the revision it
declares (--rev).
3. Inconsistencies fixed in passing
- README.md's status line still said P5e was in progress while the stage table already said
closed.
- CURRENT_STAGE_PROGRESS's next-step item 1 still listed the exit gate as pending, though
(a) and (b) were run in the previous commit; rewritten to closed plus the one item that
actually remains (E1).
- ROADMAP's P6 row still had the pre-phase plan in three of its cells; it now carries the
package order, the scope boundary and the two new gates.
Checked with check_doc_citations.py: 125 citations across docs/Disaggregated/*.md, 0 problems.
25 KiB
P2 package D — p2/magma adversarial review (v2)
Tree reviewed: ~/w7/p2-magma @ 1e89fd90, six commits on top of the contract 9c6a8a25
(tag p2/contract). Build dirs as found: build-linux (pull), build-push,
build-nolegacy. Auxiliary tree ~/w7/p2-magma-armed @ 88a8e661 (p2/magma + p2/tracker).
The tree was left exactly as found: no source edit, no new build dir inside either worktree
(the two out-of-tree compile probes wrote to ~/w7/rev-magma/ and /tmp).
Verdict: NOT APPROVED — 1 major, 11 minors.
The three v1 majors that were code defects (MAJOR 1 per-draw abort, MAJOR 2 all-pull arm
contamination, MAJOR 5 "m1 executed by no test") are genuinely fixed and I reproduced the
evidence for each. The remaining major is the replacement introduced by v2's fix for v1
MAJOR 3/4: the backend-local identity table. Its declared cost in magma-v2.md §2 MAJOR 4 is
materially understated, and the understatement hides a new unbounded-memory failure mode in
exactly the workload P2 exists to speed up.
0. What I re-ran, and what it said
Everything below was executed by me on ~/w7/p2-magma @ 1e89fd90 (builds were already
current — ninja: no work to do in all three dirs).
| gate | command | observed |
|---|---|---|
| G1 | python3 scripts/symbol_report.py --before ~/w7/p2-before-libMobileGL.so --after build-linux/libMobileGL.so --threshold 0 |
27799 -> 27799 defined symbols: 0 added, 0 removed, 4 resized, 0 renamed; the four are RenderState::RenderState() +148, RenderState::SetCapability +77, RenderState::IsCapabilityEnabled +29, _GLOBAL__sub_I_DirectGLES.cpp −9 |
| G1, isolated to this package | same script, --before ~/w7/p2-contract/build-linux/libMobileGL.so |
0 added, 0 removed, **0 resized**, 0 renamed, .text +0. This package's pull build is byte-identical to the contract's. D-13's #else duplication does what it claims. |
| G13 | check_include_closure.py / gen_pipe.py --check / --self-test / grep -rc pGLContext MobileGL/MG_Backend / stdio grep |
4 probes, 0 skipped, 0 problem(s); rc 0; 7 negative-control trip(s), positive control OK; grep empty; no stdio (only the word "puts" inside prose comments) |
| G5 | awk '/^ namespace RenderStateImpl \{/,/^ \} \/\/ namespace RenderStateImpl/' DirectGLES.cpp | sha256sum |
d8fd1c48…0efe27 — equal to ~/w7/p2-before-syncrenderstate.sha |
| G2 (name half), G14 | ctest -N with the working grep in all three dirs |
2367 / 2367 / 2367, all three byte-identical; vs the 2363-name baseline: 0 removed, 4 added, all four the contract's MG_Test/Pipe placeholders |
| unit | ctest -L unit -j 8 in build-linux / build-push / build-nolegacy |
1489/1489 in each |
| integration | ctest -L integration-gpu -j 4 -R DirectVulkan in six configurations |
432/432 in every one: build-linux (pull); build-push default mask; MOBILEGL_PIPE_PUSH=0; MOBILEGL_PIPE_PUSH=0x60 MOBILEGL_PIPE_LEGACY_MEMOS=0 (v1 MAJOR 1's repro); MOBILEGL_PIPE_LEGACY_MEMOS=0 at the default mask; build-nolegacy. No flakes in any of the six (the result file's §7 flakes did not recur here). |
| G3, DirectVulkan half | retrace_gate.py --tree ~/w7/p2-magma --lib build-push/libMobileGL.so --out ~/w7/retrace-out/rev-magma -j 4 --only 'DirectVulkan$' |
passed 40 / 40; failed: [] |
| arming (v1 MAJOR 5) | 13 DirectVulkan.*CrossFrameBuffer cases with MOBILEGL_LOG_FILE_PATH, armed tree vs delivered tree |
armed: 13/13, 0 occurrences of the fallback warning; delivered: 13/13, 1. Across the 40 retrace logs on the delivered tree the warning appears in 80 files (grep -rl "no render-state CSO" ~/w7/retrace-out/rev-magma). The claim in §4 reproduces exactly and its control half is real. |
| ownership (C.5) | git diff --name-only 9c6a8a25..HEAD |
the six files C.3 names, nothing else |
MOBILEGL_PIPE_VERIFY build |
recompiled VulkanRenderer.cpp and VertexInputStateFactory.cpp out-of-tree from build-push/compile_commands.json with -DMOBILEGL_PIPE_VERIFY=1 |
rc 0, no warnings — the never-built verify configuration is not a compile risk for this package |
Chunk-table spot check (the review's "re-derive at least five setters" item). I re-derived
eight setters from MG_State/GLState/RenderState/RenderState.cpp against the landed boundaries
in MG_Pipe/MGPipeRenderStateSpans.h:60-100 and the declaration order in
MG_Pipe/MGPipeValueTypes.h. All consistent with the rule "pipeline ⟺ a BumpVersions()
setter writes it":
| setter | RenderState.cpp |
writes | chunk | half | verdict |
|---|---|---|---|---|---|
SetStencilFunc |
:637-649 |
Func (pipeline version conditional at :649), Ref, ValueMask (++m_version only) |
Func → P2/P3, Ref/ValueMask → D3/D4 |
split | ✔ the sub-member split is exactly what the conditional bump needs |
SetStencilMask |
:652-657 |
WriteMask, ++m_version |
D3/D4 | dynamic | ✔ |
SetSampleCoverage |
:786-791 |
SampleCoverageValue, SampleCoverageInvert, BumpVersions() |
P2 | pipeline | ✔ (the D6 deviation against MGPipeTypes.h:232-235 is real and correctly resolved) |
SetCapability(ClipDistanceN) |
:373-381 |
ClipDistanceEnabledMask, ++m_version only, explicitly not BumpVersions |
D7 | dynamic | ✔ |
SetCapabilityIndexed(ScissorTest) |
:456-460 |
ScissorTestEnabledMask, BumpVersions() |
P6 | pipeline | ✔ — and it is why magma-v2.md D-4 inverts D12.3's claim correctly |
SetScissorBox |
:926-948 |
ScissorBoxes, ScissorBoxWrittenMask, ++m_version |
D7 | dynamic | ✔ |
SetPolygonMode |
:174-178 |
PolygonModeFront, PolygonModeBack, BumpVersions() |
P5 | pipeline | ✔ |
SetMinSampleShadingValue |
:813-820 |
MinSampleShadingValue, BumpVersions() |
P2 | pipeline | ✔ |
The m1 discrimination argument holds. I read ComputePipelineStateHash
(VulkanRenderer.cpp:4963-5051) field by field: every one of its RenderStateParameters
inputs — the 11 capability bools, MinSampleShadingValue, SampleMaskValue, PatchVertices,
the six patch levels, PolygonModeFront, CullFaceModeSetting, DepthFunc, LogicOp, both
faces' {FailOp, PassDepthPassOp, PassDepthFailOp, Func}, BlendStates[i], ColorMasks[i] —
lands in an odd (pipeline) chunk of the landed table. Its two remaining inputs,
colorAttachmentCount and rasterizationSamples (also reached through
ResolveEffectiveSampleMask, :4954-4960), are pinned by entry.renderPassHash:
VkRenderPassManager.cpp:606-765 folds the draw-buffer list, the valid draw-buffer count and
each attachment's sampleCount into that hash. So collapsing pipelineStateHash to the CSO
handle loses no discrimination, and m_independentBlendFeatureEnabled is a per-renderer
device constant while the memo is per renderer. I could not construct an aliasing case.
The m2 static_asserts are a real gate, not decoration. I compiled an out-of-tree probe
(~/w7/rev-magma/probe/probe.cpp) that reuses the landed
MagmaRenderStateRangeIsDynamic shape against MGPipeRenderStateSpans.h: the positive
controls (BlendColor, LineWidth) hold, the inverted controls (DepthFunc,
ScissorTestEnabledMask) hold, and a deliberately wrong assertion produces exactly one
static assertion failed. I also checked the assertion set against DynamicTailKey's own
inventory (VulkanRenderer.cpp:344-350): every listed reader is covered, none is missing.
Handle identity is sound for deletion, reuse and share groups. MGPipeHandles.h:52-58's
contract is met by MagmaPipeIdentityTable::Acquire: Gen moves on every owner change, and
lifetime ids are process-global monotonic from 1
(VertexArrayObject.cpp:17-21, BufferObject.h:254), so two live objects can never share a
{slot, gen}, a recycled heap address cannot reproduce one, and a buffer shared across a share
group keys identically in both contexts. The ABA control is wired the way D18 specifies
(VertexInputStateFactory.cpp:293-301 hashes attr.Buffer.get() on the pre-handle arm;
VulkanRenderer.cpp:3692-3710 drops the lifetime-id half of the compare), and both guards sit
on the arm D18's AbaControl run selects (MOBILEGL_PIPE_PUSH=0).
MAJOR
M1 — the re-key replaces two unbounded, per-object VAO memos with a 2048-entry 2-way cache, and above capacity turns the vertex-input content hash into a per-draw value that inserts an entry into an unbounded map on every draw
Where. MG_Backend/DirectVulkan/Renderer/MagmaPipeArms.h:143-241 (the identity table,
kMagmaVaoIdentityEntries = 2048, kMagmaBufferIdentityEntries = 8192, 2 ways per set);
VertexInputStateFactory.h:487-508 (VaoBackendMemos, kVaoMemoSlotCount = 2048);
VertexInputStateFactory.cpp:110-152 (TryGetMemoizedHash, GetOrComputeHash);
VertexInputStateFactory.cpp:158-183 (GetOrCreateVertexInputState's state memo);
VertexInputStateFactory.cpp:210-216 + .h:170 (m_cache, an unbounded
UnorderedMap<HashType, UniquePtr<BackendVertexInputState>>);
VertexInputStateFactory.cpp:420-452 (OnFrameBoundary: swept every 256 boundaries,
retire age 1024 boundaries).
What changed, precisely. Before this package, the two facts the draw path memoises per VAO
lived as mutable fields on the VertexArrayObject itself —
m_backendHashMemo / m_backendHashMemoVersion and
m_backendStateMemo / …Epoch / …Version
(MG_State/GLState/VertexArrayState/VertexArrayObject.h:204-216). One memo per live VAO, no
capacity, no eviction, guarded only by the VAO's own config version. After this package they
live in VertexInputStateFactory::m_vaoMemos: 2048 entries, indexed by a slot minted from a
2-way set-associative LRU table with 1024 sets.
magma-v2.md §2 MAJOR 4 describes this as "the mitigations are not gone, they moved one level
down", "both tables are caches", and "with more live objects than the table holds, an LRU
eviction changes a live object's handle … For a VAO that costs a memo recompute". Two of those
three statements are wrong for the memos in question, and the third understates the cliff.
Reproduction. MagmaPipeIdentityTable::Acquire (MagmaPipeArms.h:157-188) is 20 lines and
fully deterministic. I transcribed it verbatim into
…/scratchpad/wf5/magma-review/s29.sh / s37.sh and measured the fraction of uses whose
first Acquire misses — each such miss clears the VAO's VaoBackendMemos (MemosFor,
VertexInputStateFactory.cpp:100-106) and resets its VaoDrawMemo
(VulkanRenderer.cpp:3662-3671):
VAO table (2048 entries, 1024 sets), live lifetime ids CONSECUTIVE (best case), round-robin draw order:
live VAOs= 2048 handle-CHANGED= 0 ( 0.0% of uses)
live VAOs= 2500 handle-CHANGED= 4068 ( 54.2% of uses)
live VAOs= 3000 handle-CHANGED= 8568 ( 95.2% of uses)
live VAOs= 4000 handle-CHANGED= 12000 (100.0% of uses)
same, lifetime ids SPARSE (a long-running app that creates and destroys VAOs):
live VAOs= 512 handle-CHANGED= 48 ( 3.1%)
live VAOs= 1024 handle-CHANGED= 615 ( 20.0%)
live VAOs= 2048 handle-CHANGED= 3570 ( 58.1%)
Buffer table (8192 entries, 4096 sets), consecutive ids:
live buffers= 8192 key-CHANGED= 0 ( 0.0%)
live buffers=10000 key-CHANGED= 16272 ( 54.2%)
live buffers=16000 key-CHANGED= 48000 (100.0%)
The per-use miss rate is independent of how many times a draw re-acquires the same VAO (I
re-ran at 1 and 5 acquires per use — s37.sh — identical numbers), because the extra acquires
are hits that only refresh LastUse.
The second table is the one the code says is "sized four times the VAO one anyway … to keep it
rare" (MagmaPipeArms.h:227-232). At 20 % on the first table with only half its nominal
capacity in live objects, "rare" is not what the structure delivers.
Failure scenario, tier 1 (VAO table alone over capacity — certain). Minecraft in-world with
one VertexBuffer-backed VAO per chunk section is the minecraft-1.21.4-in-world /
…-sodium-in-world shape and is one of D.4.2's four device cases; the tree's own comment at
VertexArrayObject.h:150-155 describes the target as "an app cycles hundreds of VAOs per
frame", and VulkanRenderer.h:1385-1390 describes VAO create/destroy churn heavy enough that
"a deleted VAO's heap address is handed straight back". For every draw whose VAO's set is
over-subscribed:
MemosForclears the entry, soTryGetMemoizedHashreturns false andGetOrComputeHashrunsComputeHash(vao)— a walk of all 16 attributes with ~10XXH64_updatecalls each plus 16 moreMagmaPipeBufferIdentity().Acquire()calls (VertexInputStateFactory.cpp:20-56, 284-303) — once per draw where it previously ran once per VAO reconfiguration;- the state memo misses too, so
GetOrCreateVertexInputState(vao, hash)does them_cacheprobe the memo exists to skip; LookupVaoDrawMemoresetscontentHash,layoutFactsValidandbindings.frameSerial(VulkanRenderer.cpp:3666-3671), soTryBindResolvedVertexBindingsdeclines and the draw pays a full vertex-binding re-resolve.
That is three memos lost per draw in the workload whose per-draw cost is the entire point of P2, and G11's acceptance criterion is "per-thread CPU p50 and p99 deltas are not negative on either device".
Failure scenario, tier 2 (both tables over capacity — memory). Once the buffer table also
thrashes, each per-draw ComputeHash mixes a different {slot, gen} for the same buffer
(VertexInputStateFactory.cpp:289-292), so the content hash differs from the previous draw's.
GetOrCreateVertexInputState(vao, hash) then misses m_cache and heap-allocates and inserts
a new BackendVertexInputState (VertexInputStateFactory.cpp:210-216, .h:170). m_cache
has no capacity bound; OnFrameBoundary sweeps only when
m_frameBoundaryCounter % 256 == 0 and retires only entries older than 1024 boundaries
(:428-433), so growth is bounded solely by ~1024 frames × draws-per-frame of insertions.
Every erase in that sweep also bumps m_evictionEpoch, invalidating every VAO's state
memo (:436-441), so the sweep itself is a second cliff. Nothing in magma-v2.md mentions
this path; §2 MAJOR 4 stops at "costs a rebuilt BackendVertexInputState … per VAO
reconfiguration, not per draw", which is exactly the premise tier 1 removes.
This is the same class of problem the design change was made to avoid — the header's own
justification for not using MG_Impl/Pipe/SlotAllocator is that an allocator with a dead
Free "grows … for the life of the process, on a platform with an LMK"
(MagmaPipeArms.h:129-139). The replacement trades a bounded-rate leak of one SlotState
plus one map node per object ever created for an unbounded-rate insertion into m_cache of a
full BackendVertexInputState per draw.
Why this is a major and not a declared risk. The deviation is declared (D-5/D-7), but the declaration rests on three claims I can show are false or unsupported:
- "both tables are caches" — false for
VaoBackendMemos. Its predecessors were per-object fields with no capacity. The package does not move eviction one level down; it introduces eviction where there was none. - "2048 entries is what the address-hashed
VaoDrawMemotable it replaces held, so the working set this covers without eviction is unchanged" (MagmaPipeArms.h:224-226) — true of the draw memo, false of the hash and state memos, which are the ones the P1→P2 per-draw win depends on. - "nothing on desktop reaches those working sets" (§2 MAJOR 4) — true, and that is the problem: the 432 integration cases, the 40 retraces and the 1489 unit tests are all below both capacities, so every green gate in §3 is green in the regime where the structure cannot fail, and the regime where it does fail is the device A/B that has not been run.
What would close it. Either size both tables off a measured live-object high-water mark for
minecraft-1.21.4-in-world and …-sodium-in-world and pin the number with an assertion, or
keep the hash/state memo per-object (unbounded, as today) and let only the draw memo be
slot-indexed, or run D.4.2 on one device first and publish the p50/p99 before this lands. The
minimum acceptable outcome is a measurement, because no gate this package can reach can see it.
MINORS
MGLOG_W_ONCEis on the per-draw pipeline path and its documented cost is wrong by an order of magnitude.VulkanRenderer.h:1038-1041andmagma-v2.md§2 both state "_ONCEcosts one static bool test".MOBILEGL_LOG_ONCE_INTERNAL(MG_Util/Debug/Log.h:51-58) isstatic std::atomic_flag latch; if (!latch.test_and_set(relaxed))— an unconditional read-modify-write on every evaluation.objdump -dCofbuild-push/CMakeFiles/MobileGL_s.dir/…/VulkanRenderer.cpp.oshows tenxchg %al,0x0(%rip)(implicitly locked) insideVulkanRenderer::GetOrCreatePipeline. It is branch-guarded onMGPipeHandleIsNull(boundCso), so it is inert once a tracker is present (verified: 0 occurrences on the armed tree) — but it fires on every draw in the configuration this package ships today (bit 0 set, no tracker: 80 of 80 retrace logs carry it).ROADMAP.md:7forbids committing hot-path instrumentation, and §4 uses this precisely as instrumentation. Fix the comment at minimum; considerMGLOG_D_ONCEplus aPipeStatscounter, which is what D17 exists for.MOBILEGL_PIPE_LEGACY_MEMOS=0does not stop Magma entering the pre-handle arm, and does not say so. With bit 0 (kMGPipeSubsystemRenderState) clear,ResolveBoundRenderStateCsoreturns null atVulkanRenderer.h:1046-1048— before the warning — andResolveFallbackPipelineStateHash(:924-935) callsComputePipelineStateHash, which D14's compile-switch row names explicitly as part of "the pre-handle arm". D14's runtime row says "false: the legacy arm is never entered". Repro:MOBILEGL_PIPE_PUSH=0x7e MOBILEGL_PIPE_LEGACY_MEMOS=0runs green while executing the legacy hash on every draw whose pipeline version moved, silently. The behaviour is arguably the only sensible one, but it is a D14 deviation and it is not inmagma-v2.md§5.- §4's inference is scoped more narrowly than it is stated. "Its ABSENCE from a run's log
is the positive evidence that every draw keyed on a handle"
(
VulkanRenderer.h:1038-1041,magma-v2.md§2) holds only while bit 0 is set. With bit 0 clear the warning can never appear and no draw is keyed on a handle, so absence proves nothing. Worth one clause in the comment, because the integrator will grep these logs. - The identity tables are process-global and never reset, while both consumer tables are
per-instance.
MagmaPipeVaoIdentity()/MagmaPipeBufferIdentity()(MagmaPipeArms.h:234-241) are function-local statics;m_vaoDrawMemoTableandm_vaoMemosbelong to aVulkanRenderer/VertexInputStateFactory. Two live contexts, or a context recreation inside one process, share and drive one LRU: no aliasing (lifetime ids are globally unique) but halved effective capacity and interleaved eviction, which feeds M1. The tables also carry aVector::resizeand per-call LRU writes with no synchronisation;s_evictionEpochSourceand the sharedstatic inline XXH64_state_t* m_hashState(VertexInputStateFactory.h:184-190) set that precedent, so this is consistent with the file rather than new — but a global that outlives every context is new. - Commit
553065dc's subject describes a change it does not make. "drive the dynamic tail from the pushed dynamic version" —git show --stat 553065dcis1 file changed, 98 insertions(+), all of it comment andstatic_assert;ApplyDynamicDrawStateTail'sconst Uint paramsVersion = MGB_CTX->GetRenderStateParametersVersion();is untouched. The re-sourcing is the contract's (D-2 says so honestly in §5, and the tree is right against D12.3), but the commit message claims the deliverable. - D19's
DynamicChunksCoverMagmasDynamicTailKeyctest entry exists nowhere. It isstatic_asserts inVulkanRenderer.cpp:399-425here and a named test in package A'sRenderStateSpansTest.cppthere.magma-v2.md§8.7 flags "make sure the outcome is not neither"; the integrator must actually close it. (Thestatic_asserts themselves are a real gate — proved above.) - D17's re-audit of the
AccessorCallstally constants was not done. D17 namesVulkanRenderer.cpp:5009,5016,5274,5927,5934,6416,6449,6462; all eight line numbers have moved, and the tallies at the pipeline-memo gate (:5191,:5198) still sayAccessorCalls, 1on both arms although the handle arm no longer performsComputePipelineStateHash's bulkGetRenderStateParameters()fetch. §8.11 lists this package'sMEASUREMENTS.mdinput but not the re-audit D17 makes a precondition for quotingacc/draw. build-verifywas never configured for this package. C.3 does not ask for one, and D.3 part 2 is the authority — but nothing here proves the package compiles underMOBILEGL_PIPE_VERIFY. I closed that specific hole myself (both changed TUs recompiled with-DMOBILEGL_PIPE_VERIFY=1frombuild-push/compile_commands.json: rc 0, no warnings), so G4 is not at build risk; the applier's verify-only assertions remain unexercised here.- Both assertions this package adds are compiled out in every build P2 runs.
MOBILEGL_ASSERTis live only whenMOBILEGL_LOG_ACTIVE_LEVEL <= DEBUG(MobileGL/Defines.h:97-115); all three build dirs areMOBILEGL_LOG_LEVEL_INFO. TheGen-wrap assert (MagmaPipeArms.h:175-178) never runs — consistent withMGPipeHandles.h:52-58, which says the wrap is defended only in a debug allocator — and1e89fd90's null-handle assert (:214-215) never runs either; only its release-path ternary has effect. The commit's value is the ternary, not the assertion. - Brief-vs-tree items I independently confirmed (all already listed in
magma-v2.md§6, recorded here so the integrator has a second source): the A-section G2/G14 grepgrep -E '^\s+Test #'returns 1368 of 2367 names, the working form returns 2367;~/w7/retrace_gate.py --helpshows only--tree --lib --out -j --only, so G3's--ssimand C.3's--backenddo not exist;MGLOG_F_ONCEis absent fromMG_Util/Debug/Log.h; and G1/D15's admitted resize set is short of_GLOBAL__sub_I_DirectGLES.cpp(−9), which is the contract's and appears after every merge. MG_Pipe::MGPipeApplier()is one process-globalg_applier(PipeApply.cpp:99, 112), not the per-context CSO store D2 specifies.ResolveBoundRenderStateCso(VulkanRenderer.h:1045-1057) reads it directly, so in a multi-context process one renderer's pipeline memo would key on whatever CSO another context last bound. The defect is package A's, but Magma is its only consumer in P2 and the integrator should route it rather than let both reviews assume the other caught it.
Things I tried to break and could not
Recorded so the integrator does not re-spend the time.
- Pipeline-memo aliasing across the two arms. Handle-arm entries carry
pipelineStateHash == 0and a non-nullrenderStateCso; fallback entries carry a real hash andkMGPipeNullHandle. The probe tests both components (VulkanRenderer.cpp:5180-5184,:6577-6582) and the insert writes both (:5851-5854). No cross-arm match is constructible. - Fast path vs full path keying differently. Both call
ResolveBoundRenderStateCso()and both fall back throughResolveFallbackPipelineStateHashwith the render-pass facts from their own source; the key tuples are identical. vaoMovedweakening. The handle-arm form (VulkanRenderer.cpp:6313-6315) is strictly stronger than the address+lifetime-id form: identical VAO ⇒ identical handle unless the identity table evicted it, in which case the handle differs and the compare is conservative.- Mid-draw handle drift. Every
Acquireinside one draw is for the same VAO lifetime id (the buffer acquisitions inComputeHashhit a different table), soMemosFor,LookupVaoDrawMemoandResolveVaoHandlecannot disagree within a draw. - A stale
VaoBackendMemosserved across an owner change.MemosForclears onOwner != handleandGenmoves on every owner change, so contents are never inherited. - A reference into
m_vaoMemosinvalidated across the nestedGetOrCreateVertexInputState. The table is fixed-size after its firstresize, and the code re-takes the reference anyway. GetBackendAuxMemolosing a reader.grep -rnacrossMobileGL/confirms the getter has no caller anywhere, so retiring rather than moving it is correct (D12.5 agrees).- Slot-band collisions.
MGPipeKind::BufferandVertexElementsCsoare distinct kinds;kMGPipeShaderCsoCompositeSlotBaseis aShaderCso-only band;kMGPipeDefaultFramebufferis{0,1}of kindFramebuffer. Slots 1…8192 of these two kinds collide with nothing. MOBILEGL_PIPE_PUSH=OFF -DMOBILEGL_PIPE_LEGACY_MEMOS=OFFfailing to compile (VaoContentHashIfKnown's#elsecallsvao.GetBackendHashMemo, which only exists underMOBILEGL_PIPE_LEGACY_MEMOS).CMakeLists.txt:476-479forces the option ON in that combination, so the configuration is unreachable.