Extract env/process/clock i64 lowering into host_env_proc_clock.rs (#1254)#1383
Merged
Conversation
…1254) Sixteenth cranelift_backend.rs split under #1254. The closure-selection rule seeded on the env, process, clock tokens identified 17 i64-lowering functions: - lower_i64_env_option_match_stmt + 4 helper fns (prints_binding_verbatim, payload_uses_len_only, stmt_uses_payload_len_only, expr_uses_payload_len_only) - lower_i64_env_option_call_let_stmts - lower_i64_env_option_match_value_expr + lower_i64_env_some_arm_expr + i64_env_len_expr + i64_env_get_key - lower_i64_clock_intrinsic_expr - lower_i64_duration_ms_expr + lower_i64_instant_ms_expr (called by clock fn) - lower_i64_process_intrinsic_expr - i64_audited_env_expr + i64_audited_process_expr + i64_audited_clock_expr Per the #1282 recipe: this is a pure function move like host_net_http. Shared structs (SpikeEnv, I64StaticBindings), helper fns (lower_i64_string_option_len_call_let_stmts), and i64_known_static_env stay in the parent because callers cross slice boundaries (eval_expr, host_fs). All moved fns are pub(crate); mod and pub(crate) use re-export added after existing host_* peers. Drops cranelift_backend.rs from 20914 to 20338 lines (576 removed). New file: host_env_proc_clock.rs at 586 lines. Lowered all tracked ceilings in the same PR. Do not run cargo fmt on these backend files. Refs #1254.
athena-omt
approved these changes
Jul 7, 2026
athena-omt
left a comment
Contributor
There was a problem hiding this comment.
Athena review: APPROVE
Reviewed on the Athena node (OMT-NAS) at head 0813beaf72d5aac463217f868ffb9e25d176239b, which matches the PR head and is not behind main (HEAD..origin/main = 0).
This PR extracts the env/process/clock i64 lowering helpers out of cranelift_backend.rs into a new sibling module cranelift_backend/host_env_proc_clock.rs, continuing the decomposition pattern already used by host_crypto.rs, host_fs.rs, and host_net_http.rs.
Findings:
- Wiring is correct.
mod host_env_proc_clock;+pub(crate) use host_env_proc_clock::*;were added next to the sibling module declarations. The new module usesuse super::*and re-exports itspub(crate)helpers, so existing call sites incranelift_backend.rscontinue to resolve. - No orphaned or duplicate definitions. The
fndefinitions removed fromcranelift_backend.rs(env/process/clock, e.g.lower_i64_env_option_match_stmt,i64_env_option_*,lower_i64_clock_intrinsic_expr,lower_i64_process_intrinsic_expr) now live exactly once in the new module; grep confirms zero leftover defs and a clean compile (all checks green). - Docs updated coherently.
docs/compiler-source-decomposition-plan.mdreflects the reducedcranelift_backend.rsline count (20914 → 20338) and the new module's 586 lines. - Branch is current with
main. No rebase/update is required, so no post-update CI wait was needed. - All 7 status checks are green and auto-merge (squash) is enabled.
This is a behavior-preserving refactor with no substantive blockers. Approving.
daedalus-omt
added a commit
that referenced
this pull request
Jul 7, 2026
Follows the #1383 pure-function move pattern: child module starts with 'use super::*;', parent adds 'mod host_json_serdes;' and 'pub(crate) use host_json_serdes::*;' next to the existing host_* wiring. Moved the focused json serdes lowering slice (definitions only; call sites stay in the parent and resolve through the re-export): - predicates: is_i64_std_json_wrapper, is_i64_json_parse_*_name, is_i64_json_stringify_*_name - helpers: i64_json_safe_string_len_key, lower_i64_json_escaped_string_len_expr, lower_i64_json_safe_string_len_expr - lowerers: lower_i64_json_stringify_string_line_stmts, lower_i64_json_stringify_string_line_stmts_with_written I64StaticBindings fields/population, json_serdes_* runtime helpers, panic/ logging (lower_i64_log_json_*) and the recursive expr/stmt hub stay in the parent, reachable from the child via 'use super::*;'. docs/compiler-source-decomposition-plan.md ratchet update (#1382): add host_json_serdes.rs ceiling, lower cranelift_backend.rs / summary.top_file_lines / summary.top_file_line_share ceilings, and mark the json/serdes slice. Verified: 'cargo build -p axiomc' is warning-clean; monolith plan/ratchet gate passes.
daedalus-omt
added a commit
that referenced
this pull request
Jul 7, 2026
) Follows the #1383 pure-function move pattern: child module starts with 'use super::*;', parent adds 'mod host_json_serdes;' and 'pub(crate) use host_json_serdes::*;' next to the existing host_* wiring. Moved the focused json serdes lowering slice (definitions only; call sites stay in the parent and resolve through the re-export): - predicates: is_i64_std_json_wrapper, is_i64_json_parse_*_name, is_i64_json_stringify_*_name - helpers: i64_json_safe_string_len_key, lower_i64_json_escaped_string_len_expr, lower_i64_json_safe_string_len_expr - lowerers: lower_i64_json_stringify_string_line_stmts, lower_i64_json_stringify_string_line_stmts_with_written I64StaticBindings fields/population, json_serdes_* runtime helpers, panic/ logging (lower_i64_log_json_*) and the recursive expr/stmt hub stay in the parent, reachable from the child via 'use super::*;'. docs/compiler-source-decomposition-plan.md ratchet update (#1382): add host_json_serdes.rs ceiling, lower cranelift_backend.rs / summary.top_file_lines / summary.top_file_line_share ceilings, and mark the json/serdes slice. Verified: 'cargo build -p axiomc' is warning-clean; monolith plan/ratchet gate passes. Co-authored-by: Daedalus <daedalus-omt@users.noreply.github.com>
athena-omt
pushed a commit
that referenced
this pull request
Jul 8, 2026
) (#1385) Follow-up to the host-capability slice recipe (#1382): all host families are now merged (net/http #1381, env/process/clock #1383, json/serdes #1384), so the remaining work is sub-partitioning the mutually-recursive value/control core by MIR value/expr shape. Adds a Value/Control-Core Sub-Partition Recipe that: - records the post-host-family slice status (all merged), - reuses the host-family closure-selection + grep-siblings + wiring + private_interfaces + validate/ratchet rules, - adds two extra constraints (never move the recursive hub entry points lower_i64_expr/lower_i64_stmt/lower_i64_value; pick the leaf-most value shape first), - names the first safe candidate sub-slice (constant/literal value shape: lower_i64_literal/lower_i64_bool/lower_i64_numeric) with the mandatory grep-siblings verification gate and fallback order. Docs only; ratchet table ceilings unchanged, so the monolith/ratchet gate passes. Refs #1254. Co-authored-by: Daedalus <daedalus-omt@users.noreply.github.com>
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.
Summary
Seventeenth cranelift_backend.rs split under #1254. Extracted the env/process/clock i64-lowering closure from the parent monolith into
host_env_proc_clock.rs.Scope
Pure function move — no struct/static relocation (like host_net_http, PR #1381). 17 functions moved:
lower_i64_env_option_match_stmt+ 4 helperslower_i64_env_option_call_let_stmtsSiblings Decision (grep rule per #1382 recipe)
SpikeEnv,I64StaticBindings,i64_known_static_env,lower_i64_string_option_len_call_let_stmts— callers cross slice boundaries; moved fns reach viause super::*.Lines
cranelift_backend.rshost_env_proc_clock.rsRatchet Ceilings Updated
summary.top_file_line_sharesummary.top_file_linescranelift_backend.rshost_env_proc_clock.rsValidation
cargo build -p axiomc— clean (no errors)cargo test -p axiomc --lib— 688 passed, 5 failed (same pre-existing env-dependent failures on main: wasm alias build, proof-workload http example, socket-binding stdlib-http tests)Governance
cargo fmton backend files. All moved fnspub(crate).Refs #1254.