Repository navigation
Own pending WebSocket bytes across writer threads - #258
Merged
Merged
Conversation
Co-authored-by: GPT-6 <gpt-6@openai.com>
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.
Babel’s short-lived scripted decision worker crashed while replacing a pending WebSocket frame allocated by another thread. The stack ended in Nim’s thread-local allocator during
sendFrame. Borrowing the socket alone reproduced the same crash.Store pending upgrade/frame bytes with explicit libc ownership and retain their length/offset across partial writes. Serialized writers can now change threads without freeing another thread’s Nim string. The receive owner, TLS checks, deadlines, and protocol remain unchanged.
Validation:
nim c --debugger:native --parallelBuild:1 --threads:on --mm:orc -o:probe tests/support/native_websocket_probe.nim;python3 tests/test_native_websocket.py ./probe./tmp/coworld-websocket-storage-v1/{test-fixed-v9.log,test-bookworm-v10.log}and/tmp/coworld-babel-websocket-v2/{test-scripted.log,test-native.log}. Failed baseline and harness runs are preserved separately.Runs used finite owned lanes totaling at most two CPUs and 2GiB, Nice19. Native fixtures carry no authenticated model authority. Game images must pin and qualify this source separately; no production release.
Independent coordinator source review and exact input-hash-bound whole Babel reproduction passed. The unchanged game/fixture with old pointer-borrow-only player exits1; the fixed player exits0. Unit
873e8225c000412aa2b4faafc8298a75finished0, Nice19/1CPU/1GiB/180s. Proof: Zephyrus/tmp/coworld-babel-root-pending-review-ae0ad31/proof.json. Every source/image adopter remains responsible for a fresh pinned runtime gate; no production publication/reupload is included.