Coerce Idriç floating requests to Float16 with warnings - #6
Closed
isomorphisms wants to merge 23 commits into
Closed
Coerce Idriç floating requests to Float16 with warnings#6isomorphisms wants to merge 23 commits into
isomorphisms wants to merge 23 commits into
Conversation
isomorphisms
force-pushed
the
float32-primitive
branch
from
August 29, 2026 22:54
a5cd61c to
9b0bf7f
Compare
Owner
Author
|
Classification: SUPERSEDED by the final stack tip #49. #49 carries forward the source-visible Float16 policy work from this branch, but deliberately replaces This intermediate state should not merge independently. Its branch is being retained because #48/#49 still record the stack ancestry; the final Float16 line still needs reconciliation onto current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Make
.idricfloating precision tolerant of ragged type information instead of treating a wider spelling as a fatal source error.Source-language rule
In
.idricfiles:Float16is the ordinary floating type.Float16arithmetic rounds again after+,-,*, and/;Double,Float,Float32, andFloat64are accepted as precision requests, normalized toFloat16, and produce a nonfatal warning such as:Canonical
Float16and bare decimal literals do not produce a narrowing warning.Ordinary
.idrfiles retain inherited IdrisDoublebehavior.Current representation boundary
This PR does not pretend that every backend already has a native half-precision register path. The source
Float16value currently uses inheritedDoubleas an implementation carrier, but construction and basic arithmetic pass through an executable IEEE-754 binary16 round-to-nearest-even boundary. The carrier is therefore not the source precision.Direct CPU/GPU backends can later replace that carrier with native or unboxed Float16 storage/instructions without changing the source-language rule.
Regression
tests/idris2/basic/edric007now checks that:Float16compiles without a narrowing warning;2048.0 + 1.0evaluates as2048.0, proving binary16 rounding occurs at an arithmetic-operation boundary rather than merely renaming a Double carrier;.idrfile still accepts inheritedDoubleunchanged.The focused
./edric testpath continues to includeedric007.Boundary
This is a filename-scoped Idriç source policy. Compiler implementation code and compatibility code may still use wider host arithmetic internally. That does not make those wider precisions the normal
.idricsemantics.Precision-line relation
This head is the Float16-coercion design. The genuine-binary32 commit
249921a30b9fc5b9e842dbb6489a4d8d231b6174, pinned byfuthark-benchmarks#1, is a divergent historical head rather than an ancestor of this PR; it is preserved asarchive/genuine-binary32-futhark. PR #48 is one commit atop this PR and changes only the carrier-division totality wrappers.