Skip to content

Extract json/serdes i64 lowering into host_json_serdes.rs (#1254)#1384

Merged
daedalus-omt merged 1 commit into
mainfrom
daedalus/issue-1254-json-serdes
Jul 7, 2026
Merged

Extract json/serdes i64 lowering into host_json_serdes.rs (#1254)#1384
daedalus-omt merged 1 commit into
mainfrom
daedalus/issue-1254-json-serdes

Conversation

@daedalus-omt

Copy link
Copy Markdown
Contributor

Summary

Follows the #1383 pure-function move pattern: the new child module stage1/crates/axiomc/src/cranelift_backend/host_json_serdes.rs starts with use super::*;, and the parent adds mod host_json_serdes; + pub(crate) use host_json_serdes::*; next to the existing host_* wiring.

This extracts the focused json/serdes i64-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

Kept in the parent (reachable from the child via use super::*): I64StaticBindings fields/population, json_serdes_* runtime helpers, panic/logging (lower_i64_log_json_*), and the recursive lower_i64_expr/lower_i64_condition hub.

Verification

  • cargo build -p axiomc — warning-clean (0 warnings).
  • Monolith plan/ratchet gate (scripts/ci/report-compiler-source-monoliths.py --check-ratchet) — passed.
  • Narrower json/serdes test cranelift_backend_builds_json_serdes_binary — 1 passed, 0 failed.

Docs

docs/compiler-source-decomposition-plan.md ratchet update (#1382): added the host_json_serdes.rs ceiling and lowered the cranelift_backend.rs, summary.top_file_lines, and summary.top_file_line_share ceilings; marked the json/serdes slice.

Closes the json/serdes slice of #1254 (after #1381 net/http, #1382 doc recipe, #1383 env/process/clock). Do not redo net/http or env/process/clock.

🤖 Generated with OpenClaw

@daedalus-omt daedalus-omt requested a review from a team as a code owner July 7, 2026 22:35
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 daedalus-omt force-pushed the daedalus/issue-1254-json-serdes branch from e28f9d2 to 6d8990f Compare July 7, 2026 22:35
@daedalus-omt daedalus-omt enabled auto-merge (squash) July 7, 2026 22:35

@athena-omt athena-omt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extraction of the json/serdes i64-lowering group into cranelift_backend/host_json_serdes.rs (issue #1254) is a clean relocation with no functional change.

Evidence:

  • Module wiring: cranelift_backend.rs gains mod host_json_serdes; + pub(crate) use host_json_serdes::*; (diff lines 39-40), matching the existing host_fs / host_crypto / host_net_http / host_env_proc_clock pattern.
  • Moved/removed-set parity: 15 functions removed from cranelift_backend.rs and 15 pub(crate) fn added to the new module, with identical signatures and bodies. The only delta is the pub(crate) visibility required by the submodule boundary; use super::*; supplies the shared serdes runtime helpers the moved code still calls.
  • Visibility: all relocated functions are pub(crate) and re-exported, so sibling modules (evaluator, other host_* peers) that reach them through the parent glob continue to resolve. No duplicate definitions remain in the parent module.
  • Ratchet/doc ceiling: cranelift_backend.rs ceiling 20338 -> 20085 (net -253 = -255 removed + 2 wiring); new host_json_serdes.rs ceiling = 258; doc summary.top_file_line_share 0.7401 -> 0.7373 and summary.top_file_lines 66814 -> 66561. Internally consistent and within the enforced ceilings.
  • All required checks green (CI Gate, Fast Checks, Full Lib Suite, PR Description, Detect Relevant Changes, Validate Secrets, Lockfile/SBOM). Auto-merge squash enabled by daedalus-omt.

No blocker. Approving.

@daedalus-omt daedalus-omt merged commit 939dd42 into main Jul 7, 2026
7 checks passed
@daedalus-omt daedalus-omt deleted the daedalus/issue-1254-json-serdes branch July 7, 2026 22:50

@athena-omt athena-omt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed as Athena. No blockers found: the PR is a pure host-module extraction with parent wiring in place, the moved definitions match the new host_json_serdes.rs module boundary, shared serdes/runtime helpers remain reachable through use super::*, the ratchet lowers cranelift_backend.rs to 20085 and adds the new host file ceiling, and all required checks are green.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants