Repository navigation
Define allow_backprop in McXtrace TRACE sections - #401
Merged
g5t merged 1 commit intoOct 20, 2026
Merged
Conversation
The McXtrace particle struct gained allow_backprop for McCode >= v3.6.9 (mccode-dev#247), but the TRACE #define/#undef lists only had it for McStas, so the runtime PROP_*/DISALLOW_BACKPROP macros failed to compile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@g5t cool. antlr-test-path also enabled in McCode mcxtrace workflows now. |
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.
Adds
allow_backpropto the McXtrace TRACE runtime parameters, so the generated code gets#define allow_backprop (_particle->allow_backprop)(and the matching#undef), as McStas already does. Part of #118.#247 added the
allow_backpropmember to the McXtrace particle struct (for McCode >= v3.6.9), but not the TRACE define. The McXtrace runtime macros (PROP_*,DISALLOW_BACKPROP, ... inmcxtrace-r.h) use the bare name, so almost every McXtrace instrument failed to compile against current McCode:Classic reference:
mccode/src/cogen.c.in:1705in McCode includesallow_backpropin the McXtrace list.Testing
tests/test_trace_allow_backprop.py: passes with the fix, fails without it.mxtest --nsigma 5 --mpi=auto(macOS arm64, McCode main,mcxtrace-antlras MCCOGEN):allow_backprop)mcxtrace.Not in this PR (noticed while testing)
*.comp.<build>.json) are not invalidated when aSHARE INHERITparent component changes (SAXSPDBkept a stale copy ofSAXSPDBFast's SHARE).🤖 Generated with Claude Code