de-rust phase-0: archive Rust LLVM backend to archive/rust-llvm-backend (RESTORE documented); defaults unaffected
This commit is contained in:
7
archive/rust-llvm-backend/RESTORE.md
Normal file
7
archive/rust-llvm-backend/RESTORE.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# RESTORE — Rust LLVM backend
|
||||||
|
|
||||||
|
To restore the archived backend back to the original location:
|
||||||
|
|
||||||
|
git mv archive/rust-llvm-backend/llvm src/backend/
|
||||||
|
|
||||||
|
Rationale: Python llvmlite is the primary LLVM path. The Rust backend was deprecated and archived as part of the De‑Rust Phase‑0.
|
||||||
35
docs/development/strategies/de-rust-gap-analysis.md
Normal file
35
docs/development/strategies/de-rust-gap-analysis.md
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# De‑Rust Gap Analysis (Phase 21.9)
|
||||||
|
|
||||||
|
This memo enumerates gaps to execute Phase‑1/2 tasks safely.
|
||||||
|
|
||||||
|
## hv1_inline → Parity
|
||||||
|
- JSON support: ensure compare/branch/jump/phi/mir_call minimal are covered.
|
||||||
|
- Parity canaries: phase2037/* (flow), phase2170/* (state).
|
||||||
|
- Env guard: consider `HAKO_VERIFY_DISABLE_INLINE=1` for hard opt‑out (optional).
|
||||||
|
|
||||||
|
## TLV Codec → C shim
|
||||||
|
- Minimal C API: tlv_encode(buf,len, out_ptr, out_len) / tlv_decode(...)
|
||||||
|
- FFI wrapper in Rust; map errors to Result.
|
||||||
|
- Tests: round‑trip on byte arrays; malformed inputs; size limits.
|
||||||
|
|
||||||
|
## MIR Interpreter (Rust) — Diagnostic mode
|
||||||
|
- Keep as fallback/diagnostic; Primary = Hakovm.
|
||||||
|
- Ensure boxcall/mir_call minimal parity for sample set.
|
||||||
|
- Gate via env to avoid accidental use in primary flows.
|
||||||
|
|
||||||
|
## LLVM Wrapper → Hako/C Harness
|
||||||
|
- Keep Python llvmlite primary until Hako IR is mature.
|
||||||
|
- Hako wrapper CLI to drive harness with env (`NYASH_LLVM_USE_HARNESS=1`).
|
||||||
|
- Tests: small end‑to‑end const/ret and simple branch; IR dump gate remains.
|
||||||
|
|
||||||
|
## Resolver/Using SSOT (Hako First)
|
||||||
|
- Runner policy and HakoCheck strip/order unified; document precedence.
|
||||||
|
- Strict profiles disallow path‑literal using.
|
||||||
|
|
||||||
|
## FileBox Core → C (later)
|
||||||
|
- Small C layer for read‑only (Analyzer) and read/write (dev) under caps; Rust shim remains.
|
||||||
|
|
||||||
|
## Acceptance Summary
|
||||||
|
- Build: cargo build (default) green.
|
||||||
|
- Smokes: quick/core green; parity canaries pass.
|
||||||
|
- Docs: roadmap + plan page + restore steps present.
|
||||||
@ -16,11 +16,21 @@ Purpose: reduce Rust surface (non‑plugin) while keeping correctness and revers
|
|||||||
- TLV codec → C shim (FFI) with thin Rust wrapper.
|
- TLV codec → C shim (FFI) with thin Rust wrapper.
|
||||||
- LLVM wrapper → Hako/C harness (Python stays primary until Hako IR is ready).
|
- LLVM wrapper → Hako/C harness (Python stays primary until Hako IR is ready).
|
||||||
|
|
||||||
|
Deliverables & Tests
|
||||||
|
- hv1_inline: parity canaries = phase2037/flow + phase2170/state; add `HAKO_VERIFY_DISABLE_INLINE` opt-out (optional).
|
||||||
|
- TLV C shim: round‑trip tests (encode→decode) on representative payloads; FFI error mapping spec.
|
||||||
|
- MIR interpreter: keep as diagnostic path; parity sample set (const/binop/compare/branch/jump/ret/phi/mir_call minimal).
|
||||||
|
- LLVM wrapper: unify CLI entry; ensure `NYASH_LLVM_USE_HARNESS=1` path stays green.
|
||||||
|
|
||||||
### Phase 2 — Core Thinning (2–4 months)
|
### Phase 2 — Core Thinning (2–4 months)
|
||||||
- Plugin loader thin C wrapper (dlopen/dlsym), unify host ABI.
|
- Plugin loader thin C wrapper (dlopen/dlsym), unify host ABI.
|
||||||
- Basic boxes (Array/Map/File) small C core (handle‑based), keep Rust shim.
|
- Basic boxes (Array/Map/File) small C core (handle‑based), keep Rust shim.
|
||||||
- Resolver/Using: SSOT in Hako; runner uses shared policy.
|
- Resolver/Using: SSOT in Hako; runner uses shared policy.
|
||||||
|
|
||||||
|
SSOT for Using/Resolver (summary)
|
||||||
|
- Resolution order: modules (nyash.toml) → relative path inference → not found (warn) with verbose details.
|
||||||
|
- Analyzer/HakoCheck follows the same order; runner shares policy helpers. No path‑literal using in strict profiles.
|
||||||
|
|
||||||
### Phase 3 — Long‑haul (3–6 months)
|
### Phase 3 — Long‑haul (3–6 months)
|
||||||
- Python llvmlite → Hako IR builder + C ABI.
|
- Python llvmlite → Hako IR builder + C ABI.
|
||||||
- Parser/MIR builder fully Hako‑first; Rust becomes fallback.
|
- Parser/MIR builder fully Hako‑first; Rust becomes fallback.
|
||||||
@ -36,3 +46,8 @@ Purpose: reduce Rust surface (non‑plugin) while keeping correctness and revers
|
|||||||
2) Add phase docs (docs/private/roadmap/phases/phase-21.9/PLAN.md).
|
2) Add phase docs (docs/private/roadmap/phases/phase-21.9/PLAN.md).
|
||||||
3) Keep CI/dev instructions intact (no build break when features=none).
|
3) Keep CI/dev instructions intact (no build break when features=none).
|
||||||
|
|
||||||
|
## Test Strategy (gates)
|
||||||
|
- Quick: tools/smokes/v2/profiles/quick/core/* (phase2037 flow, phase2170 state) — green.
|
||||||
|
- Verify routing: HAKO_VERIFY_PRIMARY=hakovm (default); hv1_inline perf path parity (env toggles only).
|
||||||
|
- Build: `cargo build --release` (default features); LLVM paths are opt‑in.
|
||||||
|
- Docs: keep RESTORE steps for any archived parts; small diffs, easy rollback.
|
||||||
|
|||||||
Reference in New Issue
Block a user