#1503: Split position sync into a second helper script (Stack-Heap Collision after login) #1504

Open
TheSlowly wants to merge 2 commits from TheSlowly/Slipstream:helper-split into main
Collaborator

Fixes #1503.

The helper's one script used 58 KB of its 64 KB at startup since position sync (#1417), so it crashed right after login and stayed dead for the session.

  • Position sync moves unchanged into slipstream_helper_pos.lsl; the main script hands it pos/* and the keep-alive as link messages. No memory cap: a tight one crashed it in a crowd.
  • SLBridge installs, versions and verifies both scripts.
  • A helper that stops answering, or whose position script stopped (reported in hello), is reinstalled (at most twice a session).
  • hello reports the main script's memory, which the viewer logs.
  • New check helper-scripts (size budgets, hand-off, install/verify, liveness).

In world: main script now 44.8 KB of 64 KB at login (was 58.4), no error. Not yet tested: position sync with another Slipstream user nearby.

Fixes #1503. The helper's one script used 58 KB of its 64 KB at startup since position sync (#1417), so it crashed right after login and stayed dead for the session. - Position sync moves unchanged into `slipstream_helper_pos.lsl`; the main script hands it `pos/*` and the keep-alive as link messages. No memory cap: a tight one crashed it in a crowd. - SLBridge installs, versions and verifies both scripts. - A helper that stops answering, or whose position script stopped (reported in hello), is reinstalled (at most twice a session). - hello reports the main script's memory, which the viewer logs. - New check `helper-scripts` (size budgets, hand-off, install/verify, liveness). In world: main script now 44.8 KB of 64 KB at login (was 58.4), no error. Not yet tested: position sync with another Slipstream user nearby.
Since position sync (#1417) the helper's one script used 57 KB of its 64 KB at startup
(measured in world: 58356 bytes after state_entry, 60286 after one pos/send/1), so the first
larger command ended in a Stack-Heap Collision right after login, and a crashed helper stayed
dead for the session.

- slipstream_helper_pos.lsl (#Slipstream Helper Position) now holds position sync unchanged;
  the main script hands it pos/* commands and the keep-alive ping as link messages (POS_LINK)
  and keeps the rest. The position script works out on its own when the viewer went quiet, and
  runs under its startup memory + 12 KB, so the helper's reported script memory grows little.
- SLBridge installs both scripts (dropped together once both compiled, main script last),
  versions them by a hash of both templates, and verifies exactly these two, made by us.
  Older viewers see two scripts, fail their check and reinstall their own.
- READY liveness: a helper silent for three ping/hello rounds is installed again, at most twice
  a session; one that keeps dying goes UNAVAILABLE until a feature is switched on again.
- hello carries the main script's used/limit memory; the viewer logs it after the check and
  warns once when under 8 KB are free.
- Check helper-scripts: code-line budgets per script, the hand-off, install/verify of every
  script, liveness. pos-sync now reads the position script.

Test-Plan:
    python3 -I scripts/check/run.py --stage source (28 pass; helper-scripts failed before)
    slbridge.cpp syntax-checked with the Windows flags
    In world: the old helper updated, "Helper checked: 2 scripts, ours", "Helper script memory:
    44846 of 65536 bytes used (main script)" (was 58356); no Stack-Heap Collision while in world
    Not yet: position sync against another Slipstream user nearby

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In a crowd the position script died with a Stack-Heap Collision: it capped itself at its startup
memory + 12 KB, and the visible-avatar list with a long command needs more. A crashed helper is
worse than a few KB more reported script memory, so no helper script sets llSetMemoryLimit.

The main script answering hello said nothing about the position script, so that crash left
position sync dead for the session. hello now ends in llGetScriptState of the position script;
two READY hellos in a row saying it stopped count as a dead helper (same reinstall, same cap of two
a session).

Test-Plan:
    python3 -I scripts/check/run.py --stage source (28 pass; helper-scripts failed before on all three rules)
    slbridge.cpp syntax-checked with the Windows flags
    In world: crowded region, no Stack-Heap Collision from #Slipstream Helper Position

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u helper-split:TheSlowly-helper-split
git switch TheSlowly-helper-split
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sky_line/Slipstream!1504
No description provided.