Skip to content

Add non standard EDG floating point types [GH #357] - #461

Open
znoffel1 wants to merge 3 commits into
edgcpp:mainfrom
znoffel1:fix/357
Open

znoffel1 wants to merge 3 commits into
edgcpp:mainfrom
znoffel1:fix/357

Conversation

@znoffel1

@znoffel1 znoffel1 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added IFC 0.44 support for extended floating-point types, including Float16, Float80, and bfloat16 formats.
    • Extended float types can now be exported and imported through C++20 modules while retaining their distinct type identities.
    • Standard floating-point types continue to use their existing IFC representations.
  • Bug Fixes
    • Invalid or unsupported float extensions now produce an error type during processing instead of being misinterpreted.
    • Preserved compatibility when reading and writing files from earlier IFC versions.

@znoffel1
znoffel1 requested a review from a team November 2, 2026 20:42
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

IFC 0.44 adds an EDG floating-point type and seven float sorts. The compiler writes extended floating-point kinds as EDG type extensions and reads those extensions back into front-end float types. Version-dependent type-index handling supports IFC 0.43 and 0.44.

Changes: EDG floating-point type support

Layer / File(s) Summary
IFC 0.44 float type contracts
dev_tools/pylibs/edgifc/spec_files/0.44.json, src/ifc_map.h, src/ifc_map_functions.h, dev_tools/bin/gen-ifc-map
The 0.44 specification and map declarations add the float sort, type variant, node, and partition. The generator changes the spacing after its copyright notice.
IFC encoding and versioned indices
src/ifc_map_functions.c, src/ifc_map_functions_acc.c, src/ifc_map_functions_mut.c, src/ifc_map_functions_val.c
Sort and index conversion support IFC 0.44. EdgExtensionType uses the 0.44 index representation for 0.44 files and retains the 0.43 representation for older files.
Float node access and validation
src/ifc_modules_inst.h, src/ifc_map_functions.c, src/ifc_map_functions_acc.c, src/ifc_map_functions_mut.c, src/ifc_map_functions_val.c, src/ifc_map_functions_dbg.c
The map adds EdgTypeFloat construction, storage access, kind access and mutation, validation, and debug printing. The partition map associates the float sort with the four-byte node.
EDG float type writing
src/ifc_modules_write.c
The writer emits seven extended floating kinds as EdgTypeFloat nodes. Traditional and standard-width kinds continue to use fundamental nodes.
EDG float type reading
src/ifc_modules_read.c
The reader maps EDG float sorts to front-end float kinds and updates extension processing, placeholder handling, and type caching.
Compiler export coverage
tests/tests/modules/eifc/modules/export-edg-float-*
Clang 14, GNU 12, and GNU 15 module tests check exported floating-point types, overloads, fields, and related declarations.
Compiler import coverage
tests/tests/modules/eifc/modules/import-edg-float-gnu/*, src/pending_changes/gh-357-edg-float-types-in-ifc.txt
The GNU 15 import test checks arithmetic and overload selection for EDG floating-point types. The change note describes their IFC representation and read/write support.

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant FloatKind
  participant an_ifc_il_map
  participant EdgTypeFloatPartition
  FloatKind->>an_ifc_il_map: enter_float_type(kind)
  an_ifc_il_map->>an_ifc_il_map: float_kind_to_edg_float_type(kind)
  an_ifc_il_map->>EdgTypeFloatPartition: store the float sort
Loading

Possibly related issues

Possibly related PRs

  • edgcpp/compiler#315: Both changes modify float-type IFC writing and reading; this PR adds EDG extension nodes for extended kinds left unsupported by that PR.

Suggested reviewers: darkarc

Merge Risk: Minimal · up to 12bc2

This change adds IFC support for non-standard EDG floating-point types, so exporting a module that uses them no longer causes a catastrophic error. No merge-blocking issue was found.

Security architecture risk: Low · up to a9218

The new floating-point representation follows the existing module validation path, and the inspected reader and writer preserve the seven type identities. No security regression was demonstrated. Compatibility and interrupted-output recovery were not fully established.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — If an attacker can supply an imported IFC file, the inspected exposure is its interpretation into types within the consuming compiler process. This path does not demonstrate a new authority transfer; deployment-wide or multi-tenant consequences were not established.

Trust Boundaries and Controls

  • observed — The new direct float dispatch retains the existing import boundary: construct_node checks the expected partition, validates node contents and withholds invalid results. Float resolution does not receive an accepted node when this construction fails.

Resilience and Maintainability Implications

  • observed — The reader caches validation state, marks invalid nodes and invalidates the token cache when extended-type resolution returns no type. These mechanisms contain ordinary malformed-reference failures rather than reusing them as valid float types.
  • observed — The writer registers the allocated type index before initializing its kind through an explicit conversion and field copy. This establishes an intermediate in-memory state, but the inspected evidence does not show concurrent publication or recoverable reuse of that state after interruption.
Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Add non standard EDG floating point types [GH #357]" matches the main change. The PR adds EDG floating-point type extensions for non-standard types such as _Float16, __fp16, _Float32x, _Flo…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Add non standard EDG floating point types [GH #357]" matches the main change. The PR adds EDG floating-point type extensions for non-standard types such as _Float16, __fp16, _Float32x, _Float64x, __float80, __float128, and __bf16. The change spans the IFC 0.44 schema, the map and validation code, the IFC reader and writer, and new tests. The title names the primary change and the linked issue, GH #357. It does not name the IFC 0.44 schema work, but it does not need to cover every detail.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c19504e and 12bc2d3.

Files selected for processing: 26

  • src/pending_changes/gh-357-edg-float-types-in-ifc.txt
  • tests/tests/modules/eifc/modules/export-edg-float-clang/.test.rto/default.1.1.txt
  • tests/tests/modules/eifc/modules/export-edg-float-clang/.test.rto/default.1.2.txt
  • tests/tests/modules/eifc/modules/export-edg-float-clang/.test.rto/edg_x86_32_cp.1.2.txt
  • tests/tests/modules/eifc/modules/export-edg-float-clang/.test.rto/edg_x86_64_cp.1.2.txt
  • tests/tests/modules/eifc/modules/export-edg-float-clang/foo.ixx
  • tests/tests/modules/eifc/modules/export-edg-float-clang/test.mft.cpp
  • tests/tests/modules/eifc/modules/export-edg-float-gnu12/.test.rto/default.1.1.txt
  • tests/tests/modules/eifc/modules/export-edg-float-gnu12/.test.rto/default.1.2.txt
  • tests/tests/modules/eifc/modules/export-edg-float-gnu12/.test.rto/edg_x86_32_cp.1.2.txt
  • tests/tests/modules/eifc/modules/export-edg-float-gnu12/.test.rto/edg_x86_64_cp.1.2.txt
  • tests/tests/modules/eifc/modules/export-edg-float-gnu12/foo.ixx
  • tests/tests/modules/eifc/modules/export-edg-float-gnu12/test.mft.cpp
  • tests/tests/modules/eifc/modules/export-edg-float-gnu15/.test.rto/default.1.1.txt
  • tests/tests/modules/eifc/modules/export-edg-float-gnu15/.test.rto/default.1.2.txt
  • tests/tests/modules/eifc/modules/export-edg-float-gnu15/.test.rto/edg_x86_32_cp.1.2.txt
  • tests/tests/modules/eifc/modules/export-edg-float-gnu15/.test.rto/edg_x86_64_cp.1.2.txt
  • tests/tests/modules/eifc/modules/export-edg-float-gnu15/foo.ixx
  • tests/tests/modules/eifc/modules/export-edg-float-gnu15/test.mft.cpp
  • tests/tests/modules/eifc/modules/import-edg-float-gnu/.test.rto/default.1.1.txt
  • tests/tests/modules/eifc/modules/import-edg-float-gnu/.test.rto/default.1.2.txt
  • tests/tests/modules/eifc/modules/import-edg-float-gnu/.test.rto/default.1.3.txt
  • tests/tests/modules/eifc/modules/import-edg-float-gnu/.test.rto/edg_x86_32_cp.1.2.txt
  • tests/tests/modules/eifc/modules/import-edg-float-gnu/.test.rto/edg_x86_64_cp.1.2.txt
  • tests/tests/modules/eifc/modules/import-edg-float-gnu/foo.ixx
  • tests/tests/modules/eifc/modules/import-edg-float-gnu/test.mft.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@wchilders-nvidia wchilders-nvidia self-assigned this Nov 2, 2026
@wchilders-nvidia wchilders-nvidia linked an issue Nov 2, 2026 that may be closed by this pull request
@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 29.19708% with 97 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/ifc_modules_read.c 11.76% 56 Missing and 4 partials ⚠️
src/ifc_modules_write.c 46.37% 35 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@edgcpp-bot

Copy link
Copy Markdown
Collaborator

AcknowlEDG review results updated for a921864a6095:

CI success.

@edgcpp-bot

Copy link
Copy Markdown
Collaborator

AcknowlEDG review results updated for c19504ec9888:

CI success.

@wchilders-nvidia wchilders-nvidia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add tests to this to cover the new types.

@edgcpp-bot

Copy link
Copy Markdown
Collaborator

AcknowlEDG review results updated for 12bc2d3a00bf:

@edgcpp-bot

Copy link
Copy Markdown
Collaborator

AcknowlEDG review results updated for 12bc2d3a00bf:

CI success.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[E-IFC] Complete Floating Point Type Support

3 participants