Repository navigation
Scanner 13 Nov: hot-fixes from the 7 T session - #235
Merged
Merged
Conversation
epi2D/epi3D take phase_reference (default False) and navigator_lines (None: NAVIGATOR_LINES without the reference, none with it). With the reference, the last dummy shot of each slice (2D), of the volume (3D) and the FLEET calibration's dummy shot plays the shot's own train with every phase- and partition-encode prewinder, blip and rewinder scaled to zero, its lines acquired and labelled PHASECORR; every train line carries its position in the train in USER0 (ECHO_COUNTER). A scan without dummies plays one dummy cycle for it. The reference reuses the imaging shot's events, so it adds no segment. gain_calibration_readouts counts PHASECORR readouts with the dummies, as it does navigators. Scanner hot-fix, 13 Nov 7 T session (exam 5195 series 2: the navigator's odd/even slope, +52 mrad/px, is not the train's, +35 mrad/px). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…ve kernel #231 took the optimizer's flip derivatives with torch.func.vmap(jvp(...)). blochsim differentiates a sequence argument by reverse mode ("build a cost and call backward()"), and its native packing reads the train's structure with .tolist(), which a torch.func wrapper does not allow under the PyTorch the deployed environments pin (2.7.1): every fse3d Busse protocol failed at generation with "Cannot access data pointer of Tensor that doesn't have storage" on the 7 T (exam 5195). CI passed because it only ran the latest PyTorch. _ForwardSignal.slopes now takes one backward pass, J^T u with create_graph, and its derivative along each direction, J d: exact, plain autograd, blochsim's native backward. In the deployed environment tests/test_fse_busse.py and tests/test_fse_effective_te.py pass 40/40 (4 failed before, with the 7 T error); native reverse-mode gradients match float32-safe central differences to 4-5 digits. CI's Python 3.10 job now also installs torch 2.7.1. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…igator The EPI tour says what the shipped EPI sequences acquire for the odd/even correction: navigator lines, or with phase_reference the blip-free reference train. The te default of epi2D/epi3D no longer assumes a navigator. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
/build-docs |
Contributor
|
Documentation build: success (https://github.com/pulserver/pypulseqpp/actions/runs/43441491161) |
mcencini
marked this pull request as ready for review
November 13, 2026 18:47
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.
Hot-fixes from the 13 Nov 7 T session, collected here and merged after the scanner confirms them.
epi2D/epi3Dtakephase_reference(defaultFalse) andnavigator_lines(None:NAVIGATOR_LINESwithout the reference, none with it). With the reference, the last dummy shot of each slice (2D), of the volume (3D) and the FLEET calibration's dummy shot play the shot's own train with every phase/partition-encode prewinder, blip and rewinder scaled to zero, ADC on,PHASECORR; every train line carries its position in the train inUSER0(ECHO_COUNTER). A scan without dummies plays one dummy cycle for it. Same events as an imaging shot, so no new segment.gain_calibration_readoutscountsPHASECORRreadouts with the dummies.pypulseqpp/sequences/sequence/epi{2D,3D}_sequence.pyandsequences/_prescan.pyreplaced in the scanner's EnvPulserver site-packages; the zoo plugins (pulserver #382) turn the reference on (bundlebuild/scanner-2026-11-13/hotfix-epi-ref/)torch.func.vmap(jvp)on the flips failed under torch 2.7.1 (the deployed pin) with blochsim's native packing — every fse3d Busse protocol refused at generation (exam 5195 run 3499, "Cannot access data pointer of Tensor that doesn't have storage")._ForwardSignal.slopesnow uses exact reverse mode through blochsim's native backward (J^T u, then J d per direction). CI's Python 3.10 job now also runs torch 2.7.1. In the deployed environmenttest_fse_busse.py+test_fse_effective_te.py: 40/40 (4 failed before).pypulseqpp/_busse_opt.pyreplaced in the scanner's EnvPulserver site-packages, design server restarted (bundlebuild/scanner-2026-11-13/hotfix-busse-reverse/, d4ce7219 → e08f7eb3; the committed file differs only in ruff wrapping)Checks:
tests/test_zoo_epi.py,tests/test_prescan.py: 222 passed (9 new tests: the reference is the imaging train with every encode at zero, same read lobe/ADC/duration/polarity per echo, in 2D, segmented, multiband, 3D and skipped-CAIPI; it replaces the navigator and shortens TE and TR; one dummy cycle without dummies; FLEET takes its reference from its dummy shot; the gain prescan does not count it as imaging). Run against the released 0.0.67 with these files overlaid, as deployed.To do before merge: the default
phase_reference=Trueonce the scanner confirms; the EPI tour (gallery/02-tours/03_epi.py) and the sequence pages.🤖 Generated with Claude Code