Commit Graph

4 Commits

Author SHA1 Message Date
b17397f0dd tests: derive every test's scratch folder from test_temp_dir::temp_dir, not GetTempPath (TEST-TEMPDIR-STRIPPED-ENV)
With TMP, TEMP and USERPROFILE all unset, GetTempPathW returns C:\Windows\, and the throwing create_directories/copy_file/ofstream on C:\Windows\leonida_* aborts with 0xc0000409 before the test body runs. runtime/test/test_temp_dir.h grows one entry, testfiles::temp_dir(): LEONIDA_TEST_DIR when set, the current directory when the temp environment is stripped (Windows), else the standard temp resolution. Fifty-two test files and the tiny_game fixture that called GetTempPathA/W or temp_directory_path directly now use it; d3d12_queue_handover_test.cpp also checks the _sopen_s result in capture_stderr instead of silently returning empty stderr. One runtime source function needed the same fallback because tests exercise it: tls_host_clone_dir in runtime/src/pe_loader.cpp (the loader_tls tests). Rebased onto current main after its D3D-448 additions to d3d12_mesh_test.cpp (3-way; the mesh test keeps both). Verification on a Windows VM: stripped environment - the previously crashing d3d12 tests exit 77 (no usable Vulkan device) instead of aborting, file_system_test runs all 505 checks and loader_test all 95 with zero failures; normal environment - identical outcomes; LEONIDA_TEST_DIR honored under a fully stripped environment (the scratch folder observed mid-run inside it, cleaned up after the pass). The finding is whoalin1's (coordination issue #14, 02:37:44Z).

AI-assisted.
2026-11-28 19:01:06 +00:00
4263427b46 Record the library entry of each compute pipeline in the order log
Add an E line after the P line of a compute pipeline.
It holds the FNV-1a 64 hash of the library entry name, not the name.
A reader from before E lines skips them, counted as lines not read.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-26 13:13:04 +01:00
dcdcade326 runtime: address review of the pipeline order recorder
- open(): when the existing log does not end with a newline (a process killed
  mid-line), write one first so the next session line is not glued to the cut
  line and its records are not filed under the previous run.
- Fix the hook comments (vulkan_replay.h, d3d12_vulkan_device.cpp, docs,
  README): the hook never blocks and allocates nothing, but the readiness
  callbacks take a non-blocking try_lock on the first request of a pipeline
  and of a variant.
- Close the order log after the exit pipeline cache write, not before.
- Remove the unused Slot::written and Slot::build_written.
- Tests: cut file then new session, flush stops at an unpublished slot,
  unknown session version rejected. Trailing whitespace fixed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-26 00:07:37 +01:00
40e94ebb20 runtime: pipeline order recorder and replay request hook (RT-PIPELINE-PREWARM-ORDER, phase 1)
pipeline_order.h: a passive recorder of the first request of each pipeline and
variant, with its text file format (checksummed lines, truncated or damaged
lines skipped on read) and a lock-free, allocation-free hot path with a writer
thread of its own. ComputePipeline and GraphicsPipeline get a `requested`
callback, called where a submission is prepared, also for handles that exist
already. Nothing uses either yet; the device wiring is the next commit.

Tests (CPU only): pipeline_order_test (first request only, variants, order,
round trip, truncation at every byte, damaged lines, sessions, full record,
bounded file, unwritable file, 8 threads, no allocation, counts line) and
replay_pipeline_order_hook_test (ready, lazy, skipped, unbound variant).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-25 23:47:38 +01:00