Commit Graph
147 Commits
Author SHA1 Message Date
Adrià 9c6d153dec Merge pull request #10419 from iamthehimansh/split/macos-build
build: compile FileStream, error categories, thread priority and two tests on macOS
2026-10-25 22:35:29 +01:00
Adrià 5d48c6233e Merge pull request #9401 from tibzejoker/perf/grow-pipeline-store
perf(agc): size the pipeline store to the title's working set
2026-10-25 19:07:59 +01:00
Adrià 7b7d445bfb Merge pull request #9439 from milescoviello/feat/trace-calls-file
feat(libc): write the called imports to APS5_TRACE_CALLS_FILE every 10 seconds
2026-10-25 17:42:50 +01:00
fogydes df18d83072 docs: add the spawn role variable and shorten the waitpid debt 2026-10-25 13:57:18 +01:00
Himansh Raj 3a1d61c5d4 Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-25 17:00:47 +05:30
Adrià 75227c7cdc Merge pull request #10423 from meh7an/perf/shader-masked-result-memo
perf(shader): reuse a memoized result by patching its copied words
2026-10-25 11:50:14 +01:00
Adrià 35e65fb861 Merge pull request #9252 from MarcZX10/docs/trace-label-packet-coverage
docs(agc): describe label trace packet coverage
2026-10-25 11:34:48 +01:00
Himansh Raj 6809dc7b80 Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-25 16:00:54 +05:30
Adrià 654cb0bb4c Merge pull request #9965 from ebarr24/ws/ppsa01746-step1
perf(agc): pipeline queue-0 DMA_DATA by default
2026-10-25 11:06:26 +01:00
Himansh Raj 97d91fa983 Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-25 14:10:23 +05:30
Adrià 6f58a046b1 Merge pull request #9599 from shahulmubeen-a/feat/agc-skip-shader-file
feat(agc): skip the draws and dispatches of the programs listed in a file, re-read while the title runs
2026-10-25 09:32:14 +01:00
Himansh Raj a01a4354db Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-25 12:31:32 +05:30
milescovielloandClaude Opus 5.5 a938dd8f20 feat(libc): write the called imports to APS5_TRACE_CALLS_FILE every 10 seconds
A traced run that ends without a crash or an abort never reports which
imports it called. With APS5_TRACE_CALLS_FILE set, the first traced import
starts a thread that rewrites that file every 10 seconds with every import
called so far, most called first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 00:15:39 +00:00
thibautandClaude Opus 5.5 ad047899bb perf(agc): grow the pipeline store from 1024 up to 4096 entries
The graphics pipeline store kept a fixed 1024 entries and the pipeline journal replayed at most
1024 records, and a replayed pipeline that found the store full was dropped. A title whose
working set is larger rebuilt the rest at the draw on every run, and evicted pipelines it kept
using were rebuilt again and again.

The bound now starts at 1024 and doubles up to 4096: a journal replay that does not fit grows it
instead of dropping the pipeline, and so does eviction churn (a ghost list of evicted keys, checked
every bound/32 evictions: more than half of them came back). It never shrinks during a run;
APS5_PIPELINE_STORE_ENTRIES still fixes it. The journal loads its last 4096 records by default
(APS5_PIPELINE_JOURNAL_ENTRIES). Resident pipelines are bounded by count, not bytes.

agc_driver_recorder_tests --benchmark-pipeline-store-memory [count] (opt-in, not registered)
builds count graphics pipelines with one fragment module each through CachedPipeline and prints
process private bytes and VK_EXT_memory_budget heap usage before and after: with the triangle
shaders about 59 KiB host and no device memory per pipeline on an RTX 4090, 100 KiB host and
8 KiB device-local on a UHD 770.

Tests: agc_pipeline_store_growth (fails on main), agc_pipeline_store_fixed_bound,
agc_pipeline_store_replay_growth (replays on one thread: the mock Vulkan is not thread-safe).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017SNUYRd7sRKZrMYpquAsnU
2026-10-25 02:02:41 +02:00
Shahul Mubeen AandClaude Opus 5.5 e75a166184 fix(agc): ignore skip-file tokens that are not whole hexadecimal addresses
strtoull took the valid hex prefix of a token and ignored the rest, so a
malformed token such as "123garbage" selected program 0x123, and an
overflowing token was not detected. A token now has to be a whole 64-bit
hex number (with an optional 0x prefix); any other token is reported and
ignored. The test adds a list with a malformed token whose prefix is the
first program's address and an overflowing token.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 23:14:58 +05:30
Shahul Mubeen AandClaude Opus 5.5 49b68167fa feat(agc): skip the draws and dispatches of the programs listed in a file
APS5_SKIP_SHADER_FILE names a file of hex program addresses (whitespace
separated, # starts a comment). Draws and dispatches that use a listed
program are dropped as with APS5_SKIP_SHADER. The file is re-read within
500 ms of a change, so passes can be switched off and on while the title
runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 23:14:57 +05:30
Tharun Balaji ea65a95401 feat(agc): trace shader failures through draw submission batches 2026-10-24 18:58:54 +02:00
Adrià f863d6af28 Merge pull request #7814 from ionut27001/fix/videoout-output-status-resolution
fix(libSceVideoOut): report the output resolution from the host display as measured on a PS5
2026-10-24 16:58:48 +02:00
Adrià ce9471f191 Merge pull request #9836 from 00xDisaster/fix/pipeline-journal-no-workflows
fix(agc): keep the pipeline journal's newest pipelines when it is full
2026-10-24 14:13:50 +02:00
ionut27001 983a81d91b fix(libSceVideoOut): add APS5_OUTPUT_RESOLUTION to override the reported output resolution 2026-10-24 12:42:14 +02:00
Adrià 60465afd3a Merge pull request #7307 from Zenodeon/agc-submit-progress-pr
feat(agc): add opt-in bounded submission progress
2026-10-24 11:59:57 +02:00
Adrià 68ed66980e Merge pull request #9036 from dantdmdarealguy/docs/environment-row-corrections
docs(environment): correct the crash indirect memory, log timestamp, language and label flush rows
2026-10-24 11:34:14 +02:00
Adrià 6d025ee2cd Merge pull request #8657 from xXPBSXx/docs/environment-aps5-no-wgi
docs(env): document APS5_NO_WGI
2026-10-24 11:27:28 +02:00
Dean 2250381689 Merge pull request #9934 from Celegans12/feat/agc-nv-diagnostics-config
feat(agc): enable VK_NV_device_diagnostics_config behind APS5_NV_DIAGNOSTICS
2026-10-24 21:08:33 +13:00
Adrià FranchandClaude Sonnet 5.5 954bed036d docs(agc): order the progress switch row and keep the debt list contiguous
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-24 09:02:30 +02:00
Zenodeon dd72d997c7 docs(agc): register the submission progress switch 2026-10-24 09:02:30 +02:00
Himansh Raj b017223970 Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-24 12:11:02 +05:30
Adrià cd0591c8f4 Merge pull request #7705 from AnthonyClemens/fix/agc-bound-depth-plane-copies
fix(agc): bound the sampled depth-plane copies
2026-10-24 08:36:48 +02:00
Himansh Raj 93fd73a56d Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-24 10:40:23 +05:30
Adrià 7966e590ef Merge pull request #8740 from Sam-mon7/feat/frame-replay
feat(agc): capture frames at the driver boundary and replay them offline
2026-10-24 07:03:41 +02:00
Himansh Raj fc93f11b4b Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-24 09:30:22 +05:30
billybobpicklioandClaude Opus 5.5 1f11b8ab9b fix(agc): bound the sampled depth-plane copies
A depth plane copy (a depth surface sampled as several slices, an integer view or a cube) was
kept until the device went away, with a staging buffer of its own size, and a staging buffer it
outgrew was never freed. Every depth surface a scene ever sampled this way held its copy, so
device memory grew with each new scene (0.4-1.2 GB in RE2 after a level load).

The copies now share their image's ownership with the views they hand out, the recorder keeps
the image and the staging buffer until the recorded copy has run, and past
APS5_DEPTH_PLANE_COPY_MIB (default 256; 0 keeps every copy) the least recently used copies
leave the cache. A copy made again refills from the surface and guest memory as a new one does.
agc_driver_depth_plane_sampling_evicting runs the plane sampling cases with a 1 MiB budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 04:24:03 +02:00
Felipebmaitan b7640ae5a3 fix(job-manager): merge main and reconcile scheduler debt 2026-10-23 22:48:31 -03:00
Himansh Raj e836e519a8 Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-24 06:20:19 +05:30
Adrià 11d6efa06c Merge pull request #9305 from tibzejoker/fix/bit-exact-reciprocal
feat(shader): bit-exact RDNA v_rcp_f32 behind APS5_EXACT_RCP
2026-10-24 02:47:43 +02:00
Ethan Barr ce6865fc0d perf(agc): pipeline queue-0 DMA_DATA by default
Queue-0 DMA_DATA packets drained the draw pipeline unless APS5_PIPELINE_DMA was set, so the packet worker waited on the committer at every small immediate store. Kena PPSA01746 issues 17-23k DMA_DATA packets per 10 s and 11329 of its 20134 pipeline drains per 10 s are opcode 0x50. enqueueDmaPacket now queues DMA_DATA stores and fills unconditionally, and keepsDrawPipeline keeps the pipeline for a copy or fill whose source and destination miss every queued write. The APS5_PIPELINE_DMA switch and its documentation are removed and the tests run the default path.
2026-10-24 02:35:37 +02:00
dantdmdarealguy 80bcb4bd24 docs(environment): correct the crash indirect memory, log timestamp, language and label flush rows 2026-10-23 19:14:56 -05:00
SamandClaude Opus 5.5 dbe034fdf8 fix(agc): end a captured frame once per EOP flip
An EOP flip reservation also ended a frame, and so did the submission
whose EOP release carries the reserved token, so a title flipping with
EOP releases counted each displayed frame twice: a capture of N frames
stopped after about N/2 and could start between the reservation and
the submission that flips. The reservation is now only recorded; a
frame ends at a CPU flip or at a submission that flips.

agc_driver_frame_capture_eop reserves and submits six EOP flips with
APS5_FRAME_CAPTURE_FRAMES=3 and checks that the capture starts after
the first flipping submission and holds three frames of one reservation
and one submission each.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:09:44 +02:00
SamandClaude Opus 5.5 95d2a76583 feat(agc): capture frames at the driver boundary and replay them offline
APS5_FRAME_CAPTURE=<dir> makes the AGC driver record a few frames of a
title: the shader registrations and ABI resolutions, video output and
EOP flip reservations it made since it started, a snapshot of every
readable guest allocation (the title image included) taken at a frame
boundary once the driver is idle, and for the next frames each
submission, flip and suspend point with the thread that made it, its
serial progress and the guest pages the write tracker saw the CPU write
before it. At the end it stores the presented display buffers as
reference images. APS5_FRAME_CAPTURE_AT_FLIP, _TRIGGER and _FRAMES pick
the frames.

agc_frame_replay maps the captured memory at its addresses and replays
the calls of each captured thread on a thread of its own, in captured
order, through the current build of the driver with no title running.
It paces GPU work to the in-flight depth the title had, releases GPU
waits that the title's CPU threads released without calling the driver
(AgcDriverAwaitedWaits), and reports frame times, released waits and
how closely the replayed display buffers match the references.

Tests: agc_frame_capture (file format) and agc_driver_frame_replay
(two captured frames of CPU writes and DMA copies replayed and
compared). Docs: BUILD.md, ENVIRONMENT.md and the libSceAgcDriver debt
file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:09:44 +02:00
Himansh Raj cb87c6028f Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-24 05:19:58 +05:30
Dean 0884fab4b1 Merge pull request #8995 from dantdmdarealguy/fix/env-reference-environmentnumber
fix(tools): read the EnvironmentNumber environment reader in env_reference
2026-10-24 12:40:38 +13:00
Mehran 54d7c780a5 perf(shader): reuse a memoized result by patching its copied words 2026-10-24 01:17:14 +03:00
thibautandClaude Opus 5.5 3654f15bfa feat(shader): bit-exact RDNA v_rcp_f32 behind APS5_EXACT_RCP
v_rcp_f32 and v_rcp_iflag_f32 lower to the driver's 1/x, whose low bits
differ from the console's on NVIDIA and Intel. With APS5_EXACT_RCP set,
normal inputs with normal results take the RDNA reciprocal datapath
instead: a cubic over 32 segments of the mantissa in 32-bit integer
arithmetic, the linear term rounded to nearest even, and a 2,761-entry
table of one-ULP corrections, looked up only when the dropped bits fall
next to the rounding cut (6.25 % of inputs). This reproduces all 2^23
mantissas of an RDNA2 (gfx1031) sweep. Other inputs keep 1/x.

It is off by default: the tables add about 13k SPIR-V words to each
shader that uses it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017EjjFU1FjMR11oWDYs8UMo
2026-10-23 22:50:09 +02:00
Himansh Raj d6433a6006 build: compile the shared libc headers, thread priority and three tests on macOS
A macOS build of main failed 49 objects. Most included
libc/include/FileStream.hpp, whose global-namespace ::feof_unlocked and
::ferror_unlocked do not exist there (they are macros in the macOS SDK).
On macOS:

- FileStream.hpp calls feof_unlocked and ferror_unlocked unqualified.
- ExportMacros.hpp adds the leading underscore Mach-O gives C symbols to
  both names in APS5_EXPORT, so the .set alias resolves.
- ThreadPriority.cpp has no rtkit or RLIMIT_RTTIME; "high" asks for the
  user-interactive QoS class and "rt" for a Mach time-constraint policy
  (period 1 ms, computation 0.5 ms), documented in ENVIRONMENT.md.
- Formatting.cpp maps the SysV va_list builtins to va_list, and
  GuestContentSearch.cpp and GuestNpWebApi2.cpp include
  <initializer_list>.

With these, 16 objects still fail on macOS; each is in a file changed by
an open macOS PR. Linux and Windows compile the same code as before.
2026-10-24 00:50:46 +05:30
ntamas94 f90fe33e8d Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into fix/agc-copied-writer-label-drain
# Conflicts:
#	core/libs/prx/libSceAgcDriver/CMakeLists.txt
2026-10-23 16:16:43 +02:00
Felipebmaitan fc8f03594d fix(job-manager): spin only for pending work in host clock time 2026-10-23 10:34:59 -03:00
Felipebmaitan 14c582fb75 fix(tests): distinguish the manual JobManager reference runner 2026-10-23 10:28:00 -03:00
Felipebmaitan fd459d96f7 fix(libSceJobManager): honor worker spin and persistence policies 2026-10-23 10:28:00 -03:00
Adrià f2a4fb1e6d Merge pull request #8336 from saarthakpant/perf/agc-discrete-written-shadow
perf(agc): stage written buffer elements up to 8 MiB on discrete GPUs
2026-10-23 14:19:33 +02:00
Adrià ef337cd082 Merge pull request #8104 from Celegans12/perf/agc-address-build-staging
perf(agc): stage the written elements of address-based compute builds in device memory
2026-10-23 13:28:29 +02:00