Commit Graph
20967 Commits
Author SHA1 Message Date
JAB-devandClaude Sonnet 5.5 9723f7af66 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into fix/ngs2-play-without-setup
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 07:58:53 +02:00
MarcZX10 86f3f07012 merge upstream main into sched interval fix 2026-10-23 05:56:19 +00:00
JJenkx df421d52bc fix(agc): verify refreshed draw stage data 2026-10-23 01:56:06 -04:00
MarcZX10 d377ed07b9 fix(libkernel_sys): use guest timespec for sched interval 2026-10-23 05:55:48 +00:00
Celegans12 29554673bb perf(agc): tell a mid-decode vertex table store by the retired-item count
When queue 0 was busy, DecodeOrderedVertexStageInfo reread every
recorded attribute word and V# after the decode to catch a store that
finished while it ran, a second read of the vertex tables for every
draw issued behind queued work. Queue 0 now counts retired items.
Before the decode the helper notes that count and the write ranges
queued then; afterwards it drains and decodes again only when a read
overlaps a write still queued, or when the count moved and a read
overlaps a range that was queued at the start (as CnRJay proposed).
Writes still held by the draw finisher count as queued, as in Overlaps.
Decode-caused drains are counted on the [draw] pipelined line.
agc_driver_vertex_table_read_order also checks that a table a finished
item wrote, and a store elsewhere retiring mid-decode, drain nothing.

AI-assisted: yes
2026-10-23 07:50:24 +02:00
JJenkxandClaude Opus 5.5 cdc21a9897 fix(tools): bound symbol lookups to their section, keep inclusive counts and refuse unrecorded modules
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]>
2026-10-23 01:49:21 -04:00
JJenkxandClaude Opus 5.5 59693ae54c feat(tools): symbolize the Windows samplers' stacks
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]>
2026-10-23 01:49:21 -04:00
Celegans12 c77548f5f1 feat(agc): enable VK_NV_device_diagnostics_config behind APS5_NV_DIAGNOSTICS
A device loss on NVIDIA reports only VK_ERROR_DEVICE_LOST, and
VK_EXT_device_fault often gives no address. Nsight Aftermath can write a
crash dump that names the faulting shader and the kind of fault, but
only when the device was created with VK_NV_device_diagnostics_config.
APS5_NV_DIAGNOSTICS (presence) now creates the device with that
extension (shader debug info, resource tracking, automatic checkpoints,
shader error reporting) and with VK_NV_device_diagnostic_checkpoints
when the device supports them. Unset, or on a device without the
extension, the device is created as before; the latter prints a notice.
ChooseDeviceDiagnostics holds the choice so the test can check it.

AI-assisted: yes
2026-10-23 07:44:58 +02:00
Ondra97 ac06b871a9 test(libSceFreeType): isolate the gasp query declaration 2026-10-23 07:44:17 +02:00
Ondra97 b13deef0db feat(libSceFreeType): implement FT_Get_Gasp 2026-10-23 07:44:17 +02:00
milescovielloandClaude Opus 5.5 9e6966b121 perf(shader): cut small per-materialize allocations in binding population
Three allocations ran on every stage materialization:

- DescriptorBindingBuilder::Populate pushed one shaderDataUserWords
  entry per layout.userDataRegisters element without reserving, so the
  vector regrew through 1, 2, 4, ... Reserve the exact count first.
- GuestSamplersDescriptor appended each sampler's dwords without a
  reserve. Samplers are four dwords (the table path forces 4, and
  Populate indexes the result as element * 4), matching the
  resources.size() * 4 reserve GuestBuffersDescriptor already uses.
- ResolveImageTablesShared made a fresh shared ResolvedImageTables for
  every snapshot without image tables. With no tables,
  ResolveImageTables either throws (the shader expects tables) or
  returns a default-constructed result, so return one shared, immutable
  empty instance instead, still calling ResolveImageTables first so the
  mismatch keeps throwing. Its only caller reads the result through a
  const reference and never compares the pointer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 05:44:03 +00:00
milescovielloandClaude Opus 5.5 a16dd83336 perf(agc): reserve draw results only on the paths that fill them
Driver::draw reserved programs.size() + 2 RecompileResults for every
draw, but `results` only receives elements on three paths: the
rect-list tessellation pair (2), barycentric emulation (1 geometry
shader or 2 tessellation shaders) and CPU-path indirect draws (one copy
per compiled program). An ordinary direct draw never touches it, so the
reservation was a sizeable heap allocation thrown away each draw.

Move the reserve to just before the first push on each of those paths.
Every site keeps the old programs.size() + 2 bound, which covers the
largest combination (rect-list or barycentric emulation, then the
indirect copies; rect-list and barycentric emulation exclude each
other). The first reserve on a path therefore sets the same capacity
as before, later ones are no-ops, and the &results[i] pointers kept in
`stages` stay valid.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 05:44:03 +00:00
milescovielloandClaude Opus 5.5 7ea544910a perf(agc): copy the draw programs only for draws that write them
Since the draw finisher (#6946), Driver::draw copies decode->programs
into the draw tail for every draw: one outer vector, one userData
vector per program and two shared_ptr reference bumps per program.
Before it, the copy was made only when the draw writes user words
(mesh index buffer words, indirect record words or relocated user
patches), and every other draw read decode->programs in place.

Keep the copy in DrawTail::writablePrograms and make DrawTail::programs
a pointer to it or to decode->programs, as before. Every write goes
through writablePrograms, and the draws that write are exactly the
mesh, indirect and patched ones, so a const view of decode->programs
can't be written.

The queued commit closures now move writablePrograms. When it is empty
the captured decode keeps decode->programs alive, and decode is only
replaced (by the relocated copy) on draws with user patches, which
take the copy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 05:44:03 +00:00
xdCloudy 5dbfbc9382 feat(libSceIpmi): declare 49 PS5 pending exports 2026-10-23 06:43:01 +01:00
Adrià 0db47b263d Merge pull request #7831 from MarcZX10/codex/fix-perspective-offset-barycentrics-7825
fix(shader): normalize offset perspective barycentrics after interpolation
2026-10-23 07:37:02 +02:00
Adrià 0ed14c1067 Merge pull request #10031 from xXPBSXx/docs/debt-keyboard-getkey2char-title
docs(debt): note what a title call of sceKeyboardGetKey2Char shows about the output buffer
2026-10-23 07:33:53 +02:00
ntamas94 5f5c956ae8 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into fix/agc-copied-writer-label-drain
# Conflicts:
#	core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
2026-10-23 07:27:00 +02:00
Dean 16319642a4 Merge pull request #6946 from Raghav314/perf/agc-draw-pipeline
perf(agc): draw finisher pipeline (APS5_DRAW_PIPELINE)
2026-10-23 18:24:48 +13:00
Yunus Shaikh a376e37b88 fix(relinker): decode each red-zone leaf over its whole FDE range 2026-10-23 05:22:26 +00:00
Federico Marras d82faf18aa Merge branch 'fix/ngs2-atrac9-parsed-delay' into feat/ngs2-atrac9-module-loops 2026-10-23 07:22:20 +02:00
Federico Marras 25b6f6e50b Merge branch 'feat/ngs2-calc-atrac9-block' into feat/ngs2-atrac9-module-loops 2026-10-23 07:22:20 +02:00
Federico Marras 1a743bf5be Merge remote-tracking branch 'upstream/main' into fix/ngs2-atrac9-parsed-delay 2026-10-23 07:21:30 +02:00
Federico Marras 767e188339 test(libSceNgs2.native): expect the module's ATRAC9 block in the frame info test 2026-10-23 07:21:17 +02:00
Retr0 0ca2e0b4e7 fix(libkernel): return ENOTCONN from getpeername once a socketpair peer closed
getpeername on a socketpair end returned the unnamed AF_UNIX address
even after the other end was closed. In FreeBSD 11, closing an end runs
uipc_detach, whose unp_disconnect and unp_drop clear SS_ISCONNECTED on
both stream and datagram ends, and kern_getpeername then fails with
ENOTCONN. Each end now keeps a weak reference to its peer's socket,
which expires when the peer's last descriptor, duplicates included, is
closed. shutdown leaves the ends connected, as soshutdown does.
2026-10-23 08:21:09 +03:00
Retr0 0f3d4bc9ee fix(libc): fail with ENOTDIR for a file named with a trailing slash on Windows
FreeBSD 11.4's lookup() (sys/kern/vfs_lookup.c) fails with ENOTDIR when
a path with a trailing slash ends at something that is not a directory.
On Windows a mount alias dropped the slash, and the host calls do not
report ENOTDIR for "file\", so unlink, rename and open acted on the file
or failed with EINVAL. Guest path resolution now rejects an existing
non-directory named with a trailing slash with ENOTDIR on every host, and
a mount alias keeps the slash on Windows as it does on Linux and macOS.
2026-10-23 08:21:01 +03:00
Federico Marras 601d6dbe38 Merge remote-tracking branch 'upstream/main' into feat/ngs2-calc-atrac9-block 2026-10-23 07:19:59 +02:00
Dean Galvin f648ad61e2 fix(libSceConvertKeycode): map the user's keyboard type to the IME keyboard type 2026-10-23 18:19:52 +13:00
Josip Parlov 606fa2ef91 fix(relinker): take red-zone framing's function bounds from .eh_frame FDEs
Function starts were direct call targets plus 16-byte-aligned code after
int3 padding. A function reached only through a pointer and not preceded
by int3 then ended up inside the previous region, and its pop rbp; ret
exit could get the epilogue lea without a matching prologue.

The bounds now come from the executable's .eh_frame FDEs (the existing
EhFrameReader), each function is decoded from its FDE start to its FDE
end, and code outside every FDE is not framed. Conversion stops with an
error when the executable has no FDE. Sites added in one pass also count
as taken for the next function.
2026-10-23 05:19:10 +00:00
Federico Marras 0477c9c3f2 Merge remote-tracking branch 'upstream/main' into feat/ngs2-atrac9-module-loops 2026-10-23 07:18:26 +02:00
Federico Marras 6660dd080d fix(libSceNgs2.native): throw for ATRAC9 loops inside the decoder delay and blocks past the data chunk 2026-10-23 07:18:26 +02:00
Federico Marras e8f8e59a35 Merge #8987's current head (106e73669d) with this PR's commit on top 2026-10-23 07:13:21 +02:00
Federico Marras f77f61ec7a Merge remote-tracking branch 'upstream/main' into tmp-9141 2026-10-23 07:12:32 +02:00
Federico Marras f73a4e8133 feat(libkernel_sys): implement the scePthread scope, atfork and setconcurrency forms 2026-10-23 07:12:32 +02:00
Federico Marras cf06f64c29 Merge remote-tracking branch 'upstream/main' into feat/audio-out-mastering
# Conflicts:
#	docs/dev/debt/libSceAudioOut.md
2026-10-23 07:11:02 +02:00
slopggobblercobbler81 e256e6d2d5 test(recompiler): gate Windows separator test cases to Windows platform 2026-10-23 07:10:41 +02:00
klosixgaming-arch 191dddae77 feat(agc): apply the color logic operation of CB_COLOR_CONTROL
The driver refused every ROP3 code but copy, so a draw that asks for a
logic operation stopped the process. The code is decoded into the draw
state, keyed in the pipeline cache and the pipeline journal, and applied
through the Vulkan logic operation of the color blend state.

The field accepts the 28 codes of the source and destination form and of
the brush and destination form, where the brush is the shader color; both
keep their function in bits 0, 1, 6 and 7. A code that combines source and
brush, blending together with a logic operation, a device without the
logicOp feature, and a color target that is not a normalized or integer
format throw.

The pipeline journal format moves to 7.

AI-assisted: yes. Written with AI assistance and reviewed by me.
2026-10-23 00:03:03 -05:00
Yunus Shaikh 542cb30f70 docs(relinker): describe the operand stubs and refused patches of --frame-red-zone
The debt entry no longer says that a leaf with an rsp operand that
cannot move in place is skipped. A new entry says that such an operand
moves to a stub, when the leaf is still skipped, and that a game patch
over a framed site or a moved displacement is refused. The USAGE row
says the same in short.
2026-10-23 04:50:13 +00:00
Yunus Shaikh 10fedd32e3 fix(relinker): refuse game patches over red-zone frame sites and moved displacements
Game patches are applied before framing, and the overlap check that
refuses a patch over another writer's bytes did not see the framer's
writes. A patch in a framed leaf's prologue, exit or operand stub site
was copied into the stub and replaced by a jump, and a patch over an
rsp operand's displacement was overwritten when the displacement moved.

The framer's sites and moved displacements now join the writers that
CheckOverlaps compares the patched ranges with, reported as "red-zone
frame site" and "red-zone moved displacement".
2026-10-23 04:50:13 +00:00
Arnab Ghosh 1f1ddc9e3a feat(libSceNgs2): implement sceNgs2VoiceGetMatrixInfo and sceNgs2CustomRackGetModuleInfo 2026-10-23 10:50:00 +06:00
Emanuele 75fdf64721 fix(shader): route a loop's back edge through an empty continue block when its latch holds instructions 2026-10-23 06:46:55 +02:00
thuanquangandClaude 0a3ea213e1 fix(shader): read a 2D MSAA T# through DIM 2D as its sample 0
A DIM 2D image_load or image_sample of a 2D MSAA T# returns sample 0 on
RDNA2 (RX 6700 XT, measured through HIP; bilinear blends sample-0 texels).
The recompiler now reads such a direct sampled access as a 2D image, and
the driver binds a one-sample copy of the target's sample 0, refreshed by
a fragment pass before each binding. Peace Walker (PPSA18216) stops on
this read at the end of its opening movie.

Co-Authored-By: Claude <[email protected]>
2026-10-23 11:38:12 +07:00
xXPBSXxandClaude Sonnet 5.5 f73c71563a docs(debt): note what a title call of sceKeyboardGetKey2Char shows about the output buffer
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 06:37:00 +02:00
MarcZX10 e58b8f5c22 test: drop obsolete HTTP cookie stub expectations 2026-10-23 04:33:14 +00:00
MarcZX10 62bd4638d2 fix(shader): bump cache format for barycentric metadata 2026-10-23 06:32:27 +02:00
MarcZX10 f6826208fb fix(shader): normalize offset perspective barycentrics 2026-10-23 06:32:27 +02:00
slopggobblercobbler81 99018acee7 fix(recompiler): normalize shader cache paths across platform separators 2026-10-23 06:25:16 +02:00
Yunus Shaikh 259bb69d65 feat(relinker): move rsp operands that cannot keep their encoding to stubs
A leaf whose rsp operand could not keep its encoding after the shift
was skipped: an 8-bit displacement that overflows, an operand at (%rsp)
without a displacement, or an indexed (%rsp,%idx,s) operand. Such an
instruction now moves to a stub, re-encoded with the moved displacement
in 8 bits when it fits and in 32 bits otherwise, followed by a jump
back.

The site covers the instruction and the sequential instructions after
it until it is 5 bytes long. It is refused when a branch lands inside
it, when it would have to cover a branch, ret or rip-relative
instruction (these are not relocated), or when it overlaps the
prologue, an exit, another operand site or an existing stub. Legacy,
REX and VEX forms are re-encoded; EVEX operands, whose 8-bit
displacement is scaled, are still refused. A leaf with no room for a
site is skipped as "rsp operand that cannot move and has no room for a
stub". Operands inside a site that could move in place are carried by
the stub instead, so the site's bytes stay as they were.

The report counts the operand stubs and the operands they carry.
2026-10-23 04:24:32 +00:00
Queuze 7358bec9ff fix(libc): isolate host stream buffering 2026-10-23 01:22:23 -03:00
Felipe Arce 6f401fe667 feat: run the common-dialog state machine in the Facebook and game custom data dialogs 2026-10-23 01:18:59 -03:00
Yunus Shaikh e0ba27fc60 test(relinker): run red-zone leaves under writes below rsp, framed and unframed
The framer's tests check its sites, stub bytes and moved displacements,
but nothing yet showed that framed code survives a write below rsp.

red_zone_framer_execution frames synthetic leaves with
FrameRedZoneFunctions in a writable and executable buffer, writes the
moved displacements and the stubs as Conversion.cpp and the trampoline
builders do, and calls each leaf with the trap flag set. A SIGTRAP
handler fills [rsp-0x80, rsp) of the interrupted context at every
instruction, as Windows exception dispatch may.

Five leaves each loop over slots they spilled, so a clobbered slot
changes the result: #5640's frameless shape, a leaf reaching 0x28 below
rsp, a leaf that also reads its saved rbx at +0x10 (moved in place), a
leaf that takes the address of a slot below rsp (shifted by the whole red
zone), and the inflate_fast-shaped leaf that allocates with sub after six
pushes. Each must return the right value unframed without the clobber
and a wrong one with it, and the right value framed with it.

The test is built and registered on Linux x86-64 only; elsewhere its main
returns 77.
2026-10-23 04:14:20 +00:00