[CI] (P13 W5 S4): the latch-site map follows the record verbs into RecordVerbSink.cpp.

This commit is contained in:
2026-10-06 12:37:43 -04:00
parent e04c6edb76
commit ed7800a550
2 changed files with 12 additions and 9 deletions
+6 -6
View File
@@ -1152,7 +1152,7 @@ namespace {
}}, }},
// P8-F: ProtocolCorruption, no longer UnmigratedVerb - our client cannot send this shape // P8-F: ProtocolCorruption, no longer UnmigratedVerb - our client cannot send this shape
// (nor +CLIENT_INDICES, the same site), so only a foreign peer like this one reaches it. // (nor +CLIENT_INDICES, the same site), so only a foreign peer like this one reaches it.
{"MultiDrawInstanced", "PipeApplier.cpp", "MultiDraw*+INSTANCED", Outcome::Latched, {"MultiDrawInstanced", "RecordVerbSink.cpp", "MultiDraw*+INSTANCED", Outcome::Latched,
"Fatal{ProtocolCorruption, \"MultiDrawArrays+INSTANCED\"}", false, "Fatal{ProtocolCorruption, \"MultiDrawArrays+INSTANCED\"}", false,
[](Client::ClientSession& c, PeerReport& r) { [](Client::ClientSession& c, PeerReport& r) {
P::MGPDrawInfo info{}; P::MGPDrawInfo info{};
@@ -1165,7 +1165,7 @@ namespace {
std::memcpy(tail.data(), ranges, sizeof(ranges)); std::memcpy(tail.data(), ranges, sizeof(ranges));
return Forge(c, r, P::MGPWireOp::DrawVbo, Bytes(info), {tail}); return Forge(c, r, P::MGPWireOp::DrawVbo, Bytes(info), {tail});
}}, }},
{"UnitWindowSamplerViews", "PipeApplier.cpp", "SetSamplerViews.Count (unit window)", Outcome::Latched, {"UnitWindowSamplerViews", "RecordVerbSink.cpp", "SetSamplerViews.Count (unit window)", Outcome::Latched,
"Fatal{ProtocolCorruption, \"SetSamplerViews.Count\"} - draw_vbo applies", false, "Fatal{ProtocolCorruption, \"SetSamplerViews.Count\"} - draw_vbo applies", false,
[](Client::ClientSession& c, PeerReport& r) { [](Client::ClientSession& c, PeerReport& r) {
P::MGPContextValues values{}; P::MGPContextValues values{};
@@ -1185,7 +1185,7 @@ namespace {
const P::MGPDrawRange range{0, 3, 0}; const P::MGPDrawRange range{0, 3, 0};
return Forge(c, r, P::MGPWireOp::DrawVbo, Bytes(info), {Bytes(range)}); return Forge(c, r, P::MGPWireOp::DrawVbo, Bytes(info), {Bytes(range)});
}}, }},
{"UnitWindowSamplerStates", "PipeApplier.cpp", "BindSamplerStates.Count (unit window)", Outcome::Latched, {"UnitWindowSamplerStates", "RecordVerbSink.cpp", "BindSamplerStates.Count (unit window)", Outcome::Latched,
"Fatal{ProtocolCorruption, \"BindSamplerStates.Count\"} - draw_vbo applies", false, "Fatal{ProtocolCorruption, \"BindSamplerStates.Count\"} - draw_vbo applies", false,
[](Client::ClientSession& c, PeerReport& r) { [](Client::ClientSession& c, PeerReport& r) {
P::MGPContextValues values{}; P::MGPContextValues values{};
@@ -1248,7 +1248,7 @@ namespace {
// P9 (CONTRACT-P9.md §1): the pack-buffer readbacks. Each sink has ONE shape site, fed by // P9 (CONTRACT-P9.md §1): the pack-buffer readbacks. Each sink has ONE shape site, fed by
// every check (box, extent, PH-3 bound, Src.DstSize, the layout), so one row per sink // every check (box, extent, PH-3 bound, Src.DstSize, the layout), so one row per sink
// covers them; the texture sink's unreadable-level site is the third. // covers them; the texture sink's unreadable-level site is the third.
{"ReadPixelsToBufferShape", "PipeApplier.cpp", "ReadPixelsToBuffer.shape", Outcome::Latched, {"ReadPixelsToBufferShape", "RecordVerbSink.cpp", "ReadPixelsToBuffer.shape", Outcome::Latched,
"Fatal{ProtocolCorruption, \"ReadPixelsToBuffer.shape\"} the read box or its format is invalid", false, "Fatal{ProtocolCorruption, \"ReadPixelsToBuffer.shape\"} the read box or its format is invalid", false,
[](Client::ClientSession& c, PeerReport& r) { [](Client::ClientSession& c, PeerReport& r) {
P::MGPReadbackToBuffer rec{}; P::MGPReadbackToBuffer rec{};
@@ -1259,7 +1259,7 @@ namespace {
rec.RowStride = 16; rec.RowStride = 16;
return Forge(c, r, P::MGPWireOp::ReadPixelsToBuffer, Bytes(rec)); return Forge(c, r, P::MGPWireOp::ReadPixelsToBuffer, Bytes(rec));
}}, }},
{"GetTextureImageToBufferShape", "PipeApplier.cpp", "GetTextureImageToBuffer.shape", Outcome::Latched, {"GetTextureImageToBufferShape", "RecordVerbSink.cpp", "GetTextureImageToBuffer.shape", Outcome::Latched,
"Fatal{ProtocolCorruption, \"GetTextureImageToBuffer.shape\"} the image extent is not a whole level's", false, "Fatal{ProtocolCorruption, \"GetTextureImageToBuffer.shape\"} the image extent is not a whole level's", false,
[](Client::ClientSession& c, PeerReport& r) { [](Client::ClientSession& c, PeerReport& r) {
P::MGPReadbackToBuffer rec{}; P::MGPReadbackToBuffer rec{};
@@ -1275,7 +1275,7 @@ namespace {
// A well-shaped record naming a texture the server never created: the level cannot be // A well-shaped record naming a texture the server never created: the level cannot be
// read, and with no reply to answer ERROR in, the session latches under the reply form's // read, and with no reply to answer ERROR in, the session latches under the reply form's
// family word. // family word.
{"GetTextureImageToBufferUnreadable", "PipeApplier.cpp", "GetTextureImageToBuffer", Outcome::Latched, {"GetTextureImageToBufferUnreadable", "RecordVerbSink.cpp", "GetTextureImageToBuffer", Outcome::Latched,
"Fatal{ReplyError, \"GetTextureImageToBuffer\"}", true, "Fatal{ReplyError, \"GetTextureImageToBuffer\"}", true,
[](Client::ClientSession& c, PeerReport& r) { [](Client::ClientSession& c, PeerReport& r) {
P::MGPReadbackToBuffer rec{}; P::MGPReadbackToBuffer rec{};
+6 -3
View File
@@ -38,6 +38,8 @@ TEST = ROOT / "MobileGL" / "MG_Test" / "Wire" / "PeerLatchTest.cpp"
FILES = { FILES = {
"PipeWireCodec.cpp": ROOT / "MobileGL" / "MG_Remote" / "Wire" / "PipeWireCodec.cpp", "PipeWireCodec.cpp": ROOT / "MobileGL" / "MG_Remote" / "Wire" / "PipeWireCodec.cpp",
"PipeApplier.cpp": ROOT / "MobileGL" / "MG_Remote" / "Server" / "PipeApplier.cpp", "PipeApplier.cpp": ROOT / "MobileGL" / "MG_Remote" / "Server" / "PipeApplier.cpp",
# P13 W5: the record verbs ServerVerbSink applied moved to their own consumer, with their latches.
"RecordVerbSink.cpp": ROOT / "MobileGL" / "MG_Backend" / "Record" / "RecordVerbSink.cpp",
"ServerLoop.cpp": ROOT / "MobileGL" / "MG_Remote" / "Server" / "ServerLoop.cpp", "ServerLoop.cpp": ROOT / "MobileGL" / "MG_Remote" / "Server" / "ServerLoop.cpp",
"SurfaceOpCodec.cpp": ROOT / "MobileGL" / "MG_Remote" / "Protocol" / "SurfaceOpCodec.cpp", "SurfaceOpCodec.cpp": ROOT / "MobileGL" / "MG_Remote" / "Protocol" / "SurfaceOpCodec.cpp",
} }
@@ -75,7 +77,7 @@ UNREACHABLE = [
"peer's bytes; ServerLoopTest's lost-window case is its negative control"), "peer's bytes; ServerLoopTest's lost-window case is its negative control"),
# P9 (CONTRACT-P9.md §1): the pack-buffer read's decline. The reply form's twin answers # P9 (CONTRACT-P9.md §1): the pack-buffer read's decline. The reply form's twin answers
# DECLINED for the same case and has no row either. # DECLINED for the same case and has no row either.
("PipeApplier.cpp", 'Fatal{ReadbackDeclined, "ReadPixelsToBuffer"}', ("RecordVerbSink.cpp", 'Fatal{ReadbackDeclined, "ReadPixelsToBuffer"}',
"both server backends install GL.ReadPixels; no record bytes can take the slot away, so the " "both server backends install GL.ReadPixels; no record bytes can take the slot away, so the "
"arm exists only for a backend that never had one"), "arm exists only for a backend that never had one"),
] ]
@@ -154,7 +156,8 @@ def print_mechanics():
", ".join(f"`{case_suite(f, c)}.{c}` ({f})" for f, c in cases) + " |") ", ".join(f"`{case_suite(f, c)}.{c}` ({f})" for f, c in cases) + " |")
LATCH_CALL = re.compile(r"(?<![A-Za-z0-9_])(SessionLatch|WireProtocolLatchAt|WireProtocolLatch)\s*\(") # P13 W5: MGPipeRecordLatch is SessionLatch through the record arm's seam (MG_Pipe/PipeSessionFail.h).
LATCH_CALL = re.compile(r"(?<![A-Za-z0-9_])(SessionLatch|MGPipeRecordLatch|WireProtocolLatchAt|WireProtocolLatch)\s*\(")
STRING = re.compile(r'"((?:[^"\\]|\\.)*)"') STRING = re.compile(r'"((?:[^"\\]|\\.)*)"')
CONVERSION = re.compile(r"%[-+ #0-9.]*(?:hh|h|ll|l|z|j|t)?[diouxXcsp]") CONVERSION = re.compile(r"%[-+ #0-9.]*(?:hh|h|ll|l|z|j|t)?[diouxXcsp]")
@@ -282,7 +285,7 @@ def latch_sites():
if re.search(r"\bBool\s+WireProtocolLatch(At)?\s*\(", previous): if re.search(r"\bBool\s+WireProtocolLatch(At)?\s*\(", previous):
continue # the SessionLatch inside the helper: its callers are the sites continue # the SessionLatch inside the helper: its callers are the sites
args = string_args(call_text(lines, index, match.start())) args = string_args(call_text(lines, index, match.start()))
if match.group(1) == "SessionLatch": if match.group(1) in ("SessionLatch", "MGPipeRecordLatch"):
fmt = next((a for a in args[1:] if a is not None), None) fmt = next((a for a in args[1:] if a is not None), None)
elif match.group(1) == "WireProtocolLatch": elif match.group(1) == "WireProtocolLatch":
fmt = None if args[0] is None else ( fmt = None if args[0] is None else (