perf(agc): draw cache keys on the user words a program reads, memoizes failures, serves data-only hits #291
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/291"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-01T21:58:07Z.
What
Split out of #167. Three changes to the draw cache:
APS5_DRAW_KEY_ALL_USER_WORDS=1mixes all 32.APS5_DRAW_FAILURE_RETRY_MS(500 ms).APS5_NO_DRAW_DATA_HITS=1disables them, andAPS5_VERIFY_DRAW_DATA_HITS=1compiles and compares instead.A new key of a shape replaces that shape's previous entry instead of filling the cache with keys that never repeat. The new entry starts without the previous entry's variants: those were compiled under other user words, and a variant validates only the memory it captured, not the user words that pointed there.
That inheritance caused the regression found on #167 (Dreaming Sarah's menu text invisible until clicked). Each text draw took over the previous one's variants and drew with its data.
Tested
Windows 11 Pro, AMD Ryzen 5 7600, NVIDIA GeForce RTX 5080 (driver 32.0.16.1074), 32 GB DDR5-5600, MinGW-w64 GCC 15.2.0.
APS5_NO_DRAW_SRT_ENTRIES=1), the text shows.ctest: all tests pass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T07:09:57Z.
@boykopovar this one needs your call before Michon rebases it: should a draw that failed be skipped on a timer? This PR keeps a failed draw rejected until the memory it read changes or 500 ms pass (
APS5_DRAW_FAILURE_RETRY_MS). Failures in the decode step are stored without any memory runs (recordDrawFailure(failureKey, error, memoryFailures, {}, {})inDraw.cpp), so for those only the clock ends the skip, and which draws get skipped then depends on timing. That is a project policy question more than a plain bug.It also bundles two other mechanisms (draw keys on the user words a program reads, and data-only hits), and #422, merged today, already memoizes source failures one layer down. My read: I'd take the user-word keys and the data-only hits as separate PRs, and a failure memo only if it ends on memory changes alone. It needs a rebase after #290 and #422 either way.
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-04T08:13:37Z.
That split makes sense to me, and I'd rather not have a time-based skip in the driver either. My plan, unless @boykopovar prefers otherwise:
I'll close this one when the split PRs are up.
Imported from boykopovar/AnyPS5. Originally posted by MichonGoddijn231849 on 2026-10-04T09:11:35Z.
Split as discussed: #493 keys draws on the user words each stage reads, and #494 (on top of it) adds the data-only hits. The time-based failure memo is dropped: #422 already memoizes source failures, and a skip that ends on a clock isn't exact. Both are rebased on current
mainand no longer stack on #290.Pull request closed