vkQueuePresentKHR blocks the presenter for a frame's pacing on some
drivers (about 6 ms per present on NVIDIA in FIFO mode), and it ran under
GuestMemory::GpuMutex because the main queue needs external
synchronization with the recorder's submits. When the presentation
family has a free queue, the device now takes it as a presentation queue
guarded by its own mutex, and the presenter hands the image to it after
releasing the GPU mutex. WaitIdle takes that mutex around
vkDeviceWaitIdle. Without a free queue the present stays on the main
queue under the GPU mutex as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
RAND_add, RAND_bytes, RAND_status, RAND_load_file, RAND_file_name,
CRYPTO_malloc, CRYPTO_free and CRYPTO_set_mem_functions threw. They now
behave as in LibreSSL 2.6.5 through 3.4.3, where these functions did not
change: RAND_bytes fills the buffer from host entropy and returns 1,
RAND_add ignores its input, RAND_status returns 1, RAND_load_file returns
123456 for -1 and the requested count otherwise, RAND_file_name copies
"/dev/urandom" with strlcpy semantics, CRYPTO_malloc and CRYPTO_free use
the guest heap, and CRYPTO_set_mem_functions refuses with 0.
CRYPTO_malloc of zero or a negative size throws because later LibreSSL
versions take a size_t and call malloc instead of returning null.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A DLL that a global injector (Windhawk, antivirus hooks) loads into
every process can pull msvcrt.dll or ucrtbase.dll in before the entry
stub runs. That CRT then initializes in a GUI process without standard
handles and pins stdout and stderr to _file = -2, so after the stub
redirects the standard handles to anyps5.log, every write from a module
linked against that runtime is discarded as a successful no-op.
After SetCurrentDirectoryW the stub now asks each runtime that is
already loaded, through its own __iob_func or __acrt_iob_func and
_wfreopen, to reopen the streams whose standard handle the stub
redirected, onto the same log in append mode. A runtime that is not
loaded, a stream that kept its own handle and a failed log creation are
left alone, and a runtime that first loads with a module keeps binding
the redirected handles at its CRT init as before.
The test starts the converted executable suspended, loads the module's
runtime into it before the first instruction runs, and expects both
probes in anyps5.log, which reproduces the injector on a clean machine.
Co-Authored-By: Claude Fable 5 <[email protected]>
The DB clamps a pixel shader's exported depth to PA_SC_VPORT_ZMIN_0 and
ZMAX_0 unless DB_RENDER_OVERRIDE.DISABLE_VIEWPORT_CLAMP is set. Vulkan only
clamps with depthClamp, which also drops clipping, so the exported value
reached the depth attachment unclamped.
The pixel stage info now carries the two bounds when the shader exports
depth (0 and 1 otherwise), and the exported value is NClamped to them
before it is stored to gl_FragDepth. With
DISABLE_VIEWPORT_CLAMP the value is stored as exported; non-finite or
inverted bounds are rejected. DB_RENDER_OVERRIDE joins the draw key
registers. The bounds
are part of the recompile cache key (only for depth-exporting shaders, so
other keys do not change), the draw key and its register check, and
recompile requests (serialization version 47).
Tests: the pixel stage decode reads the bounds, passes the disable flag through
and rejects bad bounds, and leaves a draw without depth export at 0 and 1; a
recompiled depth export stores the NClamped value, and its bounds survive
serialization and key the cache.
Request version 47: main is at 44 (#8612) and open PRs also claim 44 to 46 (#8564, #7888, #9193 and the #9020, #9335, #9748 stack). Whichever of these lands second renumbers.
Measured in a payload process on a PS5 (firmware 13.60) through libkernel_sys.sprx's pathconf: /system_data gives 65536 for the allocation, transfer and hole sizes, 16384 for the transfer alignment, 3 for _PC_ACL_PATH_MAX and 0 for the ACL and MAC flags, and EINVAL for _PC_MAX_CANON, _PC_MAX_INPUT, _PC_VDISABLE and _PC_ASYNC_IO, which used to throw.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
agc_driver_bda_reads_shadowed_results, its per-build form and
agc_unit_shadow_completion_store force host imports to stay watched on
non-Windows hosts. On RADV, importing watched host memory and reading it
from the GPU both report the pages written, which is why the driver
compares those imports instead of watching them. Under the forced watch
those reports read as CPU stores: every shadowed unit is stale-dropped
before the address-based publish, and the tests fail on every run.
Both tests now run the import probe and skip, like agc_unit_shadow and
agc_shadowed_key_stores already do there, when the import or a GPU read
reports pages written. Devices whose imports stay clean until a GPU
write, such as lavapipe, still run them.
Console title libc.prx (PPSA26344) and libSceLibcInternal export H-TDszhsYuY as STT_OBJECT st_size 104; titles that resolve it as data need thirteen zeroed uintptr_t slots.
Both are exported by firmware 13.60 libSceSpSysCallWrapper.sprx as a single
jmp to the getpid and select stubs. Forward them and trim the debt entry to
sceSpPthreadMutexattrSetprioceiling.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
captureValidation gave each texture of a build its last lookup record by scanning the thread's lookup
log backwards once per texture. A build keeps all of its own records in the log, so a build over a
large image table read on average half of a log at least as long as the table for every texture: about
1.1 million record reads per capture for a 1,500-texture table. LastRecordIndices sorts the build's
objects once and walks the log backwards once, stopping when every object has its record: the same
records, in O((textures + records) log textures). Its scratch vectors are released like the log's
when a large build has grown them past the log's bound.
A graphics test compares LastRecordIndices with the backward scan over repeated records and objects,
absent and null objects, a 1,500-texture table over its own records, over records looked up twice and
over a log missing its first records, and random logs of up to 2,048 records.
Co-Authored-By: Claude Opus 5.5 <[email protected]>