Repository navigation
Disjoint sets: the members' state is boxed, so a system holding the host is small - #3045
Merged
Merged
Conversation
Owner
|
Thanks, this is the real cause behind the stack overflow on #3042, and boxing the set's state is the right fix. Merged as is. |
rblaine95
added a commit
to bunkerlab-net/benilla
that referenced
this pull request
Nov 22, 2026
- 53fbf8d (samwhosung#3039): Signal unit field changes through linked watchers. - 0e5c47b (samwhosung#3045): Box disjoint system parameter state. - 3216a7a (samwhosung#3042): Validate the optional call host once per run. Native object packets still use the shared watcher path. The fork has no caller of the removed watcher export and no override of the changed host lends. Keep its separate cached-state box pending a stack comparison. Regenerating the map and deviation index produced no diff. Linux gates: - `mbx fmt --all -- --check` passed. - Strict Clippy passed for app and UI, and for app without defaults. - App lib, installed and empty `WOW_DATA`: 9,221 of 9,221 passed in each configuration across the full suite and an isolated rerun; 33 ignored each. `resident_result_transport_changed_source_allows_ historical_ack_not_fresh_geometry` failed on a local geometry reply deadline at two and four threads under load. It passed in both configurations on the same binary with `--exact --test-threads=1`. The installed run had 17 GiB of swap in use. - UI: 3,620 unit and 19 integration tests passed, 1 ignored, 0 doctests. - Python: verify-libtest-output 61, native-starter 182, classic-export 347, initial-hooks 22 passed. Ave Deus Mechanicus
rblaine95
added a commit
to bunkerlab-net/benilla
that referenced
this pull request
Nov 22, 2026
Upstream samwhosung#3045 boxes disjoint system parameter state. The separate fork box from 53b2e7b no longer protects the nameplate click test from a stack overflow, so remove it and match upstream. The exact nameplate click test passed on the default 2 MiB stack with and without the fork box. On a 64 KiB grid, both builds overflowed at 393,216 bytes and first passed at 458,752 bytes. Both had 1,638,400 bytes of margin at that granularity. Linux gates: fmt and strict Clippy passed for app plus UI, and for app without defaults. App lib with installed WOW_DATA passed 9,221 tests with 33 ignored. With empty WOW_DATA, 9,220 passed and 33 were ignored. The same native geometry reply deadline seen on the boxed merge failed at four threads; it passed on the same binary with --exact --test-threads=1. Across both runs, the empty-data configuration passed all 9,221 tests. Ave Deus Mechanicus
rblaine95
added a commit
to bunkerlab-net/benilla
that referenced
this pull request
Nov 22, 2026
…the verified merge Join UpstreamMerge8's signed merge 1a42cf4 and its follow-up 1148535 onto the local P2P foundation. Upstream samwhosung#3045 boxes the same oversized script host state as the fork's CachedState box, and measured stack margins were identical, so the follow-up removed the fork box and script_calls.rs now matches upstream. The joined tree changes only the 13 client files of the verified merge. Their contents equal 1148535. No runtime, simulation, store or script file changes. Genmap produced no diff. Ave Deus Mechanicus
ornfelt
added a commit
to ornfelt/benilla
that referenced
this pull request
Nov 23, 2026
…ung#3042, samwhosung#3043, samwhosung#3045, samwhosung#3046 and the fork's no-change merge) merged as is - no conflicts, no gfx trigger (protocol self flag and ActivePlayerCreate, script-call host validation and boxed disjoint state, live-read routing, unit field watchers, channel cast holds), the feature-off diff against main the same lines before and after; cargo check --workspace --all-targets clean with and without benilla/gfx, benilla-protocol and benilla-ui tests green apart from lua50 table_size's a_nested_sort_costs_one_host_level_per_comparator, which reaches 58 of 150 levels at dev-fast's opt-level 0 and passes at dev, benilla-app net, creature_anim, script_calls, ui_unit, ui_chat, lanes and ui_script tests green at dev-fast, built on Windows only
ornfelt
added a commit
to ornfelt/benilla
that referenced
this pull request
Nov 23, 2026
…ung#3042, samwhosung#3043, samwhosung#3045, samwhosung#3046 and the fork's no-change merge) merged as is - no conflicts, no gfx trigger (protocol self flag and ActivePlayerCreate, script-call host validation and boxed disjoint state, live-read routing, unit field watchers, channel cast holds), the branch's diff against main the same lines before and after, no schedule change (frame test green); cargo check --workspace --all-targets clean, benilla-protocol and benilla-ui tests green apart from lua50 table_size's a_nested_sort_costs_one_host_level_per_comparator, which reaches 58 of 150 levels at dev-fast's opt-level 0 and passes at dev (the eight_nested_switches_fit_a_two_megabyte_stack case again), benilla-app net, creature_anim, script_calls, ui_unit, ui_chat, lanes, ui_script and frame tests green at dev-fast, built on Windows only
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.
What benilla did
A
disjoint_set!'s state was a struct of every member's state, held inline. The call host's appliers are such a set, andScriptCallHost's state is 181 KB.Bevy's
FunctionSystemholdsOption<FunctionSystemState<P>>inline from the moment the system is made, before it is initialised. So every system that takes the host (VmWith,HostedVm,InputHost, the chat lane) is 181 KB or more while a plugin adds it. That stack goes oninto_system, the boxing intodyn System, and anyadd_systemstuple.Building the whole headless client (
headless_client_unrun) takes about 1.5 MB of stack on Windows, and close to the 2 MB of a test thread on Linux. Any change near those systems can tipscript_calls::cached_state_tests::the_hosted_vm_keeps_one_state_across_callsinto a stack overflow in the Linuxplayer-testsgate.What changes
disjoint_set!'sStateisBox<$state>.init_stateboxes it, andget_paramlends&mut **state. Nothing outside the macro changes.How to see it, before and after
the_hosted_vm_keeps_one_state_across_callson a thread of a given size, player build (--no-default-features), Windows,CARGO_INCREMENTAL=0,CARGO_PROFILE_DEV_DEBUG=0as in CI:The headless client build alone needs the same as the whole test before (it overflows at 1536 KB and fits at 1538 KB), so the build is where the stack went.
Checks (Windows, without the client data)
cargo test -p benilla-app --lib: 7765 passed, 0 failed.cargo test -p benilla-formats -p benilla-app --no-default-features --lib: 7704 and 566 passed, 0 failed, the newthe_hosts_state_is_a_few_wordsamong them.cargo clippy -p benilla-ui -p benilla-app --all-targets -- -D warnings: clean.cargo clippy -p benilla -p benilla-app --no-default-features -- -D warnings: clean.wgpu-haldependency (bind_cbv).scripts/doc-links.py: ok.rustfmt --checkon the changed file: clean.