Skip to content

fix: post-Bareiss follow-up — conway marker removed, polynomial bounds 12 → 128 (unblocks red main) - #85

Merged
hyperpolymath merged 3 commits into
mainfrom
fix/post-bareiss-followup
Jul 28, 2026
Merged

fix: post-Bareiss follow-up — conway marker removed, polynomial bounds 12 → 128 (unblocks red main)#85
hyperpolymath merged 3 commits into
mainfrom
fix/post-bareiss-followup

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

main is currently red and this unblocks it. KnotTheory.jl#48 merged, so quandledb's @test_broken on conway(figure_eight) now reports "Unexpected Pass" — a hard error, and precisely the forcing signal the marker existed to produce. Reproduced locally against KnotTheory a2f2938.

1. Conway marker → hard assertion

Upstream now normalises Alexander to Δ(1) = +1 (the Conway normalisation) instead of "leading coefficient positive", which was the wrong canonical choice on mixed-sign knots. conway(figure_eight) = 1 − z² exactly, so the assertion is restored.

2. Alexander/Conway bounds: 12 → 128

The bound of 12 in #82 was calibrated against the O(n!) cofactor determinant that #48 replaced with O(n³) Bareiss elimination. Re-measured on s1^n torus closures (the worst case — no arc merging):

crossings alexander, Bareiss alexander, cofactor (before)
16 ~0 s > 6 h (the CI kill)
40 0.07 s
100 0.10 s
140 0.61 s

128 keeps the worst case sub-second while covering every realistic diagram. Jones (20) and HOMFLY (15) are unchanged — those are genuinely exponential (Kauffman bracket 2ⁿ; skein recursion), and their bounds come from upstream's own limits.

3. Guard testset reworked

With the three bounds now an order of magnitude apart, one diagram can no longer exercise them all — the old single-fixture test would have silently stopped testing the alexander/conway guard. It now covers:

  • 16 crossings — only HOMFLY defers; alexander, conway and jones must all be real values.
  • 130 crossings — all four defer, with an explicit @test length(pd.crossings) > ALEXANDER_MAX_CROSSINGS so that raising the bound without raising the fixture fails loudly instead of going quiet.

Verification

Full axioms suite against KnotTheory a2f2938: passes with zero broken markers — a first for this suite.

Note on the BR-5 fuzz residual

Re-measured at 200 trials: still exactly 11/200, unchanged by #48. My expectation that the sign fix would shrink it was wrong — the mismatches are not caused by the alexander/conway sign convention. A component-level diagnostic is running to identify the actual cause; the @test_broken counter marker stays until that is known, and the finding will be posted to KnotTheory#42 (and appended here if it changes anything in this PR).

🤖 Generated with Claude Code

…s 12 → 128

main is currently RED: KnotTheory.jl#48 merged, so the conway
@test_broken now reports 'Unexpected Pass' — a hard error, and exactly
the forcing signal the marker existed to produce. This clears it.

- conway(figure_eight) restored to a hard @test. Upstream now
  normalises alexander to Delta(1) = +1 (the Conway normalisation)
  instead of 'leading coefficient positive', which was the wrong
  canonical choice on mixed-sign knots; the value is 1 - z^2 exactly.

- ALEXANDER/CONWAY_MAX_CROSSINGS 12 → 128. The bound of 12 was
  calibrated against the O(n!) cofactor determinant that #48 replaced
  with O(n^3) Bareiss elimination. Re-measured on (2,n)-torus closures
  (the worst case — no arc merging): n=40 → 0.07s, n=100 → 0.10s,
  n=140 → 0.61s, against 6h+ at n=16 before. 128 keeps the worst case
  sub-second while covering every realistic diagram. Jones (20) and
  HOMFLY (15) are unchanged — those are genuinely exponential.

- The guard testset is reworked: with the three bounds now an order of
  magnitude apart, one diagram can no longer exercise them all. It
  tests a 16-crossing diagram (only HOMFLY defers; alexander, conway
  and jones must all be real) AND a 130-crossing diagram (all four
  defer). The second case asserts crossings > ALEXANDER_MAX_CROSSINGS
  explicitly, so raising the bound without raising the fixture fails
  loudly rather than going quiet.

Validated locally against KnotTheory main (a2f2938): the full axioms
suite passes with ZERO broken markers — a first for this suite.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

Note

Automatic reviews are paused because your trial's included automatic processing has been used for this period. Upgrade now, or comment "Gitar review" to run a review anytime.
Learn more

Code Review ✅ Approved

Removes the Conway broken marker and increases polynomial bounds from 12 to 128 to unblock the main branch following upstream KnotTheory updates. No issues found.

Auto-approved and auto-merge armed: No blocking issues found.
Please see Auto-approve Docs for details on setting custom approval criteria. — merges when pipeline and required approvals pass.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@gitar-bot

gitar-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

⚠️ Gitar auto-approved this PR but could not enable auto-merge: auto-merge is disabled for this repository — enable "Allow auto-merge" in the repository settings.

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitar has auto-approved this PR and enabled auto-merge (configure)

@gitar-bot gitar-bot Bot added the gitar-approved Added by Gitar label Jul 28, 2026
The 11/200 count did not move when KnotTheory#48 merged, falsifying the
assumption that the alexander/conway sign convention caused it. Split by
Delta(1) over the same 200-trial corpus:

    links (Delta(1)=0):  11 mismatch, 87 agree
    knots (Delta(1)=±1):  0 mismatch, 102 agree

Knots are now fully crossing-order invariant; the residual is entirely a
multi-component-link defect. Upstream conway_polynomial reconstructs from
an assumed symmetry about exponent 0 that no link satisfies (even span
gives a half-integer centre), so it returns genuinely different
polynomials for the same link — 1 + z^2 vs 1 — rather than a different
unit. Filed as KnotTheory.jl#51 with the worked examples.

Comment updated to cite that evidence instead of the old vague wording.
The marker stays until #51 lands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hyperpolymath

Copy link
Copy Markdown
Owner Author

BR-5 residual: diagnosed — prediction was wrong, real cause filed

Updating the open question in the PR body. The residual did not shrink after KnotTheory#48 — still exactly 11/200. Splitting the same 200-trial corpus by Δ(1):

mismatch agree
links (Δ(1) = 0) 11 87
knots (Δ(1) = ±1) 0 102

Every mismatch is a multi-component link; not one knot mismatches. So #48 did make knots fully crossing-order invariant — it simply never touched the cause of these 11. Links can't use that fix (Δ(1) = 0), so the code falls back to an order-sensitive rule; and conway_polynomial reconstructs ∇ from an assumed symmetry about exponent 0 that no link satisfies (even span ⟹ half-integer centre), yielding genuinely different polynomials for the same link (1 + z² vs 1) rather than a different unit. ∇ has no unit freedom, so that's a correctness bug.

Filed as hyperpolymath/KnotTheory.jl#51 with worked examples and a suggested fix direction. Pushed dac9b3e here rewriting the fuzz @test_broken comment to cite this evidence and to record explicitly that the earlier sign-convention attribution was wrong. The marker stays until #51 lands.

…e instantiate

#83 changed server/Project.toml [sources] from ../../../<name>.jl to
../../<name>.jl but left this workflow symlinking two levels above the
workspace. Every run since has died in 'Instantiate server project' with

    expected package KnotTheory [215268c9] to exist at path
    /home/runner/work/quandledb/KnotTheory.jl

i.e. main has been red for this as well as the conway marker — the path
error hits first, so the axioms suite never even ran.

Symlink now targets $GITHUB_WORKSPACE/../, matching [sources]. Adds a
check that reads server/Project.toml and asserts every [sources] path
resolves to a real directory BEFORE instantiate, so the next drift names
its own cause instead of surfacing as a registry-shaped error.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@hyperpolymath
hyperpolymath marked this pull request as ready for review July 28, 2026 19:00
@hyperpolymath
hyperpolymath merged commit 9113da7 into main Jul 28, 2026
20 of 21 checks passed
@hyperpolymath
hyperpolymath deleted the fix/post-bareiss-followup branch July 28, 2026 19:05
hyperpolymath added a commit that referenced this pull request Jul 29, 2026
…TE refresh (#87)

## Summary

**`main` is red right now** and this fixes it, plus lands two
documentation changes that missed the #85/#86 merges (both PRs were
merged before these commits were pushed).

### 1. The last `@test_broken` retires — main is red until it does

KnotTheory.jl#52 merged the link canonicalisation, so the BR-5
crossing-order marker now reports **"Unexpected Pass"** — a hard error,
and exactly the forcing signal the marker existed to produce.

Measured against KnotTheory `main` after #52: **0 mismatches over 200
trials**, links and knots alike (was 11/200, every one a multi-component
link). Validated at CI's 50 trials — all four BR-5 testsets pass with no
Broken column.

**quandledb now carries no `@test_broken` markers at all.** Every marker
this campaign added was retired by the upstream fix it was tracking,
which is the mechanism working as intended.

### 2. `docs/db-6-explain-strategy.md` — reconciling two surfaces under
one name

The document said "Phase A landed 2026-06-01" while issue #34's Phase A
had never been built. Both statements were true of **different
surfaces**, and conflating them is what made #34 look closable:

| Surface | What | Landed |
|---|---|---|
| SQL-side | `EXPLAIN QUERY PLAN` over read-path SQL, HTTP endpoint |
2026-06-01 |
| KRL-side | `explain` keyword + structured plan with
`indexed`/selectivity | 2026-07-28 (#86) |

Now names both explicitly and documents the KRL surface: syntax, plan
shape, why `explain` parses to its own statement type, why selectivity
is a labelled stub guarded by `plan_is_costed()`, why `INDEXED_COLUMNS`
is deliberately short, and what Phase B actually needs (DB-3, #33).

### 3. `.machine_readable/6a2/STATE.a2ml` — the file agents read said
nothing

Last touched 2026-02-13, with `# No milestones recorded`, `# No blockers
recorded`, `# No actions recorded`. Now carries measured state: phase
`testing`, the DB-6/DB-3 milestone chain, the four live issues (Guix
gate, ruleset `--admin`, doc drift, ungated Idris2/Zig/AffineScript
tiers) each with an evidence path, ordered next actions with owners, and
`zero-known-broken-markers = true`.

`last-result` is deliberately **`warn`, not `pass`**: every gate the
repo owns is green, but the estate-wide Guix policy check is red and is
not green-able here in good faith (see
`dev-notes/guix-policy-gate-advice-2026-07-28.md` — the gate is
presence-only, so a stub `guix.scm` would buy green with a lie).
Reported rather than suppressed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gitar-approved Added by Gitar

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant