Commit Graph
120 Commits
Author SHA1 Message Date
Alexej Szpevák 819d5c4a6d docs(usage): describe app0.zar 2026-10-16 20:03:32 +02:00
Adrià FranchandClaude 57ff6a63b2 fix(agc): record nothing in the pipeline journal without its file lock
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-16 12:52:28 +02:00
Adrià FranchandClaude Fable 5.1 4aafda8e3b perf(agc): journal the pipelines of a run and build them ahead on the next one
A graphics pipeline the store builds or a compute pipeline a dispatch builds is
appended to pipelines.journal next to the shader cache entries, as the
materialized result of each stage (the specialized SPIR-V, bindings and push
constants) plus the recipe the pipeline was built from: the stages'
identities, vertex input layout, descriptor set layout keys and the state
fields the Pipeline constructor reads. When a VulkanDevice is created with a
window (a headless device waits for its first draw or dispatch, since the
window's device usually replaces it first) the journal is loaded and its
pipelines are built on a pool of threads while the title loads, so the first
draw or dispatch of a configuration seen on an earlier run finds its pipeline
resident instead of compiling it on the queue worker.

The pipeline stores key on RecompileResult::Identity, a hash of the module
words, specialization constants, subgroup width and bindings that is the same
on every run (SharedSpirv::ContentHash, computed once per shared module),
rather than on the process-lifetime variant ids; a generated stage is keyed
like any other. CachedPipeline builds outside the store's mutex and the
library parts and link are built outside the library store's mutex, so replay
threads and queue workers build in parallel; a concurrent build of the same
key keeps the first inserted. A replayed pipeline enters the store at its
least recently used end and a full store takes none, and its optimized relink
waits for the first draw that binds it, so the title's own pipelines come
first in both. The compute pipeline creation moves into
VulkanDevice::createComputePipeline, shared by dispatches and the replay. The
store key also covers the color component mapping, the depth target's sample
count and a depth bias clamp, which the constructor reads.

The file names the device it was written for (the properties the driver's
pipeline cache file is named by) and starts over for another; a torn tail is
cut at a record boundary; two runs sharing the directory take turns on a lock
file and keep each other's records; a read failure never starts the file
over. A device cancels its replay before it is replaced or destroyed, and a
replaced device destroys its pipelines then rather than at the driver's stop.

APS5_NO_PIPELINE_JOURNAL=1 disables it; APS5_PIPELINE_JOURNAL_THREADS,
APS5_PIPELINE_JOURNAL_ENTRIES (the first recorded), APS5_PIPELINE_STORE_ENTRIES
and APS5_PIPELINE_JOURNAL_MAX_MIB bound it; APS5_PROFILE_DRAW prints a
[pipeline-journal] summary. APS5_VERIFY_SET_LAYOUTS=1 now also checks a
dispatch's set layout against the one described from its shader. The lavapipe
test suite, which shares one cache directory, runs with the journal off except
for the journal's own tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P6hw3kRAuQdfcU9YCZgaoK
2026-10-16 12:52:28 +02:00
fdfawef324andClaude Opus 5.5 13b171cab5 feat(agc): keep the last submissions per queue and dump them on a stall or crash
A GPU hang or a crash in a title leaves no record of what the queues
were last given: APS5_TRACE_GPU prints every submission (too much to
leave on), and the WAIT_REG_MEM timeout message shows only the packet
before the wait on the waiting queue.

Each queue now keeps a ring of its last 16 submissions
(APS5_PM4_RING=<n>, 0 to 4096, 0 disables): the TraceMs time in tenths
of a millisecond, serial, size, guest address and a copy of the first
512 dwords after indirect buffers are inlined, recorded under the
driver lock next to the serial, REWIND tails included. The ring of a
queue and the failure report registration are set up at the top of
Submit, before any output is reserved, so recording under the lock
does not allocate. Disabled, Submit only tests a static flag; enabled,
it costs one bounded copy per submission.

DumpSubmissionRings decodes the kept dwords with Pm4::PacketWords and
the new Pm4::KnownName, which returns the decoder's names as views of
static strings (empty for an unknown opcode, printed as UNKNOWN_0x%02x);
Pm4::Name now builds its std::string from it. Every line is formatted
with integer and string conversions only into a 512-byte stack buffer
and written with one WriteFile / write(2) on the stderr handle, so the
dump does not allocate from the C runtime heap, lines from other
threads do not interleave and the CRT stream lock is not taken (the
rule of #3871). The header gives the number of queues and the ring
size, and each queue line the submissions recorded and kept.

libc gets a small registry of failure reports
(LibcRegisterFailureReport_nid_no_patch, Unregister, Run); Run runs
the registered reports the first time it is called and returns at once
after that. The Windows crash report runs it after the thread dump of
an unhandled exception, after SIGABRT (which also covers the
APS5_HANG_DUMP_SECS timed dump, since it aborts) and after an invalid
CRT parameter, so an abort after a reported exception does not print
the rings twice. The driver registers its dump at the first submission
and unregisters at static destruction; the dump there waits a bounded
time for each ring lock. What the crash-path dump cannot do (a ring
held by the crashed thread, rings corrupted by the crash, Linux) is
recorded in technical debt.

APS5_STALL_WATCHDOG_SECS=<n> (0 to 86400, 0 disables) makes a waiter
that has not progressed for n seconds dump the rings once per wait: a
WAIT_REG_MEM (progress as for APS5_GPU_WAIT_TIMEOUT_MS: another packet
runs or completes), a REWIND waiting for the title, and a compute
submission held behind queue 0. The last one prints under the driver
lock, so submissions and the other queues wait for it (USAGE.md says
so). Both variables are read at the top of Submit, so an invalid value
of either throws at the first submission and never later inside a GPU
worker. The order wait behind queue 0 releases its order hold on scope
exit, so a throwing dump cannot leave it counted.

No packet semantics change; packet sizes and names are those of the
existing decoder (PM4 type-3 header layout as in Mesa
src/amd/common/sid.h). The queue bound of Submit and of the rings is
one constant, SubmissionQueueEnd.

Tests: agc_driver_pm4_tests gets ten modes, each its own ctest:
agc_driver_pm4_ring (APS5_PM4_RING=4, six submissions on queue 0 and
two on 0x20: the dump holds #3..#6 and #1..#2 in order, nothing
older), agc_driver_pm4_ring_empty (one line), _ring_disabled (one
line), _ring_invalid and agc_driver_pm4_stall_watchdog_invalid
(APS5_STALL_WATCHDOG_SECS=1x: the submission throws and is not
executed), _ring_report (LibcRunFailureReports_nid_no_patch dumps the
rings), _ring_report_heap (Windows: with ucrtbase.dll's HeapAlloc and
HeapReAlloc imports counting calls from the reporting thread, the
failure report of a submission holding INDEX_BUFFER_SIZE names it and
allocates nothing, while Pm4::Name of the same header is seen
allocating), and with APS5_STALL_WATCHDOG_SECS=1 a WAIT_REG_MEM
(agc_driver_pm4_stall_watchdog), a REWIND (_stall_watchdog_rewind) and
a compute submission held behind a queue 0 rendering wait
(_stall_watchdog_order), each held for about 2.5 s, dump once and
complete when released. The PM4 catalog test checks KnownName against
every opcode and custom name. windows_backtrace_failure_report checks
that abort() runs the registered reports once and not an unregistered
one; windows_backtrace_failure_report_once that abort() does not run
them again after an earlier run. With the dump decoding through
Pm4::Name, agc_driver_pm4_ring_report_heap fails with "the failure
report allocated from the C runtime heap"; with Run resetting its
flag, windows_backtrace_failure_report_once prints the report twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 11:18:26 +02:00
gguerra26 9b92c55edf fix(relinker): lower ANDN in Rosetta conversion 2026-10-15 15:00:43 +02:00
Adrià 7a22c43027 Merge pull request #5695 from YossiYad/fix/relinker-executable-mode
fix(relinker): write Linux and macOS executables with execute permission
2026-10-15 14:15:08 +02:00
Adrià 2693ac2f64 Merge pull request #5582 from JJenkx/fix/pad-command-file-access
fix(tools): preserve controller command access
2026-10-15 13:23:03 +02:00
Adrià b72378b0fa Merge pull request #5525 from ahmedmakroum/docs/usage-shader-cache
docs(usage): document the shader cache directory and its environment variables
2026-10-14 23:46:37 +02:00
Adrià 153d5d469d Merge pull request #5519 from Zinebyte/fix/import-audit-module-sidecars
fix(tools): ignore non-module sidecars in import audit
2026-10-14 23:39:08 +02:00
Adrià fa539dd9ba Merge pull request #5486 from MarcZX100/docs/runtime-param-json
docs: explain required app metadata in runtime layout
2026-10-14 22:58:00 +02:00
Adrià 92b892f15a Merge pull request #5247 from devavijitsingh/feat/web-conversion-recovery
fix(web): remove incomplete folder output on failure
2026-10-14 22:55:41 +02:00
Kang, Harry Zixuan b2c9e91102 fix(relinker): audit dependencies without imported functions 2026-10-14 20:57:16 +02:00
Avijit Singh 7cc555561f docs(web): describe failed folder output cleanup 2026-10-14 20:54:00 +02:00
Adrià 278765a073 Merge pull request #5040 from screamm/docs/app0-eboot
docs(user): stage the original eboot.bin in app0
2026-10-14 19:55:05 +02:00
Adrià 38c0bfa33a Merge pull request #5131 from parl0v/docs/nvidia-610-compiler-crash
docs(usage): note the NVIDIA 610.47 shader compiler crash on Windows
2026-10-14 19:41:27 +02:00
Adrià f3b5daaf85 Merge pull request #4836 from dantdmdarealguy/docs/input-touchpad-fingers
docs(input): describe the forwarded touchpad fingers and the View button
2026-10-14 19:14:47 +02:00
AlxcBTWandClaude Opus 5.5 b8ed78902f fix(input): read the input file from paths with non-ASCII characters
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 18:52:30 +02:00
ahmedmakroum e4c77414ba docs(usage): document the shader cache directory and its environment variables 2026-10-14 15:55:45 +00:00
Josip Parlov 4a71c6b05a docs(usage): note the NVIDIA 610.47 shader compiler crash on Windows 2026-10-14 16:42:09 +02:00
Adrià ef4d09d22a Merge pull request #5697 from gjonn/hdr-output
feat(videoout): present PQ display buffers through an HDR10 swapchain
2026-10-14 16:27:11 +02:00
Gjon Gojcevic 4e27d8d753 fix(videoout): keep the output SDR on hosts without a monitor HDR report
A Vulkan surface can offer HDR10 formats while the display is not in
HDR (KDE Wayland with RADV lists them with the output's HDR disabled),
so on hosts other than Windows the probe now reports an SDR monitor and
HDR output stays off until an output-state signal exists. A probe test
checks that a window without a Windows monitor report reads as SDR with
an HDR10 surface.

The HDR10 present test now also changes the monitor's luminance while
presenting HDR10, and the presenter logs the HDR metadata it sets.

AI-assisted: yes
2026-10-14 08:55:18 -04:00
Adrià 8ffbb49267 Merge pull request #5588 from ryyReid/feat/unwrap-self
feat(tools): unwrap decrypted SELF containers into clean ELF
2026-10-14 14:48:51 +02:00
Adrià 1015c55ee8 Merge pull request #5324 from lubaxe/feat/agc-store-pending-at-label
feat(agc): store pending storage-image results before each GPU label with APS5_STORE_AT_LABEL
2026-10-14 14:18:57 +02:00
Adrià b8f42c5aed Merge pull request #4593 from Recapi/feat/relinker-linux-fixed-base
feat(relinker): load Linux executables at a fixed base
2026-10-14 13:56:07 +02:00
Sasha PapoandClaude Opus 5.5 d756f525fc feat(agc): store pending storage-image results before each GPU label with APS5_STORE_AT_LABEL
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 13:40:18 +02:00
Adrià bb7006342f Merge pull request #4780 from ivica00/codex/crash-indirect-memory
feat(libc): optionally dump indirect memory in Windows crash reports
2026-10-14 12:48:15 +02:00
Renan Pires 75cfcec67c feat(relinker): load Linux executables at a fixed base with --linux-fixed-base 2026-10-14 12:35:36 +02:00
Yossi Yadgar bfc95d20c6 docs(user): drop the chmod step that conversion no longer needs
Keep it for copies that lost their mode, and name the LoadExec error a
missing execute bit gives.
2026-10-14 12:49:12 +03:00
Dean 2582ec1193 Merge pull request #5309 from hugodearaujo/feat/agc-sparse-dmabuf-import
feat(agc): import shared ranges above 64 MiB as sparse buffers over udmabuf chunks
2026-10-14 21:50:50 +13:00
Dean Galvin 83a268a867 feat(libkernel): stop at start-up on a host CPU without the PS5's extensions
Titles run natively, so a host CPU without an extension that compiled Zen 2 code uses faults with an illegal instruction deep inside a title (#3719: SHLX, BMI2). libkernel now reads CPUID and XCR0 when it loads on Linux and Windows, logs the host CPU's extensions and throws, naming the CPU and the missing extensions, before any title code runs.
2026-10-14 20:29:57 +13:00
Gjon Gojcevic c9ba43bfb7 feat(videoout): present PQ display buffers through an HDR10 swapchain
Detect HDR output on the host: on Windows the monitor showing the window
must run in HDR10 (DXGI IDXGIOutput6), and on every host the window's
Vulkan surface must offer a 10-bit VK_COLOR_SPACE_HDR10_ST2084_EXT
swapchain with VK_EXT_swapchain_colorspace and VK_EXT_hdr_metadata. The
monitor's luminance comes from DXGI; hosts that report none get 1000
nits peak and full frame, 0 nits black.

While HDR output is available, sceVideoOutGetOutputStatus reports
dynamic range 2 and flag bit 0, sceSystemServiceGetHdrToneMapLuminance
reports the monitor's luminance, and every open port's output mode
event fires when that changes. PQ display buffers are presented
unchanged through an HDR10 swapchain with HDR metadata; any other
display buffer switches back to the SDR swapchain. Without HDR output
the PQ to SDR conversion uses the peak the title was last told as its
white level.

AI-assisted: yes
2026-10-14 02:55:21 -04:00
MarcZX100 150c24ce70 docs: clarify app metadata selection and mounts 2026-10-14 06:55:10 +00:00
hugodearaujoandClaude Opus 5.5 5894feff7e feat(agc): import shared ranges above 64 MiB as sparse buffers over udmabuf chunks
On Linux a shared-backed guest range is imported through one udmabuf
covering the whole range, and udmabuf refuses buffers above its
size_limit_mb (64 MiB by default). Larger ranges fell back to copies; an
address-based dispatch then synced its whole mirror, storing back every
pending storage image inside it each time.

Such a range is now one sparse buffer bound to the existing 64 MiB chunk
imports. The bind runs on a sparse binding queue of its own when the
device has one, so imports made at map time (without the GPU mutex) can
use it; otherwise only under the GPU mutex on the main queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:55:39 +13:00
Dean 75690a117e Merge pull request #4237 from MarcZX100/codex/carry-fixed-base-3043
fix(relinker): load Windows executables at a fixed low base
2026-10-14 17:49:45 +13:00
Dean Galvin bf6b6c0a17 docs(relinker): describe fixed-base default for Windows executables 2026-10-14 17:39:48 +13:00
Dean 970316ae04 Merge pull request #4704 from AlxcBTW/feat/input-mouse-look
feat(input): turn mouse speed into a smooth right-stick tilt
2026-10-14 15:55:08 +13:00
DotDebianandClaude Opus 5.5 d9852df2a2 fix(libc): track writes to singly mapped direct memory without faults on Windows
A direct memory page mapped at one guest address now lives in private
MEM_WRITE_WATCH memory at that address, and its writes are collected with
GetWriteWatch like flexible memory: no fault is raised. A page mapped at a
second address moves its whole resident run into the section, behind a
read-only fence while it is copied, and every address becomes a view of it,
tracked by write protection. Unmapped resident pages that are not blank are
kept in a private reservation until they are mapped again, not in the
section.

Ported onto main's 4 KiB subpage tracking of shared views: resident runs
keep a per-page collected bit and enter the fresh ranges, so Fresh and
Armed collections select them like shared views; a demoted run carries its
collected bits into the views and reports every page once. MapAlias throws
through refuse() when a resident run extends outside the aliased range, and
the caller keeps main's fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1W4jdNSKTV7xwuS6xQPJV
2026-10-14 02:39:10 +02:00
ryyReid 2a01e9eb18 feat(tools): unwrap decrypted SELF containers into clean ELF
The relinker reads a plain ELF executable and skips SELF containers with a
warning, so an eboot.bin or a *.prx taken from a title cannot be relinked
before it is unwrapped, and the repository has no tool for that.

The inner ELF program headers of a container carry stale offsets: a SELF
inserts its own metadata blocks between the segments, so the data sits at the
offsets of the SELF segment-record table at file offset 0x40. The segments are
also packed without honouring p_align, while ELF requires p_offset % p_align
== p_vaddr % p_align, which the relinker enforces on guest modules. The tool
places the segments from the records, falls back to the vaddr to file mapping
of the containing PT_LOAD for segments the table does not cover, copies every
region to an offset satisfying the alignment, and refuses a container whose
load segments all look encrypted.
2026-10-13 19:23:51 -05:00
JJenkx 78f661e6e6 Merge commit '30f961266ade83b41d5c9de7dec1393e7fcecfb7' into fix/pad-command-file-access 2026-10-13 18:59:59 -04:00
Zinebyte 3b2601daa3 fix(tools): ignore non-module sidecars in import audit 2026-10-13 18:24:56 -04:00
MarcZX100 d5209e3696 docs: explain required app metadata in runtime layout 2026-10-13 21:00:38 +00:00
ivica00 139bc7b981 feat(libc): optionally dump indirect memory in Windows crash reports 2026-10-13 19:15:33 +02:00
AlxcBTWandClaude Opus 5.5 38bc0fd348 feat(input): turn mouse speed into a smooth right-stick tilt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 17:00:20 +02:00
codingreapermapsandClaude Opus 5.5 430e5c833e feat(relinker): add --trace-imports for Windows executables
With --trace-imports the entry stub resolves TraceImport_nid_no_patch
in libc.prx and passes each function import through it before writing
the slot: every PLT slot, and a GOT slot only when the original symbol
is a function, so data imports such as __stdoutp keep their address.
Without the option the output is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 16:55:31 +02:00
Adrià 2f5c3a4bf5 Merge pull request #4559 from MarcZX100/codex/import-audit-sectionless-modules
fix(tools): audit sectionless guest modules
2026-10-13 16:43:53 +02:00
Adrià 2672a73178 Merge pull request #4501 from devavijitsingh/fix/diagnose-self-module-skip
fix(relinker): warn when SELF modules are skipped
2026-10-13 16:30:12 +02:00
Mouad-Scriptz-0andClaude Fable 5.1 94087d08b0 feat(libSceVideoOut): capture the host cursor for guest mice and scale their deltas
The console's mouse reports relative motion, so the host cursor can never line
up with the cursor a title draws. While a title has a mouse open and the
window is focused the host cursor is hidden and captured, released on focus
loss or while the pad's mouse-to-stick toggle is on. Motion deltas are scaled
from the presented image's size in window units to the title's display
resolution with sub-pixel carry, so the title's cursor travels as far as the
host pointer would, on scaled desktops and letterboxed windows alike.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-13 14:05:52 +00:00
Avijit SinghandCopilot 1796482721 docs(relinker): clarify skipped SELF modules
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-13 18:04:49 +05:30
Adrià afbc22fb1a Merge pull request #4140 from veosett/fix/relinker-windows-fixed-base
feat(relinker): support fixed Windows guest image bases
2026-10-13 14:26:54 +02:00
boykopovar 8485298e46 Merge pull request #5114 from boykopovar/feat/web-relinker-ui
feat(pages): add web relinker ui
2026-10-13 15:16:10 +03:00