Repository navigation
refactor(gpu): drop the unused observable expectations - #301
Merged
Merged
Conversation
Nothing in Tsim asks the Metal sampler for observable expectations: they served only tests. Remove them from the shared tape and noise split and from the Metal kernels and sampler, and merge sample_accepted into the private _accepted, which always takes columns. _select no longer commits an empty command buffer when it dispatches nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
rafaelha
added a commit
that referenced
this pull request
Nov 13, 2026
The removal of expectations from the shared tape, the noise split and the Metal sampler moves to its own PR (#301). CUDA keeps its own simplification: it asks the shared tape for no observables, so its tapes compute none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
☂️ Code Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
rafaelha
added a commit
that referenced
this pull request
Nov 17, 2026
CUDA takes the shared tape's new signatures (#301): tape_kernel has no num_detectors, and the tape kernel no expectations pointer. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.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.
Nothing in Tsim asks the Metal sampler for observable expectations:
sample_accepted(expectations=True)served only tests. This drops the feature and the plumbing around it (about 310 lines).Changes
gpu/tape.py: tapes no longer compute expectations: noevargument,observablesmap or weight bookkeeping.tape_kernellosesnum_detectors, andtape_functionlosesobservables.gpu/noise.py:splitlosesobservables_from.metal/kernels.py: the tape kernel loses itsexpectationsbuffer, sodeviationmoves from buffer 7 to 6. Thegather_floatkernel is gone.metal/sampler.py:sample_acceptedand_sample_callmerge into the private_accepted, which always takes columns.direct_boolspasses every output.expectations. The split is computed when the module compiles._selectno longer commits an empty command buffer when it has nothing to dispatch.test_metal_unmasked_expectations_after_a_masked_callbecomes a rows-only check of the same buffer reuse.Testing
pytest test/unit test/integration/test_metal_sampler.pyon Linux: 2254 passed, 103 skipped (the Metal tests skip without a Mac).valuesargument and the empty command buffers that are no longer committed.PR #219 (CUDA) leaves this shared code alone and will drop its own use of the old signatures once this lands.
🤖 Generated with Claude Code