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]>
Implement sceNpWebApi2AddWebTraceTag with the (int64_t request_id, const char* value) signature from shadPS4. Validates that value is not null, accepts any request id, and acts as a silent stub matching the other offline request functions.
The shader disk cache source version hashed raw file bytes, so one commit
checked out with CRLF in one worktree and LF in another produced two
versions and emptied the cache and pipeline journal. Hash the text with
CRLF folded to LF.