Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Booting the kernel now loads the standard library from the Lib/StLib Shen
# sources (kernel/stlib/), whose type-checked load recurses well past the
# 2 MB default stack of cargo's test threads. The `shen-rust` binary already
# boots on a >=64 MB thread (bin/shen-rust/src/main.rs); this sets the same
# floor for every thread cargo spawns (tests, doctests) so `cargo test` and a
# bare `cargo run` behave without a hand-set RUST_MIN_STACK.
[env]
RUST_MIN_STACK = "268435456"
5 changes: 3 additions & 2 deletions STATUS.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ model, not a single hot spot. On served workloads the story inverts: VM

## Known limitations

- Boot loads + AOT-installs 18 kernel files every startup (~sub-second release);
shen-cl uses pre-compiled FASLs.
- Boot loads + AOT-installs 17 kernel files every startup, then loads the
standard library from the `kernel/stlib/` Shen sources (~sub-second
release); shen-cl uses pre-compiled FASLs.
- GC collection is opt-in (`SHEN_RUST_GC=1`) and requires aarch64
macOS/Linux (the conservative stack scan is unimplemented elsewhere —
refused with a warning, heap stays grow-only). Hosts embedding the engine
Expand Down
27 changes: 14 additions & 13 deletions crates/klcompile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,16 @@ pub struct CompileReport {
}

/// Kernel defuns whose source is so large (deeply nested cons literals)
/// that LLVM optimization takes minutes per release build. They run
/// once at boot, so AOT gives no speedup — leave them tree-walked.
/// This is the KERNEL invocation's policy (see `CompileOptions::kernel`),
/// not a property of the compiler.
pub const KERNEL_SLOW_DEFUNS: &[&str] = &[
"stlib.initialise-sources",
"stlib.initialise-types",
"stlib.initialise-environment",
"stlib.initialise-arities",
];
/// that LLVM optimization takes minutes per release build, so the kernel
/// AOT invocation leaves them tree-walked. This list is the KERNEL
/// invocation's policy (see `CompileOptions::kernel`), not a property of
/// the compiler.
///
/// Empty since the S41.2 refresh: the only members were the four
/// `stlib.initialise-*` defuns in the community `stlib.kl`, which is
/// retired — the standard library now loads from the `Lib/StLib` Shen
/// sources at boot (`kernel/stlib/`) and is not part of the kernel AOT set.
pub const KERNEL_SLOW_DEFUNS: &[&str] = &[];

/// Compile KL source text to a Rust module. Pure: no filesystem access.
/// One `Codegen` per call, so `__tN` numbering matches the historical
Expand Down Expand Up @@ -1110,9 +1110,10 @@ mod tests {
p
}

/// Pin the kernel skip set: with the kernel options, the only
/// force-skipped defuns across all kernel .kl files are exactly the
/// legacy four. A budget heuristic must never silently change this —
/// Pin the kernel skip set: with the kernel options, no defun across
/// the kernel .kl files is force-skipped (empty since the S41.2 refresh
/// retired `stlib.kl`, whose four `stlib.initialise-*` defuns were the
/// only members). A budget heuristic must never silently change this —
/// the kernel AOT bytes are frozen behind Gate 6.
#[test]
fn kernel_skip_set_is_exactly_the_legacy_four() {
Expand Down
2 changes: 0 additions & 2 deletions crates/shen-rust/src/aot/kernel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ pub mod macros;
pub mod prolog;
pub mod reader;
pub mod sequent;
pub mod stlib;
pub mod sys;
pub mod t_star;
pub mod toplevel;
Expand Down Expand Up @@ -61,7 +60,6 @@ pub fn install_all(interp: &mut Interp) {
t_star::install(interp);
yacc::install(interp);
types::install(interp);
stlib::install(interp);
extension_features::install(interp);
extension_expand_dynamic::install(interp);
extension_launcher::install(interp);
Expand Down
Loading