Skip to content

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

Merged
wchilders-nvidia merged 2 commits into
edgcpp:mainfrom
znoffel1:fix/357
Nov 30, 2026
Merged

wchilders-nvidia merged 2 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 support for reading and writing IFC 0.44 floating-point types, including extended formats such as 16-bit, 128-bit, and bfloat16.
    • C++ modules can now export and import these floating-point types while preserving their type information across supported Clang and GNU compiler versions.
    • IFC 0.44 files recognize the new floating-point type category; earlier file versions retain their existing handling.

@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

The change adds IFC 0.44 support for seven EDG floating-point types. The compiler can write these types as EDG extensions and resolve them when reading IFC modules. New module tests cover export and import with Clang 14, GNU 12, and GNU 15.

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 define the float sort, type index, 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
IFC conversion handles the 0.44 float sort and type index. EdgExtensionType uses version-matched indices and retains 0.43 handling for older files.
Float node access and validation
src/ifc_map_functions.c, src/ifc_map_functions.h, src/ifc_map_functions_acc.c, src/ifc_map_functions_dbg.c, src/ifc_map_functions_mut.c, src/ifc_map_functions_val.c, src/ifc_modules_inst.h
The map adds storage, access, validation, and diagnostic support for EdgTypeFloat, including its partition mapping.
EDG float type writing
src/ifc_modules_write.c
The writer maps seven extended floating kinds to EDG sorts and writes them as EdgTypeFloat nodes. Traditional and standard-width kinds remain IFC fundamental types.
EDG float type reading
src/ifc_modules_read.c
The reader maps EDG float sorts to front-end kinds and updates extension resolution, placeholder handling, and type-cache processing.
Compiler export coverage
tests/tests/modules/eifc/modules/export-edg-float-clang/*, tests/tests/modules/eifc/modules/export-edg-float-gnu12/*, tests/tests/modules/eifc/modules/export-edg-float-gnu15/*
Module tests cover exporting and importing extended floating-point types, overload selection, fields, and related declarations across the listed compiler versions.
Compiler import coverage
tests/tests/modules/eifc/modules/import-edg-float-gnu/*
The GNU 15 module import test checks arithmetic helpers and floating-point overload selection.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant IFCWriter as IFC writer
  participant IFCModule as IFC 0.44 module
  participant IFCReader as IFC reader
  IFCWriter->>IFCModule: write an EdgTypeFloat node for an extended float kind
  IFCModule->>IFCReader: provide the EdgTypeIndex and float sort
  IFCReader->>IFCReader: map the EDG float sort to a front-end float kind
Loading

Possibly related issues

Possibly related PRs

  • edgcpp/compiler#315 — Adds writer and reader handling for standard extended floating-point types and changes related float-kind encoding. This change extends the IFC mapping to EDG floating-point types.

Suggested reviewers: darkarc, soroshsabz

Merge Risk: Minimal · up to e84fd

This change adds IFC 0.44 support for exporting and importing seven EDG extended floating-point types, with module tests for Clang 14, GNU 12 and GNU 15. The inspected code shows no concrete defect, so merge risk is minimal. The one open question is the dropped sign assignment on ordinary floating fundamental types, which looks benign.

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 changeset adds IFC 0.44 support for EDG float type sorts (Float16, Fp16, Float32x, Float64x, Float80, Float…
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 changeset adds IFC 0.44 support for EDG float type sorts (Float16, Fp16, Float32x, Float64x, Float80, Float128, StdBfloat16), the EdgTypeFloat node, validation, read/write paths, and tests for the new types. The title is concise, specific, and names the primary change. The issue reference is accurate to the linked objectives.

Finishing Touches

Generate unit tests (beta)

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

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.51.3)

src/ifc_map_functions.h

sg: summary|project: isProject=true,projectDir=/ast-grep-rules

thread '' (6) has overflowed its stack
fatal runtime error: stack overflow, aborting
/bin/bash: line 8: 4 Aborted ast-grep scan --json=compact --inspect summary --config '/ast-grep-rules/sgconfig-623497fa-56c6-43bb-8d37-79e1d90659a4-3-a0.yml' -- 'src/ifc_map_functions.h'

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 12bc2d3 and e84fde6.

Files selected for processing: 37

  • dev_tools/bin/gen-ifc-map
  • dev_tools/pylibs/edgifc/spec_files/0.44.json
  • src/ifc_map.h
  • src/ifc_map_functions.c
  • src/ifc_map_functions.h
  • src/ifc_map_functions_acc.c
  • src/ifc_map_functions_dbg.c
  • src/ifc_map_functions_mut.c
  • src/ifc_map_functions_val.c
  • src/ifc_modules_inst.h
  • src/ifc_modules_read.c
  • src/ifc_modules_write.c
  • 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
Files skipped from review as they are similar to previous changes: 1

  • dev_tools/bin/gen-ifc-map

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.

@edgcpp-bot

Copy link
Copy Markdown
Collaborator

AcknowlEDG review results updated for e84fde6b3a93:

CI success.

@wchilders-nvidia
wchilders-nvidia added this pull request to the merge queue Nov 30, 2026
Merged via the queue into edgcpp:main with commit 47cb1fd Nov 30, 2026
21 checks passed
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