fchmod and sceKernelFchmod on either end of a pipe answered ENOENT on
Windows, where the pipe has no path, and changed the pipe's mode on Linux.
FreeBSD 11's pipe_chmod sends an unnamed pipe to invfo_chmod, which
returns EINVAL, as sockets already get here.
The firmware matcher at 0x1bb70 looks up the first character before it
compares any character with the end pointer, and the export at 0x1bd90
calls it without comparing the first and end pointers, so a range whose
first and end characters are the same still matches a word starting there.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
Name the commands that provide the compiler, CMake and Ninja on macOS
next to the existing mention of AppleClang in the relinker-only section.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
A synchronous draw read, uploaded, read back and stored a linear color
target whole, even when its scissor covered a small part of it, and the
store rewrote every byte with what was read before the draw, losing guest
CPU stores made meanwhile. For a linear target without DCC under a
smaller scissor, only the scissor's rows are read, only the scissor
rectangle is copied in and out, and the rows are stored with
WriteChanged against the bytes read.
Co-Authored-By: Claude <[email protected]>
Draw takes an optional fragment push range size. The new case sets it
to the stencil reference dword, so the shader data of a pixel shader
that reads its color with s_buffer_load_dword through a buffer
descriptor in user data is in a buffer with or without the pipeline
library, and the reference is the only push constant. The replayed
draw must color every pixel from the buffer. Without the buildPrepare
fix before it, both stencil replay registrations refuse that draw with
"guest buffer offset lies outside the shader's push constants".
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A pixel shader whose stencil export is replayed gets a push constant
block that ends with the stencil reference word. When its shader data
is not in push constants (registration modules give a shader with an
image a shader data buffer, and data over the stage push range goes
there too), the block holds only that word, and buildPrepare took any
non-empty block to mean the guest buffer offsets are in push
constants: the draw threw "guest buffer offset lies outside the
shader's push constants". Only the stencilReferenceDword words before
the reference now count as shader data in push constants; with none,
the offsets go to the shader data buffer, where the shader reads them.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fstat must fill the same FileStat as _fstat for an open descriptor, return EFAULT for a null buffer and EBADF for a closed or invalid descriptor, as the fstatfs check beside it does for _fstatfs.
Mode 1 threw for every input since fe4016f61, which stopped Grand Theft Auto V (PPSA04264) right after sceVoiceInit. It now returns 0 for priorities 256-767 with non-zero affinity masks within 0x1fff, the range sceVideoOutOpen accepts for its service thread; no voice worker threads run, so the values reach no host scheduling, and other values still throw.
The layer-pitch assertion was guarded by layerPitch + sliceBytes > BlockBytes,
which holds for this fixture, so it never ran. It now asserts the content of the
layer the depth surface does not start at, and a new case fills a 64 KiB
swizzled depth plane without storing it back, takes a four-layer view over the
same memory, and checks that the pending depth result is in guest memory before
the view is uploaded and that the overlapping layer holds the guest bytes that
were there.
The trap checks unmask exceptions with feenableexcept and its relatives
and expect MXCSR to hold the new masks, and the enable and disable
results to report the traps enabled on both units. Under Rosetta 2
MXCSR keeps its six exception masks set, so no SSE trap is ever enabled
and every result reports none. The test now asks the host once whether
it keeps an unmasked MXCSR exception and, where it does not, expects
all six SSE masks set and no trap on both units; on other hosts the
expectations are the same as before. A debt entry records that the
trap functions change only the x87 masks under Rosetta.
Under Rosetta 2 the six MXCSR exception masks always read back set: a
write that unmasks an SSE exception is not kept, while the x87 masks and
the other MXCSR bits are. guest_floating_point unmasked the overflow
exception on both units and then expected MXCSR to equal the value it
wrote, so it failed on macOS although fesetexceptflag and feclearexcept
left the masks alone. The test now compares with the environment read
back after the write, which on other hosts is the value written. The
debt entry for the floating-point functions notes the Rosetta behaviour.
main now starts libSceNetCtl initialized, so GuestNetCtl's checks before
sceNetCtlInit expect argument errors; the NpToolkit register, unregister
and check join them with the errors and result their IPv4 counterparts give.
main now keeps object keys sorted and stops at the end of the first
value, so the nested document lists its keys in order and "1,5" parses
as the integer 1 instead of failing.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
BunnyFl ran firmware 13.42's libSceHmd exports under an emulator. The
distortion and wide-near correction queries look the handle up before
checking initialization: a handle other than the one sceHmdOpen stored,
which stays 0 without a headset, returns HANDLE_INVALID even before
sceHmdInitialize. sceHmdGet2dVrCommand checks its arguments first:
PARAMETER_NULL for a null descriptor or command buffer or a null
pointer at descriptor offset 0, 8 or 0x20, and PARAMETER_INVALID for a
non-zero field at 0x34 or 0x38.
The queries and their sceHmdDistortion* aliases now answer in that
order. What handle 0 gets after initialization isn't measured, so it
throws NotImplemented_nid_no_patch instead of returning HANDLE_INVALID.
feof_unlocked, ferror_unlocked, getc_unlocked and putc_unlocked are macros
on macOS, so they are called without the global scope qualifier. The
remaining differences are the ones Darwin's headers and libSystem have:
- CLOCK_REALTIME_COARSE and st_mtim do not exist; the write mark uses
CLOCK_REALTIME and st_mtimespec.
- tm_zone is a non-const char*.
- __cxa_thread_atexit returns void, so the wrapper reports success.
- Darwin's stack protector reads __stack_chk_guard from libSystem; the
guard of the guest libc has the postfixed name, which receives the NID
of the original.
- APS5_EXPORT spells the symbols with the leading underscore of Mach-O.
- GuestArenaSetProtection and PosixProtection are built on macOS as on Linux.
- The fclose failure test fills /dev/full, which exists on Linux only.
exception_runtime relies on the Itanium unwinder of libc, which is not
registered on macOS (the host libc++abi is used), so its test is only
registered elsewhere.
unchangedUntil skipped a write by the reading instruction itself for every shader, so an RDNA s_load that overwrites its own address pair was taken as a user-data pointer load where main refused it. The skip now applies only to PS4 (GCN) shaders, where it is needed; PS5 shaders take main's path.
The SOPK branch of the GCN decoder never set the literal for
s_setreg_imm32_b32, so the eight-byte instruction was re-encoded as one
word and its decode threw "literal operand word is out of the code span
bounds". The decoder now copies the literal for that opcode; the new
agc_gcn_decode test decodes the reported stream.
Co-authored-by: javierUDP <[email protected]>
Co-authored-by: Savvanis Spyros <[email protected]>
Each GCN instruction is re-encoded to its RDNA form and decoded by the
existing RDNA decoder, so the PS4 path shares the recompiler. Covers the
legacy VS stage (program at the VS slot, user SGPRs from s0, vertex and
instance index in v0-v3), fetch shaders linked as user-data calls, MIMG
(image_sample and friends), PS4 buffer descriptors (GCN DATA_FORMAT /
NUM_FORMAT, 44-bit base) and T# image descriptors (GCN tiling in word 7).
The GCN switch is keyed into the shader disk cache. PS5 behaviour is
unchanged: every PS4-only rule is gated on GcnGuestShaders().
A one-sample depth target under a multisampled rasterizer without MSAA_ENABLE is drawn as one sample at the pixel center, but DB_EQAA INTERPOLATE_COMP_Z threw on it. Gran Turismo 7 (PPSA01317) draws its 3840x2160 main pass this way after its EQAA pass (PA_SC_AA_CONFIG 0x0020c002, PA_SC_MODE_CNTL_0 0x2, DB_EQAA 0x00050000, a Z_32_FLOAT depth target with one sample) and stops on it.
On this path every sample is taken to be at the pixel center, so Z interpolated to any sample position is the center's Z, which the one-sample draw already tests and writes. INTERPOLATE_COMP_Z is now accepted there. INTERPOLATE_SRC_Z and overrasterization still throw. Neither PAL nor radeonsi sets the bit and its meaning is not documented, so the debt entry records this as the same inference.