Skip to content

perf(process): reuse session receive cases - #56

Merged
wolfy-j merged 1 commit into
masterfrom
perf/stable-receive-cases
Oct 5, 2026
Merged

wolfy-j merged 1 commit into
masterfrom
perf/stable-receive-cases

Conversation

@wolfy-j

@wolfy-j wolfy-j commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Reuse the receive-case arrays and descriptors in the Session ingress and shutdown loops instead of rebuilding them on every select.

  • Keep the ingress order: inbox, events, bus completion, policy requests.
  • Keep the distinct shutdown order: bus completion, policy requests, inbox.
  • Construct shutdown cases only if the bus completion has not already been consumed.
  • Keep cases private to each run and let each select return a fresh result.

The channels are fixed throughout a run. Current master already waits directly on the command bus wake channel, so command_bus.lua is intentionally unchanged. No API, configuration, dependency or admission-policy change.

Verification

Test-first: on unchanged production code, the two reuse regressions failed while the other 334 cases passed. After the change, all 336 tests pass.

  • Current Hub stable runtime v0.3.44a: 10 consecutive full-suite runs, 336/336 each; lint clean across 171 entries.
  • Development runtime built from runtime #904: 10 consecutive full-suite runs, 336/336 each; lint clean across 171 entries.
  • Independent Astra review approved; its own full-suite run passed 336/336.
  • git diff --check passes.

The regressions check per-loop reuse and construction counts, distinct priority orders, invocation isolation, durable steering input, late-input rejection, and skipped unused shutdown cases. A real-channel test checks concurrent descriptor reuse, exactly-once delivery, independent retained results, and closure.

The scripted ingress tests use real SQLite admission/persistence but do not schedule the command bus or call an LLM. This establishes removal of repeated case construction, not a measured whole-Session latency or RAM improvement. It does not require runtime #904.

@wolfy-j
wolfy-j requested a review from skhaz October 4, 2026 00:12
@wolfy-j
wolfy-j merged commit 4393c3a into master Oct 5, 2026
2 checks passed
@wolfy-j
wolfy-j deleted the perf/stable-receive-cases branch October 5, 2026 18:09
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.

2 participants