Stop a run on a FLOAT that is not finite, so proofs about FLOAT hold
The prover reasons about a FLOAT as a number: Y == Y holds, and X < Z or X >= Z. The interpreter let 1.0E308 * 10.0 become infinity and X - X become NaN and carried on, so a run broke claims the prover had proved (tests/prover/float-overflow.pseudo proved ASSERT Y == Y with Y NaN). The notation already stops on a FLOAT division by zero and on a whole number past 2^53 - 1. It now also stops, with an 'overflow' error, when an arithmetic result, a built-in's result or a literal is not a finite number (finiteCheck in interp.js). Every run then stays inside what a proof covers. Regression programs whose fix was to the language rather than to a rule now say where the run must stop, with a RUN-STOPS header the soundness test checks. A unit that does FLOAT arithmetic now carries a 'float-model' note: FLOAT is treated as a finite number, rounding is opaque, and the lab stops past about 1.8e308, while the generated Mojo goes on with inf or nan (stated for a division by zero, the case probes/float-special has verified). New probe mojo/probes/float-overflow.mojo asks the compiler what a Float64 product past the largest double gives; it is unverified and needs pixi run mojo-verify-item 'probes/float-overflow' (network). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FgvbRdoEheAHqsRmr2WuKZ
This commit is contained in:
1 parent
8f403226fb
commit
08c74c16d2
6 files changed
+56
-7
No files matched your search
+10
-1
@@ -3129,6 +3129,14 @@
|
||||
"verdict": "observed",
|
||||
"why": "did not compile"
|
||||
},
|
||||
{
|
||||
"corpus": "probes",
|
||||
"id": "probes/float-overflow",
|
||||
"key": null,
|
||||
"question": "does a Float64 product past the largest double give inf at run time, and inf - inf nan?",
|
||||
"verdict": "unverified",
|
||||
"why": "no answer from the pinned compiler yet"
|
||||
},
|
||||
{
|
||||
"corpus": "probes",
|
||||
"id": "probes/float-print",
|
||||
@@ -5506,7 +5514,8 @@
|
||||
},
|
||||
"probes": {
|
||||
"observed": 71,
|
||||
"pass": 13
|
||||
"pass": 13,
|
||||
"unverified": 1
|
||||
},
|
||||
"quest": {
|
||||
"pass": 170
|
||||
|
||||
Reference in new issue
Block a user