[GH-ISSUE #1094] [Issue]: Slurp world tick freezes the whole Engine for ~7 s every 5 minutes #558

Closed
opened 2026-10-20 17:28:34 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Gunterlie on GitHub (Sep 26, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1094

Originally assigned to: @Gunterlie on GitHub.

Summary

Every ~5 minutes the [slurp-world] simulation tick runs on the Engine's main thread for about 7 seconds. While it runs, the whole Marinara Engine process is frozen: every other capability package, every API route and every open tab stops responding. About 4.4 of those 7 seconds are spent in Slurp's getSettings(), which re-normalizes and fully re-validates the settings with zod on every call, and the tick calls it many times.

Reported by SonaGate.

Affected package

slurp2 (Slurp Remastered) 0.2.38

Expected behavior

The world tick runs without blocking the Engine. Other packages, routes and tabs keep responding.

Actual behavior

The Engine freezes for ~7 s every 5:07 (tickMinutes plus the work). An event-loop lag watchdog logged:

[17:31:20.002] the engine was stuck 6756 ms
[17:36:27.313] the engine was stuck 7064 ms
[17:41:34.682] the engine was stuck 7188 ms
[17:46:42.001] the engine was stuck 7003 ms
[17:51:48.975] the engine was stuck 6595 ms
[17:56:55.966] the engine was stuck 6676 ms

A scene-close request in another package took 5.4 s because it was queued behind the tick.

Steps to reproduce

  1. Run the Engine with Slurp 0.2.38 installed and its world set up.
  2. Watch any request or tab at 5-minute intervals, or run a 500 ms setInterval that logs performance.now() lag: it shows ~7000 ms late ticks every 5:07.
  3. Profile across one of those moments: getSettings / normalizeSlurpSettings / zod dominate.

Environment

  • Marinara Engine version: 2.4.6 (staging)
  • Package version: slurp2 0.2.38
  • Install type: other (39 capability packages installed)
  • OS + version: Windows 10, Node 24.15
  • Browser or app shell: any

Logs, screenshots, or video

CPU profile (1 ms sampling) of the busiest 7-second window, 7,002 ms sampled:

Owner Time
slurp2 4,569 ms
garbage collector 1,534 ms
everything else 899 ms
4434 ms  getSettings            server.mjs:246:54562
4409 ms    Iu (normalize)       server.mjs:246:38162
1181 ms      VV → wEe → Eh → Gd → zod safeParse / _parseSync / _parse
  81 ms  getAccountById
  11 ms  listThreadsForCreators

getSettings appears under several callers, including withoutHiddenAmbientAccounts and microtask continuations, so it is called per item or per step during the tick.

Additional context

Suggested fixes: read or cache settings once instead of re-validating on every call, and yield to the event loop during the tick. Workaround until a fix lands: raise simulationTuning.clock.tickMinutes.

Fix: #1093

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Gunterlie on GitHub (Sep 26, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1094 Originally assigned to: @Gunterlie on GitHub. ## Summary Every ~5 minutes the `[slurp-world]` simulation tick runs on the Engine's main thread for about 7 seconds. While it runs, the whole Marinara Engine process is frozen: every other capability package, every API route and every open tab stops responding. About 4.4 of those 7 seconds are spent in Slurp's `getSettings()`, which re-normalizes and fully re-validates the settings with zod on every call, and the tick calls it many times. Reported by SonaGate. ## Affected package `slurp2` (Slurp Remastered) 0.2.38 ## Expected behavior The world tick runs without blocking the Engine. Other packages, routes and tabs keep responding. ## Actual behavior The Engine freezes for ~7 s every 5:07 (`tickMinutes` plus the work). An event-loop lag watchdog logged: ``` [17:31:20.002] the engine was stuck 6756 ms [17:36:27.313] the engine was stuck 7064 ms [17:41:34.682] the engine was stuck 7188 ms [17:46:42.001] the engine was stuck 7003 ms [17:51:48.975] the engine was stuck 6595 ms [17:56:55.966] the engine was stuck 6676 ms ``` A scene-close request in another package took 5.4 s because it was queued behind the tick. ## Steps to reproduce 1. Run the Engine with Slurp 0.2.38 installed and its world set up. 2. Watch any request or tab at 5-minute intervals, or run a 500 ms `setInterval` that logs `performance.now()` lag: it shows ~7000 ms late ticks every 5:07. 3. Profile across one of those moments: `getSettings` / `normalizeSlurpSettings` / zod dominate. ## Environment - Marinara Engine version: 2.4.6 (staging) - Package version: slurp2 0.2.38 - Install type: other (39 capability packages installed) - OS + version: Windows 10, Node 24.15 - Browser or app shell: any ## Logs, screenshots, or video CPU profile (1 ms sampling) of the busiest 7-second window, 7,002 ms sampled: | Owner | Time | |---|---| | slurp2 | 4,569 ms | | garbage collector | 1,534 ms | | everything else | 899 ms | ``` 4434 ms getSettings server.mjs:246:54562 4409 ms Iu (normalize) server.mjs:246:38162 1181 ms VV → wEe → Eh → Gd → zod safeParse / _parseSync / _parse 81 ms getAccountById 11 ms listThreadsForCreators ``` `getSettings` appears under several callers, including `withoutHiddenAmbientAccounts` and microtask continuations, so it is called per item or per step during the tick. ## Additional context Suggested fixes: read or cache settings once instead of re-validating on every call, and yield to the event loop during the tick. Workaround until a fix lands: raise `simulationTuning.clock.tickMinutes`. Fix: #1093 ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:28:34 +07:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
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
Pasta-Devs/Marinara-Agents#558
No description provided.