Skip to content

Add open variable lists - #248

Open
zayenz wants to merge 49 commits into
mainfrom
feature/open-cp
Open

zayenz wants to merge 49 commits into
mainfrom
feature/open-cp

Conversation

@zayenz

@zayenz zayenz commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Add variable lists whose positions are constructed during propagation and search. Models can express sequences of unknown length without allocating a fixed array and encoding an unused suffix.

OpenIntVarList, OpenBoolVarList, and generic OpenVarList<Var> provide an eventual-length variable, factory and transition callbacks, constraints that follow list growth, and standard branching selectors. Regular-language filtering excludes prefixes that cannot reach an accepting state within the maximum list length. Callbacks run with global propagator information disabled by default (Space::NoGPI); models can opt into ordinary accumulated failure counts with Space::UseGPI.

The open-route example introduces list construction, constraints, branching, and solutions. Common-pattern uses prefix projection to mine frequent subsequences, and fifteen-puzzle builds a sequence of moves.

Validation: 69 focused open-list and regular-constraint tests passed with static mimalloc and ASan/UBSan. Erebor GCC/mimalloc also passed 536 broader checks and the examples. Leak detection was disabled for existing test-registration and thread-pool lifetimes.

@zayenz
zayenz changed the base branch from main to feature/improved-regular-construction October 4, 2026 18:18
@zayenz zayenz changed the title Add open integer variable sequences and constraints Add open variable sequences Oct 5, 2026
@zayenz
zayenz added this pull request to stack #250 October 5, 2026 13:21
@zayenz zayenz changed the title Add open variable sequences Add open variable lists Oct 6, 2026
Base automatically changed from feature/improved-regular-construction to main October 8, 2026 17:43
@zayenz
zayenz force-pushed the feature/open-cp branch 2 times, most recently from e7e8370 to 5e20c4f Compare October 12, 2026 19:30
@zayenz
zayenz force-pushed the feature/open-cp branch 2 times, most recently from e2a0fe9 to 8207ea7 Compare October 15, 2026 13:47
@zayenz
zayenz marked this pull request as ready for review October 20, 2026 06:49
@zayenz
zayenz force-pushed the feature/open-cp branch 3 times, most recently from 0e679a7 to 5fb98a6 Compare October 21, 2026 08:11
Replace repeated scans of prior positions with a lazily populated identity set. Clones rebuild the set with their own variable pointers only when an unassigned append needs it; assigned aliases remain legal.

Add IntVar and BoolVar coverage for alias rejection, assignment, clone-local indexing, and source independence.
Combine forcing sequence windows into inclusion and exclusion intervals. For range sums, use monotone queues to select the strongest residual bounds covering each position. Both propagators update each covered position once per sweep while retaining their snapshot and advisor rescheduling semantics.

Add width-one sequence and range-sum cases to the existing exhaustive tests.
Convert the active-variable count to int before calling Region::alloc. On 64-bit Windows, vector::size_type is unsigned long long and otherwise makes the allocation overload ambiguous. The count fits int because it is bounded by the open-list length.
Add a view-based interface to the shared open-list source. Keep variable creation and transition callbacks at the source boundary while propagation, branching, and regular filtering operate on views. Length remains an IntView when list elements use negated views.

Preserve shared growth and clone isolation without copying a view array per actor. Exercise view pruning, materialization, cloning, and extremum closure in the existing tests.
Select the relation once when posting OpenRel<View,irt>. Track changed positions with advisors and propagate equality, adjacent disequality, or ordered bounds directly over the growing list instead of creating binary edge propagators.

Retain bounds and domain equality levels, including sparse domains. Cover all six relations through the existing closed and incremental test histories.
Retain assigned values in a Space-owned packed range array, growing capacity without rebuilding the full set for each appended value. Clone only live ranges and preserve canonical range iteration for domain subtraction.

Process new assignments in sorted batches with two alternating buffers. Reject duplicates before range conversion and collect assignments caused by each pruning wave for the next batch.

Cover range unions, integer endpoints, independent clone growth, and cascading assignments. Keep endpoint arithmetic within int; bound allocation capacity separately.
Replace the vector with a geometrically grown space allocation and clone only live views. Free the buffer with its allocated capacity when disposing the propagator.

Share domain exclusion, assignment collection, and swap-removal between history filtering and propagation waves. Keep one history snapshot and express the wave loop with its nonempty-batch condition.
Move internal actors into their existing family namespaces and headers, and place public posting overloads beside the corresponding fixed-array posters. Keep list construction and materialization together, and place public list types beside variable containers.

Separate equality and bounds sliding-sum actors so each owns only its required state and lifecycle. Use the native filtered and unfiltered brancher policies instead of an always-true callback, and remove the cross-enum value selector cast.

Rename the incorporated-position cursor to processed and move list materialization tests beside the other list tests.

This branch has not been deployed

No deployments
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