mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-07 01:53:24 +09:00
The shared control page both roles map had a mixed-writer cache line:
{appliedSeq, submittedSeq, retiredSeq, completedFrameSerial, presentAckSerial}
sat together, but submittedSeq is producer-written (Ring.h's "THE FIVE
WATERMARKS") while the other four are consumer-written. That is why no
single-writer progress block could be aliased over it, and it is what this
package fixes: submittedSeq moves up beside cmdHead, the other thing the
producer writes, and the four that remain become a named LinkProgress member -
the struct c6 declared in ILink.h - so a data plane with no shared page can own
the same four values and every wait predicate in SessionRings.h keeps ONE
implementation at source level.
The two event flags deliberately stay in the doorbell group. Promoting them
would put the client's per-drain exchange(0) on eventRingFull (EventRing.h:200)
onto the line the client's own spin predicate reads 1e5-1e6 times a frame.
73 call sites rewritten, 15 in the library and 58 in tests. The rewrite is
receiver-scoped rather than field-scoped, because SplitRuntimePeek.h:77 has its
own struct with a field of the same name and SplitRuntimePeek.cpp:146 has both
on one line - a field-scoped rename would have silently broken the peek struct
that MagmaRunAheadScenario reads nine times.
THE ASSERTS ARE THE PART THAT NEEDED A SECOND PASS. The first revision shipped
four aggregate asserts and an adversarial review broke them by counterexample:
swapping retiredSeq and completedFrameSerial inside LinkProgress compiled
clean, passed all four, and passed the runtime layout test too - because
appliedSeq stays at offset 0. Three wire-visible offsets on a shared page were
pinned by nothing. Nothing else in the tree covers it either: the ABI
fingerprint takes no input from this page, and sizeof(RingControl) is 4096
whatever the members do, because alignas(4096) makes it so.
So the block is now per-field as CONTRACT-P6 §8.3 actually asked, plus a
standard-layout precondition, a tail bound that alignas cannot satisfy for us,
and the LinkEventFlags mirror. Each was run red: the field swap reds the
per-field asserts by name, a fifth member inside LinkProgress reds sizeof.
One of them cannot go red, and Ring.h now says so rather than implying
otherwise. A SMALL member inserted between Progress and serverEpoch lands at
offset 288, inside Progress's own line, and serverEpoch's alignas(64) absorbs
up to 32 bytes of it - so both line asserts still pass. The review's proposed
fix does not catch it either; I tried it. A gate nobody can falsify is worse
than no gate, so the limit is written down beside the asserts.
Also: RingTest.ControlPageLayoutIsTheSharedContract said nothing about the one
field this package moved, and now asserts the producer/consumer separation and
the event flags' exclusion itself rather than borrowing the claim from Ring.h.
Ring.h grew 30 lines, so the Ring.h:NN citations this package and c6 authored
are re-anchored to named blocks instead of line numbers. ARCHITECTURE.md §11.2
is updated for the new layout, and a factual error introduced in the previous
revision of that paragraph - submittedSeq annotated as releasing staging, which
retiredSeq does - is corrected.
Gates: pull 0 added / 0 removed, .text size 10822147 unchanged; split 0/0,
.text size 11681395 unchanged; unit suite 2326/2328 with the same two
pre-existing environmental failures as the baseline. The five edits behind
MGITEST_SPLIT_RUNTIME_PEEK were proven compiled by a red-once, not assumed.
Note on the .text claim: that is a SIZE, not the bytes - field offsets moved,
so immediates moved with them. And this page's layout IS observable across
binaries; what is unobservable is behaviour within one binary. The contract
already books the layout change deliberately, before spawn exists to care.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
工作笔记(原 ~/w7/notes/)
这一层是 MGPipe 各阶段的工作笔记原件:包计划(BRIEF-*.md)、契约草稿、集成者逐条裁定
(INTEGRATOR-DECISIONS-*.md)、只读审计、普查、设备记录、包任务书(TASK-*.md)与阶段报告。
它们此前只存在于一台机器的 ~/w7/notes/ 下。上层那几份文档(ROADMAP.md、
CURRENT_STAGE_PROGRESS.md、MEASUREMENTS.md …)大量引用它们——裁定编号、审计行号、
逐门数字的出处几乎全在这里。一份引用了几百次、却只存在于本地未跟踪目录的记录,等于没有记录。
所以整体移进仓库。
路径映射
~/w7/notes/<phase>/<file>.md → docs/Disaggregated/notes/<phase>/<file>.md
上层文档里凡写作 ~/w7/notes/... 的 .md 引用,都按这条规则读。
移进来的是什么,没移的是什么
| 移进来了 | 全部 .md,415 份,约 11 MB,目录结构原样保留 |
| 没有移 | 脚本(.sh / .py)、运行日志(.log / .out / .err)、普查与门的结果数据(.json / .txt / .tsv)、补丁、APK 与 .idsig、nm 转储 |
没移的那些仍在 ~/w7/notes/ 与各构建树下。它们是证据数据而不是文档:体积大、随每次运行
重新产生、且多数只在产生它的那台机器上有意义(绝对路径、设备序列号、构建目录)。上层文档引用
它们时给的是路径,不是内容。
两个需要知道的例外
- P6 的包计划已提升为正式文档:原
~/w7/notes/p6/BRIEF-P6.md现在是../P6-SPAWN-PLAN.md,本目录不再保留副本,避免两份同源文档各自漂移。 契约草稿同理,见../P6-CONTRACT-DRAFT.md。 recovered/是从失败的 workflow 运行里捞回来的材料(wf1…wf5),与同名阶段目录 可能重复,保留是因为其中几份是当时唯一的完整版本。查阶段记录请先看阶段目录。
不受 citation lint 管
CI 的文档引用 lint 只吃 docs/Disaggregated/*.md(非递归,.github/workflows/test.yml),
本目录不在其中,这是有意的:这些笔记的 file:line 是写在各自当时的代码头上的,拿今天的
HEAD 去解析必然大面积失败,而那不是错误——那是它们作为历史记录的正确状态。要核对某份笔记的
引用,用它自己声明的那个 revision:
python3 scripts/check_doc_citations.py --rev <当时的头> docs/Disaggregated/notes/<phase>/<file>.md