Commit Graph

922 Commits

Author SHA1 Message Date
Adrià 3afc78464c
Merge pull request #2543 from overlordxrz-source/feat/libkernel-kill
feat(libkernel): implement kill
2026-10-10 11:21:08 +02:00
Adrià b750211412
Merge pull request #1776 from Celegans12/feat/shader-lds-beyond-device-limit
feat(shader): implement compute LDS beyond the device's shared memory limit
2026-10-10 11:20:13 +02:00
Adrià 1138fa96f4
Merge pull request #2554 from 22alfbassett/fix/kernel-sync-recorded-paths-linux
fix(libkernel): flush only recorded paths in sceKernelSync on Linux
2026-10-10 11:17:59 +02:00
Adrià 95fe14235a
Merge pull request #2536 from orbz22/fix/audioout2-queue-port-buffers
fix(audioout): play every AudioOut2 port buffer set between pushes, one per grain
2026-10-10 11:17:19 +02:00
Adrià a0a650884b
Merge pull request #2412 from MathiasDevelopes/feat/libscepsml-module
feat(libScePsml): build libScePsml from the libScePsml_debug source
2026-10-10 11:13:55 +02:00
overlordxrz-source 9a70477170 feat(libkernel): implement kill
ProsperoStore (PPSA99000) imports kill from libkernel and stops at it on
current main. Its crash reporter resets a crash signal to SIG_DFL and
sends it again with kill(getpid(), signal).

kill follows FreeBSD's kern_kill and killpg1 for the only guest process:
EINVAL for signals outside 0 to 128, signal 0 only checks the target,
and the caller's own pid, 0 and minus its pid deliver through raise.
Any other pid, and -1, which skips the caller, report ESRCH.
2026-10-10 11:06:12 +02:00
Adrià 2f3b5046e5
Merge pull request #1492 from Celegans12/feat/agc-dual-source-blending
feat(agc): implement dual-source blending from the MRT1 export
2026-10-10 11:01:16 +02:00
Adrià 412fa8b06f
Merge pull request #1864 from fisherjoey/fix/agc-compute-gate-capture
fix(agc): land cross-queue waits and capture the gated compute group at the gate
2026-10-10 10:57:52 +02:00
Adrià Franch 60251f9205 docs: describe LDS in device memory in ARCHITECTURE and TechnicalDebt
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-10 10:56:56 +02:00
Adrià e11c7bef4e
Merge pull request #2623 from oneandonlydean/fix/savedata-cancel-2598
fix(savedata): export sceSaveDataCancel
2026-10-10 10:50:53 +02:00
Adrià 4b6abf0381
Merge pull request #2625 from oneandonlydean/fix/carry-2577
feat(agc): sample with DISABLE_CUBE_WRAP through non-seamless cube samplers
2026-10-10 10:47:31 +02:00
Adrià 970c3059c2
Merge pull request #2617 from oneandonlydean/fix/carry-2553
fix(libSceFont): report vertical glyph metrics
2026-10-10 10:46:39 +02:00
Adrià 444edc3652
Merge pull request #1819 from TheAggie/feat/agc-pixel-stipple-fixed-point
feat(agc): accept the LINE_STIPPLE_TEX and POS_FIXED_PT pixel inputs
2026-10-10 10:37:00 +02:00
Celegans12 b8cc4adb3b feat(agc): implement dual-source blending from the MRT1 export
CB_BLENDn_CONTROL factors 15-18 (BLEND_SRC1_COLOR, BLEND_INV_SRC1_COLOR,
BLEND_SRC1_ALPHA, BLEND_INV_SRC1_ALPHA) threw "unsupported blend
factor". They blend MRT0 with the pixel shader's MRT1 export as the
second source, as RADV and radeonsi program it.

DecodeState maps them to the VK_BLEND_FACTOR_SRC1_* factors and accepts
them only with pixel exports to slots 0 and 1, color writes to slot 0
alone, an MRT1 export with MRT0's export format and shader mask, an
ADD, SUBTRACT or REVERSE_SUBTRACT operation and an identity component
order. The blend is draw state, so the specialized module of the
registered pixel shader moves its MRT1 output to location 0 index 1,
which ValidateShaders requires; pipelines need dualSrcBlend, now enabled
when present. The request field dualSourceBlend is in the module key,
the result memo, the draw key and the serialized request (version 15).
2026-10-10 10:29:00 +02:00
Joey Fisher db1bd553c7 fix(agc): drop the switches that turned the wait and capture fixes off 2026-10-10 10:27:59 +02:00
Joey Fisher f89bf1d417 fix(agc): resolve a compute queue's dispatch group when its wait passes 2026-10-10 10:27:59 +02:00
Joey Fisher de93d3e7b0 fix(agc): land cross-queue waits passed on recorded labels before guest reads 2026-10-10 10:27:59 +02:00
Yassine a44e70957a fix(libSceFont): report vertical glyph metrics
sceFontGetCharGlyphMetrics and sceFontGetRenderCharGlyphMetrics set the
vertical bearing and advance to zero although the glyph is loaded with
FT_LOAD_VERTICAL_LAYOUT. The library's own text writing steps the pen by
that vertical advance, so every character of vertical text was placed on
the previous one.

The vertical metrics now follow the FreeType driver's metrics of a
rendered glyph: FreeType's vertical advance, and for a face without
vertical metrics a bearing of half the horizontal advance left of the
horizontal bearing and of half the advance left over by the glyph height.

guest_system_font checks every metric of a square glyph at 100 pixels.

(cherry picked from commit 04dd69f806379df8b52cfdeb2979f2595973a9b3)
(cherry picked from commit 11f6f9e954756ee8d4a3fc2be574ab3b57ecd7c5)
2026-10-10 21:23:19 +13:00
Dean Galvin ec2bb21e70 fix(savedata): export sceSaveDataCancel
Palworld (PPSA23126) imports sceSaveDataCancel (e6y3WMBYbiM) from
libSceSaveData and fails to load because no library exports it. Its
signature is unknown, so it is exported without an implementation and
throws if it is called, like sceSaveDataConvert.
2026-10-10 21:22:48 +13:00
AlxcBTW bf18420007 feat(agc): sample with DISABLE_CUBE_WRAP through non-seamless cube samplers
Guest samplers with DISABLE_CUBE_WRAP (S# word 0 bit 28) are created with
VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT when the device enables
VK_EXT_non_seamless_cube_map; RADV maps the flag to the same bit. The bit
only changes cube filtering, so without the extension the sampler is still
created and only a cube texture sampled through it throws.
2026-10-10 21:20:28 +13:00
Adrià f6af6d11d3
Merge pull request #2123 from LuisBiceps/feat/libkernel-waitpid-no-children
feat(libkernel): report no child processes from waitpid
2026-10-10 10:18:56 +02:00
Scott Schuster c160d31649 feat(agc): accept the LINE_STIPPLE_TEX and POS_FIXED_PT pixel inputs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 10:18:16 +02:00
Adrià ddcb251a97
Merge pull request #2092 from authurtabo-byte/fix/agc-color-compare-forms
fix(agc): accept additional color comparison image forms
2026-10-10 10:13:30 +02:00
Adrià eab888e02f
Merge pull request #2573 from oneandonlydean/fix/carry-2241
fix(agc): zero-fill a vertex fetch past the record count
2026-10-10 10:13:05 +02:00
Adrià Franch 8de5e70477 docs(technicaldebt): shorten the waitpid entry
Requested by @oneandonlydean in review.
2026-10-10 10:11:04 +02:00
LuisBiceps c059cc733f refactor(libkernel): move waitpid and its TechnicalDebt entry away from lines open pull requests change
waitpid now sits between exit and _exit, and its TechnicalDebt entry follows the packed horizontal gathers entry, so the open system and getuid pull requests and the thread cancellation test pull request no longer touch the same lines.
2026-10-10 10:11:04 +02:00
LuisBiceps ac6852ec26 test(libkernel): check every waitpid option set on every pid, with and without a status
Unknown options are now checked for every pid, with 0x80 and 0x80000040 added, and so are valid combinations such as WNOHANG | WUNTRACED. Each call is repeated with a null status. The TechnicalDebt entry cites kern_wait, which adds WEXITED and WTRAPPED, and lists pdfork.
2026-10-10 10:11:04 +02:00
LuisBiceps 918bc0a49c feat(libkernel): report no child processes from waitpid
waitpid returns -1 with ECHILD, or EINVAL for an option FreeBSD does not know, and leaves the status unwritten: AnyPS5 runs the title as one process and exports nothing that creates a child. VLC PPSA85300 stops on main at this import.
2026-10-10 10:11:04 +02:00
authurtabo-byte e50bd2f824 fix(agc): retain anisotropic compare rejection and test sRGB forms 2026-10-10 01:08:03 -07:00
Adrià 2c4828a63d
Merge pull request #2072 from STUPIDCONTEM/fix/srt-signed-comparison
fix(shader): evaluate signed comparisons in SRT expressions
2026-10-10 10:07:30 +02:00
Adrià d185c31678
Merge pull request #2348 from Pipodi/fix/1d-storage-through-2d-stores
fix(shader): write 1D storage images through 2D image stores
2026-10-10 10:06:36 +02:00
Dean ac75a96dd7
Merge pull request #1908 from TheAggie/fix/libkernel-sched-other-priority
fix(libkernel): accept SCHED_OTHER in sched_get_priority_max/min
2026-10-10 21:05:56 +13:00
Adrià 0bc8313a25
Merge pull request #2177 from MarcZX100/codex/fix-color-compare-negative-wrap
fix(shader): normalize negative color comparison wrap indices
2026-10-10 10:02:56 +02:00
Adrià 700d5a64c8
Merge pull request #2312 from SleglJan/feat/shader-lds-float-atomics
fix(shader): LDS float atomics quiet signalling NaNs and flush denormals as the hardware does
2026-10-10 10:00:51 +02:00
Adrià 034dd75f85
Merge pull request #2204 from XairRrR/feat/videoout-deferred-flip-buffer
feat(libs): resolve command-buffer flip buffers when the GPU reaches the flip
2026-10-10 09:59:35 +02:00
danzaio 5e3268969b fix(agc): zero-fill a vertex fetch past the record count
A strided vertex fetch whose index is at or past the descriptor's num_records threw and aborted the title. PPSA01325 draws its fullscreen composite as a 4-vertex strip over a 3-record buffer, so the fourth vertex past the records stopped presentation.

Hardware returns (0, 0, 0, 0) for such a fetch with OOB_SELECT 0 and 1, measured on RDNA2 gfx1036 with tools/hw-oracle in #2241. VertexBufferReadSize now spans the whole fetch, and the staging copy reads the record bytes then zero-fills from num_records * stride onward. Each such fetch gets its own copy, outside the shared copies of its sibling attributes, the host-import in-place path and the draw-snapshot cache. OOB_SELECT 2 and 3 keep throwing past num_records, since each needs its own rule. Recorded in docs/dev/TechnicalDebt.md.
2026-10-10 20:58:25 +13:00
Adrià Franch f6d97ad3d2 test(agc): drop the 1D-T# image_load refusal that main now accepts
eb06284c7 made a read-only 2D image_load through a 1D T# valid, so the
test no longer pins a refusal. The TechnicalDebt line now says storage
loads still throw.
2026-10-10 09:57:16 +02:00
Alex Collini 6c4660b73c fix(shader): ignore y in 2D stores through a 1D storage image
Measured on RDNA2 (gfx1035) in review: image_store with DIM 2D through a
1D T# writes texel x for every y, including y = 0xffffffff. The T# type
decides the addressing and DIM only how many address VGPRs are read. The
store no longer drops y != 0.

The test now pins the second store at y = 1 with dmask 0x5: texel x holds
its components 0 and 2, components 1 and 3 are 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 09:55:37 +02:00
Alex Collini 14d9b13cd8 fix(shader): write 1D storage images through 2D image stores
A compute program of PPSA26344 writes a 1D storage image with image_store
DIM 2D, and no runtime image mode matched its T#. A write-only 2D storage
access now also gets a 1D mode. A store through it is dropped when y is not
0, as a one-texel-high image bounds it; this mirrors the measured 3D loads
through 2D T#s of #2023 and is listed in TechnicalDebt as unmeasured.

Loads, atomics and image_store_mip through such a pair still throw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 09:55:37 +02:00
XairRrR c9fe124c10 feat(libs): resolve command-buffer flip buffers when the GPU reaches the flip
A flip packet names a buffer index; the buffer was looked up when the
command buffer was submitted, so a title that registers its buffers
after submitting the first frame failed with "flip buffer is not
registered". The buffer is now resolved when the GPU reaches the flip,
as the hardware does. A flip whose buffer is still unregistered then
presents black and completes (see TechnicalDebt).

Uncharted: Legacy of Thieves Collection (PPSA05684) submits its first flip before registering its buffers and stopped with "flip buffer is not registered".
2026-10-10 09:54:29 +02:00
Adrià a29bae31af
Merge pull request #2572 from oneandonlydean/fix/carry-2237
fix(shader): read 2D image accesses through 1D T#s as measured
2026-10-10 09:54:13 +02:00
Adrià d697af329d
Merge pull request #2351 from Faffu/fix/avplayer-nosync-late-frames
fix(avplayer): skip late video frames in no-sync mode while audio drives the clock
2026-10-10 09:50:52 +02:00
Adrià ada939d2eb
Merge pull request #2035 from CouchRiv/fix-shader-f64-snan-ieee0
fix(shader): quiet f64 signaling NaNs only in IEEE mode
2026-10-10 09:49:38 +02:00
Adrià f70a091f90
Merge pull request #2380 from SleglJan/fix/shader-trig-quarter-fold
fix(shader): make v_sin and v_cos linear within 2^-12 of a turn from a zero
2026-10-10 09:47:14 +02:00
Faffu 068da6a99f fix(avplayer): skip late video frames in no-sync mode while audio drives the clock
In SCE_AVPLAYER_AV_SYNC_MODE_NONE every decoded frame was handed out in
order, so a title that requests video slower than the film's frame rate
fell behind its audio (about 52 s by the end of the PPSA12544 intro).
While the title pulls audio, frames the audio clock has already passed are
now skipped; frames that are not late are handed out as before.

Fixes #1635

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 09:42:20 +02:00
Jan Šlégl 4fb613ec40 fix(shader): flush LDS float atomic inputs for FP_DENORM_FLUSH_IN as well
On RDNA2 (gfx1036) ds_min/max/cmpst(_rtn)_f32 and _f64 flush both operands
when bit 0 of the type's denormal field is clear: field 2 flushes like field
0, field 1 keeps like field 3, in IEEE 0 and 1. The flush decision now tests
that bit. agc_driver_lds_float_atomic_modes adds FLOAT_MODE 0x50 (both fields
1) and 0xa0 (both fields 2), and the TechnicalDebt entry records the measured
fields.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012GLfKH7Sqe51wX254k1XsV
2026-10-10 09:40:42 +02:00
Jan Šlégl c2a9491e96 fix(shader): LDS float atomics quiet signalling NaNs and flush denormals as the hardware does
ds_min/max/cmpst_f32 and ds_min/max/cmpst_f64 with their _rtn forms follow the
rule measured on RDNA2 (gfx1036): both operands are flushed to a signed zero
when the type's denormal field flushes, a signalling-NaN data operand is stored
quieted, else a signalling-NaN old value, else a quiet NaN loses, else the
ordered compare decides, and the flushed value is written. The shared f32
path used the host's float compares, so its NaN and denormal results were the
driver's; the shared f64 path lacked the signalling-NaN rules the buffer path
has. Both now use AtomicFloatBits. The translation marks the shared float
atomics with the mode's flush in MemoryInfo.

The new agc_driver_lds_float_atomic_modes pins 32 operand pairs per type in
the titles' mode, with both fields kept and with both flushed. The 64-bit
test's model gets the signalling-NaN rule and one lane kind now feeds the
signalling NaN of its table into min/max.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012GLfKH7Sqe51wX254k1XsV
2026-10-10 09:40:41 +02:00
Alex d199fbc708 fix(shader): quiet f64 signaling NaNs only in IEEE mode
The f64 unary instructions, v_ldexp_f64, v_div_fixup_f64 and
v_cvt_f64_f32 always quieted a signaling NaN. The hardware does that
only with IEEE_MODE=1, as #1867 measured for the f32 and f16 forms;
with IEEE=0 the NaN comes out unchanged, measured on gfx1036.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-10 09:40:09 +02:00
Adrià Franch 64193dd96d docs(technical-debt): measured v_sin and v_cos error inside the bands
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-10 09:39:14 +02:00
Jan Šlégl 909281c994 fix(shader): make v_sin and v_cos linear within 2^-12 of a turn from a zero
After #1979 the cycle is exact, but the driver's sine of the radians loses
tiny results to its absolute error, and near the zeros of sine at k + 0.5
and of cosine at k ± 0.25 the f32 radians drop the low bits of the cycle.
Measured on RDNA2 (gfx1036), the hardware returns the input times 6.2831826
for every input below 2^-12 of a turn and stays within 7 ULP of the f32 2π
times the distance at the half and quarter turns.

Within 2^-12 of a turn from a zero the lowering now returns the linear term
of the exact distance to that zero, with the hardware's constant at the
integers and the f32 2π elsewhere; everywhere else it keeps the driver's
sine or cosine of the radians. agc_driver_sin_cos_near_zero pins 32 inputs
per type from the oracle with per-lane tolerances.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012GLfKH7Sqe51wX254k1XsV
2026-10-10 09:39:01 +02:00