Skip to content

chore(upstream): sync batch 22 from boykopovar/AnyPS5 & metal driver draw key optimizations - #539

Merged
RINNECODER merged 23 commits into
mainfrom
sync/batch-22
Oct 17, 2026
Merged

RINNECODER merged 23 commits into
mainfrom
sync/batch-22

Conversation

@RINNECODER

Copy link
Copy Markdown
Owner

Summary

Upstream sync batch 22 bringing 18 vetted commits from boykopovar/AnyPS5 plus Metal driver performance optimizations:

  1. Draw Translation Cache Allocation Elimination: Eliminates heap allocations during hot-path draw translation lookups via reusable member scratchKey.
  2. Batched Readbacks: Consolidates fused texture readbacks into a single compute command encoder pass.
  3. Upstream PR Sync: PRs fix(libc): reject null secure scan destinations boykopovar/AnyPS5#7211, feat(libkernel): export nmount boykopovar/AnyPS5#7229, feat(libkernel): implement pthread_condattr_setpshared boykopovar/AnyPS5#7225, fix(libkernel): accept fractional nanosecond kevent periods boykopovar/AnyPS5#7206, test(libkernel): stagger the leaving-thread raise by the clock, not by yields boykopovar/AnyPS5#7216, fix(libSceHttp): make URI escaping independent of host locale boykopovar/AnyPS5#7214, fix(json2): keep numeric conversion independent of host locale boykopovar/AnyPS5#7215, fix(libSceNet): guard recvfrom sender outputs before receiving boykopovar/AnyPS5#7186, fix(recompiler): give a dynamic-mip storage image a slot for every level boykopovar/AnyPS5#7238, perf(shader): fold a select nested in a select on the same condition boykopovar/AnyPS5#7218, perf(shader): drop the result flush of a product behind its tiny-product check boykopovar/AnyPS5#7212, feat(agc): render 5_6_5 UNORM color targets boykopovar/AnyPS5#7213, fix(agc): take a later slice's HTILE clear when every word has ZMask 0 boykopovar/AnyPS5#7194, feat(libSceAgcDriver): support CMASK fast clears on base mip 0 of mipmapped 2D targets boykopovar/AnyPS5#7199, test(agc): skip the multisampled target test without storage image multisampling boykopovar/AnyPS5#7191, fix(libc): open long Windows host paths boykopovar/AnyPS5#7187, fix(libkernel): stat files under long Windows paths boykopovar/AnyPS5#7196, fix(libkernel): support lstat on long Windows paths boykopovar/AnyPS5#7202.

Test Gates

  • Conventions: 100% passed
  • Rosetta test suite: 25/25 passed
  • Metal test suite: 63/63 passed

simonbronk and others added 23 commits October 17, 2026 13:59
Prevent reached null conversion destinations from crashing sscanf_s and vsscanf_s. Return EOF before writes and retain earlier assignments. Add regression coverage through both guest ABI entry points.

AI-assisted: yes (OpenAI Codex). Windows WinLibs GCC 15.2 Release: production baseline crashes with the new regression; fixed shared libc passes guest_scan_count, guest_formatting, guest_wide_formatting and guest_strings (4/4). Conventions pass. Full all-target build was deliberately stopped after 83s with 3691 pending targets, not completed. No title or console run; constraint-handler invocation remains unimplemented as documented. No performance or coverage-percentage claim.
Prospero Themes (PPSA90210) imports nmount (3YnXspQNyw8) from libkernel
and fails to load without it:
"./app.elf: symbol lookup error: ./app.elf: undefined symbol: 3YnXspQNyw8".

Mounting file systems is not supported, so it throws if called, like
execvp does for executable replacement. The title opens its theme
library without calling it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sovthwyu4H63RMbRVha2Sy
PSFlyCast (PPSA99247) imports pthread_condattr_setpshared (3BpP850hBT4)
from libkernel and fails to load without it:
"./app.elf: symbol lookup error: ./app.elf: undefined symbol: 3BpP850hBT4".

The attribute stores PTHREAD_PROCESS_PRIVATE (0) or
PTHREAD_PROCESS_SHARED (1); a null or uninitialized attribute and any
other value return EINVAL without changing it, following FreeBSD 11
libthr thr_condattr.c and pthread_mutexattr_setpshared here. Sharing
across processes is not modeled, as for mutexes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Sovthwyu4H63RMbRVha2Sy
Prevent decimal-comma LC_NUMERIC from emitting invalid JSON and silently truncating decimal-point input. Keep 17-digit output, signed underflow and overflow rejection without changing the process locale.

AI-assisted: yes (OpenAI Codex). Windows WinLibs GCC15.2 Release: original shared Json2 fails the final locale regression; fixed guest_json and guest_json_numeric_locale pass (2/2, no skips). Final conventions pass. Only relevant runtime/test targets built; full build/full suite and game/console/Linux/macOS behavior unverified. No performance or coverage increase claimed.
AI-assisted: OpenAI Codex.
Windows native checks: 17 related CTests and 10 regression repetitions pass.
No affected title verified.
A dynamic-mip storage image reserved four mip slots, so a compute shader
whose T# spans more levels failed with "runtime storage image mip capacity
exceeded". PPSA01317 hits it on boot with a 512x512 surface of ten levels
and aborts. An RDNA T# addresses at most sixteen levels (4-bit BASE_LEVEL
and LAST_LEVEL), so a dynamic-mip image now reserves sixteen slots, and a
typed storage heap holds 64 elements so four such images still share one
class. Heap arrays keep their compact length. The runtime ABI goes to 14,
so existing shader caches are invalidated.

AI-assisted: yes
select(c, a, select(c, b, d)) is select(c, a, d), and
select(c, select(c, a, b), d) is select(c, a, d). The recompiler leaves
these behind when a register is written more than once under the same
lane mask and when the f32 NaN selection tests the same source twice,
and nothing folded them. The constant folder now takes the inner arm
the outer condition already decides, then folds a select whose arms
became equal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uct check

A v_mul_f32 in a FLOAT_MODE that flushes f32 denormals emits the
nearest-even tininess check, the NaN result selection and then a
result flush. The check already turns every product that rounds below
2^-126 into a zero of its sign, so the flush can't change what it
keeps. DenormalFlushEliminator now proves that: a select arm guarded
by the tiny-product check of the same denormal-free factors, an arm a
select takes only when its own bits are NaN, and an and with a mask
that has no significand bits are denormal-free.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Goosebumps Terror in Little Creek (PPSA27305) aborts in gameplay with
"unsupported color format 16 number type 0 component swap 2": it renders
into a COLOR_5_6_5 UNORM target. The target now renders into
R5G6B5_UNORM_PACK16. AMD keeps X in bits 0-4 and Z in bits 11-15, and
Mesa's ac_translate_colorswap programs SWAP_STD_REV for a surface with
red in bits 11-15, so with SWAP_STD_REV the exports are written as they
are and with SWAP_STD they are written with X and Z exchanged, as for
1_5_5_5. The alternate swaps and other number types keep throwing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A bind of slice 1 or later of a depth array read the slice's HTILE but took
its clear only when all its words were equal, because the HTILE word layout
of those slices is not modelled. Neither step needs the layout: the clear
is taken when every word of the range has ZMask 0 (a check over the set of
words), and the store-back rewrites each word in place from its own bits.
The value the surface is cleared to is DB_DEPTH_CLEAR, which the DB's depth
test reads for every cleared tile whatever its Min/Max Z (HTILE_Z_CLEAR_REG
in Mesa's src/amd/common/ac_descriptors.h), the same rule slice 0 already
follows.

PPSA05684 resets the four slices of its 2048x2048 D16 sun cascade array
every frame by writing ZMask 0 words with Min/Max Z 0 or 1 into their HTILE.
Slices 1 to 3 kept the previous frame's depth, and the main menu lost its
volumetric sun shafts and sunlit foliage.

agc_driver_depth_fast_clear_submit: slice 1 with words alternating 0x0 and
0xfffffff0 takes the clear, stores them back expanded and leaves slice 0's
HTILE alone. The refusal case keeps a word left expanded and is renamed.

AI-assisted: yes
…ltisampling

agc_driver_sample_multisample_target draws into a 4x target and reads
its samples back through a multisampled storage image. On a device
without shaderStorageImageMultisample, such as an Intel Arrow Lake iGPU
on ANV, the recompiler refuses that shader ('storage image multisampling
is unavailable on the target device') and the test failed. It now
skips there, as the recorder's storage multisample checks already do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-17T19:22:02.526324Z fe3189f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@RINNECODER
RINNECODER merged commit dda5969 into main Oct 17, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@RINNECODER
RINNECODER deleted the sync/batch-22 branch October 17, 2026 19:22
@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 83719bba-6d3b-41f9-a245-d95ded86245b
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.