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

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

📋 Pull Request Information

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

Base: main ← Head: feat/rt-pipeline-checkpoint-guards-and-tests


📝 Commits (1)

  • 5a418b5 feat(runtime): add input validation guards and unit test suite for d3d12_pipeline_checkpoint

📊 Changes

3 files changed (+166 additions, -1 deletions)

View changed files

📝 runtime/CMakeLists.txt (+6 -0)
📝 runtime/shims/d3d12_pipeline_checkpoint.h (+11 -1)
➕ runtime/test/d3d12_pipeline_checkpoint_test.cpp (+149 -0)

📄 Description

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)


🔄 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/2081 **Author:** [@abnalstlll-byte](https://github.com/abnalstlll-byte) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/rt-pipeline-checkpoint-guards-and-tests` --- ### 📝 Commits (1) - [`5a418b5`](https://github.com/ubiquitarianism/leonida/commit/5a418b50cdac78cc80c49626621efc45abde3780) feat(runtime): add input validation guards and unit test suite for d3d12_pipeline_checkpoint ### 📊 Changes **3 files changed** (+166 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `runtime/CMakeLists.txt` (+6 -0) 📝 `runtime/shims/d3d12_pipeline_checkpoint.h` (+11 -1) ➕ `runtime/test/d3d12_pipeline_checkpoint_test.cpp` (+149 -0) </details> ### 📄 Description ### 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) --- <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#2088
No description provided.