Skip to content

Cascading list shadows across owners (#268), grouped complement filter (#266), tracing test flake (#263) - #269

Merged
blackopsrepl merged 3 commits into
mainfrom
fix/cross-owner-shadows-and-backlog
Nov 15, 2026
Merged

blackopsrepl merged 3 commits into
mainfrom
fix/cross-owner-shadows-and-backlog

Conversation

@blackopsrepl

Copy link
Copy Markdown
Collaborator

Closes #268, closes #266, closes #263. One branch, one gate, one release.

#268: cascading list shadows across list owners

#[shadow_variable_updates] gains cascading_field, cascading_compute and cascading_dependencies. A start time can depend on the previous task on its machine and on tasks of other machines; SolverForge owns ordering, propagation, change reporting and undo.

  • CascadePropagation (core) recomputes the downstream cone of the changed elements in dependency order: each element at most once, after its inputs, only when an input changed, so propagation stops where a value is unchanged. Elements on a dependency cycle created by a move are unset (None).
  • The score director defers element rows to the end of the move when PlanningSolution::HAS_CASCADING_SHADOWS is true: owners refresh their structure, the move's last owner propagates, each written element is retracted before its write and inserted exactly once (dedup across owners).
  • Models without a cascading shadow: the branch is on an associated constant, so their move path is unchanged. The only layout change is one Option<Box<_>> pointer in the director's list-shadow state (no allocation unless used).
  • Tests: engine vs full refresh (pruning, cycles, self-dependency, 400 random moves); director over 300 random moves + undos; planning_model! saw/mill model through the director and a full_assert solve; compiled docs/modeling.md example; compile-fail case for missing list-structure fields.

#266: uni grouped complement drops the stream filter

complement / complement_with_key now group through the stream's filter (FilterNode). Breaking: ComplementedConstraintStream / ComplementedConstraintBuilder gain a Fi type parameter. Regression tests fail on the old code and pass now.

#263: flaky construction telemetry test

Tracing caches callsite interest process-wide; both capture helpers now rebuild the interest cache after installing their scoped subscriber.

Verification

  • cargo test --workspace --all-features --no-fail-fast: 70 suites, 0 failures
  • cargo clippy --workspace --all-targets --all-features -- -D warnings: clean
  • make pre-release, make examples, zero-regression gate vs v0.29.0: posted below

Tracing caches callsite interest process-wide. A callsite another test
thread registers while a scoped capture subscriber is being installed can
keep the 'never' interest it computed without that subscriber, so the
capturing test misses the event. Both capture helpers now rebuild the
interest cache once their dispatcher is installed.

Closes #263
GroupedConstraintStream::complement and complement_with_key built their
ComplementedConstraintStream from the extractor, key and collector but
dropped the stream's accumulated filter, so rows a .filter(..) before
.group_by(..) rejected were grouped and scored, and a key closure relying
on the filter could panic. The complemented stream now carries the filter
(type parameter Fi) and groups through a FilterNode, like the plain
grouped stream.

Closes #266

BREAKING CHANGE: ComplementedConstraintStream and
ComplementedConstraintBuilder gain a filter type parameter Fi after EA.
Code naming these types spells the extra parameter.
A list shadow could only depend on the list holding its element. A start
time that waits on a task in another owner's list (job shop, flow shop,
transfers between vehicles) could not stay correct incrementally: the
director refreshed only the changed owner's elements.

#[shadow_variable_updates] gains `cascading_field` (an Option<_> element
field), `cascading_compute` (a solution method computing it from the
previous element and the dependencies) and `cascading_dependencies` (the
elements an element waits on). SolverForge owns ordering, propagation,
change reporting and undo:

- CascadePropagation (solverforge-core) recomputes the downstream cone of
  the changed elements in dependency order: each element at most once,
  after its inputs, and only when an input changed, so propagation stops
  where a value is unchanged. Elements on a dependency cycle are unset.
- The score director defers element rows to the end of the move when
  PlanningSolution::HAS_CASCADING_SHADOWS is true: owners refresh their
  list structure, the last owner of the move propagates, every written
  element is retracted before its write and inserted exactly once.
- Solutions without a cascading shadow keep their path: the branch is on
  an associated constant, and the director carries one pointer for it.

Tests: engine against a full refresh (cycles, pruning, 400 random moves),
the director over random moves and undos, a planning_model! saw/mill
model through the director and through a full_assert solve, a documented
compiled example, and a compile-fail case.

Closes #268
@blackopsrepl

Copy link
Copy Markdown
Collaborator Author

Zero-regression gate — 53d86875 vs 59672a2b (main = v0.29.0): passed (EXIT 0)

14 cases, 5 layouts, 51 trials. semantic_match on every case: True.

  • wall: -0.75% … +0.39%
  • instructions: -0.00% … +0.13%
  • allocations: +0.00% … +0.00%
  • allocated bytes: +0.00% … +0.00%
  • simulated D1 misses: -1.01% … +3.17%
  • simulated LL misses: -0.01% … +0.05%

Evidence: zr-pr268-53d86875-vs-59672a2b/report.json.

@blackopsrepl
blackopsrepl merged commit e475e7f into main Nov 15, 2026
7 checks passed
@blackopsrepl
blackopsrepl deleted the fix/cross-owner-shadows-and-backlog branch November 15, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant