feat(runtime): add input validation guards and unit test suite for d3d12_pipeline_checkpoint #2081

Merged
abnalstlll-byte merged 1 commit from upstream-pr/2081 into main 2026-11-28 08:06:26 +00:00
abnalstlll-byte commented 2026-11-25 19:42:26 +00:00 (Migrated from github.com)

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


Summary

  • Added input validation guards and helper accessors in
    untime/shims/d3d12_pipeline_checkpoint.h:
    • \CacheStagingFile: gracefully rejects empty destination and 0-byte mappings. Added \is_valid()\ and \ emp_path()\ accessors.
    • \publish(): validates non-null data and non-empty destination prior to unmapping and moving.
    • Added pure helper \is_direct_session_cache_enabled(val, len)\ to inspect environment strings.
  • Added comprehensive unit test suite in
    untime/test/d3d12_pipeline_checkpoint_test.cpp:
    • Tests \CompileActivity\ RAII counter under single-threaded and multithreaded concurrency.
    • Tests \is_direct_session_cache_enabled\ across edge cases.
    • Tests \cache_temp_suffix\ across valid and malformed suffixes.
    • Tests \CacheStagingFile\ invalid arguments, publish workflow, and RAII abort cleanup.
    • Tests \clean_stale_cache_files\ edge cases.
  • Registered \d3d12_pipeline_checkpoint_test\ in
    untime/CMakeLists.txt\ under \if(WIN32).

Verification

  • Claimed in #1608: \RT-PIPELINE-CHECKPOINT-GUARDS-AND-TESTS\ (claim comment: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172605451).
  • Compiled and executed \d3d12_pipeline_checkpoint_test\ with MinGW C++20: all test categories 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:5497971189 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2081). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-25T19:42:26Z. --- ### Summary - Added input validation guards and helper accessors in \ untime/shims/d3d12_pipeline_checkpoint.h\: - \CacheStagingFile\: gracefully rejects empty destination and 0-byte mappings. Added \is_valid()\ and \ emp_path()\ accessors. - \publish()\: validates non-null data and non-empty destination prior to unmapping and moving. - Added pure helper \is_direct_session_cache_enabled(val, len)\ to inspect environment strings. - Added comprehensive unit test suite in \ untime/test/d3d12_pipeline_checkpoint_test.cpp\: - Tests \CompileActivity\ RAII counter under single-threaded and multithreaded concurrency. - Tests \is_direct_session_cache_enabled\ across edge cases. - Tests \cache_temp_suffix\ across valid and malformed suffixes. - Tests \CacheStagingFile\ invalid arguments, publish workflow, and RAII abort cleanup. - Tests \clean_stale_cache_files\ edge cases. - Registered \d3d12_pipeline_checkpoint_test\ in \ untime/CMakeLists.txt\ under \if(WIN32)\. ### Verification - Claimed in #1608: \RT-PIPELINE-CHECKPOINT-GUARDS-AND-TESTS\ (claim comment: https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7172605451). - Compiled and executed \d3d12_pipeline_checkpoint_test\ with MinGW C++20: all test categories 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)
DadaCap commented 2026-11-28 08:06:29 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DadaCap on 2026-11-28T08:06:29Z.


Merged into main (merge commit 493867366), approved by DadaCap (maintainer). Thanks!

Checked before merging: Its new test d3d12_pipeline_checkpoint passes with main merged in. The merge was pinned to the head commit that was tested (5a418b50c).

AI-assisted (Claude Code), posted for DadaCap.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7236367675 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2081#issuecomment-7236367675). Originally posted by [DadaCap](https://github.com/DadaCap) on 2026-11-28T08:06:29Z. --- Merged into `main` (merge commit 493867366), approved by DadaCap (maintainer). Thanks! Checked before merging: Its new test `d3d12_pipeline_checkpoint` passes with main merged in. The merge was pinned to the head commit that was tested (5a418b50c). _AI-assisted (Claude Code), posted for DadaCap._
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!2081
No description provided.