relspec templ's @TableIndex ordering is non-deterministic #10

Closed
opened 2026-07-19 13:46:31 +00:00 by warkanum · 2 comments
Owner

Found a real upstream bug while checking codegen reproducibility: relspec templ's @TableIndex ordering is non-deterministic (content-identical, order differs) on 6 of the 18 tables — this will cause spurious failures on the "clean diff" CI gates both docs promise for regeneration. Worth filing against relspecgo.

Found a real upstream bug while checking codegen reproducibility: relspec templ's @TableIndex ordering is non-deterministic (content-identical, order differs) on 6 of the 18 tables — this will cause spurious failures on the "clean diff" CI gates both docs promise for regeneration. Worth filing against relspecgo.
Member

PR opened: #11

Branch: fix/issue-10-deterministic-table-index
Commit: c2def00bcfe9a0529dea08efc7edafabb3489826

Verification completed:

  • Regression first reproduced nondeterministic output before the fix.
  • TMPDIR=$PWD/.tmp GOCACHE=$PWD/go-cache go test ./pkg/writers/template -run TestWriterTableIndexValuesDeterministic -count=1
  • TMPDIR=$PWD/.tmp GOCACHE=$PWD/go-cache go test ./pkg/writers/template ./pkg/reflectutil -count=1
  • TMPDIR=$PWD/.tmp GOCACHE=$PWD/go-cache go test ./pkg/writers/... -count=1
  • TMPDIR=$PWD/.tmp GOCACHE=$PWD/go-cache go test ./... -count=1
  • TMPDIR=$PWD/.tmp GOCACHE=$PWD/go-cache make test
  • git diff --check

Not merging or closing; ready for independent review.

PR opened: https://git.warky.dev/wdevs/relspecgo/pulls/11 Branch: `fix/issue-10-deterministic-table-index` Commit: `c2def00bcfe9a0529dea08efc7edafabb3489826` Verification completed: - Regression first reproduced nondeterministic output before the fix. - `TMPDIR=$PWD/.tmp GOCACHE=$PWD/go-cache go test ./pkg/writers/template -run TestWriterTableIndexValuesDeterministic -count=1` - `TMPDIR=$PWD/.tmp GOCACHE=$PWD/go-cache go test ./pkg/writers/template ./pkg/reflectutil -count=1` - `TMPDIR=$PWD/.tmp GOCACHE=$PWD/go-cache go test ./pkg/writers/... -count=1` - `TMPDIR=$PWD/.tmp GOCACHE=$PWD/go-cache go test ./... -count=1` - `TMPDIR=$PWD/.tmp GOCACHE=$PWD/go-cache make test` - `git diff --check` Not merging or closing; ready for independent review.
Member

Completed and merged via PR #11. Independent review confirmed the template values path now sorts map keys deterministically, repeatedly generated TableIndex output is byte-identical and lexically ordered, gofmt and git diff --check pass, and go test ./... passes. Feature SHA: c2def00bcf.

Completed and merged via PR #11. Independent review confirmed the template values path now sorts map keys deterministically, repeatedly generated TableIndex output is byte-identical and lexically ordered, gofmt and git diff --check pass, and go test ./... passes. Feature SHA: c2def00bcfe9a0529dea08efc7edafabb3489826.
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wdevs/relspecgo#10