feat(runtime): add policy parse helpers and unit test suite for d3d12_indirect_draw_policy #2074

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

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


Summary

  • Added pure parse helpers to
    untime/shims/d3d12_indirect_draw_policy.h:
    • \parse_indirect_draws_disabled(value, len): evaluates boolean policy directly from string buffer without modifying process environment or static cache.
    • \is_indirect_draws_raw_obsolete(value, len): detects obsolete raw mode string.
  • Authored portable unit test suite in
    untime/test/d3d12_indirect_draw_policy_test.cpp\ verifying parse logic across edge cases (case-sensitivity, length bounds, null inputs, obsolete tags) and default environment behaviour.
  • Registered \d3d12_indirect_draw_policy_test\ in
    untime/CMakeLists.txt\ under \if(WIN32).

Verification

  • Claimed in #1608: \RT-INDIRECT-DRAW-POLICY-COVERAGE\ (claim comment: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172469043).
  • Compiled and executed \d3d12_indirect_draw_policy_test\ with MinGW C++20: all checks passed.
  • Verified test registration: \python -I tests/test_ctest_registration.py\ (5/5 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:5497879043 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2074). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-25T19:36:04Z. --- ### Summary - Added pure parse helpers to \ untime/shims/d3d12_indirect_draw_policy.h\: - \parse_indirect_draws_disabled(value, len)\: evaluates boolean policy directly from string buffer without modifying process environment or static cache. - \is_indirect_draws_raw_obsolete(value, len)\: detects obsolete raw mode string. - Authored portable unit test suite in \ untime/test/d3d12_indirect_draw_policy_test.cpp\ verifying parse logic across edge cases (case-sensitivity, length bounds, null inputs, obsolete tags) and default environment behaviour. - Registered \d3d12_indirect_draw_policy_test\ in \ untime/CMakeLists.txt\ under \if(WIN32)\. ### Verification - Claimed in #1608: \RT-INDIRECT-DRAW-POLICY-COVERAGE\ (claim comment: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172469043). - Compiled and executed \d3d12_indirect_draw_policy_test\ with MinGW C++20: all checks passed. - Verified test registration: \python -I tests/test_ctest_registration.py\ (5/5 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:40 +00:00 (Migrated from github.com)

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


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:7243458676 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2074#issuecomment-7243458676). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T18:00:40Z. --- 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).
MoonEyes commented 2026-11-29 12:54:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-29T12:54:44Z.


Closing: main already tests this policy in a fresh process (d3d12_com_test.cpp --indirect-policy, lines 41-48: unset, off, uppercase, and process caching). The refactor only splits two 3-character comparisons out of code that works, so it adds no coverage. Thanks for the effort!

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7256152026 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2074#issuecomment-7256152026). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-29T12:54:44Z. --- Closing: main already tests this policy in a fresh process (d3d12_com_test.cpp --indirect-policy, lines 41-48: unset, off, uppercase, and process caching). The refactor only splits two 3-character comparisons out of code that works, so it adds no coverage. Thanks for the effort!

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!2074
No description provided.