[docs] (P7): record the PH-1 (3)(4) latch as CONTRACT-P7 §10 item 7 (session children latch and exit 75, inproc keeps Fatal) and its debts in §12; mark the PLAN PH-1, PH-2 and fuzz-arm-2 rows

This commit is contained in:
2026-09-23 13:44:37 -04:00
parent 3ef5c61e96
commit 1f67123835
2 changed files with 5 additions and 3 deletions
@@ -22,8 +22,8 @@ P7 收官的关键路径是:**先造仪器(wave 0)→ 真机诊断(wave
| 项 | 判定 | 必要性 | 剩余工作(可调度) | 规模 | 波次 |
|---|---|---|---|---|---|
| PH-1 `Session::Fail` 翻成每会话闩 | partial | **必须,但重新定界** | 路线图写的「每个 `[[noreturn]]` 站点造真实返回路径」(98 处 `SessionFail` + 6 处 `WireLogFatal`)**拒做**:≥9 处返回引用(`ServerSession&`、`RingControl&`、`Doorbell&`、`ClientSession&`,`ServerSession.cpp:270/283/740/765/774/784/790`、`WireTables.cpp:118`、`EmitTables.cpp:212`)没有诚实返回值;且 §12.3 的进程级 `eglTerminate` 使「闩住但活着的 server 进程」也服务不了第二个会话。P6.5 的 `--serve` fork-per-session(`ServerMain.cpp:302`)**已经**给出「下一连接照常服务」。真正欠的四片:(1) supervisor **观测并命名**子进程死亡——三处 `waitpid(active, nullptr, WNOHANG)`(`:279/:289/:294`)换成读 status、记 `pid exit=/signal=`、计 `sessionsFaulted`;(2) 两处绕过漏斗的裸 `abort`(`Server/StagedShadow.h:115`、`Server/StagedTextureStore.h:344`)改走 `SessionFail`;(3) **只对对端字节可达的站点**做 latch-and-decline(`PipeWireCodec.cpp` R-2 诚实臂 + 解码边界、`PipeApplier.cpp` 七处、`ServerLoop.cpp` 四处、`SurfaceOpCodec.cpp` 三处——它们都已在 `Bool`/`MobileGLResult` 返回的函数里),`DrainRing` 顶部加闩检查;(4) 负控:喂畸形帧 → 会话闩住 → 下一连接得到 Welcome。 | (1)+(2) 1 天;(3)+(4) 2–2.5 天 | (1)(2) 与 P7 wave 0 同一提交(费用极低);(3)(4) 在 P7 之后 |
| PH-2 slot 预算(`SlotTables.h:347/:371` 两条 `MOBILEGL_ASSERT`) | partial(wave 2-F 未做,见 `ph-f.md` §4) | 必须 | 提升为 release 下具名拒绝(先经 `SessionFail`,闩落地后改闩) | 0.5 天 | 与 D11 五处一起 |
| PH-1 `Session::Fail` 翻成每会话闩 | partial → **(3)(4) done**(F2 latch 包,`p7/f2-latch`:会话子进程武装的 `SessionLatch`、exit 75、inproc 保持 Fatal——`CONTRACT-P7.md` §10 第 7 条;逐站表 `scripts/ci/ph_latch_sites.py --table`;第二批站点、PH-2、生成门记在 §12) | **必须,但重新定界** | 路线图写的「每个 `[[noreturn]]` 站点造真实返回路径」(98 处 `SessionFail` + 6 处 `WireLogFatal`)**拒做**:≥9 处返回引用(`ServerSession&`、`RingControl&`、`Doorbell&`、`ClientSession&`,`ServerSession.cpp:270/283/740/765/774/784/790`、`WireTables.cpp:118`、`EmitTables.cpp:212`)没有诚实返回值;且 §12.3 的进程级 `eglTerminate` 使「闩住但活着的 server 进程」也服务不了第二个会话。P6.5 的 `--serve` fork-per-session(`ServerMain.cpp:302`)**已经**给出「下一连接照常服务」。真正欠的四片:(1) supervisor **观测并命名**子进程死亡——三处 `waitpid(active, nullptr, WNOHANG)`(`:279/:289/:294`)换成读 status、记 `pid exit=/signal=`、计 `sessionsFaulted`;(2) 两处绕过漏斗的裸 `abort`(`Server/StagedShadow.h:115`、`Server/StagedTextureStore.h:344`)改走 `SessionFail`;(3) **只对对端字节可达的站点**做 latch-and-decline(`PipeWireCodec.cpp` R-2 诚实臂 + 解码边界、`PipeApplier.cpp` 七处、`ServerLoop.cpp` 四处、`SurfaceOpCodec.cpp` 三处——它们都已在 `Bool`/`MobileGLResult` 返回的函数里),`DrainRing` 顶部加闩检查;(4) 负控:喂畸形帧 → 会话闩住 → 下一连接得到 Welcome。 | (1)+(2) 1 天;(3)+(4) 2–2.5 天 | (1)(2) 与 P7 wave 0 同一提交(费用极低);(3)(4) 在 P7 之后 |
| PH-2 slot 预算(`SlotTables.h:347/:371` 两条 `MOBILEGL_ASSERT`) | partial(wave 2-F 未做,见 `ph-f.md` §4)→ 具名拒绝经 `MGPipeSessionFail` 已落地(F2,`CONTRACT-P7.md` §10 第 6 条);闩已落地(F2 latch)但**改闩未做**,理由与八处站点见 `CONTRACT-P7.md` §12(`@Ph-declined (ID-P7-1)`) | 必须 | 提升为 release 下具名拒绝(先经 `SessionFail`,闩落地后改闩) | 0.5 天 | 与 D11 五处一起 |
| PH-3 readback 尺寸门(`PipeApplier.cpp:444`) | not_started | 必须 | 绝对上限取 P6.5 `LinkTerms.maxReplyBytes`(server 自陈),在 resize **之前**比较,超限回 `PostReply(kStatusError)` 而非 Fatal | 4–6 h | D11 |
| PH-4 `StagedTextureStore` 按 level 范围设界(`:440`) | not_started | 必须 | `CopyRunInto` 传入 level 宣告 extent,`imageOffset+byteSize` 越界即拒绝 | 1 天 | D11 |
| PH-5 `ArchiveVector` 上限(`ProgramArtifactsCodec.cpp:309`) | not_started | 必须 | `TakeCount` 带元素大小,`raw*sizeof(T)` 对 `Remaining()` 设界 | 4–8 h | D11 |
@@ -33,7 +33,7 @@ P7 收官的关键路径是:**先造仪器(wave 0)→ 真机诊断(wave
| PH-8 尺寸由 server 钳制 | **done**(wave 2-F:单测 + 两进程 smoke `hello_asks_64_gib`;F 修复轮:超出所授条款的请求记一条 `MGLOG_W`) | 必须 | 已陈述;补「client Hello 要 64 GiB 时 server **忽略请求、按自己的尺寸建段**而非分配」的单测(不是钳制:四个计数根本不参与定尺寸) | 0.5 天 | P7 之后 |
| 门:`Session::Fail` 站点普查零新增 | partial ⚠ | 必须 | `scripts/ci/fatal_census.py` 存在且在 CI(`test.yml:2011`),但 (a) `SCAN_ROOT` 只有 `MG_Remote`,server 进程里 ~79 处 abort(DirectGLES.cpp 16、Managers.cpp 12、VkBufferManager.cpp 11、PipeRoute.cpp 7……)看不见;(b) `abort_sites` 记了从不比较;(c) 12 个 family 词无 `.def` 行。改:SCAN_ROOT 扩到 server 镜像(MG_Remote / MG_Pipe / MG_Backend / MG_Impl/Pipe / MG_State),`abort_sites` 变棘轮,补 `.def` 行 | 1 天 | **wave 0**(P7 需要它看见 `@P7` abort) |
| 门:fuzz 臂 1 畸形控制帧 | partial | 必须 | 机制已在(`Framing.h:168` latch、`ControlInbox`),欠端到端脚本 `scripts/ci/ph_fuzz_control_frames.py`(五种畸形)+ `ServerMain.cpp:193` 补 `CtrlEnvelopeBufferHasIdentifier` + ctest 车道 | 1.5 天 | P7 之后 |
| 门:fuzz 臂 2 超界计数 | not_started | 必须 | = PH-1 (3)(4) + D11 五处 | 见上 | P7 之后 |
| 门:fuzz 臂 2 超界计数 | not_started → **done**(F2 latch 包:`MG_Test/Wire/PeerLatchTest.cpp` 每个转换站点与 D11 五处各一行 raw-peer 负控,每行之后同一 `--serve` supervisor 的下一会话得到 Welcome 并渲染;PH-2 与 D11 的 MG_Pipe 钩仍是具名 Fatal(`signal=6`),见 `CONTRACT-P7.md` §12) | 必须 | = PH-1 (3)(4) + D11 五处 | 见上 | P7 之后 |
| 门:fuzz 臂 3 不排空对端 | not_started | 必须 | = PH-6 + 场景 | 见上 | P7 之后 |
| 门:非 loopback 无令牌具名拒绝 | **done**(wave 2-F:smoke 入 CI,SKIP 即红) | 必须 | 已了:名字改为词表内的 `Refuse{Authentication}`(PH-7 (2));`tcp_supervisor_smoke.py` 挂为 `TcpLane.SupervisorProtocolControls`(`integration-tcp`),CI 构建钉版 flatc 并以 `junit_tally.py --require-entry-passed` 要求它**跑了且过了** | 含在 PH-7 | 同期 |
| OQ-21 令牌够不够 / TLS | 已答(ID-P7-3;wave 2-F 落地) | 必须裁定 | 见 ID-P7-3 | 0 | 本文 |