Files
MobileGL/docs/Disaggregated/notes/p6/lk-itemisation.md
T
swung0x48andClaude Opus 5 a54ae47ab9 [MG_Remote] (P6/lk): the pre-flight itemisation, and a correction to c6's regroup design
CONTRACT-P6 §8.5 requires lk to publish its blast radius before it starts,
because an earlier draft's ratchet baseline was wrong by a factor of three and
a ratchet installed on the wrong number is red on its first CI run for reasons
that have nothing to do with a leak. The itemisation is mechanical, per file,
with the grep spelling stated: 250 seam-identifier references outside
Transport/ across 23 files (127 production, 123 test), and 44 member-access
sites that the regroup itself must rewrite, across 9 files - 17 of them in
MG_IntegrationTest, which is why lk builds with the integration tests ON.
The earlier build did not, and a missed edit there would have been green.

THE CORRECTION. Measuring that radius turned up a mistake in c6, landed two
commits ago. §8.3 and ILink.h both said lk should promote eventRingFull and
eventDropped into the watermark group and called the result single-writer.
eventRingFull has TWO writers: the server latches it with store(1) when
SEG_EVENT fills (EventRing.h:140) and the CLIENT clears it with an exchange(0)
on EVERY DRAIN (:200). Promoting it would put a per-drain read-modify-write by
the client on the same cache line as appliedSeq - which the server
release-stores every 64 records and the client's spin predicate reads 1e5-1e6
times a frame. That is new false sharing on the hottest line in the system,
and it would land in exactly the numbers this package's gate has to hold
constant. It is also the same class of error the earlier draft made with
submittedSeq, one field over.

So LinkProgress is now the four consumer-written watermarks and nothing else -
genuinely single-writer - and the two flags stay in the doorbell/generation
group, where mixed writers already live beside consumerParked/producerParked,
crossing the seam through a separate EventFlags() accessor on its own line.
The contract records the correction and its reasoning rather than quietly
restating the rule.

ALSO CORRECTED, from running the baseline suite: a6's link-experiment report
said the silently-empty build stamp had "no log and no gate to say so". That
is false. SessionHandshakeTest.cpp:140 asserts BuildStamp[0] != '\0' and :180
asserts that perturbing it changes the fingerprint, and BOTH GO RED in this
configuration right now - the worktree's .git holds a Windows path WSL's git
cannot resolve, so GIT_COMMIT_HASH_SHORT is "". The finding is therefore
stronger, not weaker: the gate that catches it already exists and is already
red. What is silent is the BUILD, and hs owes a named configure-time failure
rather than a new gate.

Baseline for lk, recorded: 3878 tests, two failures, both environmental and
understood - the fingerprint one above, and PipeCatalogue.FrontendNeverTakes-
AnApplierAddress, which walks up from cwd looking for MobileGL/MG_Impl and so
fails for any out-of-source build directory.

No behaviour change. The headers are still included by nothing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-21 08:54:48 -04:00

4.0 KiB
Raw History

lk — 开工前的逐文件清单

头 0bbe41c2。CONTRACT-P6.md §8.5 要求 lk 在开工前发布这份清单,理由是早先一份草案的棘轮基线 差了三倍,而装在错误数字上的棘轮第一次 CI 就会因为和泄漏无关的理由变红。 全部计数由 grep -rn -E 在本头机械产出,口径写在每节标题下。

A 纯度门棘轮基线:Transport/ 之外的缝标识符

口径:<标识符>,排除 MobileGL/MG_Remote/Transport/ 自身。lk 之后这些必须只出现在 Transport/ShmLink.* 与传输自己的测试里。

文件 类别 合计 明细
MG_Test/Wire/SessionTest.cpp test 55 RingControl×16 ReplySlotPool×10 SessionSegments×9 RingProducer×4 RingConsumer×4 SessionConsumer×4 EventRingConsumer×3 SessionProducer×3 EventRingProducer×2
MG_Test/Wire/RingTest.cpp test 28 RingControl×11 RingProducer×9 RingConsumer×8
MG_Remote/Client/ClientSession.cpp prod 26 RingControl×7 EventRingConsumer×7 RingProducer×5 SessionProducer×4 ReplySlotPool×2 SessionSegments×1
MG_Remote/Wire/PipeWireCodec.h prod 19 RingControl×11 RingProducer×6 RingConsumer×1 SessionConsumer×1
MG_Test/Wire/PipeWireCodecTest.cpp test 19 RingProducer×7 RingConsumer×6 RingControl×5 SessionConsumer×1
MG_Remote/Server/ServerSession.cpp prod 17 RingControl×4 RingConsumer×4 EventRingProducer×3 SessionConsumer×3 ReplySlotPool×1 SessionSegments×1 SessionProducer×1
MG_Remote/Client/ClientSession.h prod 14 RingControl×3 SessionProducer×3 RingProducer×2 ReplySlotPool×2 EventRingConsumer×2 SessionSegments×2
MG_Remote/Wire/PipeWireCodec.cpp prod 14 RingControl×6 RingProducer×4 RingConsumer×3 SessionConsumer×1
MG_Test/Wire/ServerLoopTest.cpp test 13 RingControl×4 RingProducer×3 EventRingConsumer×2 ReplySlotPool×1 SessionSegments×1 SessionProducer×1 SessionConsumer×1
MG_Remote/Server/ServerLoop.cpp prod 12 SessionConsumer×6 RingControl×2 RingConsumer×2 RingProducer×1 EventRingConsumer×1
MG_Remote/Server/ServerSession.h prod 11 EventRingProducer×3 RingControl×2 RingConsumer×2 SessionSegments×2 SessionConsumer×2
MG_Remote/Server/PipeApplier.cpp prod 5 SessionConsumer×3 RingControl×1 ReplySlotPool×1
MG_Remote/Server/PipeApplier.h prod 3 RingControl×2 SessionConsumer×1
MG_Test/Wire/RemoteClientTest.cpp test 3 ReplySlotPool×3
MG_IntegrationTest/Harness/WireLedgerChecks.h test 2 RingProducer×2
MG_Util/Metrics/PipeStats.h prod 2 RingProducer×1 SessionProducer×1
Config.h prod 1 RingProducer×1
MG_IntegrationTest/Harness/SplitRuntimePeek.cpp test 1 RingProducer×1
MG_IntegrationTest/Harness/SplitRuntimePeek.h test 1 RingProducer×1
MG_Remote/Client/EmitTables.cpp prod 1 SessionProducer×1
MG_Remote/Client/EmitTables.h prod 1 ReplySlotPool×1
MG_Remote/Client/GpuWritePending.h prod 1 RingProducer×1
MG_Test/Wire/InProcessTransportTest.cpp test 1 RingControl×1

合计:生产 127 / 测试 123,共 250 处,分布在 23 个文件。

B 重组影响面:control.<字段> 成员访问

口径:(control|m_control|ctrl)(->|.)<字段>,七个字段 = 四个 watermark + submittedSeq + 两个 event 标志。 这是把 watermark 组变成具名 LinkProgress 成员后必须逐处改写的集合。

文件 类别 处数
MG_Remote/Transport/Ring.cpp transport 14
MG_Test/Wire/RingTest.cpp test 10
MG_IntegrationTest/Harness/SplitRuntimePeek.cpp test 5
MG_Remote/Wire/PipeWireCodec.cpp prod 4
MG_Remote/Client/ClientSession.cpp prod 2
MG_Remote/Server/ServerLoop.cpp prod 2
MG_Test/Wire/PipeWireCodecTest.cpp test 2
MG_Remote/Server/ServerSession.cpp prod 1
MG_Test/Wire/SessionTest.cpp test 1

合计 41 处(传输内 14 / 生产 9 / 测试 18)。