diff --git a/MobileGL/MG_Pipe/MGPipeTypes.h b/MobileGL/MG_Pipe/MGPipeTypes.h index 710a90c8..7e84044d 100644 --- a/MobileGL/MG_Pipe/MGPipeTypes.h +++ b/MobileGL/MG_Pipe/MGPipeTypes.h @@ -24,7 +24,8 @@ // // P0.5 DEBT, half repaid. The MG_State half is gone: ResidualValueBlock's // RenderStateParameters and PixelStoreParameters now come from MGPipeValueTypes.h, so -// this header no longer reaches into MG_State. What remains is MGPCaps embedding +// this header no longer reaches RenderState.h (its closure still touches TextureEnum.h, +// through BackendObject.h, for the reason in the next sentence). What remains is MGPCaps embedding // MG_Backend's DynamicBackendParameters - deliberate, the caps block IS that struct // (section 4.4.1) - and that one include is what still keeps purity gate A (section // 10.3) off this header; the gate asserts MGPipeValueTypes.h instead. The caps block diff --git a/MobileGL/MG_State/GLState/ProgramState/ProgramArtifacts.h b/MobileGL/MG_State/GLState/ProgramState/ProgramArtifacts.h index 016aa230..b4c736cb 100644 --- a/MobileGL/MG_State/GLState/ProgramState/ProgramArtifacts.h +++ b/MobileGL/MG_State/GLState/ProgramState/ProgramArtifacts.h @@ -15,7 +15,7 @@ #include // std::set (LinkArtifacts); NOT provided by Includes.h on its own terms // PURITY: no ShaderObject.h, no SpvcSession.h, nothing under MG_Util/ShaderTranspiler/, no Config.h, // no MG_Backend/, no BufferState/. scripts/check_include_closure.py probe "artifacts-header" (ROADMAP P0.5; -// ARCHITECTURE.md:260) asserts that closure. the glslang scope token appears exactly twice below (B.0 D5: the two +// ARCHITECTURE.md:260) asserts that closure. The glslang scope token appears exactly twice below (B.0 D5: the two // glslang-typed LinkArtifacts members moved verbatim) and the gate pins that count. namespace MobileGL::MG_State::GLState { diff --git a/MobileGL/MG_Test/Program/ProgramArtifactsTest.cpp b/MobileGL/MG_Test/Program/ProgramArtifactsTest.cpp old mode 100755 new mode 100644 index 72727aab..e1f9239b --- a/MobileGL/MG_Test/Program/ProgramArtifactsTest.cpp +++ b/MobileGL/MG_Test/Program/ProgramArtifactsTest.cpp @@ -121,7 +121,7 @@ namespace { std::printf("sizeof: TypeFacts=%zu ResourceReflection=%zu XfbVarying=%zu LinkArtifacts=%zu SpirvArtifacts=%zu\n", sizeof(TypeFacts), sizeof(ResourceReflection), sizeof(XfbVarying), sizeof(LinkArtifacts), sizeof(SpirvArtifacts)); -#if defined(__GLIBCXX__) && !defined(_GLIBCXX_DEBUG) && (SIZE_MAX == UINT64_MAX) +#ifdef MGL_LINKARTIFACTS_SIZE // whichever STL branch the header pinned, this twin follows it EXPECT_EQ(sizeof(ResourceReflection), static_cast(MGL_RESOURCEREFLECTION_SIZE)); EXPECT_EQ(sizeof(XfbVarying), static_cast(MGL_XFBVARYING_SIZE)); EXPECT_EQ(sizeof(LinkArtifacts), static_cast(MGL_LINKARTIFACTS_SIZE)); diff --git a/scripts/check_include_closure.py b/scripts/check_include_closure.py index a4693c16..5465edaf 100755 --- a/scripts/check_include_closure.py +++ b/scripts/check_include_closure.py @@ -50,6 +50,7 @@ once they exist - the integrator flips `--require-all` on as the ratchet. """ import argparse +import atexit import json import os import re @@ -317,7 +318,12 @@ def flags_from_compile_commands(path): tokens = shlex.split(entry.get("command", "")) flags = [] skip_next = False + keep_next = False for token in tokens[1:]: + if keep_next: + keep_next = False + flags.append(token) + continue if skip_next: skip_next = False continue @@ -325,8 +331,9 @@ def flags_from_compile_commands(path): skip_next = token in ("-o", "-MF", "-MT", "-MQ") continue if token == "-isystem": - skip_next = False + # two-token form: keep the flag AND its directory flags.append(token) + keep_next = True continue if token.startswith(keep_prefixes): flags.append(token) @@ -570,6 +577,7 @@ def main(): check_clang_prereqs() tmpdir = tempfile.mkdtemp(prefix="mgl-include-closure-") + atexit.register(shutil.rmtree, tmpdir, True) context = { "tmpdir": tmpdir, "counter": [0], @@ -600,6 +608,16 @@ def main(): results = [] problems = 0 skipped = 0 + if args.require_all: + # The ratchet is about the two P0.5 headers existing, whether or not --probe + # narrowed this run to something else: a required header that is missing is a + # failure even when its probe was not selected. + selected_names = {probe["Name"] for probe in selected} + for probe in PROBES: + if probe["Name"] in REQUIRED_PROBE_NAMES and probe["Name"] not in selected_names and not os.path.isfile(os.path.join(REPO_ROOT, probe["Header"])): + problems += 1 + say("{} is required under --require-all but its header does not exist: {}".format( + probe["Name"], probe["Header"])) for probe in selected: # D9: a header that does not exist yet is one SKIP line, counted once, and a # failure only under --require-all (the ratchet the integrator flips).