refactor: strip no_std from kiln-runtime (phase 1: prelude + lib.rs)#168
Merged
refactor: strip no_std from kiln-runtime (phase 1: prelude + lib.rs)#168
Conversation
Remove 414 lines of cfg-gated no_std code from prelude.rs and lib.rs. The interpreter is std-only per RFC #46 architecture. Removed: - All #[cfg(not(feature = "std"))] blocks and no_std alternatives - BoundedHashMap/BoundedHashSet/BoundedString type aliases - Custom vec!/format! macros for no_std - Arc/Mutex/RwLock polyfills for no_std - option_value_as_* helper functions - All cfg gates on module declarations in lib.rs Trace: skip Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
🔍 Build Diagnostics ReportSummary
🎯 Impact AnalysisIssues in Files You Modified
Cascading Issues (Your Changes Breaking Other Files)
✅ No Issues DetectedPerfect! Your changes don't introduce any new errors or warnings, and don't break any existing code. 📊 Full diagnostic data available in workflow artifacts 🔧 To reproduce locally: # Install cargo-kiln
cargo install --path cargo-kiln
# Analyze your changes
cargo-kiln build --output json --filter-severity error
cargo-kiln check --output json --filter-severity warning |
…rity STPA hazards (H-13 sub-hazards): - H-13.1: Thread intrinsic ABI mismatch - H-13.2: Stream/future buffer overrun - H-13.3: Resource handle confusion - H-13.4: Waitable set deadlock on single-threaded runtime - H-13.5: Task status/event code misinterpretation UCAs for CTRL-BUILTINS controller: - UCA-BI-2 through UCA-BI-6 covering invalid indices, buffer overflow, double-free, deadlock, and double-completion STPA-SEC: - SH-9: Resource handle forgery (high exploitability) - SH-10: Stream buffer overflow (high exploitability) - V-9, V-10: Vulnerability mappings with 6 mitigations Requirements: - FR-RFC46-THREAD, FR-RFC46-STREAM, FR-RFC46-RESOURCE, FR-RFC46-WAITABLE Implements: H-13 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…acking Interface design document for the complete RFC #46 host intrinsic API: - Thread management → gale RTOS tasks with cooperative scheduling - Waitable sets → kiln async executor polling gale event groups - Streams → gale shared-memory ring buffers with backpressure - Resources → bounded generation-counted handle table - cabi_realloc → pre-assigned memory pool allocation STPA hazards: - H-14: Executor starvation (cooperative monopolization) - H-15: Gale task slot exhaustion from unbounded thread_new - H-16: Stream backpressure deadlock on bounded channels - H-17: Cross-component resource handle aliasing via generation wrap - H-18: Executor-scheduler priority inversion STPA-SEC: - SH-11: Thread sandbox escape via cross-component thread_switch_to - SH-12: Stream data exfiltration via handle confusion Control structure: CTRL-EXECUTOR with 5 control actions, 4 feedback loops, PROC-THREAD and PROC-WAITABLE controlled processes. Implements: H-14, H-15, H-16, H-17, H-18 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove 1,316 lines of cfg-gated no_std code from module.rs: - All struct fields simplified to Vec (was dual Vec/BoundedVec) - Delete from_kiln_module_nostd (~215 lines) - Delete from_kiln_foundation_module (~270 lines) - Simplify all GlobalWrapper/MemoryWrapper methods - Remove cfg gates from all public methods - Fix Module construction in module_builder.rs, module_instance.rs, component_instantiation.rs Trace: skip Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Complete C function signatures, types, and constants from bytecodealliance/rfcs#46 (lower-component.md as of 2026-03-18). Covers: guest→host intrinsics, non-intrinsic imports, host→guest exports, embedder bindings API, fiber management. Trace: skip Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fully stripped: memory.rs, bounded_runtime_infra.rs, func.rs, instruction_parser.rs, bulk_memory.rs, engine_factory.rs, memory_adapter.rs, memory_helpers.rs, module_builder.rs, simd_additional_ops.rs, simd_runtime.rs, atomic_runtime.rs, atomic_memory_model.rs, atomic_execution.rs, component_impl.rs, wasip2_host.rs, platform_runtime.rs, shared_memory.rs, engine/capability_engine.rs, multi_memory.rs, module_instance.rs (partial). 153 cfg blocks remain in 7 files: module_instance.rs (38), types.rs (26), memory_partial.rs (26), stackless/engine.rs (22), table.rs (20), thread_manager.rs (10), resources/handle_table.rs (10). Trace: skip Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Stripped: module_instance.rs (38), types.rs (26), memory_partial.rs (26), stackless/engine.rs (22), table.rs (20), thread_manager.rs (10), resources/handle_table.rs (10). kiln-runtime now has ZERO active #[cfg(not(feature = "std"))] blocks. The interpreter is fully std-only per RFC #46 architecture. Trace: skip Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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
First phase of stripping no_std conditional compilation from the interpreter per RFC #46 architecture decision.
This is phase 1 — 369 cfg blocks remain across 15 files (module.rs, memory.rs, module_instance.rs, etc.)
Trace: skip
🤖 Generated with Claude Code