Repository navigation
Fix DBBench SELECT grading for multi-column results - #238
appleweiping wants to merge 3 commits into
Conversation
Parse MySQL result literals without evaluating agent input, keep all tuple columns, and stop treating missing or non-finite answers as zero. Cover real training labels and adversarial answers with regression tests.
|
Ran the base (d1e4a10) and head (9fadd06) versions of Fixed at this head:
One behaviour change to confirm as intended: the list branch of Still open, as the description says:
|
Retain the grader's existing quote tolerance for ordinary list items after safe result parsing. Check all 120 standard and dev non-mutation labels in a regression test.
|
Thanks for catching the quoted-list regression. I reproduced it with The full |
|
Confirmed at a89fba7 with the same harness: quote-wrapped list answers match again on all 100 non-mutation rows of |
|
I added four opt-in live MySQL tests. They run actual SELECT queries through the existing MySQLDatabase methods and then the grader, covering multiple columns, Decimal, NULL, empty results, zero, and quoted single-column answers. With MySQL 8.4.11, Connector 26.7.0, and Python 3.12 on Windows, all 12 tests pass, including the eight existing regressions. Running the four live checks against the upstream grader reproduces the multi-column mismatch and three false zero matches for missing or non-finite answers. The test loader isolates the existing database class bodies to avoid the optional AgentRL imports. It bypasses container allocation and supplies a real localhost connection. This is database-method and grading coverage, not a full AgentRL session or container test. To rerun against a disposable local server: DBBENCH_MYSQL_PORT=33060 python -m unittest discover -s tests -v |
DBBench evaluates agent-controlled result strings, drops multi-column MySQL rows, and maps missing or non-finite answers to zero. On the training SELECT split, this can reward an empty answer for a non-empty result.
This change parses result literals without executing arbitrary calls. It permits Decimal, retains every column, and keeps genuine empty results matchable. Missing and non-finite answers do not match zero. Invalid or truncated literals do not become empty results. Quote-wrapped items keep their existing matching behavior.
The eight parser regressions cover all 1,290 shipped training SELECT labels, all 100 non-mutation standard rows, all 20 dev rows, and an attempted code-execution payload. They previously passed on Windows Python 3.14 and WSL Python 3.12 at
a89fba7.The current head
bcec10dadds four opt-in live MySQL tests. All 12 tests pass on Windows Python 3.12 with MySQL 8.4.11 and Connector 26.7.0. The live checks use the actual database class methods with a real localhost connection, then the grader. They cover multiple columns, Decimal, NULL, empty results, zero, invalid answers, and quote compatibility. Using the upstream grader reproduces one multi-column failure and three false zero matches.Without that environment variable, the four live tests are skipped. The test loader isolates repository class definitions to avoid optional AgentRL imports; it bypasses container allocation. A full AgentRL session, Docker allocation, and root-level pytest have not been validated here. Ruff and diff checks pass.
Addresses only the DBBench parsing and reward parts of #234. The other issues remain open.