fix(agc): parse FSR sharpness on older macOS runtimes #27843
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27843"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by RavenCurseBurg on 2026-11-27T15:18:10Z.
What
Targeting macOS 15 prevents the AGC driver from compiling because Apple's floating-point
std::from_charsis available from macOS 26. For older deployment targets, parseANYPS5_FSR_SHARPNESSwith Darwin's C-locale decimal conversion. Preserve the caller's floating-point environment anderrno. The configuration accepts finite decimal values in the range 0 to 2, including representable subnormal values. The availability check keeps the existing conversion on macOS 26 and the other hosts.Extend the existing presentation test with decimal exponent, subnormal, underflow, hexadecimal, leading plus, locale separator, and rounding-mode cases. This addresses the driver compilation failure observed while testing #24341.
Tested
agc_driver_presentation_passandagc_driver_presentation_fsreach passed three times on RTX 4060 and Intel UHD 770 on both parent and candidate. The Vulkan validation layer reported no VUID or synchronization hazards.I merged upstream
363e0bed4definto the submitted branch and checked the resulting tree. The project’s code and PR conventions passed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T15:29:28Z.
Review: CHANGES_REQUESTED
Reviewed — comments
Changes are required before merge: resolve whether the older macOS parser preserves the floating-point environment when its setup calls fail.
What I ran
Inspected the prepared diff and changed source at head
28727fd25cc5290d174eb5e4228b698105123c07. No commands or tests were run.Results
Findings
Blocking
core/libs/prx/libSceAgcDriver/Execution/include/UpscaleMode.hpp:36: The code ignores return values fromstd::feholdexceptandstd::fesetround, then unconditionally callsstd::fesetenv(&environment). If either setup operation fails,environmentmay not contain a valid saved state, and the parser can fail to preserve the caller’s floating-point environment as claimed. Check each return value and handle failure before parsing or restoring.Non-blocking
None.
Not verified
files.jsonand the preparedreview/files/copies were unavailable through the reader. Both changed files were read from the pinned repository head instead. No other changed files were listed in the manifest.To get this to a good state
Check the floating-point environment operation results and ensure every path restores a valid saved environment before returning or throwing.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T16:06:52Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: reject malformed decimal strings in the macOS fallback parser.
What I ran
Reviewed head
f775e9b6a4ed7ad7231bd538b0cf9d81ed691e79. Read the prepared description, commits, manifest, diff, both changed files, and the production caller inVulkanDevice.cpp. Usedrepo_read.pysearch and bounded reads; no build or tests were run.Results
Findings
Blocking
strtof_lconsumed the entire string. Because the filter allows multiple decimal points, strings such as1..2pass the character check andstrtof_lconsumes only1.; the parser can then accept the malformed value as1.0. Reject malformed decimal syntax or otherwise require the conversion to consume the full input.core/libs/prx/libSceAgcDriver/Execution/include/UpscaleMode.hpp:52.Non-blocking
None.
Not verified
Builds, tests, and runtime behavior were not verified. The PR description reports platform checks, but they were not run in this review.
files.jsonwas unavailable; the manifest lists two changed files, and both were read in full.VulkanDevice.cppwas read only around the production call site.To get this to a good state
Reject malformed decimal strings in the macOS fallback and add a regression case such as
1..2; rerun the relevant parser tests and macOS build.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T17:39:41Z.
Review: APPROVED
Reviewed — looks good
The code changes implement the older macOS parsing path and add focused input and floating-point-environment coverage; no defect was verified in the inspected changes.
What I ran
Reviewed head
65d42e289f41899a80645b0068ba80f8bab08794usingrepo_read.pyto inspect the prepared diff and changed source. No build or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
The reviewed changes are in
core/libs/prx/libSceAgcDriver/Execution/include/UpscaleMode.hppandcore/libs/prx/libSceAgcDriver/tests/PresentationPass.cppat the reviewed head.Not verified
Build and runtime behavior were not verified in this review. The author-reported platform and GPU results in the description were not independently run.
files.jsonwas unavailable; the manifest listed two changed files, and both were read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T09:26:49Z.
Review: COMMENTED
Paired Linux CTest runs of
agc_driver_presentation_passandagc_driver_gcn_scalar_buffer_basepassed onb97867d3ce6band this patch. Both Mesa lavapipe logs show Khronos validation 1.4.369 inserted and zeroVUID-errors. The same 10-bit and host-memory subcases skipped on each. I also compiled the exact alternate parser path against Linux POSIX locale headers and verified decimal parsing, subnormals, invalid input, and preservation of the caller's rounding mode and errno. The alternate parser check used Linux.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.