test(agc): leave the template audit out of the lookup log test #8601

Merged
milescoviello merged 1 commit from upstream-pr/8601 into main 2026-10-21 00:03:17 +00:00
milescoviello commented 2026-10-20 18:02:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-20T18:02:49Z.


What

agc_driver_lookup_log_fits_build fails when the machine is busy:

AGC graphics: lookup log: a set over 1500 textures took the full walk with its memory unchanged after the build

The test builds a ShaderResources set over 1500 textures, then expects the first proof, with memory unchanged, to take the fast path. Revalidate turns a fast proof into a full walk once APS5_TEMPLATE_AUDIT_MS (default 1000 ms) has passed since lastFullWalk. A new object stamps lastFullWalk when it is constructed, which is before the build of its 1500 textures. When the build and the first proof together take longer than a second, the audit is due on that first proof, so the test fails even though nothing it checks went wrong.

The test now sets APS5_TEMPLATE_AUDIT_MS to 0 (no audit) unless it is already set, the way SampledCacheBudget.cpp pins it to 250. Its fast-path and full-walk checks then depend only on memory changes. The production code is unchanged.

Tested

Ubuntu 24.04 (Linux 6.8), GCC 13.3, NVIDIA RTX 4070 Ti, driver 595.99.02, on main 892a4f1328. For each case, six copies of the test ran at once, repeatedly, with ctest's environment (ANYPS5_NO_SHADER_CACHE=1 APS5_NO_PIPELINE_JOURNAL=1) and its working directory:

test source runs pass fail
main 180 0 180, all with the message above
this PR 180 180 0
this PR with APS5_TEMPLATE_AUDIT_MS=1000 set 60 0 60, the same message

The last row shows the audit is the cause: with the default interval set again, the failure returns.

  • Run alone, main's test passes 15 of 15, and two copies at once pass 20 of 20. I found this when it failed once in a ctest -R '^(agc_|shader_cache)' -j4 run of 835 tests and then passed every rerun.
  • With this PR, ctest -R '^agc_driver_lookup_log_fits_build$' passes 3 of 3.
  • tools/check_conventions.py --base upstream/main passes, and tools/pr_overlap.py finds no open PR that touches this test.

Not tested: Windows (the _putenv_s branch is the same as SampledCacheBudget.cpp's), AMD.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none (test only)
  • GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 595.99.02, Ubuntu 24.04
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4940150688 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8601). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-20T18:02:49Z. --- ### What `agc_driver_lookup_log_fits_build` fails when the machine is busy: ``` AGC graphics: lookup log: a set over 1500 textures took the full walk with its memory unchanged after the build ``` The test builds a `ShaderResources` set over 1500 textures, then expects the first proof, with memory unchanged, to take the fast path. `Revalidate` turns a fast proof into a full walk once `APS5_TEMPLATE_AUDIT_MS` (default 1000 ms) has passed since `lastFullWalk`. A new object stamps `lastFullWalk` when it is constructed, which is before the build of its 1500 textures. When the build and the first proof together take longer than a second, the audit is due on that first proof, so the test fails even though nothing it checks went wrong. The test now sets `APS5_TEMPLATE_AUDIT_MS` to 0 (no audit) unless it is already set, the way `SampledCacheBudget.cpp` pins it to 250. Its fast-path and full-walk checks then depend only on memory changes. The production code is unchanged. ### Tested Ubuntu 24.04 (Linux 6.8), GCC 13.3, NVIDIA RTX 4070 Ti, driver 595.99.02, on `main` 892a4f1328. For each case, six copies of the test ran at once, repeatedly, with ctest's environment (`ANYPS5_NO_SHADER_CACHE=1 APS5_NO_PIPELINE_JOURNAL=1`) and its working directory: | test source | runs | pass | fail | |---|---|---|---| | `main` | 180 | 0 | 180, all with the message above | | this PR | 180 | 180 | 0 | | this PR with `APS5_TEMPLATE_AUDIT_MS=1000` set | 60 | 0 | 60, the same message | The last row shows the audit is the cause: with the default interval set again, the failure returns. - Run alone, `main`'s test passes 15 of 15, and two copies at once pass 20 of 20. I found this when it failed once in a `ctest -R '^(agc_|shader_cache)' -j4` run of 835 tests and then passed every rerun. - With this PR, `ctest -R '^agc_driver_lookup_log_fits_build$'` passes 3 of 3. - `tools/check_conventions.py --base upstream/main` passes, and `tools/pr_overlap.py` finds no open PR that touches this test. Not tested: Windows (the `_putenv_s` branch is the same as `SampledCacheBudget.cpp`'s), AMD. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none (test only) - [x] GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 595.99.02, Ubuntu 24.04 - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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
boykopovar/AnyPS5!8601
No description provided.