Skip to content

Runtime: support explicit Tier 3 InnerCoverage and add mask conformance - #4290

Open
73N1X wants to merge 5 commits into
ItsNotRexed:mainfrom
73N1X:feat/conservative-rasterization-tier3
Open

73N1X wants to merge 5 commits into
ItsNotRexed:mainfrom
73N1X:feat/conservative-rasterization-tier3

Conversation

@73N1X

@73N1X 73N1X commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Latest head: ebbd553. Merged main 561b65a and resolved the single CMake conflict by retaining both the InnerCoverage executable/optional CTest registration and main's new vk_ps_sweep tool. No Tier 3 scope expansion.

Post-merge validation: all affected conservative-raster executables, vk_inner_coverage and vk_ps_sweep build successfully; focused CTest 8 passed, 1 expected FullyCoveredEXT skip, zero failures; the separate 73-comparison matrix plus negative controls passes with core/synchronization validation and 157 valid modules. Seven runner CPU tests, CTest registration, documentation links/paths and diff checks pass. Tested on the same RX 5700 XT / MSVC 19.44 environment described below. Historical full-suite and independent GPU results below retain their original commit attribution.

Matrix-registration change: 19e1964. The 73-case mask/capture suite now has an optional CTest entry, inner_coverage_matrix, with SKIP_RETURN_CODE=77, a 600-second timeout and gpu/conservative/inner_coverage labels. It is off by default and requires Python, glslang, spirv-as, spirv-val and Khronos validation.

One-command Windows setup/build/run (tools on PATH or already cached):

./scripts/run_inner_coverage_matrix.ps1

Use -Build <existing-build> -Config <configuration> as needed; explicit tool-path arguments are documented in docs/inner_coverage.md. For an enabled/configured build, run ctest --test-dir <build> -C <configuration> -R '^inner_coverage_matrix$' -V. The normal FullyCoveredEXT tests do not substitute for this matrix. Please report actual execution of the 73 comparisons, exact head, GPU/driver, final summary and validation messages; an unavailable-device skip is not a positive result.

Validated locally through both standalone CTest and the normal-runtime PowerShell command on RX 5700 XT: the matrix passes (73 comparisons plus negative controls, 157 valid modules, core + synchronization validation, zero messages). Runner CPU checks (7), registration checks and documentation/LF checks pass. Earlier exact-head runtime/GPU evidence remains attributed below.

Skip-status fix: 50506a0. Follow-up to the Intel UHD 770 report: missing mask capabilities now propagate exit 77 / SKIP through the harness, child suite and top-level runner. Missing primitiveUnderestimation has an explicit diagnostic. Real execution/readback errors remain failures, and validation diagnostics take precedence over a skip status. The optional benchmark follows the same contract.

Verification of this follow-up: 7 CPU status-contract tests passed (including an actual child-process skip); RX 5700 XT 73 comparisons plus negative controls passed, 157 modules valid, core + synchronization validation with zero messages; focused optional benchmark passed; build, Python compilation, LF checks and diff checks passed. Intel hardware is not available locally; an exact-head UHD 770 recheck is requested. Earlier full-runtime and independent supported-device results below retain their original commit attribution.

Claimed as D3D-457. Consolidation status: #4933 (comment)
Original reservation: #4084 (comment)

Prerequisite #3451 is now merged into main; there is no remaining unmerged prerequisite PR.

Supersedes #3970: its native Tier 3 reference test, CMake registration and runner script are already included here. The reference test source and runner match #3970 head fedc442. Its discussion and independent GPU reports remain available at #3970; they retain their original commit attribution. #3970 is not a separate merge prerequisite. #4498 is complementary metadata tooling, not a build dependency.

What and why

Adds conservative-rasterization Tier 3 for caller-owned SPIR-V libraries with an explicit FullyCoveredEXT input contract, and commits the synthetic underestimation-mask implementation and regression suite for investigating devices without FullyCoveredEXT.

This consolidates the previous draft in place so its review and independent GPU evidence remain attached. The runtime/library scope is ready for review. Automatic Xbox shader translation and a general AMD runtime fallback are not implemented or advertised. The AMD-capable mask/capture implementation is an executable synthetic fixture; it is not wired into arbitrary runtime draws.

Consolidation baseline: 628acde, merged with main 3faac55 without conflicts.

Runtime and reusable components

  • Gate Tier 3 on the enabled extension, complete Tier 1/2 geometric properties, fullyCoveredFragmentShaderInputVariable and the caller's explicit inner_coverage_abi opt-in. Standalone devices leave the opt-in off.
  • Inspect actual SPIR-V capability declarations before graphics module creation, including when index capability metadata is absent. Refuse unsupported FullyCoveredEXT use; require the additional device property for PostDepthCoverage.
  • Keep separate CPU oracle, ABI/property guards, native-only reference and Vulkan/native comparison tests. The positive comparison covers 48 synthetic scenarios and compares geometric guarantees rather than assuming undefined edge values.
  • Add a checked private bitset-layout component with independent pixel/primitive/instance addresses, budget checks and 32-bit shader-index overflow rejection. Its CPU test is registered in the normal runtime build on all platforms.

Synthetic mask/capture implementation

The dedicated Vulkan executable is built by the normal runtime build with Vulkan headers and can also be built standalone. The portable Python runner has no machine-specific paths, requires core and synchronization validation, and validates generated modules with spirv-val.

  • Dedicated underestimation mask shader followed by one overestimation draw running the fragment logic.
  • One atomic bit per pixel/emitted primitive/instance; independent private IDs preserve guest PrimitiveId when a GS emits multiple primitives sharing one guest ID.
  • GPU scratch clearing outside the render pass, explicit barriers, repeated-batch reuse, and preserved unrelated counter/sentinel storage.
  • Depth/stencil isolation during mask generation; early/late tests, discard, shader depth, 1x/4x MSAA and sample-rate controls.
  • Bounded capture-once of original VS/GS output followed by two replays, preserving effects and geometry. The fixture covers one input triangle producing two triangles, not arbitrary shader instrumentation. Unsupported capture counts are rejected.
  • Negative controls deliberately collapse IDs, retain stale scratch and execute side-effecting geometry twice. They must produce the expected observable differences.

Tested at this consolidated head

Windows build 26200, AMD Radeon RX 5700 XT, driver 32.0.21045.5002, MSVC 19.44; Khronos validation layer 1.4.363 for the synthetic suite.

  • Full configured runtime build succeeded. The normal build also compiles the new fixture; standalone Release build succeeded.
  • Full runtime CTest: 166 passed, 10 skipped, 1 disabled, zero failures (177 registered). Core validation was requested. Optional translator-based targets requiring additional configured tool paths were not built; no full translator/corpus result is claimed.
  • Focused runtime checks: 7 passed, 1 skipped, zero failures. The skipped positive FullyCoveredEXT runtime test is expected: this GPU reports that Vulkan property as false. Native-only reference and Tier 2 tests passed.
  • Portable mask/capture suite: 73 comparison cases plus negative controls passed, with core and synchronization validation active and zero validation/performance messages. 157 generated SPIR-V modules passed spirv-val in the non-benchmark run.
  • Capture-once counters: VS=3, GS=1, PS=69 on both 1x/4x fixtures, matching the reference. Unsafe replay control: VS=6, GS=2 and changed geometry.
  • The unguarded derivative/discard fixture reports 52 physical atomic increments in both paths on this driver. This baseline anomaly is documented, not counted as proof of general unguarded helper-side-effect correctness. Four explicit-helper-guard comparisons produce 26 in both paths.
  • Optional synthetic 32x32/64-triangle benchmark: median reference 37.36 us, serial mask 742.36 us, batched mask 60.24 us, with 8192 mask bytes. One warmup/five samples, includes batch scratch clear, excludes pipeline creation/readback and does not measure geometry-capture cost. No application performance claim.
  • CTest registration, documentation links/repository paths, text encoding, explicit LF writer checks, Python compilation and git diff --check passed.
  • Full build emitted warnings in unchanged d3d12_vulkan_device_test/xgameruntime test files; no warnings were reported from the new fixture or changed runtime files.

Independent supported-GPU evidence retained

sds-228's RTX 3090 result applies to a55ba1f, before this consolidation: driver 621.24.0.0, Vulkan 1.4.357, FullyCovered property=1, Tier 3, 48 positive Vulkan/native scenario pairs, four focused checks and zero validation errors. Their reported full run was 159 passed, eight skipped and one disabled.

This is positive evidence for the explicit-library path at that exact head. It is not represented as a positive RTX run of the new consolidated head. A fresh supported-device check of 628acde is welcome; the local AMD result cannot substitute for it. The earlier code review remains available in this PR's discussion.

ABI investigation, reproduction and handoff

See docs/inner_coverage.md for commands, the regression matrix, public source references, measured PC input-register experiments and a task/evidence handoff table.

The investigation distinguishes SFI0 bit 0x400, signature value 70, DXIL semantic kind 15 and opcode 92. InnerCoverage is NotInSig; missing ISG1 does not prove non-use. Public AMD pipeline selectors and PC ENA/ADDR reservation experiments do not establish the Xbox ABI. False is zero; true has bit 0 set, with other bits potentially undefined.

Remaining work is explicitly separated:

  1. Independently establish Xbox metadata, effective ENA/ADDR/selector, input VGPR and value behavior using legally shareable synthetic evidence. No fixed-register guess is enabled.
  2. Generalize capture/replay and fragment instrumentation while preserving every live output and executing original-stage effects exactly once.
  3. Integrate private allocation/lifetime, capacity/chunking, command-list replay, predication and render-pass transitions into the runtime before enabling an AMD fallback.
  4. Extend the raster contract beyond these fixtures: clipping/culling, viewports/scissors/layers, tessellation/mesh, queries/transform feedback and other MSAA configurations.
  5. Repeat exact-head independent GPU validation across suitable devices.

These are follow-ups, not claims of functionality already implemented. The explicit-library runtime path and reusable conformance foundation can be reviewed independently of recovering that ABI. All inputs are hand-authored synthetic fixtures; no game files, keys, decryption or online services are involved.

@SweatierKey

Copy link
Copy Markdown
Contributor

Independent code read + build/hygiene check at a55ba1fe on Linux (WSL2, Python 3.13.5, no Windows/GPU host, no game files): pass (Windows MSVC build & GPU execution of Tier 2/3 tests not run here).

  • Code read (runtime/src/conservative_raster.h, d3d12_com.h, d3d12_vulkan_device.cpp, docs/d3d12_vulkan.md):
    • tier() cleanly gates Tier 1 (subpixel_bits >= 8, overestimate <= 0.5 - 1/512), Tier 2 (degenerate_triangles + overestimate <= 1/256 - ldexp(0.5, -min(subpixel_bits, 24))), and Tier 3 (fully_covered && inner_coverage_abi, strictly opt-in and false by default for the standalone device).
    • inner_coverage_requirements() safely validates the SPIR-V header (0x07230203), checks word count bounds (!count || count > words.size() - i), and matches the exact SPIR-V encodings (OpCapability 17 → FragmentFullyCoveredEXT 5265; OpExecutionMode 16 → PostDepthCoverage 4446).
    • PipelineState inspects every stage before vkCreateShaderModule and refuses FragmentFullyCoveredEXT (E_NOTIMPL, logged once) unless the stage is fragment, Tier 3 is active, and PostDepthCoverage is backed by the device property when declared.
  • Checks run (clean worktree on 03b09a08): git diff --check, test_ctest_registration.py (4/4), test_docs_links.py (6/6), test_docs_repo_paths.py (2/2), test_text_write_line_endings.py (3/3), test_text_encoding.py (2/2) all pass.
  • Not run here: Windows MSVC build and Vulkan/D3D12 GPU tests (d3d12_conservative_tier2_test, d3d12_conservative_tier3_test, d3d12_conservative_tier3_reference_test).

AI-assisted review.

@sds-228

sds-228 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Supported-GPU check at a55ba1f: NVIDIA GeForce RTX 3090 / driver 621.24.0.0, Vulkan 1.4.357, validation on. Property line: fullyCoveredFragmentShaderInputVariable=1, tier=3. Positive Vulkan test ran (not skipped): 48 Vulkan/native paired scenarios pass. Focused CTest 4/4 passed; full CTest 159 passed, 0 failed (9 not run: 8 skipped, 1 disabled). 0 validation errors.

AI-assisted (OpenCode)

@73N1X
73N1X marked this pull request as ready for review November 23, 2026 07:07
@73N1X 73N1X changed the title Runtime: prototype opt-in Tier 3 InnerCoverage and GPU comparison Runtime: support explicit Tier 3 InnerCoverage and add mask conformance Nov 23, 2026
@73N1X

73N1X commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Updated to 628acde and marked ready for review. This keeps the original discussion and exact-head RTX 3090 evidence in place, merges main 3faac55, and adds the portable underestimation-mask/capture suite and documented ABI handoff.

Local results: full configured runtime build; 166 CTest passes, 10 skips and one disabled test, no failures; 73 synthetic comparison cases plus negative controls with core + synchronization validation and zero messages; 157 generated modules pass spirv-val. The AMD fixture is a bounded conformance implementation, not a general runtime fallback. The explicit-library FullyCoveredEXT runtime path remains opt-in.

The RTX 3090 result above still applies to a55ba1f. A new supported-GPU run at 628acde would validate the consolidated positive path; a skipped positive test is not that evidence. Reproduction commands and remaining Xbox ABI/general instrumentation/resource-integration work are in docs/inner_coverage.md. Dependencies remain #3451 and #3970.

@DenRakEiw

Copy link
Copy Markdown
Contributor

Tested 628acdea on NVIDIA GeForce RTX 5090 (Blackwell, driver 32.0.16.1088) and AMD Radeon(TM) Graphics (iGPU, driver 31.0.22044.1), Windows 11, MSVC 19.44 / Ninja / Vulkan SDK 1.4.363.0 (LEONIDA_VK_VALIDATION=1, no game files): pass.

  • Trial-merged onto origin/main (3faac557): clean; all conservative-raster test executables and GLSL shaders built cleanly.
  • RTX 5090: ctest -R conservative -V -> 5/5 passed (d3d12_conservative_raster, d3d12_conservative_tier2, d3d12_conservative_tier3, d3d12_conservative_tier3_reference, conservative_raster, 4.50s total, 0 Vulkan validation errors).
  • AMD Radeon iGPU (LEONIDA_VK_DEVICE=AMD): ctest -R conservative -V -> 2/5 passed, 3 skipped (d3d12_conservative_tier3_reference & conservative_raster passed; d3d12_conservative_raster/tier2/tier3 skipped as expected on iGPU, 0 Vulkan validation errors).

AI-assisted (Gemini 4 Neon).

@gertify

gertify commented Nov 23, 2026

Copy link
Copy Markdown

Tested 628acde on Intel UHD 770 (driver 32.0.101.7088), Windows 11, MSVC 19.44, Vulkan SDK 1.4.357.0 with Khronos validation: the Tier 3 test skips and the inner coverage matrix stops with exit 1 on this GPU.

  • Build of d3d12_conservative_tier3_test, vk_inner_coverage and inner_coverage_mask_layout_test: exit 0.
  • d3d12_conservative_tier3_test: "Tier 3 explicit ABI: Intel(R) UHD Graphics 770; fullyCoveredFragmentShaderInputVariable=0; tier=2", "SKIP: positive Tier 3 path needs a FullyCoveredEXT-capable device", exit 77.
  • inner_coverage_mask_layout_test: "PASS: unique mask addresses, bounds, budget and overflow controls", exit 0.
  • runtime/test/inner_coverage/run.py with LEONIDA_VK_VALIDATION=1: exit 1. The device reports "experiment properties: under=0 fullyCovered=0 overestimate=0.001953125 uncertainty=0", and check_basic.py stops with "RuntimeError: Required GPU capability or validation layer unavailable: PROBE sync validation enabled", raised where coverage.py:347 sees the harness exit 77. vk_inner_coverage.cpp:511 returns 77 for the combined probe when primitiveUnderestimation is absent, so on a device without underestimation run.py ends as an error, not a skip.

AI-assisted.

@tunczzz

tunczzz commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 628acdea (merge base 3faac557) on Windows 11 10.0.26300 with an NVIDIA GeForce RTX 5070 Ti (Blackwell, subgroup 32..32), driver 616.56. Result: pass.

  • Runtime built from this head: MSVC 19.44 (BuildTools 2022), Ninja, RelWithDebInfo, -DLEONIDA_VULKAN_HEADERS_FETCH=ON (no Vulkan SDK; the loader comes from the NVIDIA driver). glslangValidator and llvm-mc 21 came from WSL Ubuntu. Build exit 0.
  • ctest -j 3: 184/184 passed. New here: d3d12_conservative_tier2, d3d12_conservative_tier3, d3d12_conservative_tier3_reference, d3d12_inner_coverage_guards, d3d12_inner_coverage_native, inner_coverage_mask_layout, inner_coverage_oracle PASS.
  • scripts/run_gpu_tests.py --build <this build>: 170/217 passed, 47 skipped, 0 failed.
  • Compared test by test with main 3faac557 on the same machine (ctest 177/177, GPU 170/217): every result is the same.

Not run: other GPUs/vendors, Linux, the Vulkan validation layer (not installed). No game files.

AI-assisted (Claude Code).

@73N1X

73N1X commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the unsupported-device status in 50506a0. The harness now names the missing primitiveUnderestimation property, and both the individual suite and run.py propagate exit 77 as SKIP rather than converting it to exit 1. An incomplete matrix does not print the final PASS. Validation diagnostics still fail even alongside exit 77; other execution/readback failures remain failures. The optional benchmark uses the same handling.

Seven CPU regression checks pass, including a real child process returning 77. The full 73-case synthetic suite and its negative controls still pass on RX 5700 XT with core + synchronization validation, zero messages, and 157 modules accepted by spirv-val. A focused benchmark also passes. I cannot rerun on Intel locally; please recheck the UHD 770 at 50506a0: the expected unsupported-mask result is now exit 77 with the explicit missing-property message, while the native Tier 3 positive test should continue to skip.

@73N1X

73N1X commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@DenRakEiw @tunczzz Thanks for the supported-device runtime checks. Could you also run the separate 73-case underestimation-mask/capture matrix at 19e1964? It is now available through CTest, including exit-77 skip handling, and has a one-command Windows wrapper:

./scripts/run_inner_coverage_matrix.ps1 -Build <your-existing-build> -Config RelWithDebInfo

This configures the opt-in entry, builds the harness and runs inner_coverage_matrix with verbose output. Python, glslang, spirv-as, spirv-val and the Khronos validation layer are required; the script accepts -Glslang, -SpirvAs and -SpirvVal tool paths. Set VK_LAYER_PATH if needed and LEONIDA_VK_DEVICE to choose an adapter. On a build configured with LEONIDA_TEST_INNER_COVERAGE_MATRIX=ON, the direct command is:

ctest --test-dir <build> -C RelWithDebInfo -R '^inner_coverage_matrix$' -V

Please report exact head, GPU/driver, whether the matrix ran or skipped, the 73-case summaries, SPIR-V validation summary and any validation messages. A FullyCoveredEXT runtime test pass alone does not execute this suite. Missing underestimation or validation prerequisites should now show Skipped, not Passed. Local RX 5700 XT results: full matrix passes, 157 valid modules, zero core/synchronization validation messages. The suite contains only hand-authored synthetic fixtures.

@thehollowedone

Copy link
Copy Markdown

Tested 19e1964cc47f245845213f457c01ede189f6583a on merge base 3faac557 with an RTX 3080 Ti, driver 621.35, Windows 11 x64 build 26300, MSVC 19.44.35230, Windows SDK 10.0.26100.0, Vulkan SDK 1.4.363.0, and CPython 3.12.8.

The published standalone opt-in inner_coverage_matrix CTest passed in 36.29 s. All 73 comparisons executed (8 initial, 22 serial/batch, 27 regressions, 6 reuse, 4 pure GS, 2 capture, 4 helper guards), plus the synthetic controls. All 157 modules passed spirv-val. Zero skips and zero Vulkan validation or performance messages with core and synchronization validation active.

Both 1x and 4x capture returned VS=3, GS=1, PS=69. The replay-twice control returned VS=6, GS=2 and different geometry. Synthetic fixtures only. AI-assisted.

@CryingLaughing

Copy link
Copy Markdown
Contributor

Exact-head inner_coverage_matrix at 19e1964cc47f245845213f457c01ede189f6583a, Windows 11 build 26200, MSVC 19.44 Release and Khronos validation 1.4.357.

  • RTX 4080, NVIDIA 621.01 — Passed in 32.71 s. All 73 comparisons ran (8 initial, 22 serial/batch, 27 regressions, 6 reuse, 4 pure GS, 2 capture/replay, 4 helper guards), plus the negative controls. All 157 generated modules passed spirv-val. Core and synchronization validation were active with zero validation messages. Both 1× and 4× capture reported VS=3, GS=1, PS=69.
  • Intel UHD 770, 32.0.101.7088 — Skipped. The requested unsupported-device recheck reached the harness and reported primitiveUnderestimation=0. CTest recorded Skipped via exit 77, with no final matrix PASS. Core and sync validation initialized. The log shows loader diagnostics for overlay layers and no probe validation errors.

Synthetic fixtures only. AI-assisted with Codex.

@Koro4e

Koro4e commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 19e1964 on RTX 3060, driver 617.14, Windows 11, MSVC 14.44 RelWithDebInfo: pass

  • ctest -C RelWithDebInfo -R "inner_coverage|conservative|occlusion|predicated|predicate": 15/15 passed, 0 failed (inner_coverage_mask_layout, both conservative WARP tiers, inner_coverage_oracle, d3d12_inner_coverage_guards, d3d12_inner_coverage_native, d3d12_conservative_tier3, tier3_reference, predicated_copy pair, both binary occlusion tests, conservative_raster).
  • Native path on this GPU: d3d12_inner_coverage_native ran 48 native-only scenarios (inner positives/negatives, 1x/4x, scissor variants, Tier 3 ABI fullyCoveredFragmentShaderInputVariable=1); d3d12_conservative_tier3 ran its 48 Vulkan/native paired scenarios; the SV_InnerCoverage reference scene checked 1166 conservative fragments / 812 inner pixels with 0 false positives; conservative_raster also covered the 24 WARP pairs and Vulkan 4x MSAA.
  • Freshness: merge-base is current main 3faac55 (the PR includes it), merge-tree shows no conflicts. The PR's own tests/test_inner_coverage_runner.py passes 7/7 when run directly.

AI-assisted.

ItsNotRexed added a commit that referenced this pull request Nov 23, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	docs/d3d12_vulkan.md
@tunczzz

tunczzz commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested 19e1964c (merge base 3faac557) on Windows 11 10.0.26300 with an NVIDIA GeForce RTX 5070 Ti (Blackwell, subgroup 32..32), driver 616.56. Result: pass.

  • Runtime built from this head: MSVC 19.44 (BuildTools 2022), Ninja, RelWithDebInfo, -DLEONIDA_VULKAN_HEADERS_FETCH=ON (no Vulkan SDK; the loader comes from the NVIDIA driver). glslangValidator and llvm-mc 21 came from WSL Ubuntu. Build exit 0.
  • ctest -j 3: 184/184 passed.
  • scripts/run_gpu_tests.py --build <this build>: 170/217 passed, 47 skipped, 0 failed.
  • Rerun at the new head (my earlier pass was on an older head). New here, all PASS: d3d12_conservative_tier2, d3d12_conservative_tier3, d3d12_conservative_tier3_reference, d3d12_inner_coverage_guards, d3d12_inner_coverage_native, inner_coverage_mask_layout and inner_coverage_oracle.
  • Every other test gives the same result as on main 3faac557 (ctest 177/177, GPU 170/217).
  • As on main, run_gpu_tests.py records cs_fmt_d16_xyz twice and skips cs_tbuffer_store. That's main's runner bug (fixed by run_gpu_tests: record cs_tbuffer_store's result; fail a run that records a test twice #4784), not this PR.

Not run: other GPUs/vendors, Linux, the Vulkan validation layer (not installed). No game files.

AI-assisted (Claude Code).

@73N1X

73N1X commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Resolved the merge conflict in ebbd553 by merging main 561b65a. The sole conflict was the CMake Vulkan-tools block: kept both our InnerCoverage harness/optional matrix registration and main's vk_ps_sweep entry. No scope expansion.

Validation after merging: affected runtime executables and vk_ps_sweep build; focused CTest 8 passed and one expected FullyCoveredEXT skip on RX 5700 XT; the 73-comparison matrix plus negative controls passes with core + synchronization validation and 157 valid modules. Seven runner CPU checks and registration/docs/diff checks also pass. #3451 is now merged, so the description no longer lists it as an outstanding prerequisite. Previous independent GPU results remain attributed to their exact tested heads.

@thehollowedone

Copy link
Copy Markdown

Windows FullyCoveredEXT recheck on ebbd5530 with 561b65a8. RTX 3080 Ti / 621.35, Windows 11, MSVC 19.44.35230, Vulkan SDK 1.4.363.0.

The focused d3d12_inner_coverage_native and d3d12_conservative_tier3 CTests both executed and passed. The adapter exposed fullyCoveredFragmentShaderInputVariable and the runtime reported Tier 3. All 48 paired Vulkan and native D3D12 frames matched byte for byte on the same adapter, with 5,468 fully covered pixels on each backend. Core and synchronization validation reported zero messages.

This checks the inherited Tier 3 path in the rebased tree, where the RX 5700 XT run skipped. The scratch fixture ran the positive native and paired cases with the exact runtime and shader code. AI-assisted.

@cynbun

cynbun commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

TEST-934: tested ebbd5530 on RTX 5080, NVIDIA 615.78.08, Linux (native, plus the Windows build under Wine 11.20; not native Windows): pass. The 73-comparison inner_coverage_matrix ran in full with core + synchronization validation and produced zero messages.

Capabilities (my own vkGetPhysicalDeviceProperties2 probe, Vulkan 1.4.351): VK_EXT_conservative_rasterization and VK_EXT_post_depth_coverage present, subPixelPrecisionBits=8, primitiveOverestimationSize=0.001953125, maxExtraPrimitiveOverestimationSize=0.75 (granularity 0.25), primitiveUnderestimation=1, conservativePointAndLineRasterization=1, degenerateTrianglesRasterized=1, degenerateLinesRasterized=1, fullyCoveredFragmentShaderInputVariable=1, conservativeRasterizationPostDepthCoverage=1.

Setup: head ebbd5530; merge base is current origin/main 561b65a8. The native build used GCC 16.2.1 with -DLEONIDA_VULKAN_HEADERS_FETCH=ON -DLEONIDA_REQUIRE_VULKAN=ON -DLEONIDA_TEST_INNER_COVERAGE_MATRIX=ON. The Windows build used clang-cl 23.1.3 with xwin. Tools: glslang 16.6.0, SPIRV-Tools v2026.4, Python 3.14.8. Validation layer: Khronos Vulkan-ValidationLayers nightly b321c028 (API 1.4.369), loaded with VK_LAYER_PATH and with VK_LOADER_LAYERS_DISABLE=~implicit~. Tests ran serially (-j1).

Native Linux, the tests this PR adds

  • inner_coverage_mask_layout: passed.
  • inner_coverage_matrix: passed in 30.1 s, with nothing skipped. Every comparison ran: 8 initial, 22 serial/batch, 27 regressions, 6 reuse, 4 pure GS, 2 capture and 4 helper guards. coverage.run asserted PROBE validation enabled and PROBE sync validation enabled on each harness call, and there were 0 PROBE_VALIDATION messages. SPIR-V validation: 157 generated modules passed.
    • Negative controls behaved as expected. Collapsed primitive mask: 1 and 2 pixels. Dirty/no-clear: 26/26/23/23/23/23 pixels. Stale prior batch: 3 pixels. Shared-ID: 3 in each of the 4 cases. Side-effecting GS: reference 1 vs two-pass 2.
    • Counters: capture-once at 1x and 4x gave VS=3, GS=1, PS=69, and the replay-twice control gave VS=6, GS=2 with changed geometry. Scratch reuse effects were 39, 65 and 104 for 2, 3 and 5 batches. Overlap effects were 69 throughout.
    • The unguarded derivative/discard cases (deriv_h0_*) report reference effects = 26 on this driver, not the 52 seen on the RX 5700 XT. The guarded cases also report 26. So the documented baseline anomaly doesn't appear on this NVIDIA GPU.
  • Validation controls:
    • Without the layer on the path, the matrix reports PROBE validation unavailable and ctest marks it Skipped (exit 77), not Passed.
    • With VK_KHRONOS_VALIDATION_VALIDATE_BEST_PRACTICES=1 added, the harness catches 10 PROBE_VALIDATION best-practices messages and the matrix fails. So the message path is live and the zero-message pass above means something.
  • On origin/main 561b65a8 (same configure flags), ctest -N -R inner_coverage lists 0 tests: neither new test exists there.
  • Full native ctest with LEONIDA_VK_VALIDATION=1:
    • head: 61 passed, 1 skipped (shader_library_corpus), 1 failed (vk_queue).
    • main: 60 passed, 1 skipped, 1 failed (vk_queue).
    • vk_queue fails the same way on both. It reports 10 synchronization-validation WRITE_AFTER_WRITE messages on back-to-back vkCmdCopyBuffer submits on one queue. That has nothing to do with this PR. conservative_raster passes on both.

Under Wine 11.20 (Windows build), coverage/raster subset (-R 'conserv|inner_coverage|coverage|msaa|occlusion|predicat')

  • head: 12 passed, 7 skipped, 0 failed out of 19. main: 11 passed, 7 skipped, 0 failed out of 18. The extra test on head is inner_coverage_mask_layout, which passes.
  • Every test that also exists on main gives the same result on both.
  • Passed: inner_coverage_oracle, conservative_raster, d3d12_msaa_draw, the three vk_*occlusion* tests, vk_predicated_copy, vk_predicate_capture, predicated_copy, replay_write_immediate_predication and replay_query_predication.
  • Skipped: d3d12_conservative_raster, _tier2, _tier3, _tier3_reference, d3d12_inner_coverage_guards, d3d12_inner_coverage_native and d3d12_predicated_copy. They exit 77 by design (hostwine::host_is_wine()) because their reference would be Wine's vkd3d, not Microsoft's D3D12 runtime, and WARP isn't real under Wine. The paired Vulkan/native D3D12 Tier 3 scenarios therefore didn't run here; this run doesn't add D3D12-side Tier 3 evidence.
  • Side note: --guards-only doesn't use the host device, but the Wine check comes before it in main(), so the guard test skips under Wine too.
  • Validation under Wine:
    • The Windows-side layer can't be used here. Wine's built-in vulkan-1.dll ("Wine Vulkan Loader") enumerates no layers from VK_LAYER_PATH or VK_ADD_LAYER_PATH: the harness reports PROBE validation unavailable with the Khronos nightly Windows layer.
    • Instead I injected the Linux layer into winevulkan's host instance (VK_INSTANCE_LAYERS, with sync validation on). VK_LOADER_DEBUG confirmed the insertion, and vk_queue_test.exe showed the same WAW hazard there, so the messages do surface.
    • In the subset, the only messages were 6 × VUID-vkCreateDevice-ppEnabledExtensionNames-01387, one per Vulkan-device test. They come from Wine's own host vkCreateDevice, which enables VK_EXT_external_memory_dma_buf without VK_KHR_external_memory_fd. main shows the identical 6, and there were no others.

No device-loss or out-of-bounds runs. Synthetic fixtures only, no game files.

AI-assisted (Claude Code).

@TheAirborneCoder

Copy link
Copy Markdown
Contributor

CI note on ebbd553: run 45169051820 is red only in the macOS job's "GPU tests on MoltenVK" step (Apple Paravirtual device): cs_fmt_int_narrow times out after 120 s and cs_w32_permlane_fi returns wrong values. Build and "Runtime tests on MoltenVK" pass. This PR changes neither the translator nor those compute tests (only the inner_coverage tests and CMake registrations), and the cs_fmt_int_narrow MoltenVK timeout is already being looked at in the #5903 follow-up, so this looks unrelated to the PR; I could not find a finished main run of that job to confirm. Read-only CI triage, no GPU run. AI-assisted (Claude Code).

@thehollowedone

Copy link
Copy Markdown

Native Windows run of the optional inner_coverage_matrix on ebbd5530 with 561b65a8. Windows 11 x64, RTX 3080 Ti / 621.35, MSVC 19.44, Windows SDK 10.0.26100, Vulkan SDK 1.4.363.0, glslang 16.6.0, SPIRV-Tools 2026.4, CPython 3.12.8.

The registered standalone CTest ran the published matrix unchanged and passed 1/1 in 32.22 seconds with no skip. All 73 comparisons passed, all negative controls detected their expected differences, and all 157 generated SPIR-V modules validated. Vulkan core and synchronization validation reported zero diagnostics. This is the optional matrix run, separate from the earlier Tier 3 check on this adapter. Synthetic inputs only. AI-assisted.

@sh1shu1

sh1shu1 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested ebbd553 on NVIDIA RTX 4070 SUPER (driver 616.92), Windows 11 26200, MSVC 14.44, Vulkan SDK 1.4.363, RelWithDebInfo: pass, no regression against main 561b65a.

  • ctest: 244/248 passed; d3d12_indirect_dispatch_count, d3d12_indirect_rt, dxgi_device, dxgi_swapchain fails on main 561b65a too (not from this PR), same 11 skips as main 561b65a
  • run_gpu_tests (LEONIDA_VK_VALIDATION=1): 183/232 native, 214/232 with LEONIDA_W64_EMULATE=1, 2 failed; ms_wave_info_s3 fails on main 561b65a too
    AI-assisted (Claude Code, Claude Fable 5.1).

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.