Feat: downstream perf improvements - bump .25#34
Merged
Conversation
ApprovabilityVerdict: Needs human review This PR changes the wire format for routed_experts from base64-encoded NumPy .npy files to JSON objects with data/shape fields. This protocol change affects runtime behavior and compatibility with other components, warranting human review. You can customize Macroscope's approvability policy. Learn more. |
JannikSt
approved these changes
May 15, 2026
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.
Note
Medium Risk
Medium risk because it changes the on-the-wire JSON schema for
routed_experts(from base64-encoded.npystrings to{data, shape}objects), which can break compatibility with existing clients/servers if not coordinated. The merge logic now relies on shape-provided sizing and row offsets, so malformed shapes could surface as new validation errors.Overview
Updates
routed_expertsprefill/decode merging to use a raw uint8 payload encoded as JSON{ "data": <base64 bytes>, "shape": [seq_len, layers, topk] }instead of a base64-encoded NumPy.npyblob, removing dtype/header parsing and related validation.Tightens merge validation by checking
row_start <= seq_len, verifying byte length matchesseq_len * layers * topkwith overflow-safe math, and updates tests accordingly. Also bumps crate/Python package version to0.1.25.Reviewed by Cursor Bugbot for commit 510092f. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Replace NumPy .npy encoding with raw uint8 JSON objects for routed experts payloads
.npystrings with a JSON object{data: <base64>, shape: [seq, layers, topk]}for all routed experts payloads inrouted_experts_merge.rs.parse_npy_payload,parse_descr,dtype_item_size); row size is now computed aslayers * topkassuming 1 byte per cell..npy-encodedrouted_expertsstrings will receive errors; payloads must be migrated to the new object format.Macroscope summarized 510092f.