Commit Graph
14017 Commits
Author SHA1 Message Date
Adrià FranchandClaude f08e691b22 fix(shader): saturate v_cvt_pk_u16_u32/i16_i32; test VOP3 integer ops
Co-Authored-By: Claude <[email protected]>
2026-10-04 17:09:47 +02:00
DotDebianandClaude Opus 5.5 a701cfb08d feat(shader): implement global_load_dword_addtid
Decode FLAT opcode 0x16 in the global segment and load one dword per
active lane from the SGPR pair base plus the signed offset plus four
times the lane id.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 17:09:25 +02:00
DotDebianandClaude Opus 5.5 9754103cc4 fix(shader): keep decoding past an s_endpgm while a branch targets later code
The decoder stopped at an s_endpgm unless the next word was a known branch
target. When an earlier branch jumps further than that word, the block right
after the s_endpgm is entered only from later code, so the program was cut
short and the graph builder rejected the branch as targeting an invalid
program counter. Stop only when no decoded branch targets a word at or past
the one after the s_endpgm.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 17:03:31 +02:00
DotDebianandClaude Opus 5.5 a590841f19 test(shader): cover the VOP3 carry-out add and subtracts and count v_sub_co_u32 as decoded
v_add_co_u32, v_sub_co_u32 and v_subrev_co_u32 (VOP3 0x30f, 0x310, 0x319)
decode to VAddI32, VSubI32 and VSubrevI32 and had no execution test.
tools/progress.py listed the first and the last as variants of those
opcodes but not v_sub_co_u32, which it reported as missing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 17:01:01 +02:00
Adrià FranchandClaude f64a683bdf fix(shader): s_wqm SCC and s_andn{1,2}_wrexec destination
Co-Authored-By: Claude <[email protected]>
2026-10-04 16:56:48 +02:00
Pouare514 497a772c5d fix(libkernel): hand arena reservations to NoOverwrite mappings 2026-10-04 16:46:39 +02:00
DotDebianandClaude Opus 5.5 cb1f456ce4 fix(shader): address ds_append and ds_consume on LDS by the instruction offset alone
On LDS the counter is at the instruction offset. The emitter added
M0[31:16] to it and required the offset to be below M0[15:0], which is
the GDS base and a size no other LDS access reads. The GDS path is
unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 16:43:54 +02:00
Pouare514 5babbe5016 fix(libkernel): support NoOverwrite mappings on Windows 2026-10-04 16:39:24 +02:00
DotDebianandClaude Opus 5.5 624eeac4c5 test(shader): cover v_fmac_f32, v_fmamk_f32 and v_fmaak_f32 and count them as decoded
VOP2 0x2b, 0x2c and 0x2d decode to the opcodes of v_mac_f32, v_madmk_f32
and v_madak_f32 and differ only by the encoding, which keeps them fused.
The progress map derives names from the opcode enum, so it listed the three
fused forms as missing.

The new test decodes the six encodings and checks that the translation
rounds the product separately for 0x1f-0x21, keeps 0x2b-0x2d fused, and
reads the accumulator and the literal from the right operand.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 16:36:17 +02:00
Pouare514 f4301a1347 feat(crashreport): dump all threads on fatal crash plus hang watchdog 2026-10-04 16:36:16 +02:00
Pouare514 fb9e0fff5b fix(libs): TLOU runtime funcs for Net (getpeername, htonll/ntohll) 2026-10-04 16:33:18 +02:00
Pouare514 9be52e47be fix(libs): TLOU runtime throwing stubs for Ssl LoadCert and GetMemoryPoolStats 2026-10-04 16:30:21 +02:00
Pouare514 af20824af4 fix(libs): TLOU sceRtcParseDateTime ISO 8601 subset parser 2026-10-04 16:30:14 +02:00
Pouare514 22dd013049 fix(libs): TLOU runtime funcs for SessionSignaling (activate user, peer address 2) 2026-10-04 16:29:47 +02:00
Pouare514 49feb79476 fix(relinker): scan overlapping span from address and cover FS-prefixed previous instruction 2026-10-04 15:41:17 +02:00
Pouare514 52587f8cf1 fix(relinker): tolerate trailing data in TLS scan 2026-10-04 15:27:57 +02:00
Pouare514 2be3860983 fix(tests): flush stdout in QuickFirst so ctest pipe captures handler output 2026-10-04 15:24:44 +02:00
Pouare514 1cbf3fa8e4 feat(libc): implement at_quick_exit and quick_exit 2026-10-04 15:20:51 +02:00
Slick Daddy e31f3edf4a test(shader): register agc_spirv_module_tests with ctest 2026-10-04 15:59:04 +03:00
Slick Daddy 753e1b9347 fix(shader): declare the word-size constraint before the overloads that use it 2026-10-04 15:58:31 +03:00
Slick DaddyandClaude 4dd9d45be8 fix(shader): cache operand-free constants and cover interning with a test
OpConstantTrue and OpConstantFalse carry no operand word, so they reached the
declaration cache through the variadic Constant template, which builds the key
vector, and paid an allocation on every call. ConstantBool emits both, so a
shader paid it twice per boolean constant. Add the two-word overload; the
compile-shaped benchmark drops from 10413 allocations to 415.

Add agc_spirv_module_tests covering the interning contract: a repeated
declaration returns one id and is emitted once, operand shapes that share a
leading key word stay distinct, integral and enum operands agree, decorated
types stay separate from plain ones, memoized ids survive AllocateId, modules
do not share ids, and ids stay unique and contiguous past the cache capacity.
The test passes against both the previous header and this one, so it pins the
contract rather than the implementation.

Benchmark, pre-optimization header against this one, best of five:

  hot loop x 2M              613.6 ms ->   46.3 ms   13.2x
  compile-shaped 5000 instr    4.2 ms ->    0.4 ms   10.8x
  64 compile-shaped modules  286.0 ms ->   25.4 ms   11.3x

Allocations for the compile-shaped case fall from 55217 to 415. Both builds
compute the same value over the same call sequence.

Co-Authored-By: Claude <[email protected]>
2026-10-04 15:58:31 +03:00
Slick DaddyandClaude 87e261b451 perf(shader): intern SPIR-V type and constant ids without a per-call allocation
Every SpirvModule::Type and Constant call built a heap std::vector key and
looked it up in a std::map keyed on std::vector, so the comparison walked the
key bytes. At the one to three such calls per emitted instruction a shader
issues thousands of them per compile.

Add a fixed-size, linearly probed declaration cache that holds the key inline
and is consulted before the key vector is built, making a repeated declaration
a hash and a compare. The cacheable shapes are those whose operands are a
word: OpTypeVoid, OpTypeBool, OpTypeInt, OpTypeFloat, OpTypeVector,
OpTypePointer, OpTypeStruct, OpTypeArray, OpTypeFunction and the scalar
OpConstant family. The overloads are constrained on word-sized operands so
that enum operands such as spv::StorageClassFunction reach the cache instead of
binding the variadic template by reference.

Measured with a harness driving the module through the emitters' call shapes:
80000 hot type and constant calls drop from 80074 heap allocations to 140. The
assigned ids and the emitted SPIR-V word stream are byte-identical.

Co-Authored-By: Claude <[email protected]>
2026-10-04 15:58:31 +03:00
PacukaandClaude Opus 5.5 6814cab9f9 fix(libkernel): map POSIX adaptive mutexes to the adaptive type
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 14:30:12 +02:00
PacukaandClaude Opus 5.5 98f050f879 fix(libkernel): default mutexes to error checking and add the adaptive type
The PS5 libthr (FreeBSD) creates error-checking mutexes by default and has
PTHREAD_MUTEX_ADAPTIVE_NP (type 4); relocking an error-checking or adaptive
mutex returns EDEADLK. Default mutexes were Normal and type 4 was mapped to
Normal, so a relock threw instead of returning EDEADLK, which aborted an
Unreal Engine title's recursive directory scan.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 14:28:33 +02:00
PacukaandClaude Opus 5.5 3e5648dcf7 fix(ajm): refuse Opus rates other than 48 kHz and record the parameter layout as unknown
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 14:28:19 +02:00
PacukaandClaude Opus 5.5 5ecf80e2f5 feat(ajm): decode Opus (codec 24) through FFmpeg
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 14:26:57 +02:00
QDarkRex 47f0bf93ef fix(relinker): identify unsupported Windows TLS instructions
The unsupported-instruction error now lists the instruction bytes, and the relink failure names the input file, the main executable or the guest module, on an extra Input: line.
2026-10-04 19:09:10 +07:00
Adrià FranchandClaude c5effd409e feat(shader): saturate VOP2 integer SDWA results on clamp
Co-Authored-By: Claude <[email protected]>
2026-10-04 13:36:35 +02:00
Adrià FranchandClaude 978dad19b1 feat(shader): accept every SDWA selector on VOP2 integer ops
Co-Authored-By: Claude <[email protected]>
2026-10-04 13:29:20 +02:00
Adrià FranchandClaude 50256b0ac4 fix(shader): VOP3 op_sel on v_alignbit/alignbyte_b32 and 16-bit max3/min3/med3
op_sel[1:0] on v_alignbit_b32/v_alignbyte_b32 selects the byte of src2 that
holds the shift, op_sel[2] is ignored and op_sel[3] writes the low 16 result
bits to the high half with the low half zeroed (measured on gfx1035).
v_alignbyte_b32 now uses src2[1:0] only, as the ISA says; values >= 4 gave
a wrong result before. v_max3/min3_{i16,u16} and v_med3_u16 take op_sel like
v_med3_i16 already does.

Co-Authored-By: Claude <[email protected]>
2026-10-04 12:41:07 +02:00
Adrià FranchandClaude 89eb938803 fix(shader): VOP3P integer clamp on v_pk_mad/add/sub_{i16,u16}
Co-Authored-By: Claude <[email protected]>
2026-10-04 12:33:38 +02:00
MichonandClaude Opus 5.5 34c57ca65d feat(agc): render into one depth slice of a 3D color target
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-04 12:24:09 +02:00
MichonandClaude Opus 5.5 d7d7c142f4 feat(agc): 4 KiB standard color targets and color views of one array slice
Color targets with the SW_4KB_S swizzle (CB_COLOR_ATTRIB3 tile mode 5) are laid out in 4 KiB
blocks with the standard element order the texture detiler uses, and are resident through the
same storage images as 64 KiB targets. A CB_COLOR_VIEW selecting one slice (SLICE_START equal to
SLICE_MAX) renders into that slice: the target starts one slice size per slice after the surface,
the slice size being the surface's mip chain as a texture of the same tile mode lays it out. Views
of several slices are still rejected.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-04 12:24:05 +02:00
SP4C3B4R-8andClaude Opus 5.5 48ebf3195e fix(libSceAgcDriver): skip depth and stencil tests whose plane is absent
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-04 12:17:38 +02:00
Adrià FranchandClaude 1233dd815d fix(shader): clamp f32 results to +0 for NaN and -0
Co-Authored-By: Claude <[email protected]>
2026-10-04 12:16:07 +02:00
Adrià FranchandClaude 1a5507698b fix(shader): choose v_div_scale_f32/v_div_fmas_f32 NaNs on the bits and refuse s_denorm_mode
v_div_scale_f32 returns a NaN source unchanged instead of scaling it,
and v_div_fmas_f32 quiets the first NaN input or returns the default
NaN 0xffc00000, so results no longer depend on the driver's NaNs. The
test compares NaN results bit for bit. s_denorm_mode throws: the
recompiler does not pin a denormal mode, so no value matches what it
models.

Co-Authored-By: Claude <[email protected]>
2026-10-04 12:05:33 +02:00
Adrià FranchandClaude 11bc279945 feat(shader): implement v_div_scale_f32, v_div_fmas_f32, v_div_fixup_f32 and s_denorm_mode
These make up the precise f32 division macro compilers emit for a / b. No
reference emulator implements them and the ISA pseudocode disagrees with the
hardware, so the rules were measured on an RDNA2 GPU:
- div_scale decides from the exponent fields only: 2^64 or 2^-64 scaling
  and VCC for differences >= 96 or <= -96, a denormal or huge (>= 253)
  denominator and a numerator exponent <= 24; a zero input gives 0xffc00000.
- div_fmas scales by 2^64 when the exponent of S2 is >= 128, else 2^-64,
  before the single rounding (the ISA says a fixed 2^32).
- div_fixup follows the ISA, and a NaN quotient with finite inputs becomes
  +-inf.
s_denorm_mode is accepted and ignored; listed in TechnicalDebt.

Co-Authored-By: Claude <[email protected]>
2026-10-04 12:05:33 +02:00
Adrià FranchandClaude 7f291b7658 feat(shader): implement the float and 64-bit inc/dec buffer atomics
buffer_atomic_fcmpswap, fcmpswap_x2, fmin_x2, fmax_x2, inc_x2 and
dec_x2 are compare-and-swap loops on the dword or qword. fcmpswap
compares as floats (-0 equals +0, NaN equals nothing) and fmin/fmax are
IEEE minNum/maxNum with -0 < +0, a quieted result for a signalling NaN
and the other operand for a quiet one, all with integer ops so the
driver's float controls do not matter. The existing 32-bit fmin/fmax
kept the old value whenever a NaN or two zeros were involved; it now
uses the same rule.

Co-Authored-By: Claude <[email protected]>
2026-10-04 12:01:15 +02:00
Adrià FranchandClaude ae36aafcb2 feat(shader): implement buffer_atomic_inc/dec and the 64-bit integer buffer atomics
buffer_atomic_inc, buffer_atomic_dec, buffer_atomic_cmpswap_x2 and
buffer_atomic_{add,sub,smin,umin,smax,umax,and,xor}_x2 threw in the decoder.
The 64-bit ones use native 64-bit SPIR-V atomics like the existing
swap_x2/or_x2; inc and dec wrap at the data operand through the existing
compare-exchange helpers.

Co-Authored-By: Claude <[email protected]>
2026-10-04 11:59:54 +02:00
Dean 2cf901bcff Merge pull request #401 from MichonGoddijn231849/perf/buffer-pool-buckets
perf(agc): keep the buffer pool's free slots by key and retain 4096
2026-10-04 22:56:48 +13:00
Dean 0bd5766246 Merge pull request #394 from MichonGoddijn231849/feat/mipmapped-3d-textures
feat(agc): mipmapped 3D textures
2026-10-04 22:56:31 +13:00
Dean 1104cfce5b Merge pull request #404 from MichonGoddijn231849/perf/color-swizzle-tables
perf(agc): build the color target swizzle tables once per element size
2026-10-04 22:56:14 +13:00
Dean 0623b69325 Merge pull request #376 from MichonGoddijn231849/feat/depth-bounds-bias
feat(agc): depth bounds test and depth bias
2026-10-04 22:55:57 +13:00
Dean bd753903e3 Merge pull request #294 from MichonGoddijn231849/split/color-target-gaps
fix(agc): color targets with gaps between written MRT slots, depth array slices
2026-10-04 22:55:40 +13:00
Dean 97822deb0b Merge pull request #446 from adriadam10/feat/vop3-f64-basic
feat(shader): implement basic f64 VALU ops
2026-10-04 22:55:23 +13:00
Dean ce8b0838ee Merge pull request #471 from adriadam10/perf/single-front-end
perf(shader): build a shader's front end once on first use
2026-10-04 22:55:06 +13:00
Dean 6a4bbade0d Merge pull request #435 from adriadam10/feat/vop3-mad-i64-i32
feat(shader): implement v_mad_i64_i32
2026-10-04 22:54:49 +13:00
Dean 13cbbfa7f7 Merge pull request #325 from adriadam10/feat/relative-indexing
feat(shader): implement v_movrelsd_b32, v_movrelsd_2_b32, v_swap_b32 and v_swaprel_b32
2026-10-04 22:54:32 +13:00
Dean f4071f2469 Merge pull request #331 from adriadam10/feat/format-d16-stores
feat(shader): implement the D16 format buffer stores
2026-10-04 22:54:11 +13:00
Dean 1f4e030374 Merge pull request #330 from adriadam10/fix/formatted-store-conversion
fix(shader): convert formatted buffer stores to the element format
2026-10-04 22:53:54 +13:00