Skip to content

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

Open
znoffel1 wants to merge 1 commit into
edgcpp:mainfrom
znoffel1:fix/357
Open

znoffel1 wants to merge 1 commit 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 IFC 0.44 floating-point types, including Float16, Float80, Float128, and bfloat16 variants.
    • IFC files can now preserve these floating-point types when read and written.
  • Bug Fixes
    • Improved handling of floating-point type extensions so they resolve to the corresponding types instead of being treated as substituted types.

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

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between cc40804 and a921864.

Files selected for processing: 12
  • 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_spec.h
  • src/ifc_modules_write.c

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

Walkthrough

IFC 0.44 adds an EDG floating-point type sort and node for seven extended floating-point kinds. The compiler maps these kinds to the new node when writing IFC and resolves the node to front-end float types when reading IFC.

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, src/ifc_modules_inst.h, src/ifc_modules_spec.h
The IFC 0.44 spec and map declarations add the float sort, type index, node, and partition, with storage and helper declarations.
IFC encoding and node access
src/ifc_map_functions.c, src/ifc_map_functions_acc.c, src/ifc_map_functions_mut.c
Conversion and node helpers handle the 0.44 float sort and index, partition sizing, and node kind access and mutation. Extension values use 0.44 representations for module files at version 0.44 or later and retain 0.43 representations for older files.
IFC validation and diagnostics
src/ifc_map_functions_val.c, src/ifc_map_functions_dbg.c
Validation checks the new sorts, indices, and node kind. Diagnostic dispatch prints the float node.
EDG float type reading
src/ifc_modules_read.c
The reader resolves float extensions to front-end float types and updates placeholder and type-cache handling for these extensions.
EDG float type writing
src/ifc_modules_write.c
The writer maps seven extended float kinds to EDG extension sorts and writes them as EdgTypeFloat nodes.

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ILFloatKind
  participant an_ifc_il_map
  participant EdgTypeFloatPartition
  ILFloatKind->>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: allocate node and store sort
Loading

Possibly related issues

Possibly related PRs

  • edgcpp/compiler#315: Adds IFC support for standard extended floating-point kinds and identifies non-standard kinds as requiring an EDG extension type; this change implements that extension path.

Suggested reviewers: wchilders-nvidia, darkarc

Merge Risk: Minimal · up to a9218

No actionable issue remains identified for the new floating-point type support. The PR is mergeable after normal checks.

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 clearly describes the main change: adding non-standard EDG floating-point types. It is concise and specific.
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.
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.50.0)
src/ifc_map_functions.h

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

thread '' (7) 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-9c15ead3-0e55-41c6-9e96-5727ed74f0e2-3.yml' -- 'src/ifc_map_functions.h'

@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!

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

2 participants