Commit ccede7e
fix(gfql/cypher): round() review hardening — ulp-correct kernel, negative-precision decline, CI polars lane
Adversarial review of the round() conformance fix (4 IMPORTANT findings):
- I2/S2: replace floor(x+0.5) with a floor+frac kernel on both engines — the
+0.5 addition itself rounds up when x sits 1 ulp below a tie (JDK-6430675),
e.g. round(0.49999999999999994) must be 0.0 and round(0.0499…96, 1) -> 0.0
(pandas previously disagreed with polars/neo4j here). Also: scaled-overflow
identity (round(1e300, 20) = 1e300, not inf), -0.0 normalized (+0.0).
- I1: negative precision now declines honestly on both engines (neo4j raises;
polars previously crashed with a raw OverflowError, pandas silently computed).
- I3: the polars-parametrized cypher test_lowering cases never ran in CI (core
lane has no polars; polars lane's file list excluded the file) — added
cypher/test_lowering.py -k polars to bin/test-polars.sh + the ci.yml coverage
step (--cov-append).
- I4: setup.py polars extra floor >= 1.5 (round(mode=) kwarg requirement).
+ulp/inf/negative-precision tests (engine-parametrized, importorskip-guarded).
1620 tests pass; ruff + mypy clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 4946fe8 commit ccede7e
4 files changed
Lines changed: 58 additions & 10 deletions
File tree
- graphistry
- compute/gfql
- lazy/engine/polars
- row
- tests/compute/gfql/cypher
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
142 | 144 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
147 | 151 | | |
148 | 152 | | |
149 | | - | |
| 153 | + | |
| 154 | + | |
150 | 155 | | |
151 | 156 | | |
152 | 157 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1366 | 1366 | | |
1367 | 1367 | | |
1368 | 1368 | | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
1369 | 1372 | | |
1370 | 1373 | | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
1371 | 1377 | | |
1372 | 1378 | | |
1373 | 1379 | | |
| |||
1379 | 1385 | | |
1380 | 1386 | | |
1381 | 1387 | | |
1382 | | - | |
| 1388 | + | |
| 1389 | + | |
1383 | 1390 | | |
1384 | 1391 | | |
1385 | 1392 | | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
1386 | 1396 | | |
1387 | | - | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
1388 | 1400 | | |
1389 | 1401 | | |
1390 | 1402 | | |
1391 | 1403 | | |
| 1404 | + | |
| 1405 | + | |
1392 | 1406 | | |
1393 | | - | |
| 1407 | + | |
| 1408 | + | |
1394 | 1409 | | |
1395 | | - | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
1396 | 1417 | | |
1397 | 1418 | | |
1398 | 1419 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3028 | 3028 | | |
3029 | 3029 | | |
3030 | 3030 | | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
3031 | 3053 | | |
3032 | 3054 | | |
3033 | 3055 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
0 commit comments