Skip to content

Build octoscript-core against the ported makepad VM - #21

Closed
ymote wants to merge 2 commits into
rename/fix-language-review-20260904from
vm-unify/core-on-ported
Closed

ymote wants to merge 2 commits into
rename/fix-language-review-20260904from
vm-unify/core-on-ported

Conversation

@ymote

@ymote ymote commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

Switches octoscript-core and octoscript-capabilities from the vendored vendor/makepad VM to makepad-script from OctoSense-org/makepad at the vm-port/integration revision (fork PR #1), which carries every vendor patch. Based on PR #20 (the renamed side branch), so this PR shows only its own commit.

Changes: Runtime holds a ScriptVmHost<H, S> and builds ScriptVm { host, bx } (the fork's host shape); seven capability downcasts go through as_any_mut(); the three tool-output sites use new_bounded_string_with, since the ported VM refuses the raw new_string_with under a heap cap. vendor/makepad is left in place for this PR and can be deleted once the fork revision is final.

Verification on this tree: cargo test --workspace --no-fail-fast = 986 passed, 4 failed, no VM regressions. The 4: canonical_newline_boundaries_are_lowered_for_vm_compatibility (upstream #1139 makes a newline-( start a statement; expectation must flip), heap_limit_bounds_total_string_storage_after_individual_strings_pass (the ported heap preflights and never allocates the over-limit string, so the next eval is not refused until GC; confirm whether refuse-until-GC was a required contract), and the two profile.rs catalog-drift tests that fail on the branch regardless of VM.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JgSir4cQyaakzPju4h6smw

ymote and others added 2 commits September 13, 2026 15:13
Point octoscript-core and octoscript-capabilities at the ported makepad
`work` VM (branch vm-port/integration, a4347332b) instead of the vendored
copy under vendor/makepad. The vendor tree stays in place; the path is a
local checkout for the G3 gate run.

Host shape: the ported ScriptVm takes `host: &mut dyn ScriptHost`, so
Runtime now owns a `ScriptVmHost<H, S>` and the capability bindings
downcast through `as_any()` / `as_any_mut()`.

Tool output strings: the ported heap refuses the unrestricted
`ScriptVm::new_string_with` whenever an allocation budget or retained cap
is armed (it cannot preflight a raw `&mut String`). The three tool-output
sites in `install_tool_module` now build through the accounted
`heap.new_bounded_string_with`, the same path octoscript-core's string
natives already use.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgSir4cQyaakzPju4h6smw
…ighted heap caps

The ported makepad-script (upstream #1139) starts a new statement at a `(` on a
new line, so the compatibility preflight now accepts `use mod.std.a\n(42)`
just as canonical lowering does. And its heap preflights every charge, so a
refused over-limit string never lands on the heap: the runtime is not left
above its cap, and the next evaluation runs instead of being refused until GC.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgSir4cQyaakzPju4h6smw
@ymote
ymote deleted the branch rename/fix-language-review-20260904 September 13, 2026 22:22
@ymote ymote closed this Sep 13, 2026
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.

1 participant