2.0 KiB
Handoff — the x86 backend, wired to the dev loop
Branch dev-loop, worktree agent-aaf84e55296df121c, from f459352. This is items 1, 2 and 3 of
HANDOFF-x86-redef.md's "What remains": the new-name path, the transient thunk, and the wiring that lets
flan dev choose the backend for a host and its modules together.
Status: in progress. This file is written before the work rather than after it, so that a session that ends early leaves its plan behind rather than nothing.
Why
llc is 15–17ms of a ~19ms C-c C-c (docs/BUILT.md). The hand-written backend exists to replace that
number and has never been given the chance: --x86 is read only by flan build's argument list, and the
daemon builds both halves through LLVM. Until it is wired, the backend saves nothing.
The plan, in the order it will be committed
- The new-name path in
X86.redefinition. Aslotpredicate besidefnctx.ext, a fourthloccase for a module-local slot,flan_dev_cell/flan_dev_globalcalls inflan_reload_install, and an init image for a new global.test/test_reload.ml's v3/v4/v5 fixtures already exist and currently assert a refusal; the transcript replaces it. - The transient thunk:
flan_reload_calland the@flan_reload_transientmarker, with an x86 analogue ofemit.ml'sm.nstrcondition — a module that holds a string literal can never claim to be transient, because the string outlives the call and the agent unloads the mapping. - The wiring: an
x86field onSession.tand onSession.change, set once inDev.startfromflan dev --x86, exactly parallel todebug— whose own comment already says why both ends have to come from one flag. Never a fallback: ifX86.redefinitionrefuses, the daemon reports the refusal. A silent fallback to LLVM is precisely the crossed pairflan.abi.x86exists to refuse.
Decisions, recorded as they are made
(to be filled in)
Measurements
(to be filled in: emit / assemble / link / dlopen, both backends)