Skip to content

feat: replace and recalibrate the polyglot corpus (phase 1) - #22

Merged
pszemraj merged 138 commits into
mainfrom
feat/calib
Sep 21, 2026
Merged

pszemraj merged 138 commits into
mainfrom
feat/calib

Conversation

@pszemraj

@pszemraj pszemraj commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Issue #20 identified inadequate calibration inputs for useful semantic defaults. This PR provides runnable development fixtures for Python, Rust, C, JavaScript, and TypeScript and derives the shipped duplicate, search, and hybrid visibility defaults from reviewed evidence. It completes phase one without closing the real-code evaluation work.

Summary

  • A shared manifest defines application fixtures, reviewed pair judgments, difficulty labels, search relevance, partial-region evidence, split provenance, and behavior contracts.
  • Cache-disabled CPU and MPS captures record complete score matrices plus corpus and per-query execution provenance. Calibration requires float32 execution on the requested device with MPS operator fallback disabled; ordinary search retains automatic fallback.
  • Selection maximizes precision-eligible F1 exactly from confusion counts and uses recall only for mathematical F1 ties. Precision floors apply per language and pooled for search and hybrid; search preserves no-result probes.
  • Report generation replays complete selections from local raw measurements. The committed summary binds evidence to corpus inputs, support files, model and numeric-runtime provenance, execution policy, and measurement digests. Replay and validation process saved scores independently of the reader's inference runtime and hardware settings.
  • Dependency constraints live in pyproject.toml, and fixture commands do not prescribe an environment manager. Unpinned Hub models use immutable locally resolved commits for cache identity by default; label-keyed reuse is an explicit loose mode.

The workflow explains selection and its limits. Shipped gates live in the model profiles; inventory, metrics, timings, and device drift live in the checked result. Raw score matrices and model caches remain local.

Independent CPU and live-MPS measurements agree on duplicate, visibility-tier, and search decisions for the checked corpus. These authored fixtures support development defaults, not held-out or ecosystem-wide accuracy claims.

Remaining scope

Phase two is a compact hand-reviewed real-code check in each supported language, followed by targeted fixture additions and recalibration justified by that evidence.

Validation

Regression, live-MPS, fixture behavior and entry-point, lint, formatting, docstring, and documentation checks pass. Isolated source/wheel builds and Cargo WebAssembly compilation pass. The model-search smoke passes on Apple silicon. Browser packaging with wasm-pack is unverified in the current environment because that tool is not installed.

Refs #20

@pszemraj

Copy link
Copy Markdown
Owner Author

Final provenance and cache-contract follow-up after the PR description was written:

  • Checked calibration identity now tracks explicit measurement behavior and fixture/model inputs instead of incidental implementation-source bytes. Documentation-only fixture changes no longer force evidence churn; raw local captures retain their stricter source fingerprint.
  • The checked report schema and provenance linkage were refreshed without changing shipped thresholds, reported metrics, or CPU/MPS decisions.
  • Calibration reporting now uses its fixed CPU/MPS contract directly, avoids repeated deterministic project validation, and reports an empty compiler override clearly.
  • Semantic precomputed-input validation reuses the shared bounded canonicalization path, preserving the existing validation and normalization contract.
  • Hatch VCS dynamic versioning was verified through an isolated package build; the existing pyproject configuration was already correct.

The PR body remains a final-state summary. Detailed values continue to live in the checked calibration result rather than this comment or the description.

@pszemraj pszemraj self-assigned this Sep 20, 2026
@pszemraj

Copy link
Copy Markdown
Owner Author

Post-description calibration repair at 9228b46:

  • Calibration records every probe query encoding separately from corpus indexing and rejects cache reuse or device fallback before publishing device evidence. Ordinary search still retains accelerator-to-CPU fallback.
  • JavaScript and TypeScript aggregation use exact-key ordinal ordering, with permutation coverage for canonically equivalent but byte-distinct Unicode identifiers.
  • The two C sort/stream pairs remain positive duplicate judgments, but their annotations now limit behavioral equivalence to successful calls and preserve the observed failure-precedence witnesses.
  • Fresh CPU and live-MPS measurements regenerated the selections and checked report. The measured profile changes are reflected in the shipped defaults and model-profile documentation; exact values remain in the checked result.

The complete regression, toolchain, fixture-behavior, search-smoke, lint/doc, and live-MPS validations pass on the pushed branch.

@pszemraj

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9228b464a0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/calibration_evaluation.py Outdated
@pszemraj

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 510c293444

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread test_fixtures/cowsay_wasm/Makefile Outdated
@pszemraj

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: c7cc210033

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@pszemraj

Copy link
Copy Markdown
Owner Author

Calibration-policy correction at 8e34baa:

Validation passes for the complete ordinary regression suite, the live-MPS module, Ruff/formatting, docstrings, corpus validation, and byte-for-byte report regeneration.

@pszemraj

Copy link
Copy Markdown
Owner Author

Review hardening through 72ba728 is pushed:

  • Calibration now records tokenizer and NumPy versions, keys evidence to the numeric runtime, requires a fresh pre-PyTorch process for MPS capture, and disables MPS operator fallback. All CPU/MPS raw measurements and the checked report were regenerated through the normal workflow.
  • Selection compares F1, recall, and precision exactly from confusion-matrix counts, so mathematically equal outcomes cannot be misranked by floating-point representation.
  • The shipped threshold declarations, profile documentation, checked evidence, and real-model search-smoke expectations are synchronized; the selected product gates did not change in the final provenance recapture.
  • Unpinned Hub cache reuse resolves immutable local commits by default. Potentially stale label-keyed reuse remains available only through the explicit loose mode, with CLI/API/docs and concurrency regressions aligned.
  • The complete ordinary suite, live-MPS suite, both real-model search smokes, fixture behavior/application validation, byte-identical report regeneration, Ruff, docstrings, package build, and Cargo native/WebAssembly checks pass. A final independent calibration/runtime/integration review round found no actionable issues.

@pszemraj

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 72ba7288da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

1 participant