Skip to content

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
developfrom
fix/supplied-start-points-join-the-ask
Closed

ofloveandhate wants to merge 1 commit into
developfrom
fix/supplied-start-points-join-the-ask

Conversation

@ofloveandhate

Copy link
Copy Markdown
Contributor

A solve's records ask is the identity it is recorded and recalled under. For a HomotopySolver solve 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 only num_paths_recalled() showed that anything had been recalled. Closes #498.

Only bertini.solve(homotopy=..., start=...) added start points to the ask, by calling SetRecordedStartProvenance. 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::User returns 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's start field when the caller has not supplied one. A start identity set by SetRecordedStartProvenance still 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

  • C++, 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.
  • Python, records_test.py: the same checks through bertini.nag_algorithm.HomotopySolver.
  • Run locally: the full C++ suite with BERTINI_NUM_THREADS unset and with it set to 1 (10/10 both times), the full Python suite in both settings (1178 passed both times), tools/doclint.sh and tools/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

…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>
@ofloveandhate ofloveandhate added this to the 4.0.1 milestone Oct 7, 2026
@ofloveandhate

Copy link
Copy Markdown
Contributor Author

Superseded by #500, the same commit opened from the ofloveandhate fork.

@ofloveandhate
ofloveandhate deleted the fix/supplied-start-points-join-the-ask branch October 7, 2026 17:26
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.

HomotopySolver leaves its start points out of the records ask, so a second solve from different starts is recalled with the first's answers

1 participant