Files
MobileGL/docs/archive/notes/p5/prompts/c1-round1.md
T

7.8 KiB

You are package c1 — the client role, the 71-slot emit table and the verb barrier of phase P5 on the MobileGL disaggregation project. You and package v1 (running in parallel, owning the server and the apply thread) jointly own the milestone: "the first IPC frame on the reduced path".

Read first, in this order: ~/w7/notes/p5/PACKAGE-PREAMBLE.md (worktree setup, the two day-one traps, build recipe, the four self-tests every package owes, the iron rules), then MobileGL/MG_Remote/CONTRACT-P5.md in the tree (authoritative — it outranks the brief; §7 is yours: R-15 and the three classes of the 71 slots, which you must not re-derive), then ~/w7/notes/p5/BRIEF-P5.md §2 (R-1, R-3, R-4, R-5, R-8, R-12, R-15), §4, §5 "c1", §13 (R-16 — read this one twice), then ~/w7/notes/p5/verb-census.md (measured, not estimated) and ~/w7/notes/p5/scout-caps-reply-reverse.md (your subject's 661-line survey). Then skim ~/w7/notes/p5/INTEGRATOR-DECISIONS.md and the wave-1 reports under ~/w7/notes/p5/p5-results/.

Base: feat/disaggregated @ 32563993 — wave 1 (c0, w1, s1, p1, b1, t1) is merged. Slug c1; worktree ~/w7/p5-c1, branch p5/c1. The full gate is running on that commit; I will tell you if it turns up breakage.

What you own

MG_Remote/Client/*, and the remote side of MG_Backend/BackendObject*. Not Managers.cpp/BufferObject.cpp (b1's), not MG_Backend/Init.cpp (v1's — the hook is theirs, the table it installs is yours).

What you build

  1. BackendObject_Remote — 8 pure virtuals + 9 EGL lifecycle virtuals. Three traps from the scout: GetRendererInfo() returns a reference, so the object must own a RendererInfo; GetFormatCapabilities() is non-virtual, so you must fill m_formatCapabilities rather than override an accessor; GetBackendType() must answer the server's backend, never a new "Remote" enumerator, because frontend branches switch on it. And LogBackendInfo() reads GetRendererInfo() at Init.cpp:21, before any surface exists — return a placeholder and accept one imprecise startup log line; do not restructure MG_Backend::Init().
  2. The emit table: 71 function pointers, not 69. Present and SetSwapInterval have zero MG_Impl call sites — they are reached through the EGL path — so a table built by mirroring GLImpl covers neither, and Present is on the reduced path. No slot may be null and no slot may fall through to the driver. The three classes are already decided in CONTRACT §7: class A answered locally from the caps mirror (GetIntegeri_v, IsTimerQuerySupported), class B emitted (Clear, DrawArrays, ReadPixels, BlitFramebuffer, Present), class C Fatal{UnmigratedVerb, "<slot>"} (the other 64).
  3. The cross-cutting rule that is easy to miss and is written into CONTRACT §7: 41 of the 69 slots are null-checked at their call site, and several of those null checks are capability probes, not safety checks. Since no slot may be null, every one of those probes would answer "supported" and the fallback behind it would silently disappear. A null check on a slot may never survive into the client under split — it becomes a caps-mirror read. Three named cases are in the contract (GL_Query.cpp:481/:785, GL_Query.cpp:534, the SubDataResident op-table slot); the rule generalises to all 41, so walk them.
  4. CapsMirror — the client's copy of the snapshot, answering the 56 caps read points. Re-arrival of a snapshot is the invalidation (R-12), so there is no separate Invalidate(); Generation() is the only thing on the client that can see a server context death, and a client memo must key on it.
  5. The verb barrier (R-1). Publish, then wait appliedSeq >= mySeq, spin MOBILEGL_IPC_SPIN_US then park. The barrier's wait and the reply's wait are the same wait — that is why ClientSession::EmitAndWait is one call. Splitting them is how a package ends up re-deriving an acceptance answer locally, which R-5 forbids: the four Bool acceptance entry points and MapPersistent's decline come back through the reply slot (c0 has now given those four rows kReplySlot, so MGPipeCallFlagsFor is the single source of truth). Do not re-derive acceptance on the client, and do not "always accept" — that is ID-39's 66 lost DirectVulkan uploads with a wire in between.
  6. R-8: the liveness gates read the caps mirror, never MGPipeGetResourceOps(). MGPipeResourceSubsystemEnabled() and P4aFamilyHasItsConsumer() must ask CapsMirror::ServerConsumes(subsystemBit). Under inproc the old read answers correctly by accident; under spawn the client has no backend at all and five families silently stop emitting while the client clears its dirty flags anyway. s1 already made the server end Fatal when nobody sets the mask; you are the client end.
  7. Blocking read_pixels — copy the pixels out of SEG_REPLY into the application's pointer. The PBO destination half (fire-and-forget + client-side MarkGpuWritten) is b1's design; wire it, do not redesign it.
  8. Wire b1's three unwired entry points. MarkGpuWritesForDraw, MarkGpuWritesForDispatch and PushPersistentMapsBeforeVerb are written and tested but have zero callers — deliberately, because the call sites are yours. They must run before the verb record. A push deferred past its draw is the C-1 regression re-committed at the transport layer. b1's report ~/w7/notes/p5/p5-results/b1-v1.md has the details, including that its own B-1 fix depends on the rising edge publishing a real one-block record.
  9. Two debts t1 filed against you, both in ~/w7/notes/p5/p5-results/t1-v1.md: E2's emitter-drop negative control (drop one Clear emission and prove OpenRA's SSIM falls below the threshold — the control that proves the split arm is really split), and the fact that whoever lands the last stub arms 21 Split. ctest entries plus two negative controls. t1's arming condition is behavioural — transport not monolith, a live ClientSession, a non-zero ImplementedVerbCount(), and the client encoder's record ordinal actually moving during the case — so it arms only when the path really runs. That last clause is yours to make true.

Acceptance

  • DirectGLES.Split.TriangleScenario.* and DirectGLES.Split.ClearThenReadPixelsScenario.* green under MOBILEGL_TRANSPORT=inproc (jointly with v1 — coordinate through me if you block on each other).
  • The four self-tests in the preamble on all four build dirs plus split. G1 must not move, and you are touching MG_Backend/BackendObject*, which is in the pull build.
  • A death test on the UnmigratedVerbFatal arm, and a unit case per caps-mirror read path (glGetString, glGetIntegerv, glGetStringi).
  • One case proving a client whose caps mask lacks a family emits nothing for it and says so — R-8's negative control.

The discipline this wave produced — R-16, and it is not optional

Five packages each shipped at least one check that could not fail for the reason it existed: a self-test control that tripped on another control's message; a persistent-map test that wrote the record field by hand so deleting the producer still passed; a lane probe that armed against stub source text — the reviewer renamed one string and 8 of 11 split lanes went green having run monolith. So: no test may construct the state it is meant to observe; every control asserts its own failure string, not merely that something failed; every gate ships with one line saying "I made it red once, by doing X". Break it, watch it fail, restore it, and put that evidence in your report. ~/w7/p5-w1-redcheck.py automates exactly this and is worth copying.

Write ~/w7/notes/p5/p5-results/c1-v1.md and return ≤200 words: commit range, acceptance numbers, whether the first inproc frame renders, and the three things v1 and the integrator most need to know.