Skip to content

[Klaud Cold] Make golden_al_distribution a Python package with a query CLI - #3482

Merged
functionstackx merged 1 commit into
mainfrom
klaud/golden-al-package
Sep 26, 2026
Merged

functionstackx merged 1 commit into
mainfrom
klaud/golden-al-package

Conversation

@functionstackx

Copy link
Copy Markdown
Collaborator

Summary

Turns infx/golden_al_distribution/ into the infx.golden_al_distribution Python package and adds a query CLI.

  • curves.py: load_curve, list_curves, curve_name (model prefix + speculative config → curve file) and golden_length (the value AgentX synthetic acceptance applies). The resolution rules move here verbatim from infx/srt_slurm/synthetic_acceptance.py, which now imports GOLDEN_DIR and golden_length from the package.
  • __main__.py: python -m infx.golden_al_distribution
    python -m infx.golden_al_distribution list                   # every curve and its measured draft lengths
    python -m infx.golden_al_distribution show qwen3.5_mtp       # every AL in one curve
    python -m infx.golden_al_distribution lookup qwen3.5 mtp 3   # 3.39
    python -m infx.golden_al_distribution lookup kimik3 dspark 7 --draft-sample-method probabilistic --json
    --json on every command; errors (missing curve, cell or Kimi sampler) exit 1.
  • README / README_zh: new "Querying the curves" section.

No curve data changes.

Test plan

  • New utils/test_golden_al_distribution.py: every committed curve loads with values in [1, tokens + 1], curve resolution for every special case, lookup errors, and the CLI (list, show, lookup, error exit)
  • utils/test_synthetic_acceptance.py + utils/test_srt_single_node.py (excluding the macOS-only pool-launcher cases): 93 passed together with the new tests
  • Equivalence sweep against main's golden_length: 11,880 combinations of model prefix × method × draft model/sampler × tokens × thinking mode, 0 differences (values exact; errors same type — only the missing-curve message wording now names the file and directory)
  • ruff check infx and ruff format --check infx clean

🤖 Generated with Claude Code

The golden AL lookup (curve resolution + committed value) moves from
infx/srt_slurm/synthetic_acceptance.py into infx.golden_al_distribution,
which synthetic acceptance now imports. python -m infx.golden_al_distribution
{list,show,lookup} queries the same data. Behaviour is unchanged: 11,880
lookup combinations match the previous implementation.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, straightforward refactor with no behavior change. Reviewed the extraction of curve-resolution logic into infx/golden_al_distribution/curves.py against the old inline synthetic_acceptance.py code — confirmed the moved golden_length/curve_name logic is byte-for-byte identical (only the missing-curve error message wording changed, plus a new isinstance(modes, dict) guard). Also checked the new CLI's show subcommand for a path-traversal read risk — it forces a .yaml suffix under a fixed dir and is a local-shell tool anyway, not a new exposure. Test file covers curve validation, curve-name resolution special cases (MTP/EAGLE/NEXTN, MiniMax GQA, DSv4/Kimi DSpark), and the CLI.

Extended reasoning...

Refactor moves existing golden-AL-curve lookup logic from infx/srt_slurm/synthetic_acceptance.py into a new infx/golden_al_distribution package (curves.py + CLI + docs), with a new test file. No security-sensitive surface beyond a local YAML-reading CLI restricted to a fixed directory and *.yaml suffix. Verified via diff that the moved logic is unchanged (equivalence claim in the PR checks out), tests are non-trivial and cover the special-case branches, and there are no outstanding reviewer objections in the timeline, so a human need not re-review this one.

@functionstackx
functionstackx merged commit ad13466 into main Sep 26, 2026
5 checks passed
@functionstackx
functionstackx deleted the klaud/golden-al-package branch September 26, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant