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

Closed
abnalstlll-byte wants to merge 1 commit from upstream-pr/2067 into main
abnalstlll-byte commented 2026-11-25 19:26:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-25T19:26:50Z.


Summary

  • Added helper functions to
    untime/shims/d3d12_feature_compat.h\ for validating SDK-newer feature query payloads:
    • \is_compat_feature(feature): checks whether an enum value is one of the compatibility-defined features (\OPTIONS20, \PREDICATION, \OPTIONS21, \APPLICATION_SPECIFIC_DRIVER_STATE, \BYTECODE_BYPASS_HASH_SUPPORTED).
    • \compat_feature_data_size(feature): returns expected payload size in bytes (8, 16, 4), or 0 for unknown.
    • \is_valid_compat_feature_size(feature, size): checks if query payload buffer size matches expected requirement.
    • \compat_feature_name(feature): provides human-readable identifier strings.
  • Added comprehensive unit test suite in
    untime/test/d3d12_feature_compat_test.cpp\ verifying ABI constants, struct geometry, offsets, predicates, payload size validation, and name mappings.
  • Registered \d3d12_feature_compat_test\ in
    untime/CMakeLists.txt\ under \if(WIN32).

Verification

  • Claimed prior to work in #1608: \RT-D3D12-FEATURE-COMPAT-COVERAGE\ (claim comment: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172172238).
  • Compiled with MinGW C++20 and executed \d3d12_feature_compat_test: all test categories passed.
  • Verified test registration: \python -I tests/test_ctest_registration.py\ (5/5 passed).
  • Verified CI registration: \python -I tests/test_ci_registration.py\ (16/16 passed).
  • Line ending check: \python -I tests/test_text_write_line_endings.py\ (passed).
  • Clean-room check: \python -I scripts/check_no_game_data.py\ (passed).

AI-assisted (Claude Code)

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5497745950 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2067). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-25T19:26:50Z. --- ### Summary - Added helper functions to \ untime/shims/d3d12_feature_compat.h\ for validating SDK-newer feature query payloads: - \is_compat_feature(feature)\: checks whether an enum value is one of the compatibility-defined features (\OPTIONS20\, \PREDICATION\, \OPTIONS21\, \APPLICATION_SPECIFIC_DRIVER_STATE\, \BYTECODE_BYPASS_HASH_SUPPORTED\). - \compat_feature_data_size(feature)\: returns expected payload size in bytes (8, 16, 4), or 0 for unknown. - \is_valid_compat_feature_size(feature, size)\: checks if query payload buffer size matches expected requirement. - \compat_feature_name(feature)\: provides human-readable identifier strings. - Added comprehensive unit test suite in \ untime/test/d3d12_feature_compat_test.cpp\ verifying ABI constants, struct geometry, offsets, predicates, payload size validation, and name mappings. - Registered \d3d12_feature_compat_test\ in \ untime/CMakeLists.txt\ under \if(WIN32)\. ### Verification - Claimed prior to work in #1608: \RT-D3D12-FEATURE-COMPAT-COVERAGE\ (claim comment: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172172238). - Compiled with MinGW C++20 and executed \d3d12_feature_compat_test\: all test categories passed. - Verified test registration: \python -I tests/test_ctest_registration.py\ (5/5 passed). - Verified CI registration: \python -I tests/test_ci_registration.py\ (16/16 passed). - Line ending check: \python -I tests/test_text_write_line_endings.py\ (passed). - Clean-room check: \python -I scripts/check_no_game_data.py\ (passed). AI-assisted (Claude Code)
MoonEyes commented 2026-11-28 18:00:43 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T18:00:43Z.


Hi @abnalstlll-byte, thanks for this pull request. It currently conflicts with main (conflicting file(s): runtime/CMakeLists.txt), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7243459536 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2067#issuecomment-7243459536). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T18:00:43Z. --- Hi @abnalstlll-byte, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `runtime/CMakeLists.txt`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
OreoFR commented 2026-11-30 13:40:30 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-30T13:40:30Z.


Carried as #2734 because of the conflict with main after #2566; @abnalstlll-byte, if you come back, say so and the carry is dropped.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7280189544 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2067#issuecomment-7280189544). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-30T13:40:30Z. --- Carried as #2734 because of the conflict with main after #2566; @abnalstlll-byte, if you come back, say so and the carry is dropped.
aslan2142 commented 2026-12-01 16:41:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:41:52Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7318056239 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2067#issuecomment-7318056239). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:41:52Z. --- 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.

Pull request closed

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

Reference
ProjectLeonida/mandy!2067
No description provided.