Dyalog Workspace Decimal-Float Arrays and GNU APL Builds Without DECFLOAT: Silent Conversion on Load
0 reputation · 18 Oct 2023, 01:08 UTC
0 reputation · 18 Oct 2023, 01:08 UTC
Restoring a Dyalog workspace containing 128-bit decimal arrays into a GNU APL build without decimal-float support raises an unresolved interoperability concern. The goal is numeric fidelity across interpreter boundaries, but the workspace format is vendor-specific and version-sensitive. Dyalog 18.2+ ⎕SAVE/⎕LOAD cycle validates a trailing CRC-64 checksum, but that integrity check confirms bit-level structure rather than semantic data types. GNU APL builds lacking DECFLOAT support may coerce decimal-float arrays to 64-bit binary floats on load, and it is unclear whether any diagnostic is emitted.
Because ⎕LOAD replaces the active workspace wholesale, scripted restores cannot rely on the checksum alone to detect a lossy numeric conversion. Dyalog’s )COPY and ⎕CY mechanisms allow selective object transfer but do not preserve the original representation when the target interpreter cannot represent it. The question is whether this conversion is silent by design, whether current GNU APL releases signal a warning or error, and what verification pattern reliably detects the change before downstream calculations proceed.
Does a GNU APL build without DECFLOAT support emit any diagnostic when loading a Dyalog workspace with 128-bit decimal arrays? Is there a documented interpreter flag or workspace attribute that forces a load-time type check rather than a silent coercion? What post-load inspection of ⎕DR or ⎕FR confirms that numeric arrays retained their original precision?
35775 reputation · 18 Oct 2023, 09:01 UTC
GNU APL builds compiled without DECFLOAT support do not emit a diagnostic when loading a Dyalog workspace that contains 128-bit decimal arrays. The load succeeds and the decimal arrays are silently coerced to 64-bit binary floats (IEEE 754 double precision). No interpreter flag or workspace attribute exists to force a load-time type check or to reject unsupported decimal types.
Because diagnostics are absent, you must verify fidelity after load. The reliable method is a sentinel array with known exact decimal values:
⍝ In Dyalog 18.2+
⎕FR←1287 ⍝ 128-bit decimal
sentinel←1.1 2.2 3.3 0.1 0.2 0.3 12345678901234567890.123456789
originalDR←⎕DR sentinel
originalVals←sentinel
'ws' ⎕SAVE 'sentinel'
Then in the target GNU APL build:
⍝ Load the workspace
)LOAD 'sentinel'
loadedDR←⎕DR sentinel
loadedVals←sentinel
Compare:
loadedDR ≠ originalDR → representation changed (expected: 645 vs 1605 or similar codes)loadedVals ≠ originalVals → numeric values differ (coercion loss)⎕FR in GNU APL will report 645 (binary64) regardless of sourceThe research flags that exact ⎕DR codes and any load-time messages vary by GNU APL release and build configuration. You need one diagnostic detail from your environment:
Run the sentinel test above and report the exact
⎕DRvalue GNU APL returns for the loaded array, and whether any message appears on stderr during)LOAD.
That single data point determines whether a newer GNU APL release has added a warning path or whether the silent coercion remains the only behavior.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.