Commit 5a8dd27
authored
fix(test): mark the bridge's real round trips broken on Windows (#56)
* fix(test): mark the bridge's real round trips broken on Windows
main was red on both Windows runners: 23 failures, all in
test_libpari_ext.jl, all in reals. Every other part of the bridge passes
there.
Cause. On Linux and macOS, GIAC renders a REAL at *that value's*
precision — 156 significant digits for a 512-bit value — and the global
`Digits` has no effect on it. The bridge reads a Giac REAL back by
decoding its printed decimal and relies on exactly that.
On Windows, GIAC honours `Digits` instead, default 12. Every real crossed
truncated to twelve significant digits:
expected 3.1415926535897932384626433832795028842
obtained 3.14159265359 0000062
at every precision asked for — 64, 128, 192, 256, 384, 512, 1024 all give
the same twelve digits, so it is a ceiling, not a rounding difference.
`Digits` governs GIAC's parser on Windows too, so
`convert(GiacExpr, ::BigFloat)` cannot even store a wide value: it lands
on DOUBLE rather than REAL.
Worth recording plainly, because it is the more useful lesson: the
decode *verifies itself* by re-encoding the candidate and comparing
printed forms, and that check was blind here. Re-encoding the truncated
value also prints twelve digits, the forms agree, and a wrong answer is
confirmed. The check establishes the printer's self-consistency, not its
fidelity; the two coincide only where the printer is faithful. A guard
that inspires confidence without providing it is worse than none.
The assertions are marked `@test_broken` rather than skipped, so the
suite errors if they start passing and tells whoever fixed the platform
difference to remove the marker.
The documentation claimed Giac's printer emits a REAL at the value's own
precision "rather than at a global setting", presented as measured fact.
It was measured on Linux only. Corrected, with a dedicated section, a
warning admonition on the reals section, and an entry in the limitations
list.
Not attempted here: raising `Digits` around the read, which might restore
Windows. That needs a Windows runner to judge and belongs on its own
branch — this one only stops main lying about the state of the tests.
* fix(test): mark the bridge's real round trips broken on Windows
main was red on both Windows runners: 23 failures, all in
test_libpari_ext.jl, all in reals. Every other part of the bridge passes
there.
Cause — a known ABI bug between the two binaries, not a Giac quirk and
not something this bridge can work around. `class gen` stored its tag as
a bitfield, `unsigned char type:5; unsigned char type_unused:3;`. GCC
fuses adjacent bitfield writes into one wider store and picks the bit
placement in a version-dependent way. GIAC_jll is built with GCC 8 and
libgiac_julia_jll with GCC 10, so they disagree about which bits hold
`type`: libgiac writes a gen tagged _REAL and the wrapper reads back
_DOUBLE_. The suite observes it directly:
Expression: Giac.giac_type(wide) == REAL
Evaluated: DOUBLE == REAL
Everything else follows. Giac.jl believes it holds a Float64, prints at
the global `Digits` — default 12 — and every real crosses truncated to
twelve significant digits:
expected 3.1415926535897932384626433832795028842
obtained 3.14159265359 0000062
identically at 64, 128, 192, 256, 384, 512 and 1024 bits, because 53 bits
is all a mis-tagged DOUBLE ever had. Raising `Digits` would change
nothing: the precision is lost at the tag, not at the printer.
Fix in flight upstream: JuliaPackaging/Yggdrasil#13717 bumps GIAC_jll to
v2.0.2 with GIAC_TYPE_ON_8BITS=1, making `type` a plain byte at offset 0
and the ABI compiler-invariant, followed by a libgiac_julia_jll bump.
Same root cause as #22 and the probe in #26.
The assertions are marked `@test_broken` rather than skipped, so that
when both JLLs land the suite reports unexpected passes and tells whoever
did it to delete the markers.
One thing this did establish about the bridge itself: its decode verifies
itself by re-encoding the candidate and comparing printed forms, and that
check is blind here. Re-encoding the truncated value also prints twelve
digits, the forms agree, and a wrong answer is confirmed. The check
establishes the printer's self-consistency, not its fidelity — the two
coincide only where the tag is right. Worth stating, because I had
described that check in the docs as what makes a text-mediated step safe.
The documentation claimed Giac's printer emits a REAL at the value's own
precision "rather than at a global setting", presented as measured fact.
It was measured on Linux only. Corrected, with a dedicated section, a
warning admonition on the reals section, and an entry in the limitations
list.1 parent 3f3b258 commit 5a8dd27
4 files changed
Lines changed: 310 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
10 | 57 | | |
11 | 58 | | |
12 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
148 | 155 | | |
149 | 156 | | |
150 | 157 | | |
| |||
179 | 186 | | |
180 | 187 | | |
181 | 188 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
192 | 205 | | |
193 | 206 | | |
194 | | - | |
195 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
196 | 268 | | |
197 | 269 | | |
198 | 270 | | |
| |||
220 | 292 | | |
221 | 293 | | |
222 | 294 | | |
223 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
224 | 303 | | |
225 | 304 | | |
226 | 305 | | |
227 | | - | |
| 306 | + | |
228 | 307 | | |
229 | 308 | | |
230 | 309 | | |
231 | 310 | | |
232 | | - | |
| 311 | + | |
233 | 312 | | |
234 | 313 | | |
235 | 314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5422 | 5422 | | |
5423 | 5423 | | |
5424 | 5424 | | |
| 5425 | + | |
| 5426 | + | |
| 5427 | + | |
| 5428 | + | |
| 5429 | + | |
| 5430 | + | |
| 5431 | + | |
5425 | 5432 | | |
5426 | 5433 | | |
5427 | 5434 | | |
| |||
5456 | 5463 | | |
5457 | 5464 | | |
5458 | 5465 | | |
5459 | | - | |
5460 | | - | |
5461 | | - | |
5462 | | - | |
5463 | | - | |
5464 | | - | |
5465 | | - | |
5466 | | - | |
5467 | | - | |
5468 | | - | |
| 5466 | + | |
| 5467 | + | |
| 5468 | + | |
| 5469 | + | |
| 5470 | + | |
| 5471 | + | |
| 5472 | + | |
| 5473 | + | |
| 5474 | + | |
| 5475 | + | |
| 5476 | + | |
| 5477 | + | |
| 5478 | + | |
| 5479 | + | |
| 5480 | + | |
| 5481 | + | |
5469 | 5482 | | |
5470 | 5483 | | |
5471 | | - | |
5472 | | - | |
| 5484 | + | |
| 5485 | + | |
| 5486 | + | |
| 5487 | + | |
| 5488 | + | |
| 5489 | + | |
| 5490 | + | |
| 5491 | + | |
| 5492 | + | |
| 5493 | + | |
| 5494 | + | |
| 5495 | + | |
| 5496 | + | |
| 5497 | + | |
| 5498 | + | |
| 5499 | + | |
| 5500 | + | |
| 5501 | + | |
| 5502 | + | |
| 5503 | + | |
| 5504 | + | |
| 5505 | + | |
| 5506 | + | |
| 5507 | + | |
| 5508 | + | |
| 5509 | + | |
| 5510 | + | |
| 5511 | + | |
| 5512 | + | |
| 5513 | + | |
| 5514 | + | |
| 5515 | + | |
| 5516 | + | |
| 5517 | + | |
| 5518 | + | |
| 5519 | + | |
| 5520 | + | |
| 5521 | + | |
| 5522 | + | |
| 5523 | + | |
| 5524 | + | |
| 5525 | + | |
| 5526 | + | |
| 5527 | + | |
| 5528 | + | |
| 5529 | + | |
| 5530 | + | |
| 5531 | + | |
| 5532 | + | |
| 5533 | + | |
| 5534 | + | |
| 5535 | + | |
| 5536 | + | |
| 5537 | + | |
| 5538 | + | |
| 5539 | + | |
| 5540 | + | |
| 5541 | + | |
| 5542 | + | |
| 5543 | + | |
| 5544 | + | |
5473 | 5545 | | |
5474 | 5546 | | |
5475 | 5547 | | |
| |||
5497 | 5569 | | |
5498 | 5570 | | |
5499 | 5571 | | |
5500 | | - | |
| 5572 | + | |
| 5573 | + | |
| 5574 | + | |
| 5575 | + | |
| 5576 | + | |
| 5577 | + | |
| 5578 | + | |
| 5579 | + | |
5501 | 5580 | | |
5502 | 5581 | | |
5503 | 5582 | | |
5504 | | - | |
| 5583 | + | |
5505 | 5584 | | |
5506 | 5585 | | |
5507 | 5586 | | |
5508 | 5587 | | |
5509 | | - | |
| 5588 | + | |
5510 | 5589 | | |
5511 | 5590 | | |
5512 | 5591 | | |
| |||
0 commit comments