test(libc): name the failing check in the math tests #11203
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11203"
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 MarcZX10 on 2026-10-25T21:48:06Z.
What
guest_math,guest_math_exactandguest_float_builtinscheck libc's math exports with a helper that aborts without a word:static void Require(bool value) { if (!value) std::abort(); }.GuestMath.cppalone has 574 calls to it. When one fails, ctest reports onlySubprocess aborted, and in an optimized build gdb cannot name the call either, because GCC merges the identicalabortcalls of the inlined checks. For example, in a RelWithDebInfo buildguest_mathaborted on anubuntu-latestrunner, and gdb blamedGuestMath.cpp:1131. The real failure was theatanfconsole-bit check at line 373 (the FMA contraction #11059 fixes). Finding it took a rebuild at-O0and then one with a line-printing helper.Each of the three files now uses the helper
GuestNanosleepLongRequest.cppalready has:Requiretakes a defaultedstd::source_locationand prints<file>:<line>: requirement failedto stderr before aborting. No call site changes. A check inside a local helper (RequireBytes,RequireCharacteristics, the floating-point state guard) reports the helper's line, which still narrows it to one function. There is one commit per test file.Tested
guest_math,guest_math_exactandguest_float_builtinspass.atanfcomparison inCheckAtanfConsoleBitsmakesguest_mathprint.../core/libs/tests/GuestMath.cpp:378: requirement failedbefore it aborts, where it printed nothing before.python3 tools/check_conventions.py --base upstream/mainandgit diff --check upstream/mainpass.tools/pr_overlap.py --branchreports two text-only overlaps: #10907 adds a constant on the line afterRequireinGuestMath.cpp, and #10780 adds includes next to these inGuestMathExact.cpp. Whichever lands second keeps both sides. Several other open pull requests add checks toGuestMath.cppin other lines. Windows and macOS were not run.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)Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-28T11:56:11Z.
Review: APPROVED
Reviewed
99652eb0048946b491a695c3dba29db3df0ff493— approve. Failed math requirements now report the caller's file and line before aborting, while the checks themselves and production math code are unchanged.Fresh Windows/GCC 15.3 Release builds:
guest_math,guest_math_exactandguest_float_builtinspassed 3/3 on both head and author base. A separate compiled probe uses the exact Require helper, verified identical across all three changed sources: a forced failure prints the caller's file/line on head; the baseline helper aborts without that diagnostic. This checks failure reporting as well as the passing path. No new console-math accuracy or full product execution result is claimed.