Repository navigation
conformance: add a corpus compile report - #3
Merged
Merged
Conversation
`make corpus-report` measures the checked-in corpus instead of asserting its outcomes: how many queries parse to the IR, how many of those emit to ES|QL, and how many emit to PromQL, with end-to-end percentages as well. The report is printed by TestCorpusReport, which is skipped unless -corpus-report is set, so the ordinary test run is unchanged. The current table is published in the README's "Conformance report" section.
be-thomas
commented
Oct 26, 2026
be-thomas
left a comment
Owner
Author
There was a problem hiding this comment.
Independent review of ffd9645, verified on a clean checkout of the commit.
What I checked:
make checkpasses (gofmt, vet, tests, build).make corpus-reportexits 0 and prints an identical table on two runs; only the surroundinggo testtiming lines differ.- Recomputed every cell independently (separate loader;
ParseVersionby each collection's dialect;Transpilewithcompiler.Options{}; plus a second pass throughcompiler.Compilewithmapping.Default()). All counts and percentages match the README. Denominators are correct:SPL→xdivides by all queries andIR→xby parsed queries, parse failures never start an emit attempt, and the Total row sums the tallies (2,812 = 549 + 2,171 + 92; 84 = 69 + 15 + 0; 65 and 6 likewise). The—cells are the zero IR denominators inspl2. emitsmatches the CLI: ESQL'sresult()blanks the query when an error diagnostic exists and PromQL'sabortreturns an empty query, soerr == nil && non-emptycannot miss a success or count a failure. The corpus contains no case oferr == nilwith empty output orerr != nilwith output.Options{}leavesMappingnil, which both emitters resolve tomapping.Default(), and leaves index/metric/span empty, the CLI's defaults.- Dialect selection matches
runCorpus(metadataspl2→SPLVersion2, otherwiseSPLVersion1), andcorpusDirssorts its glob, so row order is stable and matches the README. - Without
-corpus-reportthe test skips andgo test ./conformanceis unchanged; the Makefile passes-v -count=1, so the table is visible, the run is uncached, and a failure exits non-zero. - Spot checks against the CLI agree for parse+emit, parse+refuse (both targets), and parse-fail.
tstatsis the first refusal for exactly 1,022 detection queries, as the prose says.
Two documentation nits are inline.
The printed table now matches the README exactly: collection names are code-formatted, every Total cell is bold, and the total row is built from the total flag rather than a name. Correct the PromQL refusal prose to the measured breakdown instead of attributing most refusals to four stages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Adds a measured report over the checked-in query corpus, and publishes it in
the README.
make corpus-reportprints, per collection and in total:*ast.Pipeline),ES|QL,
There is no separate SQL back-end: ES|QL is the SQL-style target and PromQL the
other, which the README section states.
spl1spl1-detectionsspl2All figures use the compiled-in default mapping with no per-query index,
metric, or span override.
Implementation
conformance/report_test.go:TestCorpusReport, skipped unless-corpus-reportis set, sogo test ./conformanceis unchanged. It reusesthe corpus loader and counts a query as emitted only when the emitter
returns no error and a non-empty query.
Makefile:corpus-reporttarget and help line.README.md: new "Conformance report" section with the generated table.CONFORMANCE.md: points at the report as the measurement companion toTestCorpus's assertions.CHANGELOG.md: entry under Unreleased.Tests run
make check— format, vet, tests, build: pass.make corpus-reporttwice: same table.Open questions
make corpus-reportthen paste). Should CI compare the README table with the generated one and
fail on a stale report, the way
make generate-checkprotects the ANTLRoutput?
--indexor--metriccount as failures. Should the report also measurethe best case with per-query overrides, or stay on the default path?