Skip to content

fix(rust): the run drops a host's value of any depth without recursing - #186

Merged
kommander merged 5 commits into
devfrom
fix/hostvalue-iterative-drop
Dec 3, 2026
Merged

kommander merged 5 commits into
devfrom
fix/hostvalue-iterative-drop

Conversation

@kommander

@kommander kommander commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

A HostValue nested past ~15,000 levels crashed the process when the run dropped it, even after refusing it (found in #185). The run now drops what a host gives it with HostValue::discard (64 levels at a time, then a work list, as #185's Data::discard): host-call results and throws, pending results (also after a suspend), results kept for snapshot hooks, and a restored durable call's data. A result the program took whole is no deeper than maxValueDepth and drops as before. No API change; rust/README.md notes that a host's own values drop recursively.

Callgrind vs dev: tool fan-out −0.32%, durable −0.07%, async −0.06%, small sync −0.06%, medium sync +0.01%; the 9 bench programs within ±0.01%.

@kommander
kommander force-pushed the fix/hostvalue-iterative-drop branch from f53d9e7 to 8e7716a Compare December 2, 2026 17:28
@kommander kommander closed this Dec 2, 2026
@kommander kommander reopened this Dec 2, 2026
# Conflicts:
#	rust/crates/psychoscript/src/host.rs
…sed properties without recursing

A namespace listing that throws discards what it threw, and a function the program refuses
drops its own properties without recursing, sync, async or durable. A thrown value or a global
clears the partial flag, and a refused result keeps no root for a later suspend.
@kommander
kommander merged commit 24d94bc into dev Dec 3, 2026
2 checks passed
@kommander
kommander deleted the fix/hostvalue-iterative-drop branch December 3, 2026 04:00
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