Skip to content

Add canonical graph6 decoding and verification - #983

Closed
yuelgrace1810-ops wants to merge 6 commits into
mainfrom
agent/canonical-graph6-decoder
Closed

Add canonical graph6 decoding and verification#983
yuelgrace1810-ops wants to merge 6 commits into
mainfrom
agent/canonical-graph6-decoder

Conversation

@yuelgrace1810-ops

Copy link
Copy Markdown
Collaborator

Summary

  • add graph.encoding.graph6.decode.compute for standard small-order graph6 (orders 0–62), with optional >>graph6<< header
  • implement the standard column-major upper-triangle bit order and return canonical sorted edges, degree sequence, and a digest of the exact decoded graph
  • reject sparse6, digraph6, extended-order headers, invalid lengths, invalid characters, and nonzero padding
  • add graph.encoding.graph6.decode.verify with independent standard-library bitstream replay

Reproduction

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 is VERIFIED.

Validation

  • focused graph producer/verifier and checker-installation suite: 25 passed
  • Ruff lint and format: passed
  • mypy on affected source: passed
  • git diff --check: passed
  • hosted CI will run broad lanes selected for shared graph contracts/checkers

Related to #947; does not close it.

morluto commented Aug 10, 2026

Copy link
Copy Markdown
Owner

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.

@morluto morluto left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

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.

morluto commented Aug 12, 2026

Copy link
Copy Markdown
Owner

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.

morluto commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Superseded by #1284. The replacement moves graph6 value/decoding semantics into jacobian.math.graphs, exposes one thin OperationSpec, and uses a dedicated standard-library checker runtime. It deliberately omits the old invariant mini-framework and reciprocal relationship machinery.

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.

2 participants