Skip to content

Trace each SPLIT branch as its own ray - #414

Merged
g5t merged 1 commit into
mainfrom
split-trace-rays
Nov 23, 2026
Merged

g5t merged 1 commit into
mainfrom
split-trace-rays

Conversation

@willend

@willend willend commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #413.

In trace mode, all SPLIT branches of a particle were in one ENTER:...LEAVE: block, so mcdisplay drew a "return line" from the end of each branch back to the SPLIT point. The SPLIT loop now emits DEBUG_LEAVE(); DEBUG_STATE(); DEBUG_ENTER(); DEBUG_STATE(); before restoring the particle for the second and later branches, so each branch is a separate ray. Only trace output changes.

Same one-line change as the classic code generator in mccode-dev/McCode#3159, so the generated C stays equivalent.

Verified: the new tests/test_split_trace.py fails without the change and passes with it (run directly with Python 3.14 on macOS arm64, without pytest, so the full suite was not run). The behaviour itself (separate rays in the trace and in mcdisplay) was checked with the McCode change.

🤖 Generated with Claude Code

All SPLIT branches of a particle were traced in one ENTER/LEAVE block,
so mcdisplay drew a return line from each branch end back to the SPLIT
point. Matches mccode-dev/McCode#3159. Fixes #413.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@g5t
g5t merged commit 6b753ea into main Nov 23, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SPLIT branches drawn with a return line in mcdisplay

2 participants