The CMake flag table left out the ANYPS5_REQUIRE_CPU_LEAD_TEST option and
the ANYPS5_AGC_EXECUTION_TESTS cache list that the Windows, MSYS2 and
sanitizer workflows set. Add a row for each and drop the stray comma
after "the reason" in the sanitizer workflow paragraph.
The directory limits (128 records, 256 MiB) throw CaptureLimit, which
WriteOptional catches: capture disables itself with one stderr line and
the pipeline is still created. Only the per-record 36 MiB limit throws
out of the capture, so the old sentence described both as an error.
TraceThread::Slice holds five eight-byte members (scope, stage, begin,
length and the recorder batch), so an event takes 40 bytes, not 32.
The example sizes follow: 10 MiB at the default 262,144 events, 120 MiB
at 3,145,728 and 160 MiB at the 4,194,304 maximum.
ANYPS5_BUILD_FUZZERS builds relinker_conversion_fuzzer with AddressSanitizer
and UndefinedBehaviorSanitizer in relinker-only Clang builds on Linux. The
first input byte selects the target system, --to-intel and the unused-filter
level; the rest is the executable passed to Conversion::Convert, the path the
web converter takes. tools/relinker_fuzz_seeds.py writes the relinker test
fixtures as seeds, and CTest runs a short smoke run.
The workflow and BUILD.md said ASAN_OPTIONS must end with ':' because tests append their own options with string_append. That is wrong: add_asan_test_options appends ':<options>', so ASAN_OPTIONS=detect_leaks=0 already gives detect_leaks=0:detect_stack_use_after_return=0 for the fiber test. Use detect_leaks=0 and remove the claim.
Document in BUILD.md, next to -DANYPS5_ENABLE_ASAN, what the Sanitizers workflow builds and runs, where the known failures are listed and what the job summary reports, and how to repeat a run locally: end ASAN_OPTIONS with ':' because tests append their own options, and set UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 so undefined behavior fails the test.
The recorder released its lock between recording a submission, flip or
suspend point and the driver accepting it. Another thread's delta could
then wait for the accepted work, read its blocks, and record itself
after a call whose work the driver had not accepted yet, so the replay
submitted that work before applying stale bytes over its result. The
entry points now pass the driver call to the recorder, which runs it
under the same lock right after recording the call.
agc_driver_frame_replay_concurrent submits copies from a second thread
during the capture and checks that every memory delta was read after
the submissions recorded before it had completed.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A delta read its blocks with ReadCommittedUnsynced while GPU work
accepted before the call could still write them, so a capture could
hold a block from before a DMA copy that the replay then wrote back over
the copy's result. A delta with blocks to read now waits up to 10 s for
the accepted submissions and records the serials after the wait; the
capture stops with a warning when the work does not finish. The Windows
quarantine of agc_driver_frame_replay is removed.
Fixes#10711
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The recorder took its ranges once, at the snapshot, so a title that
committed memory during the captured frames replayed submissions from
memory the capture never had. Each memory delta now adds the allocations
the registry gained since the last one as new ranges with their nonzero
64 KiB blocks, and the header counts them as late_ranges.
A submission ended a captured frame when the driver's flip count changed
while it was being submitted, and the count was global, so a submission
that overlapped another thread's flipping one ended the frame as well.
The count is now kept per thread.
agc_driver_frame_replay copies its second frame from a block committed
during the capture, and agc_driver_frame_capture_eop checks that a flip
submitted on another thread leaves this thread's count unchanged; both
fail without the fix.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Order memory deltas and video output registration before the next
recorded call, and serialize the deadlock breaker with delta application
- Capture the blocks holding shader code with each shader delta
- Reserve explicit and automatic EOP flip tokens under one lock
- Record video output unregistration so replay can close and reopen a handle
- Clear already mapped ranges before restoring the snapshot so elided zero
blocks replay as zero
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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]>
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]>
The note told Windows users to set TEMP and TMP to a directory the scanner
excludes, but since 39dd854c8 CTest sets TMPDIR, TEMP and TMP of the
relinker tests to core/relinker/test-temp in the build directory, so those
variables no longer move the executables. Name that directory instead and
add windows_bss and windows_fixed_base, which fail the same way when the
scanner blocks the executables they run.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review of #9572 found three gaps:
- PeModule.name() checked that an RVA was in some code section, then
bisected one list of every symbol, so an address in a later code
section before that section's first symbol took the last symbol of an
earlier section. Each code section now keeps its own sorted list.
- Address files keep both counters ('module offset self inclusive'):
the inclusive count is kept and subtracted by --since, and the summary
lists functions by inclusive samples as well, summed over each
function's addresses (an upper bound when a function is on one stack
more than once). The total comes from the '# N samples' line or from
the 'thread <id> samples <n>' headings of APS5_SAMPLE_THREADS, which
the loader previously misread as a stack line; --thread keeps one
thread.
- The address writers of both samplers wrote no '# module' records, so
those files skipped the size and timestamp check. Both now write them
(through the helper the collapsed-stack writer uses), and the tool
leaves a module unsymbolized when the samples have no record for it,
unless --unverified is given.
Five new cases cover a second code section, inclusive totals, --since
on an address file, thread headings with --thread, and the missing
record with and without --unverified.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Windows samplers (APS5_SAMPLE_WORKER, APS5_SAMPLE_COMMITTER and
APS5_SAMPLE_THREADS) write every frame as module+0xRVA, and BUILD.md left
naming them to the reader ("for example with nm on the .prx"). Doing that
by hand means finding each module's image base, choosing between COFF
symbols and the export table, and keeping the files cumulative totals in
mind.
tools/symbolize_samples.py reads a collapsed-stack file or the address
file, opens each module it finds in --libs as a PE32+ image, and names
every frame module!function:
- From the COFF symbol table that the MinGW-built .prx and .dll keep:
external and static symbols in code sections, at the section's RVA
plus the symbol value. Addresses outside a code section, or before the
first symbol, stay module+0xRVA.
- From the export table, prefixed with "~", for a module without
symbols, such as the runtime DLLs.
- A module whose SizeOfImage or TimeDateStamp differs from the sampler's
"# module" line is left unsymbolized, with a warning: its addresses
would name the wrong functions.
--since subtracts an earlier copy of the same file, which keeps only the
samples taken between the two copies (the files hold totals since
start-up). --out writes the named stacks for speedscope or flamegraph.pl.
--demangle uses c++filt when it is on PATH. It needs no binutils
otherwise.
test_symbolize_samples (registered with CTest) builds small PE32+ images
with COFF symbols and with an export table, and covers short, string-table
and static names, the ignored section and data symbols, addresses outside
code, the export fallback, the size and timestamp check, --since with
--out, the address-file format and rejected lines.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Name the commands that provide the compiler, CMake and Ninja on macOS
next to the existing mention of AppleClang in the relinker-only section.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Add libogg 1.3.6 and libvorbis 1.3.7 as submodules, built from source as
hidden static libraries, and implement the 31 libvorbisfile exports on top
of them. Decoder state lives in a host table keyed by the guest
OggVorbis_File, guest callbacks are trampolined, and vorbis_info is
returned in its LP64 layout.