Commit Graph

44 Commits

Author SHA1 Message Date
Adrià 6d2f279863
Merge pull request #4607 from yunusshaikh7/feat/tracy-profiler
feat(agc): report performance timer scopes to Tracy with APS5_ENABLE_TRACY
2026-10-12 23:09:21 +02:00
Adrià 84659e16d0
Merge pull request #4632 from AlxcBTW/feat/trace-gpu-track
feat(agc): add the GPU, GPU mutex waits and shader preparation to the trace
2026-10-12 22:39:23 +02:00
Adrià 44ab0c39ee
Merge pull request #3886 from PrintOrb/fix/videoout-high-frame-rate
fix(videoout): support permitted high-frame-rate output for Quake II
2026-10-12 22:23:31 +02:00
AlxcBTW eb8a7255d2 feat(agc): add the GPU, GPU mutex waits and shader preparation to the trace
The trace gets a gpu track: one slice per recorder batch from its timestamp
pair, and with APS5_PROFILE_GPU=1 one per command class range under the
[gputime] class names. The GPU clock is mapped onto the CPU clock from
calibrated timestamps (VK_KHR_calibrated_timestamps or the EXT version,
enabled only when a trace switch is set) taken when the window opens and
when it closes. A traced thread's wait for the GPU mutex becomes a
GpuMutex.wait.<site> slice, and the shader preparation threads are traced
with smaller buffers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 22:13:44 +02:00
Yunus Shaikh 28ca53dc89 feat(agc): report performance timer scopes to Tracy with APS5_ENABLE_TRACY
APS5_ENABLE_TRACY=ON builds the Tracy 0.14.1 client from the new
3rdparty/tracy submodule as a shared library next to the patched
libraries. Every PerformanceTimer scope of libSceAgcDriver and
libSceVideoOut becomes a Tracy zone, each presented flip ends a frame,
and the queue workers and the presenter name their threads. The client
listens only on localhost and records only while a profiler is
connected; sampling, system tracing, call stacks, code transfer and its
crash handler are off. Without the option nothing of Tracy is compiled.

On MinGW the client is built without thread_local destructors and with
TRACY_DELAYED_INIT, because emulated TLS frees thread_local objects
before their destructors run; a thread's event producer then stays
alive until the process exits instead of being destroyed on freed
memory.
2026-10-12 12:55:40 -07:00
Adrià Franch 6116fc75e1 docs(agc): say the last present of a trace window has no folded sample
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-12 21:42:59 +02:00
AlxcBTW 5668e0d0e7 feat(agc): record a present window as a Chrome trace and a summary line
APS5_TRACE_FRAMES=<start>:<count> (or APS5_TRACE_SECONDS=<start>:<length>)
records every PerformanceTimer scope and stage of the queue workers and the
presenter inside the window as complete events, named after their frame
timing keys, into a preallocated buffer per thread. Slices under 20 us are
counted per thread instead of written; a full buffer stops that thread and
sets trace_dropped. When the window closes, a ProfileOutput writer thread
writes aps5-trace-<commit>-<pid>.json.gz and appends one line to
aps5-summary.jsonl. Without either switch a PerformanceTimer costs one more
predictable branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 21:42:59 +02:00
AlxcBTW 428963d3b3 feat(agc): write the worker sampler's stacks as collapsed stacks
APS5_SAMPLE_WORKER=<file> now also writes <file stem>.collapsed.txt: one
"frame;...;frame count" line per distinct stack of queue worker 0, root
first, frames as module+0xRVA, which speedscope.app and flamegraph.pl
open. Walks go up to 64 frames, and nothing allocates while the worker is
suspended.

The libraries are built with -fno-asynchronous-unwind-tables, so most of
their functions have no .pdata entry, only a DWARF record in .ehfram, and a
walk ended at the first such frame. The worker's walk now steps those
frames through their record, with the CIE/FDE decoding and the call frame
instructions of libc's unwinder, which move from Unwind.cpp into its
header unchanged. A module is indexed after the worker resumes, the first
time a walk meets it, and every register the step restores is read inside
the worker's stack. The process sampler (APS5_SAMPLE_THREADS) keeps its 12
frames through .pdata.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 21:23:11 +02:00
PrintOrb 5c19601a12 fix(videoout): require bundled SDL XRandR support on Linux 2026-10-11 17:36:12 -05:00
Adrià a93947040c
Merge pull request #3836 from nyavana/docs/libs-build-testing-refresh-20261011
docs(build): clarify when explicit libs target is required
2026-10-12 00:09:13 +02:00
Adrià 06664a44cd
Merge pull request #3717 from jweidenh/codex/nvidia-pipeline-replay
feat(agc): capture and replay compute pipeline compilation
2026-10-11 23:54:52 +02:00
Adrià 4989809b13
Merge pull request #3705 from MarcZX100/fix/asan-guest-arena-window-3634
feat(build): support Linux AddressSanitizer builds
2026-10-11 23:53:19 +02:00
jweidenh 3740c233bc fix(agc): accept core Vulkan capabilities during compute replay 2026-10-11 16:34:26 -04:00
jweidenh a4ae6d7e31 fix(agc): capture larger compute modules and binding flags 2026-10-11 16:14:44 -04:00
jweidenh decbac9bb4 fix(agc): link capture tests with the Windows exception runtime 2026-10-11 16:09:48 -04:00
jweidenh 8fbd0eecc1 feat(agc): capture and replay compute pipeline compilation 2026-10-11 16:09:48 -04:00
nyavana 42062da564 docs(build): clarify when explicit libs target is required 2026-10-11 10:28:32 -07:00
MarcZX100 e56a727375 feat(build): support Linux AddressSanitizer builds 2026-10-11 15:40:36 +00:00
marshmll 3d83999350 fix(build): require an SDL audio backend on Linux
The bundled SDL builds its PipeWire, PulseAudio and ALSA drivers only
when their development files are found, and otherwise keeps just the
silent dummy and disk drivers without an error. The Linux CI and
release jobs install none of them, so the v0.1.1 Linux libraries
(libSceAudioOut, libSceAgcDriver, libfmod) contain no audible driver.

Fail configuration on Linux when SDL found none of the three, install
the Debian development packages in the Linux build and release jobs,
and list the packages in the build instructions.
2026-10-11 10:34:29 -03:00
husari.orozco ce6edc5a00 build: reject an SDL2 without HIDAPI and fall back to shared SPIRV-Tools
A system SDL2 that does not define SDL_JOYSTICK_HIDAPI (sdl2-compat over
SDL3 ships no such macro, and neither does a build with the driver
disabled) fails pad_sdl and makes the disk audio driver open the port
with a different channel count, so ANYPS5_USE_SYSTEM_DEPS=ON now rejects
it with a named error, like the VK_KHR_maintenance8 check. Ubuntu's real
SDL2 defines the macro through its SDL_config.h indirection and is
unaffected.

SPIRV-Tools only exports SPIRV-Tools-static when built with
SPIRV_TOOLS_BUILD_STATIC=ON; distributions that ship it shared expose
SPIRV-Tools instead, so a shared target is aliased to the static name.
2026-10-11 10:18:23 +02:00
husari.orozco 96ad950914 build: add ANYPS5_USE_SYSTEM_DEPS option
Resolve SDL2, freetype, Vulkan-Headers, SPIRV-Headers, glslang and
SPIRV-Tools from the system instead of the bundled submodules when the
option is ON. It is OFF by default, so the bundled build is unchanged.

Every package is required: a missing one, or Vulkan-Headers older than
1.4.310 (the agc driver uses VK_KHR_maintenance8), fails the configure
with an error and nothing falls back to the submodule. The system
packages are exposed under the same target names the bundled path uses,
so the rest of the CMake is untouched.

SDL2 is linked from the system as a shared library because the prx
libraries are shared objects and distribution static SDL2 is usually not
PIC. ffmpeg-core, libjpeg-turbo, stb, VulkanMemoryAllocator and LibAtrac9
stay bundled.
2026-10-11 10:18:10 +02:00
Joey Fisher f01f95d1f9 fix(agc): report a refused queue worker priority as a driver failure and reject unknown APS5_THREAD_PRIORITY values 2026-10-10 12:23:12 -06:00
Joey Fisher 0fe61e4191 fix(agc): pick one priority path per mode and throw when it is refused 2026-10-10 04:14:08 -06:00
Joey Fisher 22147dbbe6 fix(agc): lower the RLIMIT_RTTIME hard limit only when rtkit requires it
Read rtkit's MaxRealtimePriority and RTTimeUSecMax before touching the
limit, keep a hard limit that already satisfies rtkit, lower the soft
limit to at most half of the hard one, and log when the hard limit is
lowered. rtkit checks the hard limit, so it cannot be left alone when it
is above RTTimeUSecMax; the side effect is listed in TechnicalDebt.md.
Log the policy rtkit applied, SCHED_RR by default.
2026-10-10 04:14:02 -06:00
Joey Fisher a9c132a629 feat(agc): opt-in raised priority for the queue workers and the presenter 2026-10-10 04:13:57 -06:00
Adrià e0526f57cd
Merge pull request #1686 from Cloud-Multiplayer/feat/macos-write-watch
feat(libc): write watch on macOS hosts
2026-10-10 08:03:40 +02:00
Dean 0949984e5e
Merge pull request #1945 from TacoCat055/docs/relinker-python-tests
docs: explain relinker Python test discovery
2026-10-10 18:36:32 +13:00
Elijah De Guzman 80b0bab279 feat(libc): write watch on macOS hosts
macOS has no counterpart to userfaultfd write-protect or
MEM_WRITE_WATCH, so GuestWriteWatch had no backend there and the driver
re-read every guest buffer on each use.

The macOS backend write-protects watched pages. The first write to a
page faults, the SIGBUS/SIGSEGV handler records the page and restores
its protection, and Collect reports the recorded pages and protects
them again. A page is protected before its record is cleared, under the
lock the handler takes, so a write that lands in between is recorded.
The lock hands out turns in order: an unfair one starved writers under
Rosetta.

The protection is real, which adds three entry points:
- GuestWriteWatchBeginHostWrite/EndHostWrite lift it around a system
  call that writes guest memory, which would otherwise fail with
  EFAULT. GuestArena::HostWrite calls them, as it calls the Windows
  equivalent.
- GuestWriteWatchProtectionChanged tells the watch the protection given
  to watched pages by mprotect or a new mapping.
- GuestWriteWatchProtection reports that protection, since a watched
  page is read-only between a collection and the next write.

Register keeps the recorded protection of a page it already watches:
read from the kernel it would be the watch's own read-only protection,
and the page would never be watched again.

The tests build without the prx libraries and run natively and through
Rosetta.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 21:11:40 -04:00
Adrià 527b18ea59
Merge pull request #1556 from MarcZX100/docs/fedora-static-cmake-deps
docs(build): note Fedora static link packages
2026-10-10 03:10:35 +02:00
Adrià 0eb7f098dd
Merge pull request #1499 from yabanana/codex/macos-unwind-register-context
feat(libc): support x86-64 unwind register contexts on macOS
2026-10-10 03:04:54 +02:00
MarcZX100 10957e0dc4 docs(build): show Fedora static package command 2026-10-09 23:03:15 +00:00
MarcZX100 6074d658f8 docs(build): note Fedora static link packages 2026-10-09 23:03:15 +00:00
xXPBSXx 0ccfbe46a5 docs(build): note antivirus quarantine of relinker test executables on Windows
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-09 15:56:29 +02:00
Daniele Giovane fbce671015 test(libc): verify register contexts on Linux and macOS 2026-10-09 12:22:14 +02:00
TacoCat055 9a6667cb4c docs: explain relinker Python test discovery 2026-10-08 19:27:23 -06:00
ToyuAU 2d59fffdb7 build(relinker): add a dependency-free conversion build mode 2026-10-08 18:21:30 +11:00
Dean 0ce1e45091
Merge pull request #1083 from ctz23/docs/linux-x11-build-requirements-20261007
docs(build): list Linux X11 development dependencies
2026-10-08 18:29:03 +13:00
Dean 461ab16f0d
Merge pull request #1104 from jeffrey12cali/docs/libs-target-not-default
docs(build): say that the libs target is not part of the default build
2026-10-08 18:22:17 +13:00
ctz23 5ec12a44ac docs(build): list Linux X11 development dependencies 2026-10-07 17:57:05 +02:00
krishnaraya 53f94723d1 docs(build): name the CA bundle the WinLibs CMake needs for the FFmpeg download
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-07 11:48:32 -04:00
jeffrey12cali cb2a29d810 docs(build): say that the libs target is not part of the default build 2026-10-07 13:52:18 +02:00
Nicolas Abosch e08333825f test(agc): validate pixel LDS and expose pipeline statistics 2026-10-04 23:04:39 -03:00
boykopovar 545b137097 docs(usage): add relinker usage md doc 2026-10-02 21:50:35 +03:00
boykopovar ee6a4a00f4 docs(build): add prject build md instruction 2026-10-02 21:40:38 +03:00