rewatchSettledImports passed an import's 64 KiB-rounded span to
Rewatch. For an import whose size is not a block multiple the span's
last block holds pages past the allocation, the walk fails on them, and
the import stayed compared for good. Pass the import's own pages; the
shared-block and live storage image checks still use the block span.
#7948 requires the FMASK of an eight-fragment DCC target to be
write-watched at the initial import and at each reuse. On Windows an
FMASK in a host import whose deferred settle has not run yet is still
compared, so the target is refused with "native FMASK contents require
watched guest memory" after the previous commit has settled its color and
metadata ranges.
Call WatchedAfterSettle for the FMASK range at both checks, as the initial
import already does for the color, DCC and CMASK ranges. A range that is
unwatched without an import awaiting its read is still refused, and
nothing changes off Windows.
Four-sample targets take no FMASK range, so this changes nothing for them.
Refs https://github.com/boykopovar/AnyPS5/issues/9724
Rush 2 Recompiled (PPSA69423) and Wave Race 64 Recompiled (PPSA69424)
stop on Windows with "initial multisampled DCC contents require watched
guest memory" (https://github.com/boykopovar/AnyPS5/issues/9724). Their
multisampled color target lives in a 784 KiB host import made at map
time. An import under 1 MiB stays compared until a later lookup reaps
its deferred settle read, and the titles draw to the target first.
When an initial multisampled DCC import needs a range whose import still
waits for its settle read, submit that read now if it is still wanted,
wait for its fence and return the import to the write watch before the
check. This builds on #8527's ordering: the read goes through its
main-queue batch with barriers around it, so it runs after every earlier
main-queue access, and the wait happens under the GPU mutex that
submission holds.
An import that is not a whole number of 64 KiB blocks, such as these
titles' 0xc4000 bytes, never got a deferred read, and Rewatch refuses a
range that does not start and end on a block. Such an import now waits
for this path alone. It returns to the write watch with its partial
blocks whole, each stamped as a CPU store, unless another compared
import or a live storage image shares them.
Imports that stay compared for any other reason still do, an explicitly
unwatched range is still refused, and APS5_NO_DEFERRED_SETTLES still
keeps these imports compared.
The prosper console oracle measured SCE_KERNEL_ERROR_EINVAL for creating
a semaphore with an initial count above the maximum, a maximum of 0, a
negative initial count or a null name, for polling 0 or more than the
maximum, and for signalling 0. These threw, or polled past the maximum
returned EBUSY, and signalling 0 succeeded.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Firmware 13.60 subtracts Expires minus Date and Date minus Last-Modified
on unsigned ticks without comparing them, so either order wraps to a
lifetime that never runs out. Keep that behaviour, state it in the debt
doc, and cover both cases next to their in-order counterparts.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sceNgs2PanGetVolumeMatrix now returns the PS5 error codes in the PS5 check order instead of throwing, and lets NaN angles and distances through as the PS5 module does. sceNgs2PanInit gives the 7-speaker degree defaults for 0 speakers without angles, stores NaN speaker angles and leaves unused slots untouched. Inputs on which the PS5 library never returns still throw.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The PS5 libSceNgs2.native (firmware 3.20 and 4.03) accepts every value of the mastering gain param 0x30000004 with return code 0, clamps each level to [-32, 32] (so +-inf gives +-32) and keeps NaN, which then gives NaN samples. Ours threw on NaN and inf and did not clamp. A NaN sample in a PCM_I16L render buffer now throws, since the PS5 conversion was only measured into float buffers.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>