Skip to content

feat(autotune): AdventureWorks tuning on CI, parallel seeds, rule allowance - #43

Merged
nick-developer merged 10 commits into
mainfrom
claude/project-thread-8qmh8r
Nov 6, 2026
Merged

nick-developer merged 10 commits into
mainfrom
claude/project-thread-8qmh8r

Conversation

@nick-developer

@nick-developer nick-developer commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Requested by Cod3r · project thread

This PR runs relsynth autotune on AdventureWorks and fixes the autotune and scorecard issues that run exposed. The report is docs/research/autotune-adventureworks.md.

Result of the AdventureWorks search

  • The search ran in two 5-hour CI jobs (64 runs; seeds 1-3 for the search, 11-12 held out). Every hard constraint and every G1-G14 identity held on all five seeds.
  • The only setting accepted was segments.default_cap: 16, and the held-out seeds confirm it. Excess failures per seed fell from 43.7 to 42.0 on the search seeds and from 48 to 43 on the held-out seeds.
  • No setting moved most of the remaining misfit, so it needs engine or spec work:
    • novel_combination_rate: 22 excess failures per seed. Synthesised dimension rows break the support of pairs two hops away (for example FactResellerSales employee territory with reseller geography, 0.87 new combinations). A link_affinity spec experiment did not change it.
    • Reseller/product pair repeats.
    • Freight/TaxAmt and UnitsBalance marginals.
    • Order codes typed as categoricals.
  • The doctor's set of 13 fixes cut excess failures by 7 per seed but broke a privacy check, so it was rejected. This PR now tries its parts one block at a time.

Changes

  • relsynth autotune --workers N: the seeds of a candidate run in parallel processes. The records and the search path are the same as with one worker (test).
  • tools/autotune_bench.py, bench/autotune_domain.py and .github/workflows/autotune.yml run autotune on a bench database on CI. The workflow starts on dispatch or on a push with [autotune], and a push with [autotune-resume:<run>] continues an earlier search. The report and a per-candidate summary are printed to the log.
  • Scorecard: a check rule the source itself breaks gets a three-standard-error allowance instead of an exact limit. On AdventureWorks, 9 vs 12 of 60,855 rows was counted as a hard violation.
  • structure.structural_prior is now bounded by 0.999 in the registry, because the spec refuses 1. Before this, 6 runs failed. A new test checks every tunable bound against spec validation.
  • The report counts a trade-off only when the change is beyond seed noise.
  • A rejected doctor set is now retried block by block.
  • The autotune history is keyed by an engine signature (relsynth source hash plus numpy/pandas/scipy/numba/duckdb/SQLAlchemy/pyarrow versions). In runs 3 and 4, a pandas 2.3 incumbent from run 1 was compared with pandas 3.1 candidates, so every move looked like a DimProduct DCR privacy break.
  • docs/settings-reference.md is regenerated, and the CHANGELOG has an Unreleased entry.

Checks

  • ruff check src tests tools bench is clean. The mypy ratchet reports 0 new errors.
  • pytest tests/unit -m "not slow": 638 passed, after merging main (2.0.0).
  • The latest push starts a fresh AdventureWorks search (run 5) on CI under one environment. The report will be updated with its result.

https://claude.ai/code/session_01PSVqwFW6fhyVohUnuKd2fu


Generated by Claude Code

…lowance for source-broken rules [autotune]

- relsynth autotune --workers N: the seeds of a candidate run in spawned
  processes; same records and path as one worker (test).
- tools/autotune_bench.py + bench/autotune_domain.py: autotune on a golden
  database with its domain identities (AdventureWorks G1-G14).
- .github/workflows/autotune.yml: dispatch or [autotune] push; uploads the
  history, resume_from_run continues an earlier search; a link-affinity spec
  experiment on AdventureWorks runs beside it on push.
- scorecard: a check rule the source itself breaks (rate r0 > 0) passes within
  three standard errors of r0 instead of at r0 exactly (AdventureWorks
  FactResellerSales weekday rule: 12 vs 9 rows of 60,855 was a hard violation).
- docs/settings-reference.md regenerated (runtime.* keys were missing).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSVqwFW6fhyVohUnuKd2fu
Signed-off-by: Claude <noreply@anthropic.com>
@nick-developer nick-developer self-assigned this Oct 31, 2026
…me from a push [autotune-resume:41244918993]

Artifacts cannot be read from every environment, so the job log now carries
the constraints report and a summary of every candidate (tools/autotune_bench.py
--summarise). A push whose message names [autotune-resume:<run id>] continues the
search from that run's history.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSVqwFW6fhyVohUnuKd2fu
Signed-off-by: Claude <noreply@anthropic.com>
…s block by block; AdventureWorks report [autotune-resume:41265066430]

From the first AdventureWorks search (docs/research/autotune-adventureworks.md):
- structure.structural_prior bounded by 0.999 (spec range [0, 1)); a test
  checks every tunable bound against spec validation.
- report: a change in a family's failures counts toward a trade-off only when
  it is at least one check per seed and twice its paired standard error.
- loop: a rejected doctor set is retried block by block (segment counts,
  copula, marginals, ... each on their own).
- workflow: the link-affinity experiment is done (no effect), removed.
- CHANGELOG, report in docs/research.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSVqwFW6fhyVohUnuKd2fu
Signed-off-by: Claude <noreply@anthropic.com>
@nick-developer
nick-developer marked this pull request as ready for review November 6, 2026 01:17
…rt of the PR #44 fix)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSVqwFW6fhyVohUnuKd2fu
Signed-off-by: Claude <noreply@anthropic.com>
…ummary [autotune-resume:42142808423]

Every doctor fix tried alone broke a privacy check on AdventureWorks; the
summary now lists which check and its values per seed. The search goes on
from the last run's history (the facts.* settings for cardinality_ks were
not reached yet).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSVqwFW6fhyVohUnuKd2fu
Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSVqwFW6fhyVohUnuKd2fu
Signed-off-by: Claude <noreply@anthropic.com>
Runs 3 and 4 on AdventureWorks compared pandas 3.1 candidates with a
segments.default_cap=16 incumbent measured under pandas 2.3 (history from
run 1). The same seed and settings give other draws under another pandas,
so the DimProduct DCR ratio of every candidate (0.11-0.66 on seed 1)
looked like a new privacy break against the stale incumbent.

The fingerprint now includes engine_signature(): a hash of the relsynth
source and the numeric libraries' versions. This push starts a fresh
search under one environment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSVqwFW6fhyVohUnuKd2fu
Signed-off-by: Claude <noreply@anthropic.com>
… versions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PSVqwFW6fhyVohUnuKd2fu
Signed-off-by: Claude <noreply@anthropic.com>

Copy link
Copy Markdown
Owner Author

The dco check fails because two commits on this branch have no Signed-off-by line: 46af8f3 (fix: history keyed by engine and library versions) and 77d2f21 (docs: runs 3-4). I forgot -s on them. The code is fine. Every other check passed on those commits.

The only fix is to rewrite those two commits with a sign-off and force-push the branch. I have a local copy ready with the same file tree as 2ae8294, and your merge of main is kept. A force-push needs the owner's go-ahead, so I have not pushed it. Run 5 of autotune is still running on 46af8f3 and is not affected.


Generated by Claude Code

@nick-developer
nick-developer force-pushed the claude/project-thread-8qmh8r branch from 2ae8294 to 376d92f Compare November 6, 2026 15:17
@nick-developer
nick-developer force-pushed the claude/project-thread-8qmh8r branch from 376d92f to fdbc26a Compare November 6, 2026 15:27
@nick-developer
nick-developer merged commit c2cd52a into main Nov 6, 2026
26 of 27 checks passed
@nick-developer
nick-developer deleted the claude/project-thread-8qmh8r branch November 6, 2026 15:54
nick-developer added a commit that referenced this pull request Nov 7, 2026
….5 h default search (#48)

docs(autotune): AdventureWorks runs 5-6 under one environment; 4.5 h default search

Runs 5 and 6 searched from scratch under pandas 3.1 (history keyed by
engine signature) and took the same path. structural_prior 0.999 was
accepted on seeds 1-3 but not confirmed on the held-out seeds; the
defaults stay recommended. Main finding: the DimProduct DCR ratio is
near the 0.5 hard limit even at the defaults (0.40 on seed 12), and
every move that fits DimProduct more closely pushes it lower. That is
engine work, recorded under Next.

The workflow searches 4.5 hours by default: run 5 (5 hours) was cut
off by the 6-hour job limit during the held-out confirmation.

Restores the CHANGELOG entries of #43 that were lost in a merge.


Claude-Session: https://claude.ai/code/session_01PSVqwFW6fhyVohUnuKd2fu

Signed-off-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
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