Commit Graph

3760 Commits

Author SHA1 Message Date
Adrià fc50fde970
Merge pull request #1629 from ahmedhamouda78/feat/agc-dcb-reset-queue
feat(agc): write the measured sceAgcDcbResetQueue packet sequence
2026-10-10 07:58:22 +02:00
Adrià a2236210c3
Merge pull request #1605 from QRMOE/fix/shader-bitfield-mask-overflow
fix(shader): truncate overflowing 32-bit bitfield masks
2026-10-10 07:58:20 +02:00
Dean 6635c7abbf
Merge pull request #2117 from krishalivaibhav/codex/relinker-help
feat(relinker): support explicit CLI help
2026-10-10 18:54:09 +13:00
Dean e31154aa90
Merge pull request #2196 from AchrafReyani/fix/relinker-entry-point-bounds
fix(relinker): bound the entry point collector's header and symbol reads
2026-10-10 18:54:02 +13:00
Dean cbe83bbd20
Merge pull request #1755 from Zurisen/fix/windows-flock-semantics
fix(libkernel): give flock BSD semantics on Windows
2026-10-10 18:53:55 +13:00
Dean 903863c974
Merge pull request #959 from JAB-dev/feat/ngs2-pan
feat(libSceNgs2.native): implement sceNgs2PanInit and sceNgs2PanGetVolumeMatrix
2026-10-10 18:53:48 +13:00
Dean 001124896d
Merge pull request #2470 from oneandonlydean/up639/cmask-gpu-clear
fix(agc): apply CMASK fast clears per tile
2026-10-10 18:36:56 +13:00
Dean 691c0c3b35
Merge pull request #2451 from oneandonlydean/up639/half-wave-fp-reduce
fix(shader): read lane 63 of a wave64 v_max_f32/v_min_f32 half-wave scan
2026-10-10 18:36:48 +13:00
Dean 25ca708723
Merge pull request #2134 from MarcZX100/codex/fix-pr-overlap-utf8-output
fix(tools): write overlap reports as UTF-8
2026-10-10 18:36:41 +13: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
Dean 71ea4d5ee0
Merge pull request #2248 from MarcZX100/test/agc-untracked-refresh-visibility
test(agc-driver): flush untracked storage results before checking guest memory
2026-10-10 18:36:24 +13:00
Dean 3aae312a4b
Merge pull request #1552 from arvindfroi/test/decoder-length-table
test(relinker): check decoder lengths against an LLVM-generated table
2026-10-10 18:36:17 +13:00
Dean c323d49386
Merge pull request #2052 from esatturan/fix/ajm-atrac9-gapless-segments
fix(ajm): decode an ATRAC9 run's whole input and follow gapless segments
2026-10-10 18:36:09 +13:00
Dean 14469b74e8
Merge pull request #964 from JAB-dev/fix/ngs2-unset-matrix-passthrough
fix(libSceNgs2.native): mix ports without set levels through the default channel map
2026-10-10 18:36:02 +13:00
Dean b7bb2684ec
Merge pull request #1971 from Celegans12/perf/agc-held-texture-residency
perf(agc): keep sampled textures that are bound or used this frame
2026-10-10 18:28:51 +13:00
Dean 9ae2667e08
Merge pull request #1494 from TideOPL/fix/agc-pending-exact-surface
fix(agc): prefer the pending image of exactly a sampled surface over an aliasing mip chain
2026-10-10 18:25:25 +13:00
Achraf Reyani b1599a94ea fix(relinker): bound the entry point collector's header and symbol reads
The CFG/GOT filter's entry point collector checked header and symbol
positions as `offset + size > file size`, which wraps for offsets
near 2^64. A section header or symbol table offset there passed the
check, read bytes before the input buffer, and could reach an
in-bounds table through the wrapped address, adding entry points that
keep relocations alive. Check every position by subtraction instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 14:23:20 +09:00
Dean Galvin 9c3a35b867 fix(agc): apply CMASK fast clears per tile
A CMASK that was neither all fast-cleared nor all expanded threw, so a
title that fast clears a target and then draws over part of it before the
eliminate could not run past it.

The CMASK is now decoded tile by tile: one nibble per 8x8 tile in
1024x512 metablocks of 4 KiB, addressed with the pipe-aligned
SW_64KB_Z_X CMASK equation for 16 pipes (addrlib
GFX10_CMASK_SW_PATTERN, Gfx10Lib::HwlComputeCmaskAddrFromCoord). Code 0
stores CB_COLOR_CLEAR_WORD into the tile's texels, 0xF keeps them; any
other code, a cleared tile of a DCC target and any other CMASK swizzle
mode throw. Edge tiles are included and the CMASK is then stored as
expanded.

For a resident target whose CMASK is host-imported the clear is a
compute pass recorded in stream order: it reads the nibbles from the
import, stores the clear into the cleared tiles through a UINT view of
the image and fills the CMASK expanded, so nothing waits for pending GPU
writes of the CMASK. Invalid codes it reads set a bit that the next
materialization throws on. Otherwise the CPU reads the CMASK and stores
the cleared tiles into guest memory, or fills the resident image when
every tile is cleared. A CMASK nothing has stored over since it was
expanded is skipped.

The decode requires CB_COLOR_ATTRIB3 FMASK_SW_MODE SW_64KB_Z_X with
CMASK_PIPE_ALIGNED, a 4 KiB aligned writable CMASK and texels of at most
64 bits, and CMASK_BASE_EXT is part of the draw key.

Tests: CMASK sizes and nibble addresses against addrlib; decode
rejections and draw key coverage; CPU eliminate of full, partial,
out-of-range-nibble and DCC decompress cases and invalid codes. The new
agc_driver_cmask_fast_clear GPU test draws over fast-cleared and partly
fast-cleared linear and SW_64KB_R_X targets, eliminates partial, edge
and checkerboard CMASKs through the compute pass and checks that an
invalid code it reads throws.
2026-10-10 18:20:06 +13:00
Dean Galvin 1008b919cc fix(shader): read lane 63 of a wave64 v_max_f32/v_min_f32 half-wave scan
A wave64 vertex program reduces a float key across the wave with the same shape as the integer half-wave reductions: keys selected under the all-lanes EXEC with -inf (v_max_f32) or +inf (v_min_f32) outside the entry EXEC, four DPP row_shr steps, v_permlanex16_b32, then v_readlane_b32 of lanes 31 and 63, combined by one more v_max_f32. On a 32-lane host subgroup the read of lane 63 threw that it is outside the subgroup.

The matcher now also accepts FPMax32 and FPMin32 steps, with their BitCasts and the f32 denormal flush the float mode may add around operands and results; the flush leaves the -inf and +inf keys unchanged. When the entry EXEC proves that lanes 32-63 hold the constant key, every step there combines that constant with itself. The existing v_max_f32/v_min_f32 lowering returns the operand unchanged for equal operands (NaN included), so lane 63 is exactly that constant, and the read returns it. No subgroup float reduction is emitted. Lane 31, the lanes on a 64-lane subgroup, and the combining v_max_f32 keep their existing lowering. So NaN and signed-zero results are the ones the shader computes today.
2026-10-10 18:20:06 +13:00
Dean b667d1e30d
Merge pull request #2328 from TheAggie/fix/libc-collect-writes-whole-range
fix(libc): check a whole range before collecting its writes with reset
2026-10-10 18:19:17 +13:00
krishalivaibhav 1fc31ba358 feat(relinker): support explicit CLI help 2026-10-10 10:31:52 +05:30
Zurisen d2b8e66c09 fix(libkernel): decode flock operations as FreeBSD does
FreeBSD sys_flock takes LOCK_UN over LOCK_EX over LOCK_SH, ignores other
bits and fails with EBADF when none of the three is set. The operation
reached the host unchanged, so malformed operations differed between
hosts: Linux rejects them with EINVAL and the Windows lock tracking threw.
Decode the operation before either host sees it.
2026-10-10 06:49:20 +02:00
Zurisen 6daf7df9ae fix(libkernel): give flock BSD semantics on Windows
flock mapped each call straight onto LockFileEx/UnlockFileEx, whose
byte-range locks stack per handle. LOCK_UN without a lock failed with
ERROR_NOT_LOCKED and aborted the process, a repeated LOCK_EX blocked
forever, converting between shared and exclusive failed, and a repeated
LOCK_SH needed as many unlocks.

Track the one lock each descriptor holds: a repeated mode and LOCK_UN
without a lock succeed, a conversion releases the old lock before taking
the new one, and close forgets the descriptor's lock.
2026-10-10 06:49:20 +02:00
Dean bc40a6b5a0
Merge pull request #2469 from oneandonlydean/up639/occlusion-in-pass
perf(agc): keep occlusion counter dumps inside the open render pass
2026-10-10 17:47:42 +13:00
Dean 29fe66dfd1
Merge pull request #2450 from oneandonlydean/up639/half-wave-vertex-exec
fix(shader): match half-wave reductions in vertex programs
2026-10-10 17:47:33 +13:00
Dean ff2e6870d9
Merge pull request #2449 from oneandonlydean/up639/half-wave-lane-bits
fix(shader): prove half-wave reduction keys through selected and merged lane bits
2026-10-10 17:47:26 +13:00
Dean 14751060f4
Merge pull request #2357 from NahuelGenchi/fix/apr-submit-unconstructed-buffer
fix(libkernel): submit APR command buffers that were not constructed
2026-10-10 17:47:18 +13:00
Dean cb3aecac97
Merge pull request #2339 from johnmaia/fix/relinker-terminate-frame-chain
fix(relinker): end the guest frame-pointer chain at the entry stub
2026-10-10 17:47:11 +13:00
Dean 568745c091
Merge pull request #2335 from AchrafReyani/fix/directory-utf8-names
fix(libc): read directory entries through the wide dirent API on Windows
2026-10-10 17:47:03 +13:00
Dean ee364bf05f
Merge pull request #2324 from AchrafReyani/fix/libc-getcwd-application-heap
fix(libc): allocate getcwd's buffer from the application heap
2026-10-10 17:46:55 +13:00
Dean a7aa802c3e
Merge pull request #2293 from MichonGoddijn231849/fix/agc-prim-state-patch-hs
fix(agc): skip prim state preparation for a patch/hull mismatch
2026-10-10 17:46:48 +13:00
Dean 65bd2f778a
Merge pull request #2289 from AchrafReyani/fix/libkernel-unlink-directory-eperm
fix(libkernel): return EPERM when unlinking a directory
2026-10-10 17:46:40 +13:00
Dean 091505e146
Merge pull request #2284 from eljackjoestar-cmd/codex/pr-shader-module-lifetime
fix(agc): release shader modules after pipeline creation
2026-10-10 17:46:33 +13:00
Dean ac57f46711
Merge pull request #2275 from mrk1987/fix/libkernel-rwlock-concurrent-first-lock
fix(libkernel): initialize guest rwlocks before they are shared
2026-10-10 17:46:25 +13:00
Dean 2c7d2cec17
Merge pull request #2262 from NumberGuan/codex/validate-elf-identification
fix(relinker): validate ELF identification before parsing
2026-10-10 17:46:17 +13:00
Dean 42a1b1d75a
Merge pull request #2256 from NumberGuan/codex/fix-truncated-eh-frame-headers
fix(relinker): reject truncated EH frame headers
2026-10-10 17:46:09 +13:00
Dean af65ea2d8f
Merge pull request #2246 from zmeizy/claude/agc-fail-flips-before-report
fix(agc): fail a failed submission's flips before reporting the failure
2026-10-10 17:46:02 +13:00
Dean a5a4919746
Merge pull request #2245 from NumberGuan/codex/fix-eh-frame-sleb128-overflow
fix(relinker): reject overflowing signed unwind LEB128 values
2026-10-10 17:45:54 +13:00
Dean e2ba429015
Merge pull request #2243 from NumberGuan/codex/protect-relinker-inputs
fix(relinker): protect executable inputs from output overwrites
2026-10-10 17:45:47 +13:00
Dean ae3574bb0d
Merge pull request #2238 from mrk1987/fix/relinker-address-taken-tls-roots
fix(relinker): root code addresses taken by RIP-relative LEA
2026-10-10 17:45:39 +13:00
Dean 698254f048
Merge pull request #2236 from mrk1987/fix/release-direct-memory-unmaps-views
fix(libkernel): unmap direct memory views when the memory is released
2026-10-10 17:45:32 +13:00
Dean 5545196d0e
Merge pull request #2222 from EshaanJaiswal/fix-relative-relocation-bounds
fix(relinker): validate relative relocation table bounds
2026-10-10 17:45:25 +13:00
Dean 1598075951
Merge pull request #2215 from Zheorgyan/fix/debug-log-macro-name
fix(libc): define APS5_LOG_OUT_DEBUG when APS5_DEBUG_LOG is set
2026-10-10 17:45:16 +13:00
Dean a0579f4fba
Merge pull request #2202 from XairRrR/fix/pm4-unbalanced-marker-pop
fix(agc-driver): ignore marker pops without a pushed marker
2026-10-10 17:45:08 +13:00
Dean 5e5c72ee33
Merge pull request #2197 from XairRrR/fix/agc-collapsed-viewport
fix(agc-driver): rasterize nothing through a zero-scale viewport
2026-10-10 17:45:01 +13:00
Dean 6377727dd9
Merge pull request #2179 from oneandonlydean/up639/depth-bounds-absent-planes
fix(agc): pass the depth bounds test when both depth planes are absent
2026-10-10 17:44:53 +13:00
Dean ea8f654350
Merge pull request #2178 from oneandonlydean/up639/resummarize-blits
fix(agc): draw nothing for resummarize draws without depth or color work
2026-10-10 17:44:46 +13:00
Dean 4c39a245a4
Merge pull request #2157 from authurtabo-byte/fix/kernel-localtime-state
fix(libkernel): initialize the full local-time conversion state
2026-10-10 17:44:39 +13:00
Dean 661295e736
Merge pull request #2154 from gunerky/codex/diagnostic-fixture
test(relinker): isolate Windows diagnostic fixtures
2026-10-10 17:44:31 +13:00
Dean b57e66fa60
Merge pull request #2152 from MathiasDevelopes/feat/videoout-pre-vblank-start-events
feat(libSceVideoOut): deliver pre-vblank start events
2026-10-10 17:44:23 +13:00