[MGPipe] the Fatal texts no longer claim P5 does not chunk

R-10's "P5 does not chunk (R-10)" wording predates the stage chunk budget: buffer
content ranges are cut at MGPipeStageChunkBytes() (1e7c372e) and a texture level
at whole-width slabs (9469d48e), so the claim is false for the two rows that can
outgrow SEG_STAGE - and these messages are what a bring-up reads.

- PipeWireEncoder::StageAllocate's two Fatal{RingOverrun, "SEG_STAGE"} sites now
  say what reaching them means: a blob is staged whole, a row that cuts its
  content at the stage chunk budget never arrives, so this is a record type with
  no cut or a piece still larger than the arena.
- EncodeRecord's MaxRecordBytes arm says the bound is about the record's own
  bytes - the stage chunk budget cuts blobs, not a header, payload or inline
  tail - and keeps the integrator decision it names.
- Comments in PipeWireCodec.h, EmitTables.cpp's maxrecop line, Config.h's
  STAGE_MB knob, PipeStats.h's MaxRecordBytes gauge, SplitRuntimePeek.h and
  WireLedgerChecks.h said P5 does no chunking; they now say what is cut and what
  is not.
- PipeWireCodecTest.ARecordLargerThanHalfTheRingIsFatalRingOverrun asserts the
  new diagnostic text instead of "does not chunk (R-10)".
This commit is contained in:
2026-09-20 19:39:51 -04:00
parent e004269d96
commit a63577354d
8 changed files with 41 additions and 31 deletions
@@ -87,8 +87,9 @@ namespace MGITest {
// ring and 0 wraps in a process whose ring never filled are the same number and
// completely different facts.
//
// maxRecordBytes / maxRecordBytesCap: R-10 says P5 does no chunking and must prove it
// needs none. The cap is RingProducer::MaxRecordBytes() == MOBILEGL_IPC_RING_MB / 2,
// maxRecordBytes / maxRecordBytesCap: R-10's bound on a record's OWN bytes - the
// content rows cut their blobs at the stage chunk budget, nothing cuts the record. The
// cap is RingProducer::MaxRecordBytes() == MOBILEGL_IPC_RING_MB / 2,
// read from the ring this process actually got rather than recomputed from the
// environment.
//
@@ -9,8 +9,10 @@
// THE TWO ASSERTIONS THE WIRE PRODUCER'S LEDGER MAKES POSSIBLE, in one place so the scenarios
// that carry them cannot drift apart on what the numbers mean.
//
// R-10 (ExpectMaxRecordBytesUnderCap). P5 does no chunking and must instead PROVE it never
// needs any: no record may exceed RingProducer::MaxRecordBytes() == MOBILEGL_IPC_RING_MB / 2.
// R-10 (ExpectMaxRecordBytesUnderCap). No record may exceed
// RingProducer::MaxRecordBytes() == MOBILEGL_IPC_RING_MB / 2: the content rows cut their BLOBS
// at the stage chunk budget, so what is left uncut is the record itself, and it has to be shown
// to stay under the bound.
// Half of that proof is already a Fatal - PipeWireCodec.cpp aborts Fatal{RingOverrun} on a
// record ABOVE the cap - and it is the loud half. The quiet half is the one this assertion
// covers: the phase has to publish the MAXIMUM ACTUALLY SEEN on a real workload, so that a
@@ -91,10 +93,11 @@ namespace MGITest::WireLedger {
<< where << ": R-10 - the largest record this session wrote is " << state.maxRecordBytes
<< " bytes and RingProducer::MaxRecordBytes() is " << state.maxRecordBytesCap
<< " (half of a " << (state.maxRecordBytesCap * 2)
<< " byte SEG_CMD, i.e. MOBILEGL_IPC_RING_MB). P5 does NOT chunk: a record at or "
"above the cap is Fatal{RingOverrun} at the encoder, and a maximum that has "
"climbed to it is the proof obligation failing. Report it to the integrator, who "
"decides between early chunking (P8) and a bigger default ring";
<< " byte SEG_CMD, i.e. MOBILEGL_IPC_RING_MB). The content rows cut their blobs at "
"the stage chunk budget, so nothing cuts this record: one at or above the cap is "
"Fatal{RingOverrun} at the encoder, and a maximum that has climbed to it is the "
"proof obligation failing. Report it to the integrator, who decides between a "
"cut for that row and a bigger default ring";
::testing::Test::RecordProperty("max_record_bytes",
static_cast<int>(state.maxRecordBytes));
::testing::Test::RecordProperty("max_record_bytes_cap",