User direction and outcome
Drake: “I also want to perfect the migration from C to Rust to help the world transition.”
Make the existing Babel + Omega source-translation + Omega Bridge path useful to external C maintainers. Deliver editable, standalone Cargo projects, incremental migration boundaries, and independently checked behavior/safety reports. Users should be able to keep the resulting Rust without adopting an Omega runtime. This issue coordinates public-product acceptance; adapter/compiler/validation implementation stays with existing owners.
Parent: https://github.com/aien-dev/aien-architecture-mv/issues/295 Existing owners: C importer #622; Rust semantics/export #626; validation #623; conformance/integration #624; semantics #625; interface registry #631; adoption #637 in aien-dev/omega-mv. Reuse omega-bridge for ABI integration and the existing Hive/harness. Related implementation: https://github.com/aien-dev/omega-mv/pull/839. Reconcile branch ownership before edits; no duplicate translator, IR, checker or runtime.
Source-backed starting point (reviewed, not rerun)
- Babel main
src/40-gen.omalready emits Cargo metadata, Rust source modules, a differential driver and generated tests. README declares pre-alpha S1: pure C17 uint64 arithmetic, at most six inputs, with named refusals for other constructs. - Babel currently documents exit 0 as “No FAIL”; UNSUPPORTED, MISSING_IMPLEMENTATION and NOT_RUN are separate verdicts. This is a partial-analysis result, not whole-project migration completion.
- Omega PR #839 at
656192e00368c9443370f0adbc4f89309da4bd5cis open/unmerged and reports 52 passing C→Omega→Rust compositions on AArch64. Its S2 source excludes memory, loops, calls and effects. These are reported fixture results, not arbitrary-C support. src/adapters/rust-i64-export.omemits wrapping operations for wrapping profiles and ordinary signed operators for the error-on-overflow profile; the recorded Rust overflow oracle is debug. Qualify release/overflow-check settings explicitly, distinguishing defined-domain C refinement from a chosen checked-error contract. Debug panic results must not be promoted to an unconditional release guarantee.
Product requirements
- Build-aware inventory: account for all files, declarations, translation units, includes, macros/configurations, generated sources, linker inputs, ABI/data model and external dependencies in a selected build. Accept a compilation database or an equivalent declared build manifest. Record target triple, char signedness, integer widths, layout/alignment, endianness, compiler flags and language dialect. One preprocessed configuration does not establish all #ifdef variants.
- Standalone output: maintainable Cargo package/workspace with stable-toolchain/edition requirements, readable names, source mappings, comments/attribution where recoverable, tests and documentation. The completed Rust implementation builds/tests with no original C implementation or Omega runtime linked. A C compiler used only to produce a comparison oracle is reported separately. Explicitly inventory any generated helper/runtime dependency and its licensing.
- Strict completion gate: add an opt-in complete-migration command/policy (exact interface for owner to select; not an existing flag) that returns success only when every required item and check in the selected manifest is covered. Preserve useful partial analysis, but expose COMPLETE/PARTIAL/BLOCKED distinctly. Unsupported declarations, missing toolchains, untested build variants and skipped files cannot disappear from the denominator. Keep legacy exit behavior compatible or version it.
- Safe Rust core: target
#![forbid(unsafe_code)]for converted ordinary computation. Infer allocation ownership, borrowed access, mutation, bounds and lifetimes. Map pointers to slices/references/owned containers only when the transformation preserves permitted behavior; never invent exclusive&mutaccess. Shared structures may require indices/handles or justified interior mutability; extra allocation, copying, locking and failure behavior must be declared and measured. - Auditable low-level boundaries: separate necessary FFI/OS/MMIO/assembly/atomic code into minimal boundary modules/crates with safety preconditions, callers, invariants and tests. An unsafe block or raw pointer count is not a proof of unsafety or soundness. A safe facade must validate what it can and must not expose an unsound safe interface. Preserve allocator/free pairing, calling convention, struct layout, callbacks, errno/error semantics and unwind policy. Unsupported cases remain blocked for that profile.
- Separate compatibility and remediation: first establish behavior preservation for defined C executions under an explicit target/build contract. Record C undefined behavior and implementation-defined dependencies. Sanitizer observations diagnose tested executions; they do not define C semantics. A bug fix or newly checked behavior is a separate, reviewed change with its own regression case, never silently labelled exact equivalence.
- Incremental adoption: allow maintainers to replace one complete module at a time through a declared C ABI while the remainder stays external C. Report all remaining C and unsafe dependencies. Provide rollback and reproducible patches. Completed-unit certification is distinct from completed-project certification. This staged customer workflow does not relax the project's first-party
.omimplementation policy.
Qualification and evidence
- Extend #623/#624 with unit and composed-call translation checks, independent original-C comparisons, differential/property fuzzing, source sanitizers, Rust debug and release, and Miri where its supported execution model applies. Include mismatched-output, weakened-guard, overlap, lifetime, double-free, bad-length and stale-artifact negative controls. Preserve expected stdout/stderr/status/files/protocol effects as the profile requires.
- Classify evidence separately: compiled, tested, exhaustively checked within stated bounds, and formally verified against named models/assumptions. Record checker/compiler versions, source and artifact identities, semantic preconditions, bounds and unrun cases. A signature or hash establishes identity/provenance, not semantic equivalence; tests do not become universal proofs.
- Run native x86-64 and AArch64 validation where accessible; add RISC-V when actually supported. Emulated correctness and native measurements remain separate. Qualify floating point, concurrency, volatile/MMIO and constant-time requirements in dedicated profiles before claiming those properties.
- Report full input coverage, verified/conditional/manual boundaries, remaining unsafe/FFI surface, human intervention, runtime/peak-memory/code-size changes and reproducibility. Freeze corpus and acceptance thresholds before evaluating; retain failures and regressions.
Delivery order
- Reconcile and qualify the existing S1/S2 path and completion reporting; fix stale spec/PR status text through the existing owner.
- After required current-profile gates, extend control flow/calls and then arrays, slices and structs through the existing semantic-profile process.
- Add allocation/ownership, separate ABI boundaries and multi-module builds; advanced C features have explicit follow-on profiles.
- Select one small real C library with suitable licensing and meaningful upstream tests. Produce a complete, editable Rust crate; reproduce upstream behavior on the declared domain, add independent fuzz/regression checks, and verify no implementation fallback remains. Keep a second held-out project for generalization.
- Publish reproducible fixtures and maintainer documentation only through normal release ownership; no unsolicited upstream PRs or partnership claims.
Existing work and external comparisons
Use C2Rust as a baseline/corpus source where licensing permits; its own documentation describes functionality-preserving unsafe output as an initial migration stage and additional work toward safe/idiomatic output. Compare honestly rather than assuming a unique capability: https://github.com/immunant/c2rust . Research relevant to borrow/slice inference: Fromherz & Protzenko, Compiling C to Safe Rust, Formalized, https://arxiv.org/abs/2412.15042 . Rust contracts: https://doc.rust-lang.org/reference/behavior-considered-undefined.html and https://doc.rust-lang.org/reference/expressions/operator-expr.html . Dynamic checking scope: https://github.com/rust-lang/miri .
Implementation/tooling remains seeded .om; external C/Rust fixtures and reference compilers are explicitly classified translation inputs/test oracles, not hidden production fallbacks. Reconcile that classification with Babel #3 before removing any input corpus. Preserve source licensing/attribution; do not assume a translator relicenses the input or that generated helpers carry no obligations. No production deployments or toolchain-pin changes are authorized by this tracking issue. Open implementation PRs only when tested and ready for review/merge; no placeholder draft PRs. No performance, whole-C, or memory-safety-completion claim until the corresponding evidence exists.
Status: PROPOSED product/acceptance expansion. No new translator code or tests were executed in this review.