12 KiB
P1 package A (p1-core) — rework round 3 (v3)
Tree ~/w7/p1-core, branch p1/core, base feat/disaggregated @ 087685d1, contract bf86b1ed (tag p1/contract). v2 HEAD was d9f4698d (reviewed in core-review-v2.md: 1 major, 5 minors). Four new commits on top; nothing pushed; working tree clean apart from the three untracked build directories. core-v1.md records c2..c6 and core-v2.md the round-2 rework; this file records round 3 and the full re-verification on the new HEAD.
Commits (oldest first, on top of d9f4698d)
| sha | subject | review item |
|---|---|---|
30d72c5b |
[Fix] (Pipe): refuse a stamp of 0 as fresh on both branches - a read before the first fill is Fatal{UnmigratedPipeInput, "<Field>@<none>"}, not default storage |
M1 |
d0ff6475 |
[Fix] (Pipe): re-arm the verify comparator when any of its three knobs changes, not only when PipeVerify does |
minor 2 |
12b57055 |
[Docs] (Pipe): record why the forwarders carry no poison check, the InHook re-entry guard, and the Index slot no FillPoints.def row can fill |
minors 1, 3, 5 |
44ffafb2 |
[Test] (Pipe): pin the pre-fill window - every stamp of 0 is stale at serial 0, a read before any fill aborts naming "<none>", and the FATAL=0 child leaves through std::exit so the teardown summary is observed |
M1, minor 4 |
git diff --stat d9f4698d..HEAD: 6 files, +102/-15 — scripts/gen_pipe.py (+6/-2), MobileGL/MG_Pipe/generated/PipeFilled.inc (+6/-2, regenerated), MobileGL/MG_Impl/Pipe/PipeFill.cpp (+38/-11), MobileGL/MG_Backend/MGPipe/PipeInputs.h (+6), MobileGL/MG_Test/Pipe/PipeCatalogueTest.cpp (+6), MobileGL/MG_Test/Pipe/PipeInputsTest.cpp (+40/-2). All inside A's C.5 rows; no B/C/E file, no fixture. One generated file changed and is committed (gen_pipe --check clean). No signature B/C/E code against changed: MGB_CTX, MGP_FILL, the 63 accessors, the knob names and every log line are as in the contract; the only behavioural change visible to a backend is that a read before the first MGP_FILL is now the D6 Fatal instead of default storage.
What was done per review item
- M1 (serial-0 window read as fresh) —
gen_pipe.pygen_fillednow emits, andPipeFilled.inccarries:i.e. a stamp of 0 is "never filled" on both branches (the review'sconst Uint64 gen = state.FilledGen[index]; if (gen == 0) return false; return kMGPipeInputFieldSticky[index] || gen == state.CurrentVerbSerial;FilledGen != 0 &&in the non-sticky arm, written once for both). Proof, three layers: (1) the reviewer's ownprefill.cpprecompiled and relinked against the rebuiltbuild-verifywith the same ninja commands (~/w7/p1-core-v3-prefill/):before-first-fill: serial=0 gen[GetLineWidth]=0 fresh=0 live=1, rc=134 (SIGABRT), logFatal{UnmigratedPipeInput, "GetLineWidth@<none>"}— both plain and withFeatures.PipeVerify = truebefore the read (v2 wasfresh=1,stored=0 live=7, rc=0, no log line); (2)PipeCatalogue.PipeInputFieldsStartUnfilledasserts every one of the 63 fields (sticky included) stale on a value-initialisedMGPipeFilledStateat serial 0, before its existing serial-1/serial-2 assertions; (3) the fork casePipeInputsTest.ReadingBeforeAnyFillAbortsNamingNoVerb: a live context withSetLineWidth(7), no fill in the process (a visibleGTEST_SKIPif another case of the same process already filled —gtest_discover_testsruns each case alone, so it never skips in ctest), the child readsgPipeInputs.GetLineWidth(); the parent asserts SIGABRT, exactlyFatal{UnmigratedPipeInput, "GetLineWidth@<none>"}, noPipeVerifyDiffer, noverify armed. In a verify build the child setsFeatures.PipeVerify = truefirst (the lane's shape). The read hook's arming-at-first-fill is left as is:MGP_INPUT_CHECKprecedesMGP_INPUT_VERIFY_READin every accessor and a verify build always definesMOBILEGL_PIPE_POISON(PipeInputs.h:21-23), so a pre-fill read is the poison's Fatal before the hook could matter; astatic_assert(MOBILEGL_PIPE_POISON, ...)next to the hook inPipeFill.cpppins that dependency so a future change to the POISON definition fails to compile rather than reopening the window. The comment at the serial bump now states the rule. - Minor 1 (forwarders carry no
MGP_INPUT_CHECK) — behaviour kept (correct per the review); the exception is now declared in the header above the seven forwarders (why: a forward is a live call,InvalidateCompileEnvis reached from backend initialisation before any fill and would beFatal{...@<none>}on every start; the sticky stamp is consulted by no accessor and pinned only throughMGPipeInputFieldIsFreshin tests), and recorded as deviation 19 below and in the integrator notes so P2's tracker does not "fix" it. - Minor 2 (
ArmVerifyre-armed only on aPipeVerifychange) — fixed rather than only recorded:VerifyStategainedCorruptKnob(the last-parsedPipeVerifyCorruptstring) and the latch keys on all three values (PipeVerify,PipeVerifyFatal,PipeVerifyCorrupt). Lane behaviour unchanged (Features loaded before the first fill → one arm per process); cost two Bool compares and one String compare per fill in verify builds only. Deviation 14 is restated below to say exactly this;878db2c4's subject is now true for all three verify knobs. - Minor 3 (
GetBufferBindingSlot(Index)) — no code change (the null-by-design Index slot and its poison Fatal are D6's rule); theCopyFieldcomment now says why noFillPoints.defrow can fill it (GLContext derives it through the bound VAO's element-buffer slot,Core.cpp:98-106) and that no backend reads it today.MEASUREMENTS.mdis integrator-owned (C.5): the one-line record for both this andIsCapabilityEnabledIndexedis under "Records for the integrator" below. - Minor 4 (
VerifyFatalOffLogsTheDivergenceAndContinuesnever saw the summary) — the child now leaves throughstd::exit(0)instead of_exit(0), soVerifyState::~VerifyStateruns in the child, and the parent assertsMGPipe: verify summary - 2 divergence(s) survived MOBILEGL_PIPE_VERIFY_FATAL=0in the log delta. Passes in build-verify (the child's static destructors run against the forked copy of a fake context; stdio was flushed before the fork, so nothing is printed twice). The lane-levelsummary=1is still re-run below. - Minor 5 (hook re-reads the whole field;
InHookguard) — comment at the site: the per-read cost (GetRenderStateParametersre-copies and compares the struct,GetProgramForDrawre-joins the link) as a thing to keep in mind when reading the verify lane's wall time, and whatInHookprevents (aGetProgramForDraw-triggered backend re-entry reaching another accessor becomes a plain load, never a second hook, never a report against a half-copied scratch). Recorded for D.3 below.
Verification (WSL, ~/w7/p1-core, HEAD 44ffafb2; logs ~/w7/p1-core-v3-*.log, summary ~/w7/p1-core-v3-summary.txt, build/prefill log ~/w7/p1-core-v3-build.log)
Builds: cmake --build {build-linux,build-push,build-verify} -j 12 after the patch, all rc=0 (CCACHE_BASEDIR=/home/swung/w7); the verification pass re-ran them (ninja: no work to do × 3).
VERIFICATION_TABLE
Not run (unchanged from v1/v2): the 40-trace retrace under verify and the integration-verify lane (E's files, D.3 on the integrated tree). Not built per intermediate commit: the split of PipeFill.cpp between 30d72c5b / d0ff6475 / 12b57055 was checked hunk by hunk (each commit's hunks are self-contained: the static_assert and comments in A, the CorruptKnob member and its uses together in B, comments only in C); only the final tree was compiled.
Deviations from the brief (with reasons) — additions/restatements to v1's 1-13 and v2's 14-18
- (restated) The knob latches key on the value, not "once per process":
ParsePoisonOmissionKnobonFeatures.PipePoisonOmit;ArmVerifyon all three ofFeatures.PipeVerify,PipeVerifyFatal,PipeVerifyCorrupt(as ofd0ff6475; v2 keyed onPipeVerifyalone and latched the other two). Reason and cost as in v2. - The seven F-class forwarders carry no
MGP_INPUT_CHECK/MGP_INPUT_VERIFY_READ(D4: "every accessor body"). Reason: a forward is a live call with no stored value;InvalidateCompileEnvis reached from backend initialisation (BackendObject_DirectVulkan.cpp:388-390,786-788) before any verb fills, where a check would beFatal{InvalidateCompileEnv@<none>}on every start. Consequence: the sticky stamp (FilledGen = 1on the first live fill) and theSticky → FilledGen != 0branch are consulted by no accessor; they are pinned only byPipeCatalogue.PipeInputFieldsStartUnfilled/StickyFieldsAreExactlyTheSevenandPipeInputsTest.OmittingOneField.../EveryVerbFills...throughMGPipeInputFieldIsFreshdirectly. Declared in the header (12b57055). MGPipeInputFieldIsFreshrefuses a stamp of 0 on the sticky branch too (D6 words the sticky branch asFilledGen != 0, which it still is; the non-sticky arm gained the same guard). No semantic change to the sticky branch.- The read hook still arms at the first fill (D8: "Arming, once, at the first fill under verify" — unchanged); the pre-fill window is covered by the poison, and
static_assert(MOBILEGL_PIPE_POISON)in the verify block makes that dependency a build-time fact. The review's alternative (arm inside the hook when!Parsed) was not taken: in every build that compiles the hook the poison is on, so it would be dead code. PipeInputsTesthas 12 cases (v2: 11; brief: 5):ReadingBeforeAnyFillAbortsNamingNoVerbadded.VerifyFatalOffLogsTheDivergenceAndContinues's child exits viastd::exit(0), the one child in the file that runs static destructors on purpose (to observe the summary line); every other child still_exits.
Where the tree contradicted the brief's numbers
Unchanged from v1/v2 (GL_Drawing.cpp:906 vs 907; RenderStateParameters 65 members not 67; CapabilityInput 35 not 37; c5 regenerates 1 file not 7; integration-gpu 868 entries; the ctest -N regex needs the padded form). New in this round: none. One brief sentence that the tree did not honour before this round and does now: D6's "starts at 1 so FilledGen == 0 means never filled" — true of the stamp values since c2, true of the read predicate only since 30d72c5b.
Records for the integrator (not A's code)
MEASUREMENTS.mdone-liner for the two accessors where "add the row" does not apply:GetBufferBindingSlot(BufferTarget::Index)(polymorphic onGLContext— the bound VAO's element-buffer slot,Core.cpp:98-106; null in the block by design) andIsCapabilityEnabledIndexed(cap ∉ {Blend, ScissorTest})(the block carries only those two indexed caps) are push-armFatal{UnmigratedPipeInput, ...}that noFillPoints.defrow can repair; both unreachable today (every backend slot read is DrawIndirect/DispatchIndirect/Parameter/PixelPack;VulkanRenderer.cppasksBlendonly). A future backend read of either adds a field, not a row.- D.3 gains a failure mode (the review's section 5, now real): any backend read reached from EGL/init before the first verb is
Fatal{UnmigratedPipeInput, "<Field>@<none>"}in the verify lane. Per E's risk table the answer is a fill point at that boundary (an EGL virtual), never a sticky flag or aFillPoints.defrow. The scout catalogue finds no such read on this tree (the two out-of-verb pulls are the forwarded, uncheckedInvalidateCompileEnvcalls), so no lane is expected to trip today. - D.3 wall-time reading: the compare-at-read hook re-reads and compares the whole field per backend accessor call (
GetRenderStateParameters= a struct copy + 65-member compare per read;GetProgramForDraw= a link join per read); within the 5-10× verify budget by design, but the verify lane's time is not the poison's cost. - The forwarders' missing check is deliberate (deviation 19): P2's tracker should not add one.
- The v2 records stand: the vacuous
-R 'DirectGLES\.Verify\..*Mipmap'CI regex (grep the lane log for the exact Fatal instead), theGIT@stamp refresh at reconfigure.
Unfinished
Nothing in A's scope. M1 is fixed with the three proofs above; minors 1, 3, 5 are recorded in code comments and here (the MEASUREMENTS.md line is the integrator's file); minors 2 and 4 are fixed in code and covered by tests.