Repository navigation
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
JJenkx
left a comment
There was a problem hiding this comment.
The fallback scans its special tokens in the caller's character locale before converting in the C locale. strncasecmp uses the current locale on macOS, and std::isalnum also uses the current character locale. Floating-point from_chars requires C-locale syntax for the whole scan. Apple libc · C++ floating-point grammar
I forced the exact fallback header at ece6946fc027 on Linux with a small adapter for LC_C_LOCALE, then compared with the ordinary std::from_chars branch. With tr_TR.UTF-8, INF, INFINITY, and -InFiNiTy! returned invalid_argument for both float and double when the ordinary branch accepted them. With tr_TR.ISO-8859-9, a NaN followed by a parenthesized non-ASCII letter also reported 6 bytes consumed where the C-locale parser consumed 3.
A local variant using strncasecmp_l(..., LC_C_LOCALE) and isalnum_l(..., LC_C_LOCALE) matched all 102 comparisons across C and both Turkish locales. Please make the character scan locale-independent as well. This checks the scanner contract. The two current callers reject or never generate these special tokens. The forced-branch test used Linux libc and did not run on macOS.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
The reviewed change has no verified blocking defects; the reported macOS tests were not run in this review.
What I ran
Read the prepared diff and all four changed files at head ece6946fc02790fa3cad337be239cacb96b44b15 through repo_read.py. No build or test commands were run.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | All four changed files read |
| Build and tests | not run | Results in the PR description are author-reported |
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and test results were not independently verified. Linux, Windows, Apple silicon, macOS 26, and console behavior were not tested in this review. All files listed as reviewed were read: core/libs/DecimalParsing.hpp, core/libs/prx/libSceNKWebKit/CharactersToNumber.cpp, core/libs/prx/libSceVideoOut/src/InputMapping.cpp, and core/libs/prx/libSceVideoOut/tests/InputMapping.cpp. No changed files were excluded.
To get this to a good state
Nothing is required.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thank you, you are right. I reproduced it natively on Intel macOS 15.7.8 at The scanner now compares AI-assisted: yes |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — changes requested
Changes are required before merge: restore the saved floating-point environment even when conversion or classification fails.
What I ran
Reviewed head c2aeb13ac63d603aacf2f5e7ef1cdb689a6b1884 and its prepared diff. I read all four changed files listed in the manifest; no commands or tests were run.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed code | passed | Four changed files read |
| Tests | not run | No local execution |
Findings
Blocking
core/libs/DecimalParsing.hpp:68changes the calling thread’s floating-point environment toFE_DFL_ENV, then restores it only on the normal path at line 73. Ifstd::stringallocation at line 64 throws, or a conversion/classification operation fails exceptionally, the caller’s rounding mode and exception flags may remain altered. Guard the environment change with an RAII restore so every exit path reinstates it.
Non-blocking
None.
Not verified
No tests or compilation were run. The PR description reports author-run macOS checks, but these were not independently verified. No files were excluded by the provided manifest; all four changed files were read.
To get this to a good state
Add exception-safe restoration of the floating-point environment, then rerun the relevant parsing and environment-preservation checks.
JJenkx
left a comment
There was a problem hiding this comment.
I retested the ASCII scanner on exact head c2aeb13ac63d. The forced fallback matched std::from_chars in all 102 comparisons across C, Turkish UTF-8, and Turkish ISO-8859-9.
For the floating-point environment follow-up, 72 checks passed across all four rounding modes. They cover successful, invalid, overflow, and underflow inputs, plus eight injected std::bad_alloc throws from the temporary string allocation for float and double. The caller's rounding mode and pre-raised exception flags survived all cases. The allocation happens before the switch to FE_DFL_ENV, and the ordinary out-of-range return follows the restore. This experiment used the exact fallback on Linux with a C-locale API adapter. Native macOS remains the portability check.
AI-assisted: yes
|
@MarcZX10 I checked the order at
So every path that changes the environment also reaches AI-assisted: yes |
|
Tested on Apple silicon: Apple M4, macOS 15.7.9, Apple clang 17.0.0, For this PR (at AI-assisted: yes (Claude Code) |
ligmaSec
left a comment
There was a problem hiding this comment.
pad_input_mapping and agc_driver_gcn_scalar_buffer_base passed on main and the patched tree on the same Linux llvmpipe device with Vulkan required, shader cache disabled, and validation layer 1.4.369. Both logs show layer insertion and no missing-layer diagnostic or VUID- entry. A Linux fixture that selected the macOS fallback passed 20,052 conversion comparisons and caller-state checks. Native macOS remains outside this run.
AI-assisted: yes.
|
I read |
The ask was an RAII restore of the floating point environment. In DecimalParsing.hpp the std::string is built at line 64, before fegetenv and fesetenv (lines 67-68). Between that and the restore at line 73 only strtof_l or strtod_l and std::fpclassify run, which cannot throw and have no early return, so every path restores it.
What
On macOS releases before 26, libc++ has no floating-point
std::from_chars, solibSceNKWebKit/CharactersToNumber.cppandlibSceVideoOut/src/InputMapping.cppdo not compile (call to deleted function 'from_chars').Both now call
ParseDecimal_nid_no_patchin the newcore/libs/DecimalParsing.hpp.std::from_charsexactly as before.from_charsgeneral syntax (decimal numbers,inf,infinity,nan,nan(...)), converts withstrtod_lorstrtof_lin the C locale under the default floating-point environment, restores that environment anderrno, and reports overflow and underflow to zero asresult_out_of_rangewithout writing the value.The guard is the one in RavenCurseBurg's candidate fix for
UpscaleMode.hpp(744123f, posted on #24341). This PR does not touch that file, solibSceAgcDriverstill needs that fix on these releases.#20016 also edits
InputMapping.cpp; thefrom_charscall it adds parses an integer.Refs #27647.
Tested
Native Intel Mac (i5-8259U, x86_64, no Rosetta, macOS 15.7.8, Apple clang 17.0.0), Release,
mainafdd339 plus the diff of #27201 so that libc compiles.pad_input_mapping,guest_nkwebkit_numbers,nkwebkit_wtf,nkwebkit_wtftext,nkwebkit_wtftext_allocation,nkwebkit_doubletofixedandnkwebkit_doubletostringconverter: each passed 5 of 5.pad_input_mappinghas new cases for rejected syntax, range limits and a written zero.floatanddouble: no difference in error code, consumed length or result bits (for NaN: sign and NaN class, not the payload), by default, with a comma-decimal locale, withtr_TR.UTF-8andtr_TR.ISO8859-9, and with downward rounding and flush-to-zero/denormals-are-zero set.errno, the rounding mode and MXCSR were unchanged after each call.from_chars: the onlyfrom_charserrors left are inVulkanDevice.cppandPresentationPass.cpp, both fromUpscaleMode.hpp:25.libSceAgcDriver/tests/Recorder.cppneeds generated shader headers that were not built; with placeholder headers it reports nofrom_charserror. The pass also reports an unrelated error onmain,libSceAgcDriver/Execution/src/GuestMemory.cpp:4175(no matching function for call to 'min').tools/pr_overlap.pywas not run.Not tested: Linux, Windows, Apple silicon, macOS 26, any title.
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)🤖 Generated with Claude Code
Summary by CodeRabbit