test(agc): flush shader cache writes before removing test files #1986

Merged
kali113 merged 1 commit from upstream-pr/1986 into main 2026-10-09 21:42:40 +00:00
kali113 commented 2026-10-09 03:43:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kali113 on 2026-10-09T03:43:03Z.


What

agc_shader_disk_cache queues asynchronous cache writes, then removes its temporary directory without waiting for those writes. Flush the writer before removal, and fail explicitly when filesystem cleanup reports an error.

The patch is two added lines in one test file, directly on main d70b8998. No code-size optimization, store-kernel partitioning, TLS grouping or other prerequisite commits remain. Production shader semantics and cache policy are unchanged.

The Windows reproduction completed all verification phases but hung during filesystem cleanup on execution 164; GDB placed the main thread in CreateFileW through libstdc++. The same two-line correction passed 1,000 consecutive Windows Release executions (stress validation; original reproduction). Those earlier diagnostic branches had a different baseline; they establish the investigated cleanup issue, not validation of the new head or every possible filesystem stall.

Checked cache-related PRs including #1523 and #590; neither supplies this final test-cleanup synchronization. The competing #2001 infrastructure-removal proposal is not a dependency.

Tested

Exact source head 7dc3a067: independent validation passes on native GitHub Linux and Windows runners, Release / GCC, including full default builds, all-library packaging and three executions of agc_shader_disk_cache with a 30-second limit. Both platforms execute the test; no capability skip. These are fork validation jobs, not collaborator-dispatched upstream checks. Unrelated tests from the full suite were not run in this validation.

Conventions and git diff --check pass. No console or title testing is claimed for this test-only correction.

Checklist

  • Based on main snapshot d70b8998; no other open PR implements this change
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stubs added
  • No notes, investigation files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes, OpenAI Codex
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4795696018 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1986). Originally posted by [kali113](https://github.com/kali113) on 2026-10-09T03:43:03Z. --- ### What `agc_shader_disk_cache` queues asynchronous cache writes, then removes its temporary directory without waiting for those writes. Flush the writer before removal, and fail explicitly when filesystem cleanup reports an error. The patch is **two added lines in one test file**, directly on `main` `d70b8998`. No code-size optimization, store-kernel partitioning, TLS grouping or other prerequisite commits remain. Production shader semantics and cache policy are unchanged. The Windows reproduction completed all verification phases but hung during filesystem cleanup on execution 164; GDB placed the main thread in `CreateFileW` through libstdc++. The same two-line correction passed **1,000 consecutive Windows Release executions** ([stress validation](https://github.com/kali113/AnyPS5/actions/runs/37870421453); [original reproduction](https://github.com/kali113/AnyPS5/actions/runs/37846790695)). Those earlier diagnostic branches had a different baseline; they establish the investigated cleanup issue, not validation of the new head or every possible filesystem stall. Checked cache-related PRs including #1523 and #590; neither supplies this final test-cleanup synchronization. The competing #2001 infrastructure-removal proposal is not a dependency. ### Tested Exact source head `7dc3a067`: [independent validation](https://github.com/kali113/AnyPS5/actions/runs/37925995362) passes on native GitHub Linux and Windows runners, Release / GCC, including full default builds, all-library packaging and three executions of `agc_shader_disk_cache` with a 30-second limit. Both platforms execute the test; no capability skip. These are fork validation jobs, not collaborator-dispatched upstream checks. Unrelated tests from the full suite were not run in this validation. Conventions and `git diff --check` pass. No console or title testing is claimed for this test-only correction. ### Checklist - [x] Based on `main` snapshot `d70b8998`; no other open PR implements this change - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes, OpenAI Codex
MarcZX10 commented 2026-10-09 03:59:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T03:59:19Z.

Review: APPROVED


Reviewed the full diff and current head. ShaderDiskCache::Flush() waits until the queued jobs are empty and no write is active, so the test directory is not removed while the cache worker may still be writing. The cleanup now also reports filesystem errors instead of silently passing. Linux, Windows, Conventions, and changes checks are green; the author also reports a 1,000-run Windows stress validation.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5465562023 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1986#pullrequestreview-5465562023). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-09T03:59:19Z. **Review:** APPROVED --- Reviewed the full diff and current head. `ShaderDiskCache::Flush()` waits until the queued jobs are empty and no write is active, so the test directory is not removed while the cache worker may still be writing. The cleanup now also reports filesystem errors instead of silently passing. Linux, Windows, Conventions, and changes checks are green; the author also reports a 1,000-run Windows stress validation.
copilot-pull-request-reviewer[bot] commented 2026-10-09 04:17:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-10-09T04:17:46Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5465650520 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1986#pullrequestreview-5465650520). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-10-09T04:17:46Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
popcoder565 commented 2026-10-09 15:23:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:23:40Z.


Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head 7dc3a067, merged onto main d70b8998 in one build with 33 other AGC/shader PRs that had no Windows run.

  • This PR's tests pass: agc_shader_disk_cache. None of them reported skipping a case.
  • Full ctest in that build: 514 of 515. The one failure is #2257's new test, which is registered without the Windows PATH setup.

No title was run.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6083894044 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1986#issuecomment-6083894044). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T15:23:40Z. --- Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head `7dc3a067`, merged onto `main` d70b8998 in one build with 33 other AGC/shader PRs that had no Windows run. - This PR's tests pass: `agc_shader_disk_cache`. None of them reported skipping a case. - Full ctest in that build: 514 of 515. The one failure is #2257's new test, which is registered without the Windows `PATH` setup. No title was run. _🤖 Addressed by [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!1986
No description provided.