Every import lookup walked the lease out from the containing range to find
the run of continuing registry ranges, which is linear in the run length.
That walk depends only on the lease snapshot, the containing range and the
import window block, so its first and last index are now memoized per
thread under a weak reference to the snapshot, the range index, the window
and the window's low end. APS5_NO_RUN_MEMO walks every time.
Everything that depends on other state runs on each call as before: the
largest size, the budget, the failed blocks, the remembered refusals and
the halving block search. importRunBounds returns the chosen indices, so
sameRange, runCovers and the whole-run lookup in importAllocation compare
against the lease without copying the run's range pointers.
importRunFailureShrinkTests records a failed 8 MiB block between two
lookups on an unchanged registry and requires the run to shrink to its
4 MiB blocks. importRunGrowthTests and importRunReplacedTests check that a
run grows and shrinks when its ranges are registered or replaced.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The region name zones resolve to UTC on Windows (UCRT does not read them), so the round trip passed with no offset applied. Windows now runs PST8PDT and EST5EDT with the round trip, and checks tm_gmtoff and the daylight flag at a January and a July moment in 2001. The name zones stay on Linux and macOS.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A private guest commit on Windows (every anonymous kernel map commits
with a 16 KiB granule) ran reset() on each page before replacing it:
10 VirtualQuery calls, a placeholder split and the VirtualAlloc2, so
12 calls per page. At the arena's first-fit frontier the placeholder is
the arena's free tail, hundreds of GiB.
Commit now queries a placeholder once, cuts the range out of it (one
split where the range starts inside the placeholder, one where the
placeholder extends past the range), and carves the pages from that
bounded placeholder: one split and one VirtualAlloc2 per page, and no
split for the last page. Each page is still its own allocation with the
same protection, write watch and created ranges, so munmap, MAP_FIXED
remaps, views and collects see the same layout as before. A piece that
would cross the end of its placeholder (a whole-range granule over
several placeholders) still takes the coalescing path through reset(),
and committed memory in the range still only changes its protection. A
zero granule now throws std::invalid_argument before touching the
address space.
windows_write_watch counts the queries with a compile-time counter that
only that test defines (APS5_COUNT_MAPPING_QUERIES, copied from #9505)
and checks: 256 fresh pages one page into a 1 GiB placeholder take one
query (main's loop makes 2,561), each page is its own allocation and
the placeholders around them are intact; the release and recommit of
one page; a protection-only commit; the write watch of carved pages; a
whole-range granule inside one placeholder and across two; committed
pieces and adjacent placeholders inside the range; a partial release
and a fixed remap that keep their neighbours; a granule that would
cross the end of the placeholder being carved, which takes the
coalescing path; a short last piece; a commit that runs to the end of
its placeholder; an unwatched commit; and the zero-granule throw.
PPSA14363 boot on an RX 6700 XT, idle PC, 4 runs on main and 3 with
this change: the first 10 s after the first present go from 546-552
presents with a 578-704 ms frame to 588-594 presents with a 97-117 ms
frame.
Co-Authored-By: Claude <[email protected]>
Delegate sceNpCommerceDialogInitializeInternal to sceNpCommerceDialogInitialize, sharing dialog state and returning COMMON_DIALOG_ERROR_ALREADY_INITIALIZED on duplicate initialization, following shadPS4. Add regression tests in GuestNpCommerceDialog covering initial, duplicate, and post-termination initialization, and update technical debt documentation.
A multisampled sRGB target promoted to storage gained VK_IMAGE_USAGE_STORAGE_BIT on its image, and its color view in the sRGB format inherited that usage. sRGB formats have no storage image feature, so the validation layer reported VUID-VkImageViewCreateInfo-usage-02275 on the first storage access.
The view now excludes the storage usage whenever the image has it, which is what it already did for targets created with a sample-order storage form.
AI-assisted: yes. Written with AI assistance and reviewed by me.
MultisampleTargetStorageView required the rendered VkFormat to equal the requested one. A 4x R8G8B8A8_SRGB target asked for as guest format 56 (R8G8B8A8_UNORM) therefore threw "storage image access to multisampled color target ... is not implemented", although the target is created with a UNORM storage view for exactly this access.
The lookup now matches when both formats resolve to the same host storage format, which only holds for an sRGB format and its UNORM twin or for identical formats. Unrelated formats of the same size are still refused.
AI-assisted: yes. Written with AI assistance and reviewed by me.
The case expects an EVFILT_WRITE change on descriptor 0 to throw because
descriptor 0 is neither a socket nor the write end of a pipe. When the test
is started with a pipe as standard input the guest cannot tell the ends of a
Windows pipe apart, the change is accepted and the test aborts at that
check. Point descriptor 0 at the null device first so the result no longer
depends on how the test was started.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
A CPU store made inside a completion action (a copied buffer's write-back)
reached the flush hook with PublishScope::None, and PublishShadow skipped
such stores anyway. Nothing was published before the store landed, and
its own stamp then made every unit it touched stale, so the next publish
dropped those units whole: the storage results the store did not cover
were lost, both those already in the unit shadow and those of a pending
image the hook had just stored into it.
The hook now publishes the units such a store covers partly, as outside
completion actions, and its full Sync inside completion actions lands
the copies before the store. PublishShadow, FlushPending and
PublishShadowsOnly take a waited flag for this; other publishes made by
completion stores are still skipped.
On Windows only host imports of 1 MiB or more are settled and stay
write-watched; a smaller import is compared, so its range leaves the
watch and the unit shadow never engages. The address shadow test's heap
was 256 KiB, so both of its tests skipped on Windows with "the heap is
not imported or not watched", with the fix and without it.
The heap is now 2 MiB, filled exactly by a 1024x512 storage image, and
its allocation keeps one unregistered 64 KiB block after the range, so
no other registered range can continue it into a larger import run.
The assertions and Linux's forced watch are unchanged.
An address-based build binds the registered heaps in place and does not
store the storage results pending in them. With unit shadows on, a
write-back that retiled into the shadow reaches the import only through a
publish, and nothing published before such a build, so its pointer reads
saw the bytes of the last publish.
UploadFinish now publishes the fresh units over the heaps the build maps:
the address space's base on the cached path, the exempt in-place regions
on the per-build path. One AnyShadowedOverlaps check over their span
gates it, pending results stay pending, and the copies count under their
own publish reason, "address".
Failing run 39915816778 (windows conventions_function_bodies_shard_1 Timeout 30.06s; sibling shards took 27s on the same runner). No culprit merge: the 30s limit sat at the edge of normal runtime. Linux failure in that run was a runner-side submodule shallow.lock (infra).
Adds the PPSA01746 measurements on an RX 6400 to the existing entry: the awaited word already holds a slot address when the wait starts, and the RELEASE_MEM the driver saw was queued but not shown to land.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Read the clock of a libkernel condition attribute, returning
SCE_KERNEL_ERROR_EINVAL for a null or destroyed attribute as
scePthreadCondattrSetclock does, after FreeBSD 11.4 libthr's
_pthread_condattr_getclock. A null clock pointer throws.