reprend #2067: feat(runtime): add feature size validation helpers and unit test suite for d3d12_feature_compat #2734

Closed
github-bot wants to merge 4 commits from github-bot/gh-2734 into main AGit
Owner

@⁠OreoFR on GitHub · 2026-11-30 13:39 UTC · original
OreoFR:carry/pr-2067 → main · +184 −0 · 3 files · 4 commits · closed without merging

Carries #2067 by @⁠abnalstlll-byte, because it conflicts with main after #2566 and the reminder to merge main (#2067) got no answer within the delay of the carry rule. If the author comes back, this carry is dropped.

Item: RT-D3D12-FEATURE-COMPAT-COVERAGE-CARRY (claimed in #2570; original item RT-D3D12-FEATURE-COMPAT-COVERAGE).

What this branch is

  • The author's branch at 507b96ef2, unchanged (no rebase, author commits kept).
  • A merge of main (from the carry preparation of 29/11) that resolves the conflict, then a merge of current main f9f3ec4c6 (no new conflict). Both merge commits carry Co-authored-by the author.
  • Nothing else: the change itself is the original PR's; see #2067 for what and why, and the verifications posted there.

What conflicted and how it was resolved

  • runtime/CMakeLists.txt: the PR's d3d12_feature_compat_test and main's d3d12_pipeline_checkpoint_test both kept.

Tests

  • On this branch (main f9f3ec4c6 merged), Windows 11, Python 3.12, no GPU used: C++ only: left to this PR's CI (no local C++ build in this run).
  • Earlier merge: ctest 502 tests, d3d12_feature_compat passes; red: the test does not compile on main (is_compat_feature absent).
  • python -I scripts/check_no_game_data.py on every file this PR changes: clean.
  • CI on this PR covers the rest (C++ build and ctest, the full translator suite).

Depends on: none.

Needs an independent verifier before merge (red/green on another machine), as for any carry.

AI-assisted (Claude Code, oreofr-agent).

🤖 Generated with Claude Code

**@⁠OreoFR** on GitHub · 2026-11-30 13:39 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2734) `OreoFR:carry/pr-2067` → `main` · +184 −0 · 3 files · 4 commits · closed without merging Carries #2067 by @⁠abnalstlll-byte, because it conflicts with `main` after #2566 and the reminder to merge `main` (https://git.gtahub.st/github/ubiquitarianism--leonida/pulls/2067) got no answer within the delay of the carry rule. If the author comes back, this carry is dropped. Item: `RT-D3D12-FEATURE-COMPAT-COVERAGE-CARRY` (claimed in https://git.gtahub.st/github/ubiquitarianism--leonida/issues/2570; original item `RT-D3D12-FEATURE-COMPAT-COVERAGE`). ### What this branch is - The author's branch at `507b96ef2`, unchanged (no rebase, author commits kept). - A merge of `main` (from the carry preparation of 29/11) that resolves the conflict, then a merge of current `main` `f9f3ec4c6` (no new conflict). Both merge commits carry `Co-authored-by` the author. - Nothing else: the change itself is the original PR's; see #2067 for what and why, and the verifications posted there. ### What conflicted and how it was resolved - `runtime/CMakeLists.txt`: the PR's `d3d12_feature_compat_test` and `main`'s `d3d12_pipeline_checkpoint_test` both kept. ### Tests - On this branch (`main` `f9f3ec4c6` merged), Windows 11, Python 3.12, no GPU used: C++ only: left to this PR's CI (no local C++ build in this run). - Earlier merge: `ctest` 502 tests, `d3d12_feature_compat` passes; red: the test does not compile on `main` (`is_compat_feature` absent). - `python -I scripts/check_no_game_data.py` on every file this PR changes: clean. - CI on this PR covers the rest (C++ build and `ctest`, the full translator suite). Depends on: none. **Needs an independent verifier before merge** (red/green on another machine), as for any carry. AI-assisted (Claude Code, oreofr-agent). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add helper functions is_compat_feature, compat_feature_data_size, is_valid_compat_feature_size, and compat_feature_name to runtime/shims/d3d12_feature_compat.h for validating SDK-newer D3D12 feature query payloads. Add a comprehensive unit test suite in runtime/test/d3d12_feature_compat_test.cpp and register it in runtime/CMakeLists.txt.

Claimed in #1608: RT-D3D12-FEATURE-COMPAT-COVERAGE.

AI-assisted (Claude Code)
CMakeLists: d3d12_feature_compat_test (PR) and d3d12_pipeline_checkpoint_test (main) both kept.

Co-authored-by: abnalstlll-byte <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Current main after #2566; no new conflicts on top of the earlier carry merge.

Co-authored-by: abnalstlll-byte <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 13:40:43 +00:00
Author
Owner

@⁠KelboLive on GitHub · 2026-11-30 14:36 UTC · original

Independent check on Windows (not the author), at 2b1440da6.

  • Configured the branch's runtime and built d3d12_feature_compat_test (MSVC 14.52.37025, Windows SDK 10.0.26100).
  • Ran it: d3d12_feature_compat: all ABI constants, struct geometry, validation and naming tests passed (exit 0).

One review note: the four new helpers have no call site outside d3d12_feature_compat.h and this test (grep over runtime/shims, runtime/src and runtime/test). If they are preparation for a follow-up, saying so in the PR would help; otherwise is_valid_compat_feature_size is the piece that could be wired into the CheckFeatureSupport paths that currently take a size. With no consumer, this adds API but no behaviour.

The branch is based on f9f3ec4c6 and still merges cleanly; a rebase on current main would keep history linear.

Machine: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, MSVC 14.52.37025.

AI-assisted: yes (opencode).

**@⁠KelboLive** on GitHub · 2026-11-30 14:36 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2734#issuecomment-7281639288) Independent check on Windows (not the author), at `2b1440da6`. - Configured the branch's `runtime` and built `d3d12_feature_compat_test` (MSVC 14.52.37025, Windows SDK 10.0.26100). - Ran it: `d3d12_feature_compat: all ABI constants, struct geometry, validation and naming tests passed` (exit 0). One review note: the four new helpers have no call site outside `d3d12_feature_compat.h` and this test (`grep` over `runtime/shims`, `runtime/src` and `runtime/test`). If they are preparation for a follow-up, saying so in the PR would help; otherwise `is_valid_compat_feature_size` is the piece that could be wired into the `CheckFeatureSupport` paths that currently take a size. With no consumer, this adds API but no behaviour. The branch is based on `f9f3ec4c6` and still merges cleanly; a rebase on current `main` would keep history linear. Machine: Ryzen 9 7950X3D, Windows 11 Pro 10.0.26200.9711, MSVC 14.52.37025. AI-assisted: yes (opencode).
Author
Owner

@⁠KelboLive on GitHub · 2026-11-30 17:44 UTC · original

Re-checked the updated head c149d8080 (the merge is a CI re-run, no code change):

  • Built d3d12_feature_compat_test and ran it: all ABI constants, struct geometry, validation and naming tests passed (exit 0).
  • The review note still applies: grep over runtime/shims, runtime/src and runtime/test finds is_compat_feature/compat_feature_data_size/is_valid_compat_feature_size/compat_feature_name only in d3d12_feature_compat.h and its test — no production call site yet.

AI-assisted: yes (opencode).

**@⁠KelboLive** on GitHub · 2026-11-30 17:44 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2734#issuecomment-7286774420) Re-checked the updated head `c149d8080` (the merge is a CI re-run, no code change): - Built `d3d12_feature_compat_test` and ran it: **all ABI constants, struct geometry, validation and naming tests passed** (exit 0). - The review note still applies: `grep` over `runtime/shims`, `runtime/src` and `runtime/test` finds `is_compat_feature`/`compat_feature_data_size`/`is_valid_compat_feature_size`/`compat_feature_name` only in `d3d12_feature_compat.h` and its test — no production call site yet. AI-assisted: yes (opencode).
Author
Owner

@⁠KelboLive on GitHub · 2026-12-01 16:02 UTC · original · reviewed

Verified at c149d8080 on Windows (MSVC 19.44, SDK 10.0.26100.0 / D3D12_SDK_VERSION 616): d3d12_feature_compat_test builds and passes, and the same target builds and passes on a local merge of current main (0ff8a532, merge-tree clean). Because the SDK is 616, the >= 611/>= 613 blocks in the header are active, so the 8-byte and 16-byte payload sizes are checked against the real d3d12.h structs rather than against the shim's own constants — that is the right way to pin an ABI test.

The helpers are correct, but two things should be said or fixed before this lands:

  1. They have no consumer, and their logic already exists inline in CheckFeatureSupport (d3d12_vulkan_device.cpp:29091, :29099, and :29568-29574 via write_supported_feature). Fine as an explicit first step toward one mapping — but say so in the body, or wire is_valid_compat_feature_size in, otherwise the feature→payload map now lives in two places and can drift.
  2. A test gap on the guard that matters: deleting expected != 0 && in d3d12_feature_compat.h:111 does not fail the suite (I ran it). Add CHECK(!is_valid_compat_feature_size(D3D12_FEATURE_D3D12_OPTIONS, 0)); — the case the != 0 exists for. (The >= mutation is caught at line 75, so the size half is covered.)

The body's "red on main" note is vacuous, since the test file is new — it cannot compile there by construction, which is not the same as a failing test.

Carry mechanics are fine and this is not duplicated on main; #2067 should be closed on merge, since it is the same three files. A rebase would keep history linear but is not required — only runtime/CMakeLists.txt moved.

**@⁠KelboLive** on GitHub · 2026-12-01 16:02 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2734#pullrequestreview-6135004714) · **reviewed** Verified at `c149d8080` on Windows (MSVC 19.44, SDK 10.0.26100.0 / `D3D12_SDK_VERSION 616`): `d3d12_feature_compat_test` builds and passes, and the same target builds and passes on a local merge of current `main` (`0ff8a532`, `merge-tree` clean). Because the SDK is 616, the `>= 611`/`>= 613` blocks in the header are active, so the 8-byte and 16-byte payload sizes are checked against the real `d3d12.h` structs rather than against the shim's own constants — that is the right way to pin an ABI test. The helpers are correct, but two things should be said or fixed before this lands: 1. **They have no consumer**, and their logic already exists inline in `CheckFeatureSupport` (`d3d12_vulkan_device.cpp:29091`, `:29099`, and `:29568-29574` via `write_supported_feature`). Fine as an explicit first step toward one mapping — but say so in the body, or wire `is_valid_compat_feature_size` in, otherwise the feature→payload map now lives in two places and can drift. 2. **A test gap on the guard that matters**: deleting `expected != 0 &&` in `d3d12_feature_compat.h:111` does **not** fail the suite (I ran it). Add `CHECK(!is_valid_compat_feature_size(D3D12_FEATURE_D3D12_OPTIONS, 0));` — the case the `!= 0` exists for. (The `>=` mutation is caught at line 75, so the size half is covered.) The body's "red on main" note is vacuous, since the test file is new — it cannot compile there by construction, which is not the same as a failing test. Carry mechanics are fine and this is not duplicated on main; **#2067 should be closed on merge**, since it is the same three files. A rebase would keep history linear but is not required — only `runtime/CMakeLists.txt` moved.
Author
Owner

@⁠aslan2142 on GitHub · 2026-12-01 16:46 UTC · original

Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

**@⁠aslan2142** on GitHub · 2026-12-01 16:46 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/2734#issuecomment-7318213521) Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.
github-bot closed this pull request 2026-12-01 16:56:31 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/ubiquitarianism--leonida!2734
No description provided.