[Docs] (P12): the no-reply flag reviewed - the arithmetic holds and the flag is cheap, but the predicate has to be "this answer will never be read", not "fire-and-forget"

An independent review of the one design door the measurement left open (stop sending
the ~51,000 answers nobody reads, so the 8-slot pool stops churning and the create
window becomes collectable). Verdict: feasible, worth doing, and the proposal AS
WRITTEN would disable the thing it exists to enable.

THE CATCH. The windowed create is wantReply=false AND its answer is read -
WireTables.cpp's drain reads exactly those seqs. A bit keyed on "fire-and-forget"
therefore stops the server answering the creates the window is waiting for: the
window goes from "cannot be collected" to "there is nothing to collect", and the
readfail counter that is the only way to diagnose it disappears with it. It fails
silently, not loudly. The predicate has to be per-record "this answer will never be
read" - true of params / respecify-escape / sub-data, false of a windowed create -
carried as a separate input from wantReply (willReadReply), with
willReadReply && !rowCarriesReplySlot rejected rather than ignored.

VERIFIED HERE, not taken on trust (the reviewer's file:line claims, checked):
  - the flag space is RingRecordFlags (Ring.h:281-285), bits 0-4 taken, BIT 5 FREE,
    and the header's own table (PipeWire.inc:35-65) says "bit 5 kOptional vs (nothing)
    no ring counterpart" - so a new ring bit aliases kOptional, which is exactly what
    the assert at PipeWireCodec.cpp:142-145 refuses;
  - the three static_asserts that will trip are real and deliberate
    (PipeWireCodec.cpp:106, :142-145, RingTest.cpp:740);
  - WireFingerprint mixes payload-layout, catalogue, render-state digests + OpCount,
    none of which a ring bit moves - so no protocol revision bump is required, and
    both cross-version directions degrade to today's behaviour. That makes this
    "must upgrade both ends to take EFFECT", not "must upgrade both ends not to
    BREAK" - one notch cheaper than handoff-2 section 3.2's protocol surface;
  - StreamLink.cpp:564-571 is the independent progress flush (>= 64 records or
    >= 1 ms) and :577 is PostReply piggybacking SendProgress on the reply - so
    skipping replies coarsens progress granularity. Bounded, but unmeasured.

AND IT CORRECTED TWO OF MY OWN NUMBERS. The frame's reply count is 55,903, not
59,673: op 4 ResourceDestroy carries kNone in the catalogue (PipeWire.inc:179) and
PostReply Fatals on a row with no kReplySlot, so it never answers - I had added its
3,770 records to the total. The derived figures move with it (12.3 replies per create,
0.65 of a create of survival, 6,988 pool churns), and every copy is fixed here:
Config.h, ConfigLoader.cpp, WireTables.cpp's section comment, CONTRACT-P5E.md,
CREATE-WINDOW-MEASURED.md.

TWO MORE THINGS THE FOLLOW-UP MUST CARRY, both recorded in the note's section 7:
  - LinkMetricsBeginReply counts ownsReplySlot, so once the flag lands by_op 2 falls
    to ~0 - and section 1 of the note tells the reader to use by_op 2 to check whether
    the window engaged. That check becomes a FALSE GREEN; the flag needs a
    server-side "how many times did this op answer" counter beside it.
  - the ~112,000 sendmsg/frame the flag removes are on the apply thread, so the
    flag's own value is a measurable claim that nobody has measured.

172/172 and 13/13 after the comment corrections.
This commit is contained in:
BZLZHH
2026-09-26 01:13:31 +08:00
parent 7205509a9a
commit 7c822cdc85
5 changed files with 63 additions and 26 deletions
+8 -5
View File
@@ -551,16 +551,19 @@ namespace MobileGL::MG_Config {
// MOBILEGL_IPC_CREATE_WINDOW: how many RESOURCE_CREATE answers may be outstanding before the
// client waits for one. 1 = every create waits, which is the shape R-5 shipped with AND THE
// DEFAULT, because the deferral was measured on the device and does not work: the reply pool
// is 8 slots and one load frame posts 59,673 replies (create 4,536 + respecify 20,633 +
// params 18,056 + sub-data 12,671 + the rest), so an answer is overwritten after 8 replies -
// 0.61 of a create - and the window's drain can never read one back. All 4,536 creates took
// is 8 slots and one load frame posts 55,903 replies (create 4,536 + respecify 20,633 +
// params 18,056 + sub-data 12,671 + 7), so an answer is overwritten after 8 replies -
// 0.65 of a create - and the window's drain can never read one back. All 4,536 creates took
// the blocking path at 4 and at 1 alike (28.64 s both ways). Worse than inert: the
// provisional accept latches an object the applier may have refused, and the un-latch that
// corrects it lives in that same unreadable drain. WireTables.cpp's section comment has the
// counters and the arithmetic, and the gates in RemoteClientControls.inc still pin the
// mechanism, which is sound and simply unusable against this much other reply traffic.
// N > 1 is reachable for the experiment that would make it usable (a deeper pool, or a way
// to tell the server not to answer a fire-and-forget row).
// N > 1 is reachable for the experiment that would make it usable (a deeper pool, or a
// per-record "this answer will never be read" bit). NOTE THE PREDICATE: NOT
// "fire-and-forget" - the window's own creates ARE fire-and-forget and the drain reads
// them, so a flag keyed on wantReply would kill the very thing it is meant to enable
// (docs/Disaggregated/notes/p12/CREATE-WINDOW-MEASURED.md section 7).
Uint32 CreateWindow = 1;
// MOBILEGL_IPC_ADOPT_TIER: 2 = emulate (client keeps the shadow and pushes), which
// is the only tier P5 implements and the reason persistent-map-push can be non-zero