Repository navigation
fix(ini): Preserve legacy parsing for out-of-range numbers - #3436
CryoTheRenegade wants to merge 6 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughIntegral INI parsing now retries out-of-range ChangesINI Parsing
Priority: ⬆️ High Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change addresses the reported oversized INI value, and no actionable merge-blocking issue remains after normal checks. Pre-merge checks ·
|
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c3e0abfb-a13f-4e06-b88e-52951e0256b0
📒 Files selected for processing (3)
Core/GameEngine/Source/Common/INI/INI.cppTests/Google/Core/CMakeLists.txtTests/Google/Core/GameEngine/Common/INITest.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Skyaero42
left a comment
There was a problem hiding this comment.
This PR feels very AI-ish without human oversight.
xezon
left a comment
There was a problem hiding this comment.
Quite a bit complicated, but if this is faster and gives same results as original, then ok.
58fd63c to
f5f6dfa
Compare
xezon
left a comment
There was a problem hiding this comment.
Cool. If it works it works. You can also generate a benchmark for it.
Caball009
left a comment
There was a problem hiding this comment.
Looks ok.
Good to see better support for legacy parsing.
|
Benchmarks still coming or not? |
f5f6dfa to
4f68d8f
Compare
Fixes #2804
ShockWave uses
SpawnReplaceDelay = 9999999999999999999, which exceeds the signed 64-bit range used by thestd::from_charsparser and causes a startup crash.When
std::from_charsreportsresult_out_of_range, retry withstrtoll,strtoull, orstrtof. Integer conversion preserves the tested Windows legacy saturation and narrowing behavior. Floating-point overflow and underflow now produce legacy infinity or signed-zero results instead of a parse error.Accept a null-terminated
const char*token for the fallback and use astring_viewinternally forfrom_chars. Skip a leading+only forfrom_chars, but reject a following minus sign before parsing. This restores legacy rejection of double-sign inputs such as+-99999999and+-1.25on both the fast and fallback paths.AI assistance: Codex assisted with implementation, generated the tests, and ran the automated checks and earlier game smoke test.
Parser benchmark
ClangCL 23.1.3, Win32 Release, Intel Core i5-14500, Windows 11 Pro. Five randomly interleaved repetitions, 0.2 seconds minimum CPU time per repetition. Median CPU time divided by four tokens per iteration. Measured on 2026-10-12 with the benchmark added in d32299911.
Zero Hour
Generals
Each case uses four fixed tokens, not a measured distribution of game INI inputs. The current side calls the production INI scanners. The legacy side uses the original sscanf conversion and failure check. Results are local microbenchmarks, not game startup timings. Out-of-range sscanf results characterize this Windows CRT and are not portable C behavior.
Each game was measured separately using default OS scheduling, without processor affinity. Small timing differences should not be treated as conclusive speedups. Reproduction commands are in TESTING.md.