Skip to content

ci(audit): add anti-mock Vulkan probe guard and streamline CI - #20

Merged
saariuslystoned merged 1 commit into
mainfrom
feat/anti-mock-audit-and-slimmer-ci
Dec 1, 2026
Merged

saariuslystoned merged 1 commit into
mainfrom
feat/anti-mock-audit-and-slimmer-ci

Conversation

@saariuslystoned

Copy link
Copy Markdown
Contributor

Summary

  1. Deterministic anti-mock Vulkan probe/canary guard (scripts/clean-room-audit.sh)

    • Added .cc, .cpp, and .hpp to spdx_required_exts so C++ sources and headers require SPDX-License-Identifier: Apache-2.0.
    • Added a deterministic [ANTI-MOCK] guard for C/C++ implementation files (.c, .cc, .cpp) under canary/ or probes/ (excluding explicit unit-test files matching *_test.*, test_*.*, or nested inside tests/).
    • Strips C/C++ comments before matching so files must contain at least one real Vulkan API call/symbol (vkCreateInstance, vkQueueSubmit, vkCreateComputePipelines, or vkCreateDevice), preventing CPU-only synthetic mocks from passing as GPU probes or canaries.
    • Added unit tests in tests/test_clean_room_audit.py verifying fake CPU-only canaries/probes fail with [ANTI-MOCK], real Vulkan canaries pass, explicit unit tests/headers are allowed, and .cc/.cpp/.hpp files require SPDX headers.
  2. Slimmer, fail-safe CI workflow (.github/workflows/ci.yml)

    • Added top-level concurrency cancelling superseded pull_request runs while never cancelling main pushes, plus workflow_dispatch and explicit permissions: contents: read.
    • Consolidated clean-room-audit and offline-tests into a single audit-and-offline-tests job to avoid duplicate runner boot and checkout.
    • Gated build-sweeper-and-spirv on changed paths for pull_request events via a fail-safe step (id: paths, all GitHub context passed through env: with zero ${{ }} shell interpolation):
      • Always runs (run_vulkan=true) on push to main, workflow_dispatch, or any pull_request touching probes/, canary/, tools/freeusc/, .github/workflows/ci.yml, or scripts/clean-room-audit.sh, and fails safe to true whenever diff resolution is unavailable or uncertain.
      • Skips VM boot and apt-get on docs-only or freepvr-twin-only pull requests.

Verification

  • ./scripts/clean-room-audit.sh -> [audit] PASS: 0 violations across 74 files.
  • python3 -m unittest discover -s tests -v -> Ran 50 tests ... OK (including all 5 new tests in tests/test_clean_room_audit.py)
  • python3 -m unittest discover -s freepvr-twin/tests -v -> Ran 45 tests ... OK
  • All 7 CLI self-tests from .github/workflows/ci.yml (volcanic_bitdiff.py, rgx_sh_parser.py, gen_spirv_probes.py, freecs_packet_validator.py, freecs-validate, freeusc-sim --self-test, freeusc-sim --mesa-proof) -> PASS
  • yaml.safe_load validation of .github/workflows/ci.yml + zero ${{ }} interpolation check across all run: steps + 15 path-gate simulations (push, workflow_dispatch, missing/invalid/empty SHA fail-safes, docs-only, freepvr-twin-only, all 5 trigger paths, and --no-renames move out of probes/) -> PASS
  • git diff --check -> clean

- Expand SPDX Apache-2.0 header checks in scripts/clean-room-audit.sh to cover C++ extensions (.cc, .cpp, .hpp).
- Require C/C++ implementation files (.c, .cc, .cpp) under canary/ or probes/ (excluding *_test.*, test_*.*, and files inside tests/) to call or reference at least one real Vulkan API symbol (vkCreateInstance, vkQueueSubmit, vkCreateComputePipelines, or vkCreateDevice), stripping comments first so CPU-only synthetic mocks fail locally and in CI.
- Add unit tests in tests/test_clean_room_audit.py for fake CPU-only canaries/probes, real Vulkan canaries, allowed unit-test/header files, and C++ SPDX enforcement.
- Streamline .github/workflows/ci.yml with PR concurrency cancellation, workflow_dispatch, minimal read permissions, a combined audit-and-offline-tests job, and fail-safe changed-path gating for build-sweeper-and-spirv.
@saariuslystoned
saariuslystoned merged commit 8dc4672 into main Dec 1, 2026
2 checks passed
@saariuslystoned
saariuslystoned deleted the feat/anti-mock-audit-and-slimmer-ci branch December 1, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant