Skip to content

children(separate=true) stops at the module boundary - #111

Merged
revarbat merged 1 commit into
mainfrom
separate-stops-at-module
Aug 23, 2026
Merged

children(separate=true) stops at the module boundary#111
revarbat merged 1 commit into
mainfrom
separate-stops-at-module

Conversation

@revarbat

Copy link
Copy Markdown
Member

Follow-up to #110, narrowing a corner case of the feature it added.

The problem

The marks live on the CSGNodes, so separateness rode outward through an enclosing user module's own splice:

module pass() { children(separate=true); }
difference() pass() { a; b; }     // subtracted -- wrong

A module is its own shape. That it forwards its children separately is its business, not its caller's — and a caller reading difference() pass() has no way to know pass() will reinterpret it.

The fix

Only the children() call's own splice honours the marks. A user module's splice wraps its children as usual, and the wrapper hides the marks from the group walk — that is all it takes. No clearing pass, no extra state.

spliceModuleChildren gains honorSeparateMarks, defaulting to false, so every user-module splice keeps exactly today's behaviour.

Unchanged where it is asked for

Put the operator and the children(separate=true) call in the same module and it works however deeply that module is itself nested:

nested frame (works)     123000
across boundary (stops)  125000

Both halves are pinned by tests (StillWorksInsideTheModuleThatAsksForIt, StopsAtAUserModuleBoundary), replacing #110's PropagatesThroughAUserModuleWrapper, which pinned the behaviour being removed here.

1006 tests pass under both engines; verified end-to-end through the CLI under OSCAD_BYTECODE_VM=0 and =1.

🤖 Generated with Claude Code

0.42.0 let the separateness ride outward: because the marks live on the
CSGNodes, a module whose body forwarded children separately passed that
through its own splice to whatever enclosed the call.

    module pass() { children(separate=true); }
    difference() pass() { a; b; }        // subtracted -- wrong

A module is its own shape. That it forwards its children separately is its
business, not its caller's, and a caller reading `difference() pass()` has
no way to know pass() will reinterpret it.

Only the children() call's OWN splice now honours the marks. A user module's
splice wraps as usual, and the wrapper hides the marks from the group walk,
which is all it takes -- no clearing pass, no extra state. That is
spliceModuleChildren's new honorSeparateMarks, false by default so user
modules keep exactly today's behaviour.

The feature is unchanged where it is asked for: put the operator and the
children(separate=true) call in the same module and it works however deeply
that module is nested. Both halves are pinned by tests.

1006 tests pass under both engines; verified end-to-end through the CLI
(nested 123000, across a boundary 125000).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@revarbat
revarbat merged commit a64f7ce into main Aug 23, 2026
3 checks passed
@revarbat
revarbat deleted the separate-stops-at-module branch August 23, 2026 13:31
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.

1 participant