Skip to content

refactor: remove MISRA overflow codegen, improve MLIR statics - #402

Merged
godofecht merged 2 commits into
mainfrom
docs/readme-update
Aug 10, 2026
Merged

godofecht merged 2 commits into
mainfrom
docs/readme-update

Conversation

@godofecht

Copy link
Copy Markdown
Contributor

Summary

  • Removes runtime overflow-checked arithmetic codegen (FLOW_CHECKED macros, handlers). The overflow_check parameter on flow_to_c and CGenerator is gone. Literal div-by-zero and shift UB are still rejected at type-check time.
  • Removes --emit-manifest / --manifest-format CLI flags and the safety_manifest module. --profile safety still sets strict C compiler flags.
  • MLIR: large unsigned integer literals converted to two complement, CastExpression/UnaryOperation handling in module statics, string interning, null pointer globals emit body with llvm.mlir.zero.
  • Test cleanup: removed codegen-level arith safety tests, deleted test_safety_manifest.py, updated MLIR null pointer test.
  • Docs updated to reflect removed features.

All 1160 unit tests pass.

Areas requiring review

  • The MLIR static constant emission changes are new code paths. The test_mlir_generator.py suite covers the basics but edge cases with complex array literals may need attention.
  • runtime/flow_rt_support.c adds FLOW_TEST_CLOCK guard for Emscripten deterministic clock override.

This pull request includes code written with the assistance of AI.
The code has not yet been reviewed by a human.

Generated with Devin

@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

…MLIR statics

Restore c_generator.py from main to preserve complex type, RF type, and
lambda fat-pointer codegen. Then surgically remove only the MISRA overflow
check features:
- overflow_check parameter removed from CGenerator and flow_to_c
- _overflow_checks_enabled() always returns False (dead code kept harmless)
- __attribute__((unused)) removed from flow_strcat, i32_to_f32, gpu_thread_id
- memref_ prefix removed from type unwrapping
- safety_manifest.py and test_safety_manifest.py deleted
- --emit-manifest / --manifest-format CLI flags removed from transpiler

MLIR improvements (from user's working tree):
- Large unsigned integer literals converted to two complement
- CastExpression/UnaryOperation handling in module statics
- String interning and static LLVM array global emission
- Null pointer globals emit body with llvm.mlir.zero

Test cleanup:
- test_arith_safety.py: kept type-checker tests, removed codegen tests
- test_misra_euler_batch.py: kept hashmap/bigint smoke tests, removed
  temp arena / recursion / max_iterations tests
- test_misra_phase2.py: removed FLOW_DIAG and flight strcat tests
- test_mlir_generator.py: updated null pointer global assertion
- ci.yml: removed test_safety_manifest.py from safety test step

All 1227 unit tests pass.

This pull request includes code written with the assistance of AI.
The code has not yet been reviewed by a human.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@godofecht
godofecht merged commit 2407db2 into main Aug 10, 2026
16 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.

1 participant