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

Open
opened 2026-11-26 21:19:56 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2067
Author: @abnalstlll-byte
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: feat/rt-d3d12-feature-compat-coverage


📝 Commits (1)

  • 507b96e feat(runtime): add feature size validation helpers and unit test suite for d3d12_feature_compat

📊 Changes

3 files changed (+185 additions, -0 deletions)

View changed files

📝 runtime/CMakeLists.txt (+7 -0)
📝 runtime/shims/d3d12_feature_compat.h (+49 -0)
➕ runtime/test/d3d12_feature_compat_test.cpp (+129 -0)

📄 Description

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)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2067 **Author:** [@abnalstlll-byte](https://github.com/abnalstlll-byte) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/rt-d3d12-feature-compat-coverage` --- ### 📝 Commits (1) - [`507b96e`](https://github.com/ubiquitarianism/leonida/commit/507b96ef2c50f92fe4e4b7e5dd6a9b4d75256586) feat(runtime): add feature size validation helpers and unit test suite for d3d12_feature_compat ### 📊 Changes **3 files changed** (+185 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `runtime/CMakeLists.txt` (+7 -0) 📝 `runtime/shims/d3d12_feature_compat.h` (+49 -0) ➕ `runtime/test/d3d12_feature_compat_test.cpp` (+129 -0) </details> ### 📄 Description ### 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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
starred/leonida#2071
No description provided.