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

Closed
leonida/mandy
OreoFR wants to merge 0 commits from carry/pr-2067 into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

OreoFR commented 2026-11-30 13:39:13 +00:00

Carries #2067 by @abnalstlll-byte, because it conflicts with main after #2566 and the reminder to merge main (https://github.com/ProjectLeonida/mandy/pull/2067#issuecomment-7243459536) 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://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7280119323; 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

Carries #2067 by @abnalstlll-byte, because it conflicts with `main` after #2566 and the reminder to merge `main` (https://github.com/ProjectLeonida/mandy/pull/2067#issuecomment-7243459536) 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://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7280119323; 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)
KelboLive commented 2026-11-30 14:36:22 +00:00

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).

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 commented 2026-11-30 17:44:29 +00:00

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).

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 reviewed 2026-12-01 16:02:20 +00:00
KelboLive left a comment
No description provided.
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.
aslan2142 commented 2026-12-01 16:46:42 +00:00

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.

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.
Sign in to join this conversation.
No description provided.