Repository navigation
Given start points join the records ask, so a solve from different starts is never recalled with another solve's answers - #499
Closed
ofloveandhate wants to merge 1 commit into
Conversation
…arts is never recalled with another solve's answers A HomotopySolver solve named its homotopy, target, settings and seed in its records ask, but not the start points it was given. With recording on (the default), a second solve of the same homotopy from different start points was the same ask and was answered from the record of the first: it returned the first solve's endpoints. StartSystem::GivenStartIdentity() is empty for a start system whose points follow from its target, and start_system::User returns a SHA-256 of its points' exact values (IEEE bits for doubles; precision and every stored digit for multiprecision, versioned b2start/1). RecordsAsk adds it as the ask's start when the caller has not supplied one, so no entry point can leave it out. Tests: different given starts are different asks and reach their own endpoints; the same starts are still recalled; the identity tells apart points that differ by 2^-40; and the same through Python's HomotopySolver. Closes #498 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Superseded by #500, the same commit opened from the ofloveandhate fork. |
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.
A solve's records ask is the identity it is recorded and recalled under. For a
HomotopySolversolve it named the homotopy, the target, the settings and the seed, but not the start points the solve was given. With recording on, which is the default, a second solve of the same homotopy from different start points was therefore the same ask, and it was answered from the record of the first: it returned the first solve's endpoints, and onlynum_paths_recalled()showed that anything had been recalled. Closes #498.Only
bertini.solve(homotopy=..., start=...)added start points to the ask, by callingSetRecordedStartProvenance. This PR moves the responsibility to the start system, so no entry point can leave it out:StartSystem::GivenStartIdentity()returns the identity of start points the system was given. It is empty for start systems whose points follow from the target (total degree, multihomogeneous), since the target, settings and seed already determine those points.start_system::Userreturns a SHA-256 of its points' exact values, in order: IEEE-754 bits for double-precision points, and the precision plus every stored digit for multiprecision points. The encoding is versioned (b2start/1).RecordsAsk()adds that identity as the ask'sstartfield when the caller has not supplied one. A start identity set bySetRecordedStartProvenancestill takes precedence.Effect on existing records. A solve from given start points now has a different run id than it had in 4.0.0. Records that 4.0.0 wrote for such solves are computed again rather than recalled. Solves from total-degree or multihomogeneous start systems keep their run ids. The CHANGELOG entry, under a new 4.0.1 block, says so.
How it was found. In a cellular decomposition (whitney, seed 203), one face homotopy is tracked twice from different start points. With recording on, the second solve recalled the first one's endpoint and the decomposition had 5 validation problems. With recording off it had none. With this fix and recording on, it has 49 faces, 0 problems and Euler characteristic 1, the same as with recording off.
Tests
zero_dim/crossed_paths: one homotopy from given start points +2 and −2 gives two different run ids, recalls nothing, and reaches +3 and −3; the same start point solved twice is recalled; two points that differ by 2⁻⁴⁰ have different identities.records_test.py: the same checks throughbertini.nag_algorithm.HomotopySolver.BERTINI_NUM_THREADSunset and with it set to 1 (10/10 both times), the full Python suite in both settings (1178 passed both times),tools/doclint.shandtools/whitespace_lint.py.No ADR: this is a bug fix with regression tests. The ask already treated given start data as identity (ADR-0042..0047); this PR makes every entry point honour that.
🤖 Generated with Claude Code