Skip to content

chore(cli-rs): pin psychoscript to the 0.2 integration branch - #67974

Open
simonklee wants to merge 1 commit into
devfrom
ps-carrier-0-2
Open

simonklee wants to merge 1 commit into
devfrom
ps-carrier-0-2

Conversation

@simonklee

Copy link
Copy Markdown
Member

Issue for this PR

N/A (follow-up to #67374 and #67944: moves the script plugin carrier onto psychoscript 0.2)

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The native client's script plugins run on psychoscript, pinned by git to anomalyco/psychoscript's opencode-carrier branch, an integration of our psychoscript changes on an older upstream. This moves the pin to the new integration branch opencode-carrier-0.2 (aeba13aa): upstream dev at psychoscript 0.2.0 plus #202, with our changes that aren't upstream yet rebased onto it (static linked JS modules, compile-time refusals, the generated globals .d.ts, budget-stop locations, the native-work, GC, crossing and regex bounds, and five speed fixes) and without the TypeScript mode, which #67944 stopped using. regress still comes from the same fork.

Client changes for the new engine: sources go in through Source::new (no TypeScript field), the stack is read from the end of the message, the default locale feature replaces intl, and heap measurement at waits is turned on only for idle_memory (turning it on for every activation cost 46% more instructions). Plugin errors now read as the engine writes them, with file, line and a traceback. No new crates; no deps-allow.txt or deny.toml change. No feature flag: the plugin contract is unchanged.

How did you verify your code works?

  • The ports twins (ten third-party script plugins) 10 of 10 at plugin level and 8 of 8 in the TUI; check:plugin-types 0 errors; the plugin, CLI and TUI script, loader, machine and twin tests; the dependency test.
  • Script gates against the previous pin, interleaved on one machine: all hold. Instructions G1–G3 +3.2%, G4–G6 −0.4%, G9 +0.15%; G1 5.63 → 5.82 µs, G2 767 → 771 µs, G3 27.4 → 28.0 µs, G4 495 → 501 µs, G5 40.1 → 42.0 KB (the engine now counts interned atoms), G9 regroups unchanged; ten-plugin RSS 63.8 → 63.4 MiB.
  • The carrier itself passes psychoscript's TS and Rust suites, recording drift, conformance round-trip, GC stress and test262 (19,979 of 19,982).
  • cargo fmt --check, clippy -D warnings, check:drift, cargo deny. The merge lane's gate and full suites (P-CLI, P-PTY, ACP, P-TUI, drift, machines, Windows check, cargo deny) passed on 14c60591bf.

Screenshots / recordings

N/A (dependency and carrier internals).

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Move the script carrier from opencode-carrier (52337cb, psychoscript
0.1.3) to opencode-carrier-0.2 (aeba13aa): upstream dev e79e7ee, which
is psychoscript 0.2.0 plus #202, with the carrier branches rebased onto
it and no TypeScript mode. The dependency graph and the regress fork do
not change.

A Source has no typescript flag now, so a plugin's files go in through
Source::new. A diagnostic no longer carries a separate stack: its message
ends with the stack, as Node prints an uncaught error, so the report
splits the headline from the frames.

The heap cap no longer measures a run's heap at its first wait for the
host; only Runtime::measure_heap measures at waits. It measures again
once a run allocated a sixteenth of the last measurement, which for a
plugin's small heap is nearly every call: turned on for every activation
it cost G1 and G3 40 to 55% and G9's load 70%. So only idle_memory, the
one reader of an idle activation's heap_bytes, turns it on.

@opencodejr opencodejr Bot 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.

I found nothing that should block this. I couldn't run it here because this environment has no Rust toolchain, so I checked the client changes against psychoscript at aeba13aa by reading its source. Heap measurement at waits is now opt-in through measure_heap; idle_memory turns it on through the thread-local, which Activation::start reads on the same thread. Runs with a heap limit are still measured as memory grows and when the body returns, so a_plugin_runs_under_small_and_tight_caps should still pass without the flag. The engine ends its messages with a \n at … stack, which is what format_diagnostic now splits on. The lockfile changes only the psychoscript entry.

Public API: unchanged. The plugin contract stays the same; only the wording of plugin error messages changes, as described.

This branch has not been deployed

No deployments
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