Commit Graph
14017 Commits
Author SHA1 Message Date
Yunus Shaikh aaffe035ac test(agc): check that a checkerboard depth pass through the exact sample order path builds no recipe 2026-10-18 05:02:46 -07:00
Dean Galvin 5392c27efb test(agc): draw a fetchless mode 0 vertex shader on a remapping target
On a device without VK_EXT_depth_range_unrestricted the target remaps every
vertex shader, so an in-range draw carries the remap's push block too. Draw
it from a direct and from a prepared build; both must validate and store the
right depth.
2026-10-19 00:59:33 +13:00
Dean 0d078f75d3 Merge pull request #7089 from pushkarreddyy/fix/agc-driver-buffer-descriptor-reserved-bit
fix(libSceAgcDriver): normalize reserved bit 30 in guest buffer descriptors
2026-10-19 00:51:55 +13:00
Ahmad 0b24f92a6c fix(libc): append stream writes atomically on Windows
fopen and freopen in an append mode gave the C runtime a descriptor with
_O_APPEND, which seeks to the end of the file and then writes. Streams on
separate descriptors overwrote each other's data. FreeBSD opens these
streams with O_APPEND, so every flush lands at the end of the file.

Open append streams with FILE_APPEND_DATA but without FILE_WRITE_DATA,
so Windows writes each flush at the end of the file. ftruncate and
flock reopen the file to get the access such a handle lacks.
2026-10-18 14:49:55 +03:00
Alex ColliniandClaude Sonnet 5.5 7b3098714e docs(agc): keep the title name out of the released-textures debt entry
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-18 13:42:27 +02:00
Yunus Shaikh 4d906b8c04 test(shader): count direct images when selected records reach the image limit
The selected-records limit tests only read through image tables, so
nothing showed that the estimate counts direct images and samplers too.
TableManyKeyCode can now also load T#s straight from the SRT and sample
them, with the same samplers as the table reads and optionally a third
sampler on the last one.

agc_shader_selected_records_direct_image_limit:
- 63 selected reads and 1 direct image, 64 images: the per-key split is
  kept (63 selected tables and the direct image).
- 63 selected reads and 2 direct images, 65 images: over the limit only
  because of the direct images. Heap A's reads merge into one unselected
  table beside the 2 direct images (3 images, 3 pairs), and keys 2, 33
  and 64 still bind their records.

agc_shader_selected_records_direct_pair_limit:
- 31 selected reads and 1 direct image, each with 2 samplers, 64 pairs:
  the split is kept.
- The same with a third sampler on the direct image, 65 pairs: over the
  pair limit only because of the direct sampler. The reads merge into
  one table (2 images, 5 pairs), and keys 2, 17 and 32 still bind.

With ResourceTracker.cpp as on main 9caecfd2d5, the over-limit cases fail
with "image resource limit exceeded" and "sampled image/sampler pair
limit exceeded", and the cases within the limits pass.
2026-10-18 04:39:41 -07:00
Alexej Szpevák 93ea8f2684 test(libkernel): check the queued connection count on a listening socket
The listener read event now reports one connection after the first connect, and on Linux two once a second client is waiting, before both are accepted.
2026-10-18 13:35:15 +02:00
Alexej Szpevák b40e0bfb80 fix(libkernel): report the accept queue length for a listening socket's read event
A read event on a listening socket took its data from FIONREAD, which a listening socket refuses on Linux, so kevent and sceKernelAddReadEvent reported 0 connections while saying one was ready. FreeBSD 11.4 gives a listening socket filt_solisten, which reports so_qlen, the completed connections waiting for accept. Ready now checks SO_ACCEPTCONN and on Linux reads a TCP listener's accept backlog from TCP_INFO, where tcp_get_info puts it in tcpi_unacked; with no host call for the count (Windows, macOS, a listener that is not TCP) it reports 1, the lower bound the readiness already implies.
2026-10-18 13:35:15 +02:00
Myrarc cd0a067031 fix(libkernel): preserve sigtimedwait deadline across wakeups 2026-10-18 18:35:11 +07:00
Yunus Shaikh 364fb665c1 docs(shader): note that selected image-table records merge past the image and pair limits 2026-10-18 04:33:39 -07:00
Yunus Shaikh bab404e7af fix(shader): keep a shader's selected image-table records within the image and pair limits
Since #6243, each read whose record offset the CPU evaluates gets its own
selected table column, so a shader that reads one heap at many such keys
plans one image per key. Past 64 keys that is refused with "image resource
limit exceeded", or with "sampled image/sampler pair limit exceeded" when
each read is sampled twice, where the shader planned within both limits
before.

After planning the table columns, the tracker now estimates the images
and sampled pairs that collecting the program would add, keyed as
AddImage and AddSampledPair key them, from the planned column sources
and the direct handles. If either is over its limit, it plans again with
the columns of one heap unselected, the heap with the most selected
columns first, until both fit or no heap is left. Those reads then share
one keyed column, as before #6243: the union of their key domains and the
largest key. A shader within both limits plans exactly as before, from
one planning pass.

The estimate counts images exactly. A direct sampler is told apart by its
handle's words and whether the sample adjusts, before the canonicalization
collecting it applies, so the pair count can only be too high and errs
toward merging.
2026-10-18 04:33:39 -07:00
Dextroid17 c81cfce7cf docs(environment): say APS5_SRGB_SHADER_DECODE=copy samples 8 and 8_8 sRGB through the copy 2026-10-18 07:27:41 -04:00
Dextroid17 192a37d026 test(agc): force the sRGB sample copy with APS5_SRGB_SHADER_DECODE=copy 2026-10-18 07:27:15 -04:00
Dextroid17andJacmd b5502ee4a1 fix(agc): rename the near and far locals that windows.h defines
Co-authored-by: Jacmd <[email protected]>
2026-10-18 07:27:15 -04:00
Dextroid17 97354b7fd1 docs(debt): sRGB 8 and 8_8 textures read an RGBA8 sRGB copy 2026-10-18 07:27:15 -04:00
Dextroid17 49ad10b771 feat(agc): sample 8 and 8_8 sRGB textures through an RGBA8 sRGB copy
A device that cannot sample R8_SRGB or R8G8_SRGB had its sRGB textures
decoded in the shader, which cannot serve filtered samples: the decode must
come before the filter. The texture is now an RGBA8 UNORM image viewed as
RGBA8 sRGB, filled by a one-to-one blit of the R8 or RG8 texels (a snapshot's
upload, or a storage image's texels refreshed when its Version changes), so
the sampler decodes and then filters, and every sample, gather and load of
these images is an ordinary sRGB one. The recompiler is given the decode mask
only for formats the device cannot blit, or when APS5_SRGB_SHADER_DECODE=1
forces the shader decode. Tests run on lavapipe only.
2026-10-18 07:27:15 -04:00
Lberonio 9de7cfd9f4 docs(agc): clarify flip latch clearing condition 2026-10-18 14:26:35 +03:00
Thomas Abdelmalak 8aea41b5cc test(libSceFont): assert attributes are isolated per handle and per glyph 2026-10-18 14:25:29 +03:00
milescovielloandClaude Opus 5.5 d484281b61 perf(shader): keep one use list per IR value
Every IR value kept two lists of its users: uses (the users) and
operandUses (the users with their operand index). AddArgument,
ReplaceArgument and ReplaceAllUsesWith updated both, and each value
allocated and freed both. Only operandUses is kept now. Uses() is a view
of the users in operandUses, and HasUses, UseCount and Invalidate read
it. sizeof(IrValue) drops from 152 to 128 bytes; the plan value encoder
writes no use lists, so only its size check changes.

The two lists held the same users in the same order, except after
ReplaceArgument on a user that took the value in more than one
operand: uses dropped the user's first entry and operandUses the
replaced operand's entry. Uses() now follows operandUses there too.

shader_ir_use_rewrite counted the allocations of both lists: its
allocation failure check now fails the one reserve ReplaceAllUsesWith
makes, and its growth check allows the allocations of one list, which
main exceeds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 11:23:47 +00:00
Scramblrrrr 0a7cb2fca1 docs(videoout): list the SDR environment override 2026-10-18 08:18:22 -03:00
Scramblrrrr 482894b0dc Merge remote-tracking branch 'origin/main' into codex/videoout-force-sdr-main 2026-10-18 08:17:45 -03:00
David Fontanet BujaldónandClaude Opus 5.5 c494367836 Merge boykopovar/AnyPS5 main into fix/conventions-unknown-nid-collisions
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 13:17:36 +02:00
Dean 3e3e8b9050 Merge pull request #7374 from thuanquang/fix/mesh-last-provoking-vertex
fix(agc): draw geometry programs with the last provoking vertex
2026-10-19 00:13:37 +13:00
Dean 721f29c7e1 Merge pull request #7487 from DavidSamir/fix/shader-barycentric-tessellation-clip-moltenvk
fix(shader): keep clip distances in the blocks between the barycentric tessellation stages
2026-10-19 00:13:33 +13:00
Dean 7a2e4a4e7f Merge pull request #7476 from EagleBearerYS/fix/agc-settle-rewatch-live-images
fix(agc): keep a settled import compared while a storage image overlaps it
2026-10-19 00:13:29 +13:00
Dean f55ccad7c9 Merge pull request #6078 from 011010/feat/env-reference
feat(tools): add the APS5_* and ANYPS5_* environment reference and check it
2026-10-19 00:12:57 +13:00
Destroyers212xandClaude Opus 5.5 f08068ff56 test(relinker): run the macOS guest module argument check under Rosetta
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 07:12:46 -04:00
milescovielloandClaude Opus 5.5 41b25e4f57 perf(shader): reserve an IR value's arguments for its opcode at creation
Every IR value grew its argument vector one AddArgument at a time from
empty, so a value with three arguments allocated three times (capacity
1, 2 and then 4) and freed the first two. The constructor now reserves
IrOpcodeOperandCount(opcode) arguments, the count IrBuilder::Emit
already requires, so a value built with its opcode's arguments
allocates once. Opcodes without fixed arguments (constants, phis)
reserve nothing, as before. The IR and the SPIR-V are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 11:11:11 +00:00
pushkarreddyy c3c400a6f8 fix(libSceAgcDriver): normalize reserved bit 30 in guest buffer descriptors 2026-10-18 16:38:59 +05:30
Dean Galvin 2ca390366b fix(agc): accept the depth remap push block in the shader interface check
The SPIR-V interface check only allowed a push constant block for a program
with push data of its own, so a remapped vertex shader without any was
rejected as having an invalid push constant interface.
2026-10-18 23:53:58 +13:00
Kovalev Vladislav 9b42649a93 fix(agc): reconcile FMASK reads with current main 2026-10-18 16:53:33 +06:00
Lberonio 863e3f5815 docs(agc): record why the flip event latch cannot be bounded in time 2026-10-18 13:52:37 +03:00
Dean 9f25d0bf5b Merge pull request #7175 from pushkarreddyy/feat/agc-driver-primitive-polygon
feat(libSceAgcDriver): support polygon primitive type 21
2026-10-18 23:52:22 +13:00
AlxcBTW 0d699295a9 docs(agc): say which profile lines count per window and which since start 2026-10-18 12:36:32 +02:00
milescovielloandClaude Opus 5.5 f099292f8c perf(shader): leave out the both-zero select of f16 min and max
minMaxF16Bits compares the halves as ordered integers (the low 16 bits
sign-extended, with the magnitude bits of a negative half inverted),
then replaced the result when both halves were zero: max took a & b and
min took a | b. The ordered integers already put -0 (-1) below +0 (0),
so the compare picks +0 for max and -0 for min, which is what the
both-zero select produced. Every caller passes halves with their upper
16 bits clear (readF16Bits masks them, the packed path extracts them),
and for those all 2^32 pairs of each give the same bits with and
without the select. Each f16 min, max, min3, max3 and med3 now emits
five instructions fewer per pair.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 10:31:17 +00:00
AlxcBTW cb3d1d1dce fix(agc): say "cumulative" on the profile lines that count from the start 2026-10-18 12:29:55 +02:00
Dean Galvin b876d43fb1 fix(agc): journal whether a vertex shader reads the depth remap push words
The flag that adds the vertex stage to the push constant stages was not part
of the encoded result, so a journalled remapped vertex shader replayed
without it. Encode and decode it with the invocation and cover it in the
result round trip and the push stage test.
2026-10-18 23:28:51 +13:00
pushkarreddyy d6300dd1b6 feat(libSceVoice): implement sceVoiceEnableChat and sceVoiceDisableChat 2026-10-18 15:58:47 +05:30
pushkarreddyy f07df07969 feat(libSceAgcDriver): support polygon primitive type 21 2026-10-18 15:56:57 +05:30
Thomas Abdelmalak ce4a1dc054 feat(libSceFont): implement handle and glyph attributes 2026-10-18 13:23:28 +03:00
AlxcBTW 127ee82f02 feat(libc): dump the faulting thread's stack words in Windows crash reports
APS5_CRASH_STACK_BYTES=<n> prints n bytes of stack words from rsp after the
stack return address candidates, then eight words at every distinct stack word
that points at readable, non-executable memory outside the thread's stack.
Off when the variable is unset, empty or 0.
2026-10-18 12:20:10 +02:00
011010 99e295a7ba test(tools): register and extend the environment rule tests 2026-10-18 04:16:05 -06:00
011010 061101a3e8 fix(tools): report a row the pull request removes 2026-10-18 04:16:04 -06:00
AlxcBTW 17dd47d71e fix(agc): print the revalidate profile per 10 s window 2026-10-18 12:09:36 +02:00
Werner 24e5819213 test(relinker): run a 64 MiB-gap image for the Windows sparse load test
Windows refuses to start the image with a 0x7fe00000 gap (CreateProcess
WinError 193, SizeOfImage 0x7fe3e000), with or without this change. The
far image still checks the PE layout and the macOS conversion; native
Windows execution now uses a fixture whose segment is 64 MiB away.

Reported by simonbronk in the review.
2026-10-18 10:08:57 +00:00
Scramblrrrr 209f3ce87b test(shader): adapt volume rejection fixture to shared columns
(cherry picked from commit 913b93635b84ce4eb13b033ba63e1e5c29708118)
2026-10-18 02:56:51 -07:00
Yunus Shaikh dad24e3a4f Merge main into perf/shader-image-table-reuse-v3-pr 2026-10-18 02:56:48 -07:00
Dean Galvin 441ff87188 fix(agc): give a depth-remapped vertex shader its push constant stage
A remapped vertex shader reads the scale and offset from the push block, but
the pipeline's push constant stages only counted programs with push data of
their own, so a shader with none got no stage in a non-GPL layout and its
scale and offset never arrived. The result now says it reads them, and the
push stages include the vertex stage for it. The draw test gains a fetchless
remapped vertex shader with no push data.
2026-10-18 22:51:26 +13:00
milescovielloandClaude Opus 5.5 3fdef48e54 perf(shader): mark live values of a reclaimed program without a hash set
IrProgram::ReclaimUnusedValues put every live value into an
unordered_set, one allocation each, and looked every value of the
program up in it again. Values enter the program only through
CreateValue, which numbers them with nextValueId, so an id names at
most one of them. The marks of those values now live in a vector
indexed by id, after a check that the id's owner is the same pointer.
A value the program does not own, such as one in the resource plan's
value storage, which may reuse an id, still goes into a set. The values
kept and removed are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 09:47:56 +00:00
cadenasynysterandClaude Opus 5.5 9f3e867eec feat(libc): implement std::__throw_bad_variant_access
Onimusha: Way of the Sword (PPSA27836 01.000.001) imports
_ZSt26__throw_bad_variant_accessv (9G6z-nF6njg) from libc, and its
bundled libc.prx does not export it, so the title fails to load with
an unresolved import.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GtXavMkgCTCdmRpweviHcQ
2026-10-18 11:41:56 +02:00