Repository navigation
Mixed-state presentation: index beliefs by a generic projection - #52
Merged
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
build_mixed_state_presentationfinds a known belief equal to a new one by bisecting a sorted index of numeric beliefs keyed by their first coordinate. When many beliefs share that coordinate (often exactly 0), every lookup scans most of the states, which is quadratic. On some 4-state survey processes the reverse inference then ran for many minutes before reaching its state cap. Those cases hit the survey's 1500 s hard timeout before the (budgeted) pipeline even started.The index now uses the projection onto fixed positive weights that sum to 1. Beliefs equal coordinatewise to within the matching tolerance (
rtol=1e-9,atol=1e-12) project to within the same 1e-9 window, so no match is missed, but ties become rare. The symbolic/numeric split now checks every coordinate rather than only the first.main.Test plan
test_infinite_reverse_presentation_reaches_its_cap_quickly(fails onmainat 135 s, passes in 2.5 s).Made with Cursor