HostImportFor walks the import map under the import mutex for every
in-place vertex input, index buffer and label it serves, most of them
for the same few buffers. It now first checks the last four imports a
lookup found, while the map is the one they came from: the imports epoch
moves with every retire and trim and the map's size with every insert.
Imports in the map never overlap, so the one that contains the range is
the map's answer. A hit counts its use as a map lookup does, so imports
age out of their eviction protection after as many lookups as before.
APS5_NO_RECENT_IMPORTS looks every import up in the map.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
FreeBSD keeps every character device on devfs, whose devfs_statfs reports
512-byte blocks, 2 blocks and nothing free. Windows threw for any console,
NUL or the guest random device, and Linux described the host's /dev mount.
A kqueue now returns EINVAL, as getvnode does.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The context calls, the callback registrations and
SetDefaultRequestOptParam threw. They now follow shadPS4's checks and
context ids, ContextStart returns SCE_NET_ERROR_RESOLVER_ETIMEDOUT, the
answer shadPS4 records for a console without internet access, and
Terminate releases the contexts.
The 15 exports threw. They now keep title contexts and requests, run
shadPS4's argument checks in its order, and answer the record, ranking
and board calls with SCE_NP_ERROR_SIGNED_OUT, which also finishes the
request, as shadPS4 does for a user with no connection.
NpMatching2 keeps its initialized state. sceNpSignalingDeactivateConnection
and sceInvitationDialogClose, which these titles also import, are declared
and throw.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The special port table had four slots and threw for a fifth user, which
the progress report counted as scePadOpen going back to a stub. A PS4
holds at most 16 accounts, so the table now has 16 slots and a 17th
distinct user id gets 0x809b0081, the code the console returned for an
unknown user id in the libScePad survey (PS4 Pro, firmware 10.71).
Co-Authored-By: Claude Fable 5.1 <[email protected]>
The ps4probe libScePad survey (PS4 Pro, firmware 10.71) measured the
special port with one user: a second scePadOpen returns ALREADY_OPENED
(0x80920004); scePadRead and scePadReadState give the rest record
(sticks 0x80, orientation w 1, acceleration y 1, connected 0);
scePadGetControllerInformation is zeroed;
scePadDeviceClassGetExtendedInformation reports device class -1; and
scePadSetVibration, scePadSetLightBar, scePadResetLightBar,
scePadSetMotionSensorState and scePadResetOrientation return 0.
The special handle is now accepted by every pad call: setters succeed
without touching the emulated pad, getters return the measured records.
Calls not covered by the survey follow the same rule and the debt entry
lists them.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
The 14 lookup and word filter exports threw. They now run shadPS4's
argument checks in its order over local title contexts and requests,
and the lookup, censor and sanitize calls finish with
SCE_NP_ERROR_SIGNED_OUT without writing an NpId or a comment.
The eight exports threw. They now run shadPS4's argument checks in its
order, keep up to eight contexts with ids allocated as shadPS4 does,
validate NpIds with the online ID rule, and answer a connection request
with SCE_NP_ERROR_SIGNED_OUT without creating a connection.
A single flag and one handle served every user's special port, so a
second user's scePadClose dropped the first user's handle from
scePadGetHandle. Each user now gets a handle of its own
(PAD_SPECIAL_HANDLE + slot, four slots), a repeated open returns it
again, and close frees only that slot. Whether the console shares or
separates the handles is not measured yet; the debt entry says so.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
cbrtf returned the host cbrt, so its result depended on the host: on
Windows it differs from the libc.prx that titles ship on 1,303,357,444 of
the 2^32 floats. That libc.prx is msun's s_cbrtf.c, which gives the same
bits as PPSA07923's, PPSA05916's and PPSA13934's copies for every argument.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
They returned the host sin, cos and tan, so their last bit and errno
depended on the host: on Windows sinf differs from the libc.prx that titles
ship on 3,349,410 of the 2^32 floats, cosf on 3,382,210 and tanf on
303,874,018. That libc.prx is msun's s_sinf.c, s_cosf.c and s_tanf.c over
the double-precision kernels and e_rem_pio2f.c with k_rem_pio2.c; its
sincosf returns the same pair, and only an infinite argument sets EDOM.
The ports give the same bits and errno as PPSA07923's, PPSA05916's and
PPSA13934's copies for every argument.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
logf returned the host log, so its last bit and errno depended on the host:
on Windows the bits differ from the libc.prx that titles ship on 13,225,175
of the 2^32 floats. That libc.prx is msun's e_logf.c, setting ERANGE for
+-0 and EDOM for every argument with the sign bit set. The port gives the
same bits and errno as PPSA07923's and PPSA05916's copies for every
argument; the FMA-contracted copy of PPSA13934 differs by 1 ulp on 961,881.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
atanf returned the host atan, so its last bit depended on the host: on
Windows it differs from the libc.prx that titles ship on 6,481,820 of the
2^32 floats. That libc.prx is msun's s_atanf.c, which gives the same bits
as PPSA07923's, PPSA05916's and PPSA13934's copies for every argument.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fgetws in the libc.prx that titles ship (the same 133 bytes in the
copies of PPSA13934, PPSA07923 and PPSA05916, read from disassembly)
differs from this one in two cases:
- A size below 2 returns null at once, without writing the buffer,
errno or the stream (cmp $0x2,%esi; jge, else the null result). Here a
size of 1 stored a NUL and returned the buffer, and a size of 0 or less
set the stream error and errno 22.
- When fgetwc returns -1 after characters were stored, the console
null-terminates and returns the buffer; it returns null only when
nothing was stored, and never checks ferror. Here a read error after
some characters returned null.
The rest already matches: each fgetwc result is stored as its low 16 bits
(mov %ax,(%rbx)), and the newline test compares all 32 bits. A null buffer
or stream, which the console dereferences, keeps failing with errno 22.
guest_standard_streams now expects the console results for sizes 1, 0
and -1 and for an invalid byte after a stored character; its fgetwc error
indicator check is unchanged. The libc debt entry cites the reading and
what it leaves unverified.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Videodec2 now outputs 10-bit HEVC Main 10 frames, so the HEVC picture info
takes bitDepthLumaMinus8 and bitDepthChromaMinus8 from the decoded frame
instead of leaving them 0. The Main 10 stream moves to HevcFixture.hpp so the
Vdecsw test can decode it.
Vdecsw read every decoded picture's info through Videodec2's AVC picture
info, which throws for HEVC, so an HEVC decoder failed on its first
picture. Videodec2 now hands Vdecsw a codec-independent picture header,
records whether an HEVC access unit starts with an IDR slice, and Vdecsw
keeps the AVC or the 0xb8-byte HEVC picture info for each picture.
The HEVC test stream moves to HevcFixture.hpp so the Vdecsw test can
decode it.
scePadOpen returned DEVICE_NOT_CONNECTED (0x80920007) for a special port
(type 2) since #3838, which guessed the console behaviour. A PS4 Pro on
firmware 10.71 with no special controller connected opens the special
port of any valid user and returns a handle: scePadRead on it returns one
record with connected false, scePadGetControllerInformation succeeds, and
scePadRead(-1) is INVALID_HANDLE.
Unity's PS4 input module opens the standard and the special port of a
user and keeps the pad handle only if both opens succeed; otherwise it
calls scePadRead with handle -1 every frame and the title never sees a
button. Knowledge is Power (CUSA09558) and Knowledge is Power: Decades
(CUSA12435) had no controller input for that reason.
The special port now opens PAD_SPECIAL_HANDLE, tracked apart from the
standard handle by scePadClose and scePadGetHandle. scePadRead and
scePadReadState on it return a zeroed record, scePadGetControllerInformation
and scePadDeviceClassParseData zeroed structures, and the other pad calls
reject it with INVALID_HANDLE. The standard handle still reads its own
queue, so the double read of one queue that #3838 fixed does not return.
scePadOpenExt is unchanged. The unmeasured parts are recorded in
docs/dev/debt/libScePad.md.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Measured on firmware 13.60: the released range stays mapped with its
protection and contents, and a fixed no-overwrite map over it fails
with ENOMEM; a null or unaligned address, an unaligned length or a
range that wraps returns EINVAL, checked before a zero length, which
returns 0, as does a range with nothing mapped.
Co-Authored-By: Claude Opus 5.5 <[email protected]>