A context that never wrote DB_Z_INFO or DB_STENCIL_INFO had neither
register, so a draw testing depth or stencil without a depth target was
refused (PPSA24040, DB_DEPTH_CONTROL 0x777), and a depth or stencil plane
whose other register was never written stopped on a missing register.
Both now start at 0, FORMAT INVALID, initially and after CLEAR_STATE.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
FreeBSD 11 localtime.c initializes tzname to WILDABBR (" ") and settzname()
resets both entries to it before filling them from the zone's types, so a
zone with no daylight saving type keeps " " in tzname[1]. Windows left it
empty and Linux repeated tzname[0].
FreeBSD 11 fopen opens the path with _open, and vn_open_vnode refuses a
directory only for FWRITE or O_TRUNC, so fopen of a directory in a read
mode succeeds; Linux hosts already open it. On Windows CreateFileW
without FILE_FLAG_BACKUP_SEMANTICS refused it with EACCES.
fopen now opens such a path as a libkernel directory descriptor, which
libkernel registers in libc when it loads, and fclose and freopen remove
it from libkernel's table. Reads on the stream fail with EISDIR and set
the error indicator, as on a Linux host and FreeBSD's tmpfs: the Windows
CRT fails them already but reports EINVAL. Writes fail with EBADF, and
fseek, ftell and ungetc work, as on any read-only stream.
A PS5 (firmware 13.60) allocates with any flag value, zero-fills only for
flag 2 and returns 64-byte aligned blocks. Record the measured behaviour of
sceNetGetIfName, sceNetGetRandom, sceNetGetSystemTime, sceNetMemoryFree and
sceNetUsleep, which already match the console, and keep only their open gaps.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
FreeBSD 11.4's sys_flock only requires a vnode descriptor, so flock on a directory descriptor succeeds. On Windows the call reached LockFileEx, which rejects a directory handle with ERROR_INVALID_PARAMETER, and flock_nid_postfix turned that into a runtime_error that aborted the process. A directory descriptor now returns 0 without taking a lock; the new guest_file_lock_directory case covers it and the debt entry records that no lock is held.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A payload on a PS5 (firmware 13.60) shows sceHttpUriCopy clears the
whole output and all prepare bytes of the pool before it reads the
source, so a source that is the output or lies in the pool copies as
empty. Read the source after clearing, clear the output with its
padding, and test the measured layout, failures and aliasing.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A payload process on a PS5 (firmware 13.60) parsed 124 status lines and
lengths. It checks lineLen only for its minimum of 8 and for the three
code digits, reads the version and its separators past it, and finds the
line feed up to and including the byte at lineLen, so a length that
stops right before the line feed still parses. When the version ends
past lineLen the unsigned subtractions wrap and the search continues
until a line feed.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Builds on #9037. Adds threads, event flags, semaphores, atomics, heaps
and kernel memory, callout contexts, time and SDK version queries,
base64 and hex codecs, integer and string helpers, JSON escaping, URL
encoding, online id strings, language codes, title ids and debug output.
The behaviour follows libSceNpCommon.sprx from firmware 12.00, read
from disassembly.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
After the argument checks, shadPS4 looks the request up and returns
REQUEST_NOT_FOUND for one that was never created or was deleted. The
library already tracks live requests for sceNpSetTimeout.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fibers may be initialized without a context and get one from
_sceFiberAttachContextAndRun or _sceFiberAttachContextAndSwitch.
_sceFiberInitializeWithInternalOptionImpl accepts the ulobjmgr,
context size check and FPU default flags.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A payload process on a PS5 (firmware 13.60) parsed, built and merged
several hundred URIs. sceHttpUriParse cuts the hostname at the first
byte that cannot be in it and starts the path there instead of failing,
takes the userinfo up to the first '@', accepts a port up to 65536 that
ends at '/' or the end, and gives https... schemes 443 and http...
schemes 80. It sweeps the path as sceHttpUriSweepPath does but sizes the
pool for the unswept path, and leaves require alone when the pool is too
small. sceHttpUriBuild writes IPv6 hostnames without brackets.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first commit drained the device for every label recorded while any
copied writer was listed, including labels nowhere near it. CPU-copied
writers also occur in default runs, so that could cost a drain per label
in normal play.
While a copied writer is listed, a label of 8 bytes or less (every
RELEASE_MEM, the fence WRITE_DATAs) is now not recorded on the GPU at all.
A completion action of the open (or newest in-flight) batch stores it when
that batch is reaped (AfterCompletions with storedOnGpu false, reason 5).
Completions run in push order and batches finish front-first, so it lands
after every earlier write-back without a drain. The existing GPU store
plus completion re-store path would not keep this order: its GPU store is
visible to a polling title before the write-back runs, and its re-store
runs only over a write-back that overlapped the label itself.
Recorder::PendingCompletionStores counts the guest stores completions
still have to make (not end-of-pipe deliveries or write-backs). While it
is not zero, later small labels follow the same route even after every
writer was written back, so a later GPU label cannot become visible
before an earlier completion store or land under it at one address.
Stores over 8 bytes keep the GPU store and go behind the completions only
over a copied writer's range or a pending completion store of their own
range. Queue 0 reaps while it spins on REWIND, so a title polling such a
label there cannot wait forever. The debt entry lists what this still
leaves out of order (larger stores and GPU-made DMA_DATA copies away from
those ranges, and a nested sync from inside a write-back).
APS5_DRAIN_COMPLETION_LABELS=1 brings back the drain (reason 2); a second
ctest entry runs the test with it.
CopiedWriterLabelOrder now skips with a line naming
minStorageBufferOffsetAlignment when the device binds the record at
+0x1004 in place (alignment 4, AMD's driver and RADV) and nothing is
written back. Above 4 the write-back count still fails the test. A new
pass checks the order across batches: a later label to the address of a
pending completion store is not visible before it and is not overwritten
by it at the reap.
Co-Authored-By: Claude Opus 5.5 <[email protected]>