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:
7 files changed
+58
-7
No files matched your search
@@ -7,7 +7,7 @@ Generated by `python3 scripts/mojo/corpus.py status` from the goldens in this di
|
||||
| diagnostics | 0 | 0 | 0 | 42 | 132 |
|
||||
| local | 18 | 0 | 0 | 0 | 0 |
|
||||
| manual | 144 | 55 | 0 | 1 | 0 |
|
||||
| probes | 13 | 0 | 71 | 0 | 0 |
|
||||
| probes | 13 | 0 | 71 | 0 | 1 |
|
||||
| quest | 170 | 0 | 0 | 0 | 0 |
|
||||
| stress | 40 | 0 | 0 | 0 | 0 |
|
||||
|
||||
@@ -94,6 +94,7 @@ Generated by `python3 scripts/mojo/corpus.py status` from the goldens in this di
|
||||
| `error-try-finally` | the order of try, except and finally | observed |
|
||||
| `error-unhandled` | what reaches stdout, stderr, and the exit code when main raises? | observed |
|
||||
| `float-mixed` | can an Int and a Float64 be combined without a conversion? | observed |
|
||||
| `float-overflow` | does a Float64 product past the largest double give inf at run time, and inf - inf nan? | unverified |
|
||||
| `float-print` | how does print format Float64 values? | observed |
|
||||
| `float-round` | what does round() do on halves? | observed |
|
||||
| `float-special` | how are inf, -inf and nan printed after a run-time division by zero? | observed |
|
||||
|
||||
+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