Repository navigation
feat(birdbench): add BIRD's 2025-11-06 dev and both Mini-Dev releases as dated versions, and a schema-only prompt - #6711
Conversation
… versions `version` picks a release of BIRD dev's questions: dev_20240627 (the default, unchanged), the authors' revised dev_20251106 (614 of 1,534 questions changed), and Mini-Dev as of 2025-07-04 and of the 2026-10-28 update (500 each). The newer releases come from the BIRD authors' Hugging Face datasets at a pinned revision and are checked against their SHA-256; all run on dev.zip's 11 databases. A non-default version writes its own prepared file and tags its rows with question_id and bird_version; the default file is unchanged. `prompt_format=schema_only` (SQLite) prepares rows for auto-ontology-eval's schema-only prompt (prompts/schema_only_sqlite.yaml): the CREATE TABLE statements and BIRD's column descriptions, with the question and its evidence apart. eval.sh takes --version and --prompt-format. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abel Brown <[email protected]>
With --split train it read a question_id train rows don't have and would have tagged train rows with a dev release; eval.sh would also have put dev and train results in one directory. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abel Brown <[email protected]>
…ma-only prompt The README lists each release with its date, source and what changed from dev_20240627 (counts only), and the gold check per version: no gold errors on dev.zip's databases; q701 and q518 (and q1131 in dev_20251106) outlast bird_sql's 30 seconds and are masked. config.yaml documents version and prompt_format; manifest.yaml gives the license (CC-BY-SA-4.0) and the release. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abel Brown <[email protected]>
…nts both ways data/versions/ (the downloaded question releases) is git-ignored; only *.jsonl was. The README gives the dev_20251106 change counts with and without whitespace-only edits, and the SHA-256 of the dev.json the default numbers come from. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abel Brown <[email protected]>
NVIDIA-NeMo#6647 gave every prepared BIRD row a task_id, BIRD's question_id as a string, because `gym eval plan` refuses rows without task_id, problem_id or instance_id. The schema-only writer builds its own rows and had none, so a schema-only plan would be refused. It now writes the same task_id. The default-row key-set test expects task_id, the version test checks it on dated rows, and a new test checks schema-only rows carry the question_id (not the row position) and pass the bird_sql task-data schema. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abel Brown <[email protected]>
|
/ok to test 2f92e09 |
|
@abelatnvidia please take a look at the secrets detector failure and fix |
…he secrets detector The secrets detector flags the SHA-256s of the three dated releases as high-entropy strings. They are public checksums. Mark each line with `# pragma: allowlist secret`, as main does. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abel Brown <[email protected]>
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
SHIP WITH CARE
I found two RISKs: the new prepared fields are missing from the owning schema, and the documented direct configuration controls do not select the matching dataset and prompt. The eval.sh path worked in the probes. I found no BLOCKER.
I reviewed all eight changed files and their relevant consumers, with three delegated reviews covering versions, prompt generation, and evaluation wiring.
Validation
I used 766267172432.dkr.ecr.us-east-1.amazonaws.com/gym:91666f99091979a03d78b76558851f5bf1bbf43a, the base/default-branch CI image, because no successful head image build was available. Missing benchmark packages were installed into a scratch virtual environment.
test_prepare.py: 39 passed, with one pytest configuration warning. These benchmark-local tests are outside the core suite's default discovery.- Base/head preparation on a two-row SQLite fixture produced byte-identical default files. Schema-only rows rendered through the real prompt code, and a fixture answer passed the actual SQLite verifier.
- Version probes covered JSON/JSONL parsing, cache reuse and corruption, checksum rejection, task counts, and output isolation.
- Shell probes passed 19 supported combinations and four invalid combinations. Real config composition matched the shell's filenames and prompts. Direct-config cold/warm-cache probes and strict collation reproduced the two findings.
For existing suites, I relied on head CI: lint, four core shards, eight server shards, combined coverage, and the test/server summaries passed. CI is not green: Nemo_CICD_Test failed because the reusable unit-test workflow failed. Its session-routing test reported assert 1 > 1, with 1 failed, 8 passed, and 8 skipped. Matching base runs skipped that job, so I cannot establish it as pre-existing. The secret detector also failed on the three new SHA-256 literals at prepare.py:91,99,106; the log identifies them as high-entropy strings. Changed-server tests were skipped, not passed.
I did not download the full BIRD releases, independently reproduce the external prompt-parity claim, or run live models or Spark/PostgreSQL engines. The PR's full-data and live-run results are author-supplied evidence.
Inline comments (escaped v1):
-
resources_servers/bird_sql/task_data.pyline 50: RISK: Declare the new prepared-row fields in the owning schema.Could you add optional
evidence_section,question_id, andbird_versionfields here? The new writers emit them, but this schema still describes only the old shape. Every named-version row therefore has unknown provenance fields, and every schema-only row also has an unknown prompt field.The real collation probe,
/workspace/review-probes/.venv/bin/python /workspace/review-probes/bird-prompt-1/collate_probe.py, accepted old-shape rows but rejected schema-only rows withtask_data_validation="error", listing all three fields as unknown. Warning-mode evaluation and SQL verification still work; this breaks supported strict validation, not scoring.Please declare the fields with their prompt/provenance metadata while keeping them optional so existing files remain valid. Strengthen the new validation assertion to require
report.clean;error_rows == 0currently passes despite unknown keys.Acceptance: old/default rows, named-version rows, and both prompt formats should produce clean reports and pass strict collation. Keep default output bytes unchanged and continue rejecting misspelled fields.
-
benchmarks/birdbench/README.mdline 106: RISK: The documented direct version control leaves the default dataset selected.Could you wire direct configuration through the same selection as
eval.sh, or document the complete dataset overrides it needs?gym eval prepare --benchmark birdbench +prepare_script_args.version=minidev_20261028still declaresbirdbench_sqlite_dev.jsonlin config.yaml. On a cold cache, preparation writes the Mini-Dev file and then raisesConfigErrorbecause its path differs. With+use_cached_prepared_benchmarks=trueand an existing default file, it instead skips preparation and reuses the 2024 questions.The new
prepare_script_args.prompt_format=schema_onlycontrol has the same mismatch and also leaves the default prompt selected. I reproduced both cold/warm-cache cases with/workspace/review-probes/.venv/bin/python /workspace/review-probes/bird-eval-1/direct_prepare_probe.py. The shell flags work because they replace the dataset declaration too.The smallest scoped correction is to document a complete direct override or preset, including
jsonl_fpathandprompt_config, rather than presenting the prepare argument as sufficient. Alternatively, derive both before cache lookup.Acceptance: each documented direct workflow must select the requested release and matching prompt with and without an existing default cache. Preserve the existing default paths and working shell combinations.
Review generated by codex. This was a full review. Request a full review with /review reset=true.
init-nikhil
left a comment
There was a problem hiding this comment.
Looks like the two bot comments still apply? The new dataset fields fail strict validation, and using the version/prompt overrides directly can still pick up the default prepared dataset. Can we address those? The shell script seems to handle it correctly.
…n TaskData prepare.py's schema-only prompt adds evidence_section, and a named BIRD dev version (or the schema-only prompt) adds question_id and bird_version. TaskData did not declare them, so strict collation (task_data_validation=error) rejected every such row as having unknown keys. They are now optional fields: evidence_section is prompt input, question_id and bird_version are provenance. Rows without them, including every default row, validate as before, and a misspelled field is still an unknown key. The schema-only test now requires a clean report, not only zero failed rows, and new tests check that every prepared shape (default and named version, each with both prompt formats) is clean. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abel Brown <[email protected]>
…rompt_format Setting +prepare_script_args.version or +prepare_script_args.prompt_format directly, without eval.sh, left config.yaml's dataset on birdbench_sqlite_dev.jsonl and default_sqlite.yaml. `gym eval prepare` then wrote the requested file and stopped because its path differed from jsonl_fpath, or, with +use_cached_prepared_benchmarks=true and a default file present, skipped preparation and reused the 2024 questions. The dataset's jsonl_fpath and prompt_config now follow both arguments, so the cache check, preparation and collation all use the requested release's file and matching prompt. Two small lookups in config.yaml mirror prepare.output_fpath_for: the default version's file is named by the split, and the default prompt format adds no suffix; any other value names itself, so an unknown one still reaches prepare()'s own error. The default resolves to the same file and prompt as before, and eval.sh, which replaces the whole dataset entry, is unchanged. Dialect and split still go through eval.sh, since they also change the server. test_config.py now resolves config.yaml's interpolations as Gym does and checks, for every version and prompt format, that the dataset is the file prepare() writes and the prompt matches. The README documents the direct overrides. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abel Brown <[email protected]>
…set file The derived file name fell back to the raw value for an unlisted version, so a non-version could name an existing file and be reused from the cache without prepare() ever checking it: +prepare_script_args.version=dev picked the default file, and version=dev_schema_only the schema-only file with the default prompt. Setting dialect or split directly also still reused the SQLite dev file, as it did before the derivation. config.yaml's tables now list every accepted version and prompt format, and the file prefix only for SQLite dev. Any other value, and a direct dialect or split, fails while the config is resolved, before the cache is looked up, naming the missing table key. eval.sh replaces the whole dataset entry, so it is unaffected. The README says to pass the same override to `gym eval run`, sends dialect and split to eval.sh, and notes that the cache goes by file name, which dscp and include_evidence don't change. test_config.py now composes the config with Gym's own parser, checks that the tables match prepare.VERSIONS and PROMPT_FORMATS and that the other values fail, and runs Gym's prepare flow in process (cache lookup and output-path check, prepare() stubbed) with and without a cached default file. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abel Brown <[email protected]>
|
@dkmisra I ran the two legacy BIRD SQLite gold queries mentioned here against the stock database files. Both q518 and q701 hit a 30 s SQLite progress-handler deadline with a fresh read-only connection and on a reused connection after warming the database file. With a longer verifier-only precompute, the exact gold queries finished in 33.31 s and 152.15 s, respectively. A typed, snapshot-keyed gold cache then scored independently rewritten equivalent queries (28 ms / 23 ms prediction time) as passes and rejected a deliberate wrong answer for each. Cache read + comparison took under 8 ms in both cases. The prediction still had its own 30 s deadline. This matches the split in BIRD-RL: its worker-local replica pool and dirty-aware reset help stateful SQL debugging avoid per-trajectory copies; its plain BIRD executor opens the immutable/read-only database directly. Replica reuse didn't fix these slow queries. I'd try a verifier-only gold cache as an explicit alternate scoring mode, keyed by dataset version, DB content hash, gold SQL hash, engine/version and comparator, with no policy access. Keep the official shared-deadline score/denominator separately reportable; caching changes what fits under that deadline. No changes to this PR or Gym were made. Separately, the |
eval.sh built the prepared file name from --version without checking it, so an unlisted value could name another cached file: `--version dev_schema_only` selected the schema-only file with the default prompt, and `--version dev` the default file, and with the cache on prepare() never ran to reject them. eval.sh now accepts only prepare.VERSIONS, as it already did for --prompt-format; every supported combination resolves as before. A test pins eval.sh's list to prepare.VERSIONS (it reads the script rather than running it, since the script's exit trap reaps orphaned server processes). The README says a direct dialect or split stops only when it isn't sqlite or dev. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abel Brown <[email protected]>
…; test the collation path Gym's generic message for an unsupported direct value says a key under birdbench_prepared_file is not set and suggests providing it, which would map the value to a file again. config.yaml and the README now say to use a listed value instead. The direct version and prompt-format test now also checks the dataset as collation (`gym eval run`) reads it, through filter_for_server_instance_configs, beside the one `gym eval prepare` uses. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abel Brown <[email protected]>
…st arm The test read only the first accepting arm, so an extra arm such as `dev_schema_only) ;;` before the rejecting `*)` would have passed it. It now requires exactly the listed versions and the `*)` arm. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abel Brown <[email protected]>
|
Thanks. Both are addressed in six new commits on top of the branch (no rebase). 1. Strict validation (c220305). Checked with 2. Direct overrides (69a60af, 5458a63, e06a7bc, f5af0c8, 705aa35). I went with deriving rather
Tests: birdbench 121 passed (97 before), On the two CI notes in the bot review: the secrets-detector flags on the SHA-256 literals are handled by the earlier |
|
Thanks @cafzal, that matches what I saw (q701 about 183 s, q518 about 39 s here). A verifier-only gold cache as a separate, labelled scoring mode, with the official deadline score still reported, sounds like the right shape. I'd keep it as a follow-up rather than add it to this PR. Since #6274 touches the same benchmark files, I checked it against this PR and #6483 locally. The text conflicts are small, but there are two real gaps if both land, and I have tested fixes for each:
Whichever of these lands second, I'll add a merge-from-main commit and one follow-up commit with the fix, with no rebase or force-push. Happy to adjust if #6274's layout changes. To reproduce (for reviewers, or an agent)Expected: line 28 of each is Expected conflicts: Heads checked: #6274 |
|
/ok to test 705aa35 |
test_code_outside_the_library_imports_exported_names_from_the_public_api requires code outside the library to import exported names from the package's public API. test_config.py imported GlobalConfigDictParser and GlobalConfigDictParserConfig from nemo_gym.config.global_config. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abel Brown <[email protected]>
|
Pushed 36c57c3, which fixes the one CI failure. benchmarks/birdbench/tests/test_config.py imported GlobalConfigDictParser and GlobalConfigDictParserConfig from nemo_gym.config.global_config; it now imports them from nemo_gym.config, as test_public_api_facades.py requires. |
|
@ffrujeri thanks for running CI. Could you run |
Resolves the one conflict, in benchmarks/birdbench/manifest.yaml: main (NVIDIA-NeMo#6233) made modality a list, and this branch changed the description and licensing. The merged file keeps both: main's `modality: [text]` and this branch's description and `licensing: CC-BY-SA-4.0`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abel Brown <[email protected]>
|
/ok to test 36c57c3 |
Head branch was pushed to by a user without write access
|
@ffrujeri thanks. The run on 36c57c3 stopped before any tests because the PR conflicted with main. I merged main to fix the conflict in @init-nikhil the push dismissed your approval. Since you approved, the only change to this PR's files is that |
|
/ok to test 7595830 |
ffrujeri
left a comment
There was a problem hiding this comment.
Thanks for the fixes. The head closes both bot findings and both points from the earlier review: TaskData declares evidence_section, question_id and bird_version, and config.yaml builds jsonl_fpath and prompt_config from version and prompt_format, so a direct override selects its own file and an unlisted value stops while the config resolves (checked with gym env resolve). The PR's own patch is the same as the one approved at 36c57c36; the merge from main dismissed that approval. LGTM.
Optional: the provenance note in prepare.py could give the full commit (e727e4d6e1e198355099de4803590bb3681793a4) and also name ontology_sql_eval/gym/tasks.py, the source of the schema-only prompt, and the description could carry the same line.
|
|
||
| @pytest.mark.parametrize("prompt_format", birdbench_prepare.PROMPT_FORMATS) | ||
| @pytest.mark.parametrize("version", list(birdbench_prepare.VERSIONS)) | ||
| def test_direct_version_and_prompt_format_select_their_file_and_prompt(version, prompt_format): |
There was a problem hiding this comment.
Optional: CI does not run benchmarks/*/tests, so this check does not run in CI. Could a copy go in tests/unit_tests/benchmarks/, next to test_birdbench_prepare.py? Then CI catches a later change to config.yaml, for example when the Spark and PostgreSQL configs from #6274 land.
|
Thanks for the review. I've updated the description's credit line to give the full commit and name |
|
🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/46716356449 |
NVIDIA-NeMo#6711 (BIRD versions and the schema-only prompt) and this branch both added a section after the dialect notes in benchmarks/birdbench/README.md. Both are kept: the Snowflake section first (it belongs to the dialect notes), then main's Versions and Schema-only prompt sections. No other conflicts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Abel Brown <[email protected]>
What does this PR do?
Adds the BIRD authors' newer dev releases to
birdbenchas named, dated versions, next to the dev set Gym has always used, which stays the default. It also adds an optional schema-only prompt, the one auto-ontology-eval's runs use, so their runs and Gym's can be compared prompt for prompt.Please review
VERSIONSandload_version_entriesinbenchmarks/birdbench/prepare.py,prompts/schema_only_sqlite.yaml, and the--version/--prompt-formathandling ineval.sh. Skip the tests.bird_sql's grading doesn't change; itstask_data.pydeclares the three new optional row fields (evidence_section,question_id,bird_version), and the default prepared file is byte-identical tomain's.versiondev_20240627(default)dev.jsonindev.zip, as todaydev_20251106birdsql/bird_sql_dev_20251106minidev_20250704birdsql/bird_mini_dev,archive/minidev_20261028birdsql/bird_mini_dev,data/dev.zip's 11 SQLite databases. Each version's gold SQL runs there without an error (gold check below). The newer releases change questions, evidence and gold SQL, not databases.data/birdbench_<dialect>_<version>.jsonl, so a cached file from one release is never read as another. Its rows also carry BIRD'squestion_idandbird_version. The default file is unchanged.--prompt-format schema_only(SQLite):prompts/schema_only_sqlite.yamlshows the database'sCREATE TABLEstatements and BIRD's column descriptions, with the question and its evidence apart. It is auto-ontology-eval's schema-only control prompt, adapted with credit. On dev, all 1,534 rendered prompts are byte-identical to the prompts a saved auto-ontology-eval run sent. It needs no BM25 index.task_id, BIRD'squestion_idas a string, in every version and both prompt formats, asmain's rows have since fix(ifbench,birdbench,ioi26): give prepared rows a stable task_id #6647.gym eval planneeds it. It is unique within each version (see Validation).manifest.yaml: licensingCC-BY-SA-4.0(wasunknown); the description names the release.What changed from
dev_20240627(counts only)dev_20251106: the same 1,534 ids and databases. 614 changed, ignoring whitespace-only edits: question text 182, evidence 378, gold SQL 450, difficulty 86 (challenging 145 → 231). Counting whitespace: 619.minidev_20250704: 500 dev questions; 496 have question text identical todev_20240627's.minidev_20261028: renumbered 0–499 and largely re-annotated: 13 of 500 question texts are unchanged fromminidev_20250704.Gold check
Each version's gold SQL on
dev.zip's databases, one query at a time:bird_sql)dev_20240627dev_20251106minidev_20250704minidev_20261028Open questions (each with a default)
dev_20240627in this PR). The authors' current dev isdev_20251106. Switching the default would move every existing Gym BIRD number, so this PR doesn't. Proposal: flip the default todev_20251106once maintainers agree, in a one-line follow-up.bird_sql's masking). Two gold queries outlastbird_sql's 30 s on every 1,534-question release: q701 takes about 183 s and q518 about 39 s (one at a time, on a laptop), anddev_20251106adds q1131 (123 s).bird_sqlmasks those tasks as verifier errors, so Gym scoresdev_20240627out of 1,532; BIRD's officialevaluation_ex.pycounts them as misses out of 1,534. This PR doesn't change that, and reports the count per version.Validation
birdbenchtests (run locally; CI doesn't runbenchmarks/*/tests)tests/unit_tests/benchmarks/test_birdbench_prepare.py(from #6647)task_idin each version's prepared file, both prompt formatsgym eval plan's check accepts each filedev_20240627, default prompt)main'sgym env validate birdbenchdev_20240627,schema_only)eval.sh, no model callspre-commit run --fileson the changed filesLive runs
One live run per model through
eval.sh, paired per task with a saved auto-ontology-eval run of the same model. Models A and B are two public NVIDIA models, a large one and a small one. The first number is Gym's, the second auto-ontology-eval's. Grading explains no gap: replayed througheval.sh, the saved Model B run's answers get the same verdict as auto-ontology-eval's grader on every scored task (see Validation).eval.shagainst a saved auto-ontology-eval run, Model A (large), T0, same 1,534 promptsAn auto-ontology-eval re-run on the same day paired with Gym's run at p = 0.37, so the Model B gap is consistent with day-to-day serving variation rather than the harness; the re-run itself scored 41 below the saved run with identical prompts and settings.
Gym's percentages are of the tasks it scored: 1,533 for Model A and 1,532 for Model B, because
bird_sqlmasks a gold query that runs over 30 s (q518's ran just inside the limit in Model A's run). The auto-ontology-eval percentages are of all 1,534.Credits
BIRD by Li et al. (CC BY-SA 4.0). The schema-only prompt is the Auto Ontology team's (auto-ontology-eval at commit e727e4d6e1e198355099de4803590bb3681793a4:
ontology_sql_eval/gym/tasks.pyfor the prompt,ontology_sql_eval/gym/ddl.pyfor the schema dump; Apache 2.0).