Skip to content

perf(agc): remember shader validation failures and reject repeats without throwing - #192

Merged
boykopovar merged 1 commit into
boykopovar:mainfrom
MichonGoddijn231849:perf/validation-failure-memo
Sep 30, 2026
Merged

boykopovar merged 1 commit into
boykopovar:mainfrom
MichonGoddijn231849:perf/validation-failure-memo

Conversation

@MichonGoddijn231849

Copy link
Copy Markdown
Contributor

What

A draw whose shaders fail ValidateShaders is skipped by throwing, and the unwinding costs about 1–1.5 ms per throw on this toolchain (LibcUnwind decodes the frames). A title that keeps issuing the same rejected combination pays that for every draw.

  • CachedFragmentOutputs already remembers the fragment outputs of a validated configuration, keyed by the stages' variants, push constant placement, vertex attribute shapes and the state fields validation checks. Its key is now built by ValidationKey.
  • A configuration that fails validation is remembered under the same key, with its message; the first failure still throws as before.
  • The driver asks KnownDrawRejection before a (non-recipe) draw. A known failure returns DrawVerdict::Rejected with the same message, so the skip is reported as before, without an exception.
  • The memo is bounded like the success memo (cleared past 1024 entries), and APS5_NO_VALIDATE_CACHE=1 still disables both.

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.

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 in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes. Written with Claude (Anthropic) under my direction; I reviewed and tested it.

🤖 Generated with Claude Code

…hout throwing

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@boykopovar
boykopovar merged commit a67b644 into boykopovar:main Sep 30, 2026
3 checks passed
oneandonlydean added a commit to oneandonlydean/AnyPS5 that referenced this pull request Oct 1, 2026
…opovar#208 test layout, our merged PRs) into astrobot

Conflicts resolved:
- Driver.cpp: upstream split it into Execution/src/Driver/*; astrobot's
  driver changes are ported into the split files (flip throttle
  APS5_MAX_QUEUED_FLIPS, dispatch tolerance, NoteProgram, metadata-pass
  switch and DB HTILE blits, depth state in the draw register key, HTILE
  fill clears, wait outcome counters, opt-in deferred EOP interrupts).
  boykopovar#192's KnownDrawRejection is taken.
- Our merged PRs take upstream's reviewed versions: boykopovar#124 shader fusion,
  boykopovar#128 videoout open param, boykopovar#132 CB metadata passes, boykopovar#138 EOP events,
  boykopovar#176 GE_INDX_OFFSET, boykopovar#136/boykopovar#137 pixel inputs and NoPerspective by I/J
  pair, boykopovar#133 mesh tests. boykopovar#142's interpolation validation is upstream's.
- Depth: astrobot's DepthTarget model stays; upstream's DepthSurface
  module is dropped again, boykopovar#188's 16-bit depth-bit reads are kept on top.
- Videodec2: upstream's ffmpeg-core version (boykopovar#42 rework); 3rdparty/FFmpeg
  stays for libSceAvPlayer only.
- Tests follow boykopovar#208's layout (add_test_executable, build/tests); the
  AvPlayer, GDS and wave tests are defined the same way.
- Shader disk cache format 5 and request serialization version 7 cover
  both sides' fields.
- Duplicates the auto-merge produced (state decoders, RequestInputInfo,
  structurizer helpers, image offsets, opcode enum, tests) are removed.
@MichonGoddijn231849
MichonGoddijn231849 deleted the perf/validation-failure-memo branch October 9, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants