[MG_Backend, MG_IntegrationTest] (P7): the busy predicate's comments name the floor as the guarantee and the submission term as a probe, and the term is consulted and re-stamped wherever the serial is

Review ID-P7-34, item 3. 02bb5789 presented the submission term as the fix
and still carried the every-8th-drain mechanism that magma-b3.md §2.4
refutes (the probe saw one successful drain and zero boundary works across
the OpenRA replay). The term is not sound alone: lastUseSubmitIndex is
stamped at AcquireWireSlice, but a mid-draw flush (BindProgramUniformBuffers
-> SyncWireTextureShape's preserve path -> FlushWirePendingCommandsFor-
TextureUpdate) can submit the stamped index without the draw, so the stamp
names S1 while the draw rides S2. The guarantee is the floor in
OnSubmitsCompletedUpTo; the term is a defence and a device probe.

- WriteWireBuffer's block comment, the WireBufferResource field comment,
  the AcquireWireSlice stamp comment, the StreamedBufferSubData CMake
  comment and the F1WireScenario case comment are rewritten on that
  footing; the drain story is gone. The drain probe's comment now says it
  refuted the drain as the mechanism.
- WaitForWireBufferHostAccess's early return also requires the submission
  term complete, so a caller with the serial term idle cannot skip a wait
  the term demands.
- ReadWireBuffer re-stamps lastUseSubmitIndex beside lastUseSerial after
  its wait, preserving the pending draw's reservation in both halves.

All disaggregated-only code. OpenRA DirectVulkan SPLIT / SPAWN retraces
ssim 1.000000, 0 px, zero MGWIRE-FLOOR lines; integration-magma-split 90/90,
-spawn 69/69, -tcp 70/70.
This commit is contained in:
2026-09-22 20:25:11 -04:00
parent b0c6af3168
commit cba0c3a110
5 changed files with 61 additions and 39 deletions
+7 -6
View File
@@ -3108,12 +3108,13 @@ if (MOBILEGL_BUILD_DISAGGREGATED)
# ---- P7 wave 2 package B3, EXIT GATE 3: the streamed `glBufferSubData -> draw` pair.
#
# TWO ENTRIES OVER ONE CASE, for the reason the ShaderMip pair gives. The plain entry is
# a regression gate that runs on every driver. The forced entry is the RED-ONCE: it makes
# the frame-counting half of VkBufferManager's busy predicate answer "idle", which is the
# state a mid-frame idle drain puts the wire arm into on the device and which no host
# lane reaches on its own - measured, zero mid-frame frame-boundary drains across the
# whole OpenRA replay, which is why the divergence is device-only and why the lane could
# not arm against it before this knob existed.
# a regression gate that runs on every driver. The forced entry is the red-once of the
# DEFENCE term: it makes the serial half of VkBufferManager's busy predicate answer
# "idle" - the state an unsound completed-serial floor put the wire arm into on the
# device - so only the submission-fence half is left to order the copy. It does NOT
# cover the floor fix itself (forcing the serial term bypasses the floor entirely); the
# floor's lane is the OpenRA split retrace, which run_trace_case.cmake reds on any
# "MGWIRE-FLOOR unsound-serial-complete" line.
#
# ITS OWN ENTRY RATHER THAN A LANE-WIDE FLIP: the knob changes how EVERY streamed buffer
# write in the process is answered, so putting it in the shared Fm environment would
@@ -2078,12 +2078,13 @@ TEST_F(F1WireScenario, CopyImageInPlaceOverlapDeclinesAndLeavesTheLevelAlone) {
// somebody else's vertices. So the case cannot assert "no error"; it has to assert the pixels.
//
// Registered TWICE per arm. The plain entry is a regression gate on every driver. The
// `StaleSerial.` entry carries MGITEST_MAGMA_FORCE_STALE_BUFFER_SERIAL=1, which forces the
// frame-counting half of the busy predicate to answer "idle" - the state a mid-frame idle drain
// puts the wire arm into on the device, and one no host lane reaches by itself (measured: zero
// mid-frame frame-boundary drains across the whole OpenRA replay). With the counting half
// forced to lie, only the submission-fence half can still order the copy, which is exactly what
// this package added and exactly what the entry pins.
// `StaleSerial.` entry (split and spawn only - the tcp arm's server never sees an entry's
// environment) carries MGITEST_MAGMA_FORCE_STALE_BUFFER_SERIAL=1, which forces the serial half
// of the busy predicate to answer "idle" - the state the unsound completed-serial floor put the
// wire arm into on the device. With the serial half forced to lie, only the submission-fence
// half can still order the copy, so the entry pins that DEFENCE term. The guarantee is the
// floor (VulkanRenderer::OnSubmitsCompletedUpTo), which the knob bypasses; its lane is the
// OpenRA split retrace's "MGWIRE-FLOOR unsound-serial-complete" red condition.
TEST_F(F1WireScenario, StreamedBufferSubDataBeforeEachDrawIsOrdered) {
if (!Ready()) return;
constexpr int kSize = 8, kBatches = 4, kColumn = kSize / kBatches;