experiment: 32bit eop scaffolding#5916
Draft
alexandru-uta wants to merge 21 commits intomasterfrom
Draft
Conversation
Contributor
Master added Float32 with inline tagging constants in compile_enhanced.ml, but the branch moved tagging into B.TaggingScheme (backend_impl.ml). The merge correctly removed the inline code, but Float32 cases were never added to the backend modules, causing an assertion failure. Made-with: Cursor
Address all medium-severity issues found during the audit of the Backend32 instantiation of the compile_enhanced functor: - M1: narrow_to_32 is now identity on 32-bit (was ill-typed with i64 ops) - M2: candid_type_offset_size uses B.word_size_in_bytes instead of 8L - M3+M4: Float32 boxed via Bits64 F (promote/demote) on 32-bit; Backend32.TaggingScheme asserts on Float32 (can't bit-tag in 32 bits) - M6: EOP metadata string parameterized by B.word_size - M7: GC instruction counters use i64 globals/arithmetic (matching classical backend), avoiding truncation on 32-bit - M8: buffer_size overflow guard uses i64 accumulator unconditionally, matching the classical backend's safety guarantees None of these affect the active 64-bit backend; they prepare the dormant 32-bit backend for future activation. Made-with: Cursor
…ap_with Raw Wasm i64.eqz test produces i32, but E.else_trap_with expects a machine word (applies prepare_branch_condition internally). Use compile_test_i64 which extends the i32 result back to the machine word. Made-with: Cursor
The compact BigNum fast paths used Word64.compile_* (genuine i64 ops) which would cause Wasm type mismatches on 32-bit where machine words are i32. Replace with B.* operations that use the backend's word type. Also fix missing extend_word_to_i64/extend_sword_to_i64 before RTS calls (bigint_of_word64/bigint_of_int64 expect I64Type params), and missing wrap_i64_to_word after Num.truncate_to_word64 before BitTagged.tag (which expects machine word). All changes are nops on 64-bit (B.* maps to i64 ops; extend/wrap are identity), so no behavioral change for the existing backend. Made-with: Cursor
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.
No description provided.