test: the play cache check compiles again with #416's, #415's and f9a2195c's save #1419

Open
TrashPanda wants to merge 1 commit from TrashPanda/Longshot:test/play-cache-save-outcome into main
Contributor

Type: test · Risk: low · Tested on: Linux, game-free checks (g++ and clang 21) · Needs: none

Why

test_pipeline_play_cache has failed on main since #416 (177d6b22). It passes on the commit before. Neither the game nor the behaviour it checks is broken: its fixture fell behind three merged changes, and clang's 20-error limit showed only the first.

  • f9a2195c (the pipeline cache written before the title) records what a forced save did in a thread-local pcache_save_outcome, typed in precompile_save.h. It updated tests/pipeline_cache_save_test.cpp but not this fixture. #416 then pulled the real pipeline_cache_save in here, and it no longer compiles.
  • #416 grew pcache_load_off(), the first function of the pcache_init cut. It now reads dev.driver_id, programs_load_at_create() and pcache_load.h. The real pipeline_cache_save also starts helper_thread_start (96e03835).
  • #415 (35465d12) gave pcache_saved_now a fake pipeline_cache_save. With #416's real one in the same fixture, the two collide.

No open PR fixes it. #1416 only lists it among main's failures.

What changed

Only tests/pipeline_play_cache_test.cpp changes. No source changes, and no case's assertions change.

  • Stand-ins for what the cut code calls: precompile_save.h and pcache_save_outcome, the same as pipeline_cache_save_test.cpp has; helper_thread_start, also copied from there; and pcache_load.h with <unistd.h>. The fake driver is not NVIDIA's own (driver_id 0) and programs load before the title (programs_load_at_create() false). So pcache_load_off reads the file unless RX_VK_PCACHE_LOAD says not to, which is what the load-* cases expect.
  • #415's fake pipeline_cache_save goes. pcache_saved_now's cases now run against the real save #416 extracted, and their RX_VK_PCACHE_LOAD=0 assertions hold against the real code.

Measurements

Nothing to measure: tests only. The check fails on main @ 544229a2 and passes here (fabeed9c).

main @ 544229a2:
pipeline_cache_save.inc:2:21: error: use of undeclared identifier 'precompile_save'
pcache_init.inc:5:77: error: use of undeclared identifier 'programs_load_at_create'
pipeline_play_cache_test.cpp:322:6: error: redefinition of 'pipeline_cache_save'
this PR @ fabeed9c:
all 21 cases passed

Flags and settings

None.

Testing

Tested:

  • The check and its neighbours test_pipeline_cache_save and test_precompile_save, on Linux with CXX=g++ and CXX=clang++ (clang 21.1.8): they pass.
  • The check against three broken copies of vk_draw.cpp, through --source: pcache_load_off always reads the file; play_files_merge merges with the file not read; pcache_init never sets pcache_no_save. Each makes it fail (load-off*, no-save, and load-off* with pcache_saved_now's case).
  • python -I -B tests/run_all.py on Linux: 604 passed, 36 failed, 81 skipped. Main @ 544229a2 on the same PC fails 38. This check now passes, and so does test_crash_record, which already passes on main when run alone. Nothing fails here that passes on main. The 36 that also fail on main are this PC's missing packages and game folders (numpy, lz4, zstandard, the Vulkan headers), the checks #1323, #1363, #1409, #1410 and #1417 fix, test_mirror_budget (a question on #637) and test_present_thread.

Not tested: Windows. The fixture keeps its _WIN32 paths, and <unistd.h> is included only outside Windows, as in vk_draw.cpp.

Must be tested: None.

Risks

What could break: nothing in the game; one test fixture changes.

Turning it off: revert the commit.

Compatibility: Nothing changes.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
**Type:** test · **Risk:** low · **Tested on:** Linux, game-free checks (g++ and clang 21) · **Needs:** none ## Why `test_pipeline_play_cache` has failed on `main` since #416 (177d6b22). It passes on the commit before. Neither the game nor the behaviour it checks is broken: its fixture fell behind three merged changes, and clang's 20-error limit showed only the first. - f9a2195c (the pipeline cache written before the title) records what a forced save did in a thread-local `pcache_save_outcome`, typed in `precompile_save.h`. It updated `tests/pipeline_cache_save_test.cpp` but not this fixture. #416 then pulled the real `pipeline_cache_save` in here, and it no longer compiles. - #416 grew `pcache_load_off()`, the first function of the `pcache_init` cut. It now reads `dev.driver_id`, `programs_load_at_create()` and `pcache_load.h`. The real `pipeline_cache_save` also starts `helper_thread_start` (96e03835). - #415 (35465d12) gave `pcache_saved_now` a fake `pipeline_cache_save`. With #416's real one in the same fixture, the two collide. No open PR fixes it. #1416 only lists it among main's failures. ## What changed Only `tests/pipeline_play_cache_test.cpp` changes. No source changes, and no case's assertions change. - Stand-ins for what the cut code calls: `precompile_save.h` and `pcache_save_outcome`, the same as `pipeline_cache_save_test.cpp` has; `helper_thread_start`, also copied from there; and `pcache_load.h` with `<unistd.h>`. The fake driver is not NVIDIA's own (`driver_id` 0) and programs load before the title (`programs_load_at_create()` false). So `pcache_load_off` reads the file unless `RX_VK_PCACHE_LOAD` says not to, which is what the `load-*` cases expect. - #415's fake `pipeline_cache_save` goes. `pcache_saved_now`'s cases now run against the real save #416 extracted, and their `RX_VK_PCACHE_LOAD=0` assertions hold against the real code. ## Measurements Nothing to measure: tests only. The check fails on `main` @ 544229a2 and passes here (fabeed9c). ``` main @ 544229a2: pipeline_cache_save.inc:2:21: error: use of undeclared identifier 'precompile_save' pcache_init.inc:5:77: error: use of undeclared identifier 'programs_load_at_create' pipeline_play_cache_test.cpp:322:6: error: redefinition of 'pipeline_cache_save' this PR @ fabeed9c: all 21 cases passed ``` ### Flags and settings None. ## Testing **Tested:** - The check and its neighbours `test_pipeline_cache_save` and `test_precompile_save`, on Linux with `CXX=g++` and `CXX=clang++` (clang 21.1.8): they pass. - The check against three broken copies of `vk_draw.cpp`, through `--source`: `pcache_load_off` always reads the file; `play_files_merge` merges with the file not read; `pcache_init` never sets `pcache_no_save`. Each makes it fail (`load-off*`, `no-save`, and `load-off*` with `pcache_saved_now`'s case). - `python -I -B tests/run_all.py` on Linux: 604 passed, 36 failed, 81 skipped. Main @ 544229a2 on the same PC fails 38. This check now passes, and so does `test_crash_record`, which already passes on main when run alone. Nothing fails here that passes on main. The 36 that also fail on main are this PC's missing packages and game folders (numpy, lz4, zstandard, the Vulkan headers), the checks #1323, #1363, #1409, #1410 and #1417 fix, `test_mirror_budget` (a question on #637) and `test_present_thread`. **Not tested:** Windows. The fixture keeps its `_WIN32` paths, and `<unistd.h>` is included only outside Windows, as in `vk_draw.cpp`. **Must be tested:** None. ## Risks **What could break:** nothing in the game; one test fixture changes. **Turning it off:** revert the commit. **Compatibility:** Nothing changes. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers.
test: the play cache check compiles again with #416's, #415's and f9a2195c's save
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
fabeed9c2b
test_pipeline_play_cache has failed on main since #416 (177d6b22). Three
merged changes each left its fixture behind:

- f9a2195c records what a forced save did in a thread-local
  pcache_save_outcome (precompile_save.h). #416 pulled the real
  pipeline_cache_save into this fixture, which declared neither.
- #416 grew pcache_load_off, the first function of the pcache_init cut:
  it now reads dev.driver_id, programs_load_at_create() and
  pcache_load.h. The real pipeline_cache_save also starts
  helper_thread_start.
- #415 had given pcache_saved_now a fake pipeline_cache_save. With #416's
  real one beside it, the two collide.

The fixture gets the stand-ins: a driver that is not NVIDIA's own and
programs loaded before the title, so the file is read unless
RX_VK_PCACHE_LOAD says not to, as the load-* cases expect. The fake save
goes, and pcache_saved_now's cases run against the real one. All 21
cases pass.

Assisted-by: Claude Opus 5.5
TrashPanda changed title from WIP: test: the play cache check compiles again with #416's, #415's and f9a2195c's save to test: the play cache check compiles again with #416's, #415's and f9a2195c's save 2026-11-17 14:02:53 +00:00
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 6s
Website / Website on Cloudflare (pull_request_target) Has been skipped
This pull request has changes conflicting with the target branch.
  • tests/pipeline_play_cache_test.cpp
Some workflows are waiting to be reviewed.
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'test/play-cache-save-outcome:TrashPanda-test/play-cache-save-outcome'
git switch 'TrashPanda-test/play-cache-save-outcome'
Sign in to join this conversation.
No reviewers
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
MagicBeanDev/Longshot!1419
No description provided.