Add canonical graph6 decoding and verification - #983
Conversation
|
Second-pass architecture review: rebase + likely merge. This is a clean atomic deterministic codec capability with explicit format rejection and an independent replay. It does not bundle the motivating NP-hard invariant work into the codec and stays within the domain-owned capability model. Existing issue #947 already tracks the broader graph6/invariant follow-up, so I would not open a duplicate issue for this PR. |
# Conflicts: # src/jacobian/contracts/graph_invariant_operations.py # src/jacobian/domains/graph_optimization/checkers.py
morluto
left a comment
There was a problem hiding this comment.
Post-cutover architecture audit
Disposition: retain the mathematical slice, rewrite around jacobian.math.
A bounded exact graph6 decoder is a useful atomic codec operation and is not superseded by the cutover. Move decoding/canonicalization into a domain-owned graph encoding module and return a strict graph value whose vertex order/labels and edges are structurally bound; do not make the digest a substitute for that identity.
Install the producer as a thin OperationSpec and the standard-library replay as a separate authorized checker. Remove old graph bundle/exact-domain dispatcher/result metadata, relationships, and generic assurance fields. Keep the rejection cases for sparse6/digraph6/extended headers/padding and the H24 regression.
|
Post-#1265 review: keep the graph6 decoding/checking slice, but rebase it as a domain-owned graph conversion and remove unrelated stack residue. The operation is still absent from current main. Graph6 is a mathematical/domain encoding, so an explicit graph-owned conversion is compatible with the current rule against generic codec frameworks. It should live with graph semantics (or a private graph encoding adapter used by the public graph function), produce the canonical typed graph value, and not create a universal serialization/coercion layer. Keep the independent checker as a separate operation if it provides value. Do not carry old relationship metadata, and drop the unrelated discrete-log edits from the current branch when restacking. Recommendation: revise/rebase rather than close. Preserve exact decoding/canonicalization attack tests and ensure malformed/oversized encodings fail before graph backend work. |
|
Superseded by #1284. The replacement moves graph6 value/decoding semantics into |
Summary
graph.encoding.graph6.decode.computefor standard small-order graph6 (orders 0–62), with optional>>graph6<<headergraph.encoding.graph6.decode.verifywith independent standard-library bitstream replayReproduction
The H24 string from #947 decodes to 24 vertices, 30 edges, and maximum degree 3. The regression fixture checks the first canonical edges and independent verifier, and a wrong-edge candidate is rejected.
Scope boundary
This PR implements only the deterministic codec slice of #947. It does not add or broaden maximum-independent-set or zero-forcing optimization contracts. Producer output remains
COMPUTED; only the authorized independent replay isVERIFIED.Validation
git diff --check: passedRelated to #947; does not close it.