Conversation
- crypto.rs 588 → 32 L aggregator - crypto/hash.rs (107 L) — sha256, hmac-sha256, constant-time-eq - crypto/random.rs (130 L) — random-bytes, uuid4, random-int - crypto/aes.rs (140 L) — aes-gcm encrypt/decrypt - crypto/pbkdf.rs (55 L) — pbkdf2-sha256 - crypto/ed25519.rs (152 L) — keypair/sign/verify
re-exports) - scheduler/lifecycle.rs (177 L) — init/run/shutdown/wait/elapsed/parse_stack_size - scheduler/spawn.rs (174 L) — strand_spawn (+ with_base), spawn_strand (legacy), free_stack - scheduler/yield_ops.rs (107 L) — yield_strand, maybe_yield + TCO counter - scheduler/registry.rs (168 L, diagnostics-only) — StrandSlot/StrandRegistry
- signal.rs 647 → 122 L aggregator (module doc + shared SIGNAL_FLAGS/MAX_SIGNAL + mod decls + re-exports) - signal/constants.rs (189 L) — 9 SIG* getters × unix + non-unix stubs - signal/handlers.rs (92 L, unix-only) — sigaction wrappers + flag handler + mutex - signal/ops.rs (280 L) — trap/received/pending/default/ignore/clear × unix + non-unix stubs All 15 FFI symbols intact, 423 tests pass, just ci clean.
Phase 2 split complete: - closures.rs 573 → 71 L aggregator - closures/env.rs (118 L) — create_env / env_set / generic env_get - closures/accessors.rs (342 L) — type-specific readers (int/bool/float/string/quotation + push_string/push_value) - closures/construct.rs (90 L) — make_closure / push_closure All 12 FFI symbols intact, 423 tests pass, just ci clean.
PR #414 "Runtime phase 2" — Code ReviewExecutive SummaryThis is a well-executed modularization and refactoring PR that improves code organization across the runtime crate by breaking down several large monolithic modules into logically grouped sub-modules. The changes are architectural only — no functional changes or new features. The PR reorganizes ~11,600 lines of code across 6 major runtime modules:
All public APIs are preserved via re-exports, maintaining backward compatibility. What the PR DoesEach monolithic file is split into focused sub-modules. The parent module always re-exports everything via Code QualityStrengths
Minor Issues (Non-Blocking)1. Inconsistent parent module documentation style
2. Inconsistent re-export style Some modules use wildcard: pub use arith::*;
pub use bitwise::*;Others use explicit lists: pub use accessors::{env_get_int, env_get_bool, ...};Recommend picking one style and applying it consistently. Wildcards are simpler when all sub-module items should be public. 3. Motivation missing from sub-module doc comments Some sub-module Unsafe Code ReviewAll unsafe code regions are identical to the original — no new
No new safety concerns introduced. CorrectnessNo functional issues detected. This is a no-op refactoring:
PerformanceNo runtime impact. Module splits may marginally improve compile-time parallelism. All inlined functions remain inlineable with no added call layers. Binary output is identical. SecurityNo new security concerns. All safety properties are preserved:
Worth noting as a positive: the comment in Test CoverageAll existing tests remain in place with corrected imports. No tests were removed. Test behavior is identical. Suggestion for a follow-up PR: Add an integration test that verifies the public API surface is unchanged. This would catch accidental visibility regressions: // Verify parent module still re-exports everything from sub-modules
use crate::arithmetic::patch_seq_add; // would fail if re-export droppedArchitectureThe pattern used here ( Summary
Verdict: Approved. The refactoring is well-executed and low risk. The minor doc comment inconsistencies are non-blocking. Merging this will make the codebase easier to navigate and maintain going forward. |
No description provided.