mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-18 09:08:31 +09:00
[MG_Pipe, MG_Impl, MG_Remote, MG_Backend] (Disaggregated): P5c rv - set_context_values retires the value-class BARRIER_PULLED rows
set_context_values (opcode 79, MGPContextValues 96B, kCtxState) carries the active texture unit, the max touched unit, the fifteen touched-binding-point counts and the five value-class XFB rows, emitted at validate under the subsystem bit and hash-suppressed as a whole; the emit gate and the residual-skip gate read the same answer so they can never disagree. MGPipeApplySetContextValues writes gPipeInputs (the PackState shape). MGPAttribValue grows 24->56B to carry the frontend's converted three views, and MGPipeApplySetVertexAttribDefaults finally writes them (the 'ignores MGPAttribValue::ValueClass' warning dies), so GetCurrentVertexAttribute leaves the refusal set. The three texture shutters answer the applier's own serials under a server-stamped verb (APPLIER_DERIVED), storage answer kept verbatim elsewhere. FieldOwnership.def: nine value-class rows become derived RECORD_SUPPLIED, the three shutters APPLIER_DERIVED, the nine object-class rows keep their phases; FieldOwnershipTest pins that the remaining pulls are exactly the object-class list. gen_pipe.py gains SCAN_EXEMPT_ACCESSORS with per-name reasons and retiring phases (it repairs the --check gate the hd merge's two G6 probes had left red). Evidence: unit 2175/2175; integration-split 111/111; both generators' --check and --self-test green; rsp on the Xfb capture scenario 36 -> 22; red-once - gating the emission off turns seven named scenarios red, restoring returns 111/111. CONTRACT-P5C section 5.3.
This commit is contained in:
+20
-1
@@ -462,6 +462,25 @@ def check_field_lists_cover_struct_members(field_lists, payloads, header_texts=N
|
||||
ACCESSOR_READ_RE = re.compile(r"\b(?:MGB_CTX|pGLContext)\s*->\s*(\w+)")
|
||||
|
||||
|
||||
# The scanner's NAMED exemptions: accessors a backend reads through MGB_CTX-> / pGLContext->
|
||||
# that are NOT PipeInputs fields and never will be, each with the reason written down. A name
|
||||
# here is a DEBT ENTRY, not a silence: it exists so the gate can tell "scoped, named, phased"
|
||||
# from "forgot the row".
|
||||
#
|
||||
# P5c (the tx/ev/hd merge): the G6 frontend-keyed registry's framebuffer arm - two probes a
|
||||
# backend makes inside MGPipeFrontendKeyedRegistryScope (CONTRACT-P5C.md section 3.1's second
|
||||
# named exemption: the registry probes ride the scope, an unwrapped probe still aborts, and
|
||||
# the scope retires with the twin tables at P3b/P4b). They are object-registry lookups, not
|
||||
# PipeInputs state reads, so no Coverage.def row can ever describe them - a row there is a
|
||||
# field in the fill table, and these have no storage to fill.
|
||||
SCAN_EXEMPT_ACCESSORS = {
|
||||
"GetFramebufferObject": "P5c G6 registry probe (the default framebuffer's object), inside "
|
||||
"MGPipeFrontendKeyedRegistryScope; retires with the twin tables (P3b/P4b)",
|
||||
"FindFramebufferObjectByLifetimeId": "P5c G6 registry probe, inside "
|
||||
"MGPipeFrontendKeyedRegistryScope; retires with the twin tables (P3b/P4b)",
|
||||
}
|
||||
|
||||
|
||||
def scan_live_accessors(accessors, backend_dir=None, verbose=True):
|
||||
"""Every accessor a backend reads through MGB_CTX-> or pGLContext-> (comments and
|
||||
strings masked) must have a Coverage.def row - a read without a row is a PipeInputs
|
||||
@@ -479,7 +498,7 @@ def scan_live_accessors(accessors, backend_dir=None, verbose=True):
|
||||
masked = mask_comments_and_strings(read(path))
|
||||
for match in ACCESSOR_READ_RE.finditer(masked):
|
||||
read_names.setdefault(match.group(1), set()).add(os.path.relpath(path, REPO_ROOT))
|
||||
unknown = sorted(n for n in read_names if n not in known)
|
||||
unknown = sorted(n for n in read_names if n not in known and n not in SCAN_EXEMPT_ACCESSORS)
|
||||
if unknown:
|
||||
sys.exit("Coverage.def: accessor(s) read by a backend with no row: %s"
|
||||
% ", ".join("%s (%s)" % (n, ", ".join(sorted(read_names[n]))) for n in unknown))
|
||||
|
||||
@@ -558,10 +558,13 @@ def self_test():
|
||||
# substring is not decoration: see expect_trip.
|
||||
|
||||
# 1. THE HEADLINE CONTROL (exit gate E4): take one field out of the table. It is in no
|
||||
# class, and that is a build failure rather than a silent default.
|
||||
dropped = edit(r"X\(GetActiveTextureUnit," + GAP + r"BARRIER_PULLED," + GAP + r"\"[^\"]*\","
|
||||
+ GAP + r"\"[^\"]*\"\)", "", "remove GetActiveTextureUnit's row")
|
||||
controls = [("a field in NO class (GetActiveTextureUnit's row removed)",
|
||||
# class, and that is a build failure rather than a silent default. GetBoundVertexArray is
|
||||
# the control's field since P5c rv (it keeps a hand-written BARRIER_PULLED row; the value
|
||||
# rows the first version used are RECORD_SUPPLIED-derived now, so they have no row to
|
||||
# edit).
|
||||
dropped = edit(r"X\(GetBoundVertexArray," + GAP + r"BARRIER_PULLED," + GAP + r"\"[^\"]*\","
|
||||
+ GAP + r"\"[^\"]*\"\)", "", "remove GetBoundVertexArray's row")
|
||||
controls = [("a field in NO class (GetBoundVertexArray's row removed)",
|
||||
"field(s) in NO class",
|
||||
lambda: run(own_text=dropped))]
|
||||
|
||||
@@ -575,9 +578,9 @@ def self_test():
|
||||
lambda: run(own_text=doubled)))
|
||||
|
||||
# 3. A row naming something that is not a field at all.
|
||||
typo = edit(r"X\(GetActiveTextureUnit,", "X(GetActiveTextureUnitt,", "misspell a field name")
|
||||
typo = edit(r"X\(GetBoundVertexArray,", "X(GetBoundVertexArrayy,", "misspell a field name")
|
||||
controls.append(("a row naming a non-field",
|
||||
"GetActiveTextureUnitt, which is not a PipeInputs field",
|
||||
"GetBoundVertexArrayy, which is not a PipeInputs field",
|
||||
lambda: run(own_text=typo)))
|
||||
|
||||
# 4. A BARRIER_PULLED row with no retiring phase: the debt is only sized if every row
|
||||
@@ -585,17 +588,17 @@ def self_test():
|
||||
# THE REPLACEMENT IS NOT A RAW STRING. It was, and the backslashes survived into the
|
||||
# substitution, mangled the row past ROW_RE's reach and made this control a silent
|
||||
# duplicate of #1 for a whole round.
|
||||
unphased = edit(r"(X\(GetActiveTextureUnit," + GAP + r"BARRIER_PULLED,)" + GAP + r"\"[^\"]*\",",
|
||||
unphased = edit(r"(X\(GetBoundVertexArray," + GAP + r"BARRIER_PULLED,)" + GAP + r"\"[^\"]*\",",
|
||||
"\\1 \"-\",", "blank a BARRIER_PULLED row's retiring phase")
|
||||
controls.append(("a BARRIER_PULLED row with no retiring phase",
|
||||
"GetActiveTextureUnit is BARRIER_PULLED and names no retiring phase",
|
||||
"GetBoundVertexArray is BARRIER_PULLED and names no retiring phase",
|
||||
lambda: run(own_text=unphased)))
|
||||
|
||||
# 5. A class that is not one of the four.
|
||||
bogus = edit(r"(X\(GetActiveTextureUnit,)" + GAP + r"BARRIER_PULLED,",
|
||||
bogus = edit(r"(X\(GetBoundVertexArray,)" + GAP + r"BARRIER_PULLED,",
|
||||
"\\1 SOMEHOW_FINE,", "introduce a fifth class")
|
||||
controls.append(("a fifth class",
|
||||
"GetActiveTextureUnit is in class SOMEHOW_FINE",
|
||||
"GetBoundVertexArray is in class SOMEHOW_FINE",
|
||||
lambda: run(own_text=bogus)))
|
||||
|
||||
# 6. A sticky forward that lost its own row - the seven most dangerous fields are exactly
|
||||
@@ -699,9 +702,9 @@ def self_test():
|
||||
"the field set (%d of %d)" % (total, len(accessors)))
|
||||
if len(sticky) != 7:
|
||||
sys.exit("gen_pipe_field_ownership: self-test: Coverage.def no longer has seven sticky fields")
|
||||
if len(refused) != 9:
|
||||
if len(refused) != 7:
|
||||
sys.exit("gen_pipe_field_ownership: self-test: EmittedCallSuppliesTheWholeField refuses %d "
|
||||
"fields, not the nine the contract's derivation is written against" % len(refused))
|
||||
"fields, not the seven the contract's derivation is written against" % len(refused))
|
||||
if trips == 0:
|
||||
sys.exit("gen_pipe_field_ownership: self-test: no negative control tripped - the gates are "
|
||||
"not checking anything")
|
||||
@@ -710,7 +713,7 @@ def self_test():
|
||||
% (len(controls) - trips, len(controls)))
|
||||
print("gen_pipe_field_ownership: self-test: %d negative-control trip(s), each asserted against "
|
||||
"its OWN message; harness control OK; positive control OK "
|
||||
"(%d fields partitioned, 7 sticky forwards, 9 refusals)" % (trips, total))
|
||||
"(%d fields partitioned, 7 sticky forwards, 7 refusals)" % (trips, total))
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user