All findings · Lucene finding · LFV-1040 · quality-package-trec-sample-calls-nonexistent-execute-overload

The benchmark quality package overview's TREC sample calls a 4-argument QualityBenchmark.execute that no release has ever had

The benchmark quality package overview's only sample calls qrun.execute(maxResults, judge, submitLog, logger), but QualityBenchmark has only execute(judge, submitLog, logger) plus setMaxResults(int). The API changed in 2008, before the package's first release, so the copied sample fails to compile on every release from 2.3.0 to 10.6.0.

Summary

Priority
Low, rank 1256A TREC sample in the opt-in benchmark quality overview has failed loudly at compile time since 2.3.0, with no runtime effect.
Impact
minor
Since
2.3.0 (2008, the package's first release)introduced 2008-01-03 · over 18 years
Affected
2.3.0 to 10.6.0, and main (documentation only)
Status
documented
Found by
a compile check of javadoc code examples (non-formal)

AI-assisted page: this finding was first signalled by code reading or testing and then checked with AI tools; the checks it went through, and what each found, are under Prior reports, history and checks. Not yet triaged by a human. Snapshot of 2026-11-06.

The finding in 30 seconds

The sample is a plain code block in the package javadoc, which javadoc never compiles. When the result count moved from an execute argument to setMaxResults, the same commit fixed the two other callers but not this page; a 2012 edit of the sample kept the call and added the : typo.

Summary card of the bug. The quality package overview's sample sets maxResults = 1000 and calls qrun.execute(maxResults, adjudication, submitLog, logger). QualityBenchmark has only execute(Judge, SubmissionReport, PrintWriter) and setMaxResults(int), so javac rejects the 4-argument call; copied verbatim, it stops even earlier at line 41, which ends with a colon. LUCENE-1116 moved the count to setMaxResults in January 2008, before the package's first release, 2.3.0. The fix ends line 41 with a semicolon and calls setMaxResults(maxResults) before the 3-argument execute, as QueryDriver does.
The sample next to the class's real methods: javac stops first at line 41's :, then finds no execute that takes four arguments; the result count now goes through setMaxResults first. Select the still to open it at full size. Generated with AI, checked against the code.
  1. You want to measure search quality on TREC topics, open the org.apache.lucene.benchmark.quality package overview and copy its "sample code used to run the TREC 2006 queries 701-850". It sets int maxResults = 1000; and calls qrun.execute(maxResults, judge, submitLog, logger).
  2. You expect it to compile and run each query with up to 1000 results.
  3. Instead javac rejects the call: required: Judge,SubmissionReport,PrintWriter; found: int,Judge,SubmissionReport,PrintWriter. Copied verbatim, it stops one line earlier still: DirectoryReader.open(directory): ends with : instead of ;.
  4. The 4-argument execute existed only on trunk, from July 2007 to January 2008: before the 2.3.0 release, the result count moved to setMaxResults(int); QueryDriver and the tests were updated, the overview never was. With qrun.setMaxResults(maxResults); followed by qrun.execute(judge, submitLog, logger) the sample compiles.

Who is affected

Developers who start a TREC-style evaluation from the opt-in benchmark module's quality package overview: the copied sample fails to compile every time, on every release since 2.3.0. Documentation only: nothing in Lucene runs differently, and javac names the correct signature.

Mechanism, terms and numbers466 words

The overview of org.apache.lucene.benchmark.quality (an exported package of the published benchmark module) introduces its only code block as "a sample code used to run the TREC 2006 queries 701-850 on the .Gov2 collection". The block sets int maxResults = 1000; and calls qrun.execute(maxResults, judge, submitLog, logger). QualityBenchmark has only execute(Judge, SubmissionReport, PrintWriter) and takes the result count from setMaxResults(int) (default 1000). Copied into a project, the call fails with one javac error, "method execute in class QualityBenchmark cannot be applied to given types; required: Judge,SubmissionReport,PrintWriter; found: int,Judge,SubmissionReport,PrintWriter", on main and on every release from 2.3.0 to 10.6.0. Copied verbatim, javac stops even earlier, because the DirectoryReader.open(directory) line ends with :.

The API change was deliberate: LUCENE-1116 (January 2008; its issue description speaks of moving "control over max-docs-to-retrieve from benchmark constructor to a setter method", though in the code the count was the first argument of execute) added setMaxResults(int) and updated QueryDriver and TestQualityRun, but not the page. 2.3.0, the package's first release, already had the change, so no release ever shipped a compiling sample. A 2012 pass that fixed out-of-date API usage in the sample rewrote its reader lines, left the call and introduced the :. Nothing in Lucene behaves wrongly; only the page is stale.

The sample (main 645d4fe14a20, quality/package-info.java)

linetextcompiles?
36"Here is a sample code used to run the TREC 2006 queries 701-850 on the .Gov2 collection:"(prose)
41IndexReader ir = DirectoryReader.open(directory):no: ';' expected
44int maxResults = 1000;yes
63-64new QualityBenchmark(qqs, qqParser, searcher, docNameField), SubmissionReport submitLog = null;yes
65QualityStats stats[] = qrun.execute(maxResults, judge, submitLog, logger);no: no execute(int, ...)
all otherstopics and qrels readers, TrecJudge, SimpleQQParser, QualityStats.average, logyes

The API

QualityBenchmark has one execute: public QualityStats[] execute(Judge judge, SubmissionReport submitRep, PrintWriter qualityLog) (line 96). It searches with the field maxResults (line 106), documented "maximal number of results to collect for each query. Default: 1000." (lines 63-64) and set by setMaxResults(int) (line 167). A class-file scan of 22 release benchmark jars (2.3.0 to 10.5.2) and main finds no execute(int, ...); all 142 release tags that have the package (2.3.0 to 10.6.0) carry the stale line.

The correct usage in tree

trec/QueryDriver.java:96-98 and TestQualityRun.java:82-86: construct the QualityBenchmark, call qrun.setMaxResults(maxResults), then qrun.execute(judge, submitLog, logger).

Why nothing caught it

Javadoc does not compile <pre><code> blocks, and the block has no {@link} that javadoc would check. The tests use the current API.

Not claimed

Any defect of the API itself; the free name directory, normal for a fragment. The sample's 1000 happens to equal the default, so deleting the first argument alone gives the intended count by accident; for any other value the reader must find setMaxResults.

Exposure and likelihood123 words
  • Who. Readers of the quality package overview who copy its sample. A 2009 java-user@ reply pointed a user to this page as the package's usage documentation. No query, document or index file reaches it.
  • Default vs opt-in. The benchmark module is a separate, opt-in artifact. No configuration or special input is involved: the copied sample always fails.
  • Scale. Every release from 2.3.0 (2008) to 10.6.0, and main (executed on 9 releases and main; the source of all 142 release tags read); no release ever shipped a compiling sample.
  • Effect. A compile error, not wrong behaviour. javac names the 3-argument signature, and setMaxResults is in the class's method list.
  • Not claimed. Runtime defects of the same package are separate findings (LFV-935, LFV-936, LFV-937, LFV-940).

Minimal repro

One JUnit class with one test. It compiles, with javax.tools against the jars on the test class path, a tiny class holding the sample's three lines that set up and make the execute call, verbatim; the benchmark, judge and logger come in as parameters. Nothing in Lucene runs, and the result does not depend on the test framework's random seed.

TestQualityPackageSample.java (one test, public API)52 lines
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.lucene.benchmark.quality;

import java.nio.file.Files;
import java.nio.file.Path;
import javax.tools.ToolProvider;
import org.apache.lucene.tests.util.LuceneTestCase;

public class TestQualityPackageSample extends LuceneTestCase {

  // Expected: the package overview's execute call compiles; actual: javac finds no execute(int, ...).
  public void testOverviewExecuteCallCompiles() throws Exception {
    Path dir = createTempDir();
    Path src = dir.resolve("Sample.java");
    Files.writeString(
        src,
        """
        import java.io.PrintWriter;
        import org.apache.lucene.benchmark.quality.*;
        import org.apache.lucene.benchmark.quality.utils.SubmissionReport;
        class Sample {
          QualityStats[] run(QualityBenchmark qrun, Judge judge, PrintWriter logger) throws Exception {
            int maxResults = 1000;
            SubmissionReport submitLog = null;
            QualityStats stats[] = qrun.execute(maxResults, judge, submitLog, logger);
            return stats;
          }
        }
        """);
    int rc =
        ToolProvider.getSystemJavaCompiler()
            .run(
                null, null, null, "-proc:none", "-cp", System.getProperty("java.class.path"), "-d",
                dir.toString(), src.toString());
    assertEquals(0, rc);
  }
}
Command
# $LUCENE: a built checkout (./gradlew jar); $REPRO: the directory holding org/apache/lucene/benchmark/quality/Test...java
# $DEPS: junit 4.13.2, randomizedtesting-runner 2.9.2, hamcrest 3.0
V=11.0.0-SNAPSHOT
CP=$LUCENE/lucene/core/build/libs/lucene-core-$V.jar:$LUCENE/lucene/codecs/build/libs/lucene-codecs-$V.jar:$LUCENE/lucene/benchmark/build/libs/lucene-benchmark-$V.jar:$LUCENE/lucene/test-framework/build/libs/lucene-test-framework-$V.jar:$DEPS
javac -d out -cp "$CP" $REPRO/org/apache/lucene/benchmark/quality/TestQualityPackageSample.java
java -ea -Dtests.seed=DEADBEEF -cp "out:$CP" org.junit.runner.JUnitCore org.apache.lucene.benchmark.quality.TestQualityPackageSample
# assertions off, same result: java -da -Dtests.asserts=false ...
Expected
The sample's execute call compiles.
Observed
One javac error, required: Judge,SubmissionReport,PrintWriter; found: int,Judge,SubmissionReport,PrintWriter, with assertions on and off, on main and on the 10.6.0 jars.

All files of this repro: repro/LFV-1040/

More files, environment, full output299 words

The three lines are int maxResults = 1000;, SubmissionReport submitLog = null; and QualityStats stats[] = qrun.execute(maxResults, judge, submitLog, logger); (package-info.java lines 44, 64 and 65 at 645d4fe14a20).

javac writes its diagnostic to stderr; the test asserts that the compiler returns 0, so the JUnit failure reads expected:<0> but was:<1>. Sample.java:8 is the execute line.

The whole block, extracted mechanically from the page, fails first with ';' expected at the line-41 statement; with that : read as ;, the same single execute error remains (the finder's whole-block test and an independent reproducer's test agree).

No separate regression test is suggested: the test copies the page's lines, so it would not notice a later edit of the javadoc, and the javadoc build does not compile this block (compile-checking javadoc examples is the open wish LUCENE-8488, #9534). If a reviewer wants one, it is this same test with the fixed lines, which passes. TestQualityRun already covers the real API.

Environment

lucenemain 645d4fe14a20 (11.0.0-SNAPSHOT); the 10.6.0 release jars give the same error
jdkOpenJDK 25.0.3 (build 25.0.3+9-LTS)
osLinux aarch64 (the recorded checks ran on this platform only; the error comes from compile-time overload resolution)

Observed output

# the command above, main 645d4fe14a20, seed DEADBEEF, -ea (-da identical); lines in order, temp-dir prefix shortened, ... = test-framework notes / remaining runner frames
.../tempDir-001/Sample.java:8: error: method execute in class QualityBenchmark cannot be applied to given types;
    QualityStats stats[] = qrun.execute(maxResults, judge, submitLog, logger);
                               ^
  required: Judge,SubmissionReport,PrintWriter
  found:    int,Judge,SubmissionReport,PrintWriter
  reason: actual and formal argument lists differ in length
1 error
...
There was 1 failure:
1) testOverviewExecuteCallCompiles(org.apache.lucene.benchmark.quality.TestQualityPackageSample)
java.lang.AssertionError: expected:<0> but was:<1>
	at __randomizedtesting.SeedInfo.seed([DEADBEEF:B8371FF647951C59]:0)
	...
	at org.apache.lucene.benchmark.quality.TestQualityPackageSample.testOverviewExecuteCallCompiles(TestQualityPackageSample.java:50)
	...
FAILURES!!!
Tests run: 1,  Failures: 1

# the same test on the 10.6.0 release jars, -da: tests_run=1 failures=1, the same single diagnostic

Why it looks unintended

  • The page presents the block as "a sample code used to run" the TREC benchmark; it is the overview's only example, and nothing marks it as pseudo-code.
  • The 2008 change that removed the 4-argument execute (LUCENE-1116) updated QueryDriver and TestQualityRun but missed this page.
  • Lucene's own code calls setMaxResults(maxResults) and then the 3-argument execute.
The full argument217 words
  • Offered as working code. "Here is a sample code used to run the TREC 2006 queries 701-850 on the .Gov2 collection" (line 36), the package overview's only code block, with no pseudo-code marker.
  • History. 98fa2d898d1 (LUCENE-836, #1911, 2007-07-27) added the package and the sample together, and the sample matched the then-existing execute(int maxResults, Judge, SubmissionReport, PrintWriter); it compiles at that commit. 9e65cd554f2 (LUCENE-1116, #2193, 2008-01-03), whose issue description (not the commit message) lists "move control over max-docs-to-retrieve from benchmark constructor to a setter method (API change)" (in the parent's code the count was the first argument of execute, not a constructor argument), introduced setMaxResults(int) and the 3-argument execute, and updated QueryDriver and TestQualityRun, not the page. The sample compiles at the parent 40eb1cd53fd and fails at 9e65cd554f2.
  • A later fix pass missed it too. 647b5091697 (2012-09-12, "code snippet improvements: fix out of date api usage ...", on trunk; its branch_4x twin d8d5bf5e07d is the one in 4.0.0) rewrote the sample's reader lines for 4.0, kept the execute call and introduced the :.
  • No record accepts the old form. The recorded searches (as of 2026-11-01) found no issue, PR, list thread or Q&A post that uses or defends the 4-argument call; Stack Overflow answers about the package use the 3-argument execute.
The devil's-advocate check129 words

Strongest case for "not a bug": the block is illustrative; it uses an undeclared directory and has the : typo, so nobody can expect it to compile as is. The API change was deliberate, the error is loud and names the right signature, and the module is a developer tool whose real entry point is QueryDriver.

Why it fails: the undeclared directory is context a reader supplies, but no context makes a removed signature compile. A deliberate API change that leaves the package's only sample stale is a documentation defect, not intended behaviour; the same change updated the two other call sites. The packages are exported and published, and the page has no disclaimer. Every verifier and the adjudication called it real; it stays a Low documentation defect.

Suggested fix

Recommended Fix the two lines of the sample (validated)

Edit the sample (javadoc only): end the DirectoryReader.open(directory) line with ;, and replace the call with qrun.setMaxResults(maxResults); followed by qrun.execute(judge, submitLog, logger), as QueryDriver does. Validated by the recorded checks: the whole patched block compiles on main and 10.6.0, TestQualityRun passes, and the javadoc renders.

- *     IndexReader ir = DirectoryReader.open(directory):
+ *     IndexReader ir = DirectoryReader.open(directory);
@@
- *     QualityStats stats[] = qrun.execute(maxResults, judge, submitLog, logger);
+ *     qrun.setMaxResults(maxResults);
+ *     QualityStats stats[] = qrun.execute(judge, submitLog, logger);
All options and trade-offs4 options ยท 351 words

One fix was validated, with the diff applied to 645d4fe14a20; the alternatives were not run.

Fix the two lines of the sample (validated) (recommended)

Javadoc only, lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/package-info.java lines 41 and 65; mirrors QueryDriver.java:96-98.

- *     IndexReader ir = DirectoryReader.open(directory):
+ *     IndexReader ir = DirectoryReader.open(directory);
@@
- *     QualityStats stats[] = qrun.execute(maxResults, judge, submitLog, logger);
+ *     qrun.setMaxResults(maxResults);
+ *     QualityStats stats[] = qrun.execute(judge, submitLog, logger);

Trade-offs

None for users: documentation only, and no CHANGES entry is strictly needed. The block keeps its shape. It stays a fragment (it assumes directory and the imports, and closes neither the reader nor the files it opens), so a committer may reasonably prefer the QueryDriver pointer, a compiled {@snippet}, or deleting the sample. Backport: on 10.6.0 the block opens with <pre class="prettyprint"> (main's <pre><code class="language-java"> came with #15573), so the same two edits need new diff context.

What the checks validated

  • The whole block extracted from the patched file (which differs from 645d4fe14a20 only on lines 41 and 65), compiled by a one-test check: passes 1 of 1 on main with assertions on and off and on the 10.6.0 jars. The stock block fails the same check (';' expected), so the check detects the bug.
  • The minimal test with the fixed lines passes on main.
  • ./gradlew :lucene:benchmark:test --tests "org.apache.lucene.benchmark.quality.*" -Ptests.seed=DEADBEEF: TestQualityRun, 2 tests, 0 failures.
  • ./gradlew :lucene:benchmark:checkGoogleJavaFormat and :lucene:benchmark:renderJavadoc pass, and the rendered package page shows qrun.setMaxResults(maxResults); and the 3-argument execute.

Replace the sample with a pointer to QueryDriver (not run)

Shorter, and cannot go stale again.

Trade-offs

The overview loses its only inline example of the API; QueryDriver is a main() with argument parsing, a less direct read.

Re-add an execute(int maxResults, ...) overload (not recommended)

Makes the sample compile without touching it.

Trade-offs

Reverses a deliberate 2008 API change (LUCENE-1116) and adds API surface only to match stale docs.

Follow-up: compile-check javadoc examples

The generic wish of LUCENE-8488 (#9534, open), for example via the javadoc {@snippet} tag backed by compiled code.

Trade-offs

Would stop this class of drift, but it is a build-infrastructure change, not part of this fix.

Downstream note

Downstream: Lucene.NET's port of this page carries the same stale execute call and : typo, and nobody has reported it there either.

How it was found

No formal method. A probe compiled the code examples in package overviews against the main jars and hit this error; the hunt then reduced it to a one-test repro and checked every called signature in 22 release benchmark jars. Independent verifiers reproduced it with their own tests.

The method in full135 words
  • First signal. A probe compiled the page's sample (only the : read as ;) with javac against the stock main 645d4fe14a20 and 10.5.2 jars and got one error, the execute call (2026-10-29).
  • Hunt. A hunt unit for javadoc examples in the analysis, benchmark and backward-codecs modules reduced it to one in-process javac JUnit test and ran a class-file presence scan of every signature the sample calls over 22 release benchmark jars (2.3.0 to 10.5.2) and main.
  • Verification. An independent reproducer, a reviewer from another model family (OpenAI GPT-5.6) with a refute and an intended-behaviour lens, a devil's-advocate check, an adjudication and an audit (details under Independent checks).
  • History. The introducing commit was found by building the quality package from the sources of each commit around the API change and compiling the sample against it.

Prior reports, history and checks

Prior reports

No matching public report found: GitHub issues and PRs (with the migrated JIRA archive), commits, the dev@, java-user@, issues@ and commits@ lists, Stack Overflow, downstream repositories and the web were searched on 2026-10-29; re-checked 2026-11-01. qrun.execute and setMaxResults match no apache/lucene issue or PR, and no open PR touches the page.

Searches4 searches

Related, not reports: #2193 (LUCENE-1116) is the 2008 API change itself and never mentions the page; #1911 (LUCENE-836) added the then-correct sample; #10690 (LUCENE-9651) refreshed benchmark docs without touching this file; #9534 (LUCENE-8488) is a generic wish to compile javadoc examples; lucenenet#457 lists Lucene.NET's port of the page for a rewrite without identifying the defect.

Others file javadoc fixes often.

"New" means no matching public report was found in these recorded searches: GitHub keyword search does not cover PR diffs or review comments.

What was searched, when, and what turned up
WhereWhenHowFound
Scripted searches2026-10-2963 queries (GitHub issues, PRs and commits; downstream repositories; dev@, java-user@, issues@, commits@; the JIRA archive; the web; 53 before the web results were added) plus the finder's own earlier run (51 queries)only history items (#2193, #1911) and generic context
GitHub, manual2026-10-29QualityBenchmark, QualityStats, qrun, Gov2, "quality package", SubmissionReport, setMaxResults; GitHub-wide and in apache/lucenenet; changed files of all 412 open PRsno report; the Lucene.NET port carries the same stale call
Mailing lists, JIRA, Stack Overflow, web2026-10-29qrun.execute, execute(maxResults, QualityBenchmark, the exact call string; 10 emails, 3 questions and 4 answers readnothing; all user code uses the 3-argument execute
GitHub re-check2026-11-01qrun.execute, "setMaxResults", QualityBenchmark, "benchmark/quality" in apache/lucene issues and PRs; changed files of the 31 open PRs updated since 2026-10-29; the file on main, branch_11x, branch_10_6no report; three PRs touch only benchmark-jmh; lines 41 and 65 unchanged upstream. Two searches (QualityStats, is:pr is:open javadoc example) were run again the same day: QualityStats finds only #3923 and #2193, and the javadoc-fix PRs (#16949, #16936, #16904) touch no lucene/benchmark file

History

Stale since before the package's first release: LUCENE-1116 (9e65cd554f2, 2008-01-03) replaced execute(int maxResults, ...) with setMaxResults plus a 3-argument execute and missed the page; 2.3.0 already shipped that. A 2012 edit added the : typo. 2.2.0 has no quality package.

Versions tested5 rows
  • Added, then correct: 98fa2d898d1 (LUCENE-836, #1911, 2007-07-27) added the package and the sample; the 4-argument execute existed then.
  • Broken: 9e65cd554f2 (LUCENE-1116, #2193, author date 2008-01-03): the sample compiles at the parent 40eb1cd53fd and fails at this commit (quality package built from each commit's sources, against the 2.3.0 core jar: an isolation check, not a full historical build).
  • Touched, not fixed: 647b5091697 (2012-09-12, on trunk; its branch_4x twin d8d5bf5e07d shipped it in 4.0.0) rewrote the reader lines, kept the call and introduced the :; ac5e4dd3373 (LUCENE-6224, 5.1.0) converted package.html to package-info.java; 378ca8d1bbf (#15573, 2026-01-15) changed only the code-block tag.
  • branch_10x was decommissioned upstream on 2026-10-29 (#16911), which removed the file there; that is not a fix.
Versions and branches executed, with results
Version or commitVerdictResult
main 645d4fe14a20; upstream main f815e679bf6c affectedfails with the single error, -ea and -da (upstream main read, not run: lines 41 and 65 unchanged)
10.6.0 affectedfails with the single error (release jars, -da)
10.0.0, 10.5.2, 9.12.3 affectedfails with the single error
2.3.0, 3.6.2, 4.0.0, 8.11.4, 9.0.0 affectedfails at the execute call (3.6.2's older text has two more errors)
2.2.0 no such packagenot affected: the quality package does not exist there

Independent checks

A finder, an independent reproducer, a reviewer from another model family (OpenAI GPT-5.6) with lenses, a devil's-advocate check, an adjudication and an audit. All found it real; the adjudication confirmed it with high confidence as a Low documentation defect.

Checks and verdicts226 words

The refute review executed code (on main ea57360912ed, whose lucene/benchmark is identical to 645d4fe14a20). The intended-lens reviewer could not run code; a separate re-run of the repro and the fix check gave it the results to read.

Each independent check and its verdict
CheckVerdictWhat it found
Finder reproduced (doc)Compile check plus a class-file scan of 22 release benchmark jars: fails on main (-ea, -da), 10.5.2 and 9.12.3; the fix check passes.
Refute lens (OpenAI GPT-5.6) real, highOwn JUnit and a corrected control on main ea57360912ed (-ea, -da, several seeds; same lucene/benchmark as 645d4fe14a20); ran TestQualityRun; checked 2.3.0.
Reproducer real (doc, Low)Own test: fails on main (-ea, -da), 10.5.2 and 9.12.3 with the same single error.
Intended lens (OpenAI GPT-5.6) real, highIntended argument weak. The reviewer read only; a separate run re-ran the repro (fail) and the fix check (pass) on main.
Devil's advocate real (Low)Re-ran on main (-ea, -da) and 10.5.2; javap on the 2.3.0 jar shows only the 3-argument execute.
Adjudication and audit confirmed (high), LowRe-ran on main; the one-test repro fails and its fixed twin passes.
Brief verified; fix validatedMinimal test fails on main (-ea, -da) and on 10.6.0; the whole patched block compiles; the module's quality tests, format check and javadoc pass.

Diagram file

The diagram as a still image, generated with AI and checked against the code. It is under 10 MB, the limit for a GitHub attachment.

Sources and provenance

Finding record, Lucene and upstream sources, repro files and diagram notes1,344 words

Finding record

LFV-1040, snapshot of 2026-11-06

Registry title
The benchmark quality package overview's TREC sample calls qrun.execute(maxResults, judge, submitLog, logger), a 4-argument QualityBenchmark.execute that no release has ever had (maxResults moved to setMaxResults(int) in LUCENE-1116, before 2.3.0, the package's first release), so the sample has not compiled in any release (documentation defect)
Area
benchmark / search-quality package (quality/package-info.java: the package overview's TREC sample)
Priority
Low, rank 1256: A TREC sample in the opt-in benchmark quality overview has failed loudly at compile time since 2.3.0, with no runtime effect.
Impact class
minor
Impact note
Documentation only, with no runtime effect: anyone who starts a search-quality evaluation from the opt-in benchmark module's quality package overview and copies its TREC sample gets a compile error on main and on every release since 2.3.0 (2008); javac names the correct 3-argument signature, the in-tree QueryDriver shows the right calls, and nothing wrong ever runs.
Summary
You start a search-quality evaluation from the benchmark quality package overview, which presents its code block as 'a sample code used to run the TREC 2006 queries 701-850 on the .Gov2 collection', and expect it to compile against the package's API. It does not, on main or on any release since 2.3.0: the sample calls qrun.execute(maxResults, judge, submitLog, logger), but QualityBenchmark has only execute(Judge, SubmissionReport, PrintWriter) and takes the result count from setMaxResults(int), so javac rejects the call (the DirectoryReader.open line also ends with ':' instead of ';'). The API change was deliberate (LUCENE-1116, 2008) and the in-tree QueryDriver does it right (setMaxResults, then the 3-argument execute); only the page was never updated.
Introduced
9e65cd554f2e (LUCENE-1116 = #2193 'contrib.benchmark.quality package improvements', Doron Cohen, svn era, no PR, author date 2008-01-03) replaced execute(int maxResults, Judge, SubmissionReport, PrintWriter) with execute(Judge, SubmissionReport, PrintWriter) plus setMaxResults(int) ('move control over max-docs-to-retrieve from benchmark constructor to a setter method (API change)'), and updated QueryDriver and TestQualityRun but not the package.html sample [exec: the sample compiles at 98fa2d898d1, a614f0d99a6 and 40eb1cd53fd (the parent) and fails at 9e65cd554f2, with the quality package built from each commit's sources against the 2.3.0 core jar]. The sample was added, then correct, by 98fa2d898d1 (LUCENE-836 = #1911, 2007-07-27). 647b5091697 (2012-09-12, 'code snippet improvements: fix out of date api usage', first in 4.0.0) rewrote the sample's reader lines, left the execute call and added the ':' typo on main line 41 [read: git log -S and git show in the full-history clone]. (2008-01-03 (9e65cd554f2, author date); the ':' typo 2012-09-12 (647b5091697))
First affected version
2.3.0 [exec], the first release with the quality package; it already contains 9e65cd554f2, so no release ever shipped a compiling version of the sample (it compiled only on trunk, 2007-07-27 to 2008-01-03)
Affected versions
every release from 2.3.0 to 10.6.0 (10.6.0 = branch_10_6 4ae946e5a9b [exec 2026-11-01: the minimal test fails on the 10.6.0 release jars, lucene-benchmark-10.6.0.jar included, with the execute error]), main 645d4fe14a20 and upstream main a518d9ae1777 (2026-10-29); not fixed upstream. [exec: the page's own text of each era compiled against that release's jars fails with the execute error on 2.3.0, 3.6.2 (plus two errors of the 2.3-era text), 4.0.0, 8.11.4, 9.0.0, 9.12.3 (-ea and -da), 10.0.0, 10.5.2 (-ea and -da) and main (-ea and -da); 2.2.0 has no quality package] [read: all 141 release tags in the history clone that have the package carry the exact line and only the 3-argument execute; a class-file scan of 22 release benchmark jars, 2.3.0 to 10.5.2, finds no execute(int, ...) overload; the 10.6.0 RC1 page and QualityBenchmark.execute equal main's (the RC jar set has no benchmark jar); upstream main read]. branch_10x was decommissioned upstream on 2026-10-29 (#16911), which removed the file there; that is not a fix. Not new in 10.6. Caveat: all runs used JDK 25 on Linux aarch64; the 2007-2008 commit-level runs compile against the 2.3.0 core release jar.
Status
documented (brief, checks and a per-finding doc exist)
Verification
Confirmed by AI-run checks: an independent repro, a cross-model review that agreed, an intended-behaviour check, a prior-report search and a skeptical audit; not yet triaged by a person.
Found by
non-formal
Upstream and prior reports
none found (searched 2026-10-29): a scripted search with 63 queries (GitHub issues and PRs 22, commits 3, downstream 2, dev@/java-user@/issues@/commits@ 20, JIRA archive 6, web 10; 335 distinct hits, 0 high) plus the finder's 51-query run; manual GitHub searches (QualityBenchmark, QualityStats, qrun, Gov2, 'quality package', SubmissionReport, benchmark quality javadoc, items created since 2026-10-27, the parallel javadoc-fix authors); the changed-file lists of all 412 open apache/lucene PRs (newest #16943); hand-run JIRA queries; lists.apache.org searches with 10 emails read; Stack Overflow (3 questions and 4 answers read, all using the correct 3-argument execute) and the web. The independent reproduction's, the intended-behaviour check's and the adjudication's searches found nothing either. Recheck (2026-10-29): six GitHub searches (incl. everything created since a recent cutoff) find nothing new; none of the 25 open PRs updated since 2026-10-28 touches benchmark/quality; the page's latest commit on main is still 378ca8d1bbf (#15573, author date 2026-01-15, wrapper tag only) and upstream main a518d9ae1777 still has lines 41 and 65 as on 645d4fe. Closest items, not reports: #2193 (LUCENE-1116, the 2008 API change itself; it never mentions the page), #1911 (LUCENE-836, which added the package and the then-correct sample), #10690 (LUCENE-9651, a benchmark doc refresh via #759 that did not touch this file), #9534 (LUCENE-8488, a generic proposal to compile javadoc examples) and lucenenet#457 (Lucene.NET's port carries the same stale sample and lists the file for a .NET rewrite without identifying the defect). Not fixed upstream.
Lucene commit tested
main 645d4fe14a20 (2026-10-28): the minimal test fails with assertions on and off (standalone, with a plain javac/java command); the 10.6.0 release jars give the same single error; eight releases from 2.3.0 to 10.5.2 (2.3.0, 3.6.2, 4.0.0, 8.11.4, 9.0.0, 9.12.3, 10.0.0, 10.5.2) were run in the version-history runs (and the introducing commit against its parent), and the source of all 142 release tags with the package was read; the fix was checked (recorded checks) with the diff applied to 645d4fe14a20 (the whole patched block compiles on main and on 10.6.0; TestQualityRun passes, 2 tests; ./gradlew :lucene:benchmark:checkGoogleJavaFormat and :lucene:benchmark:renderJavadoc pass, and the rendered package page shows the corrected lines). Upstream main f815e679bf6c (2026-11-01) was read, not run: lines 41 and 65 are unchanged.

Lucene and upstream sources

Finding record
  • lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/package-info.java:36 ('Here is a sample code used to run ...'), :38-70 (the block), :41 ('DirectoryReader.open(directory):'), :65 ('qrun.execute(maxResults, adjudication, submitLog, logger)')
  • lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/QualityBenchmark.java:96 (execute(Judge, SubmissionReport, PrintWriter)), :167 (setMaxResults(int)); quality/trec/QueryDriver.java:96-98 and lucene/benchmark/src/test/org/apache/lucene/benchmark/quality/TestQualityRun.java:82-86 (setMaxResults, then the 3-argument execute); lucene/benchmark/src/java/module-info.java:39-41 (the quality packages are exported)
The finding in 30 seconds
  • a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/package-info.java:36, :38 (<pre><code>), :41 (':'), :44, :63-65, :70
  • a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/QualityBenchmark.java:63-64 (maxResults, Default: 1000), :96 (execute(Judge, SubmissionReport, PrintWriter)), :106, :167 (setMaxResults)
  • a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/trec/QueryDriver.java:96-98; lucene/benchmark/src/test/org/apache/lucene/benchmark/quality/TestQualityRun.java:82-86
  • a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/module-info.java:39-41 (quality, quality.trec, quality.utils exported)
Minimal repro
  • a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/package-info.java:44, :64, :65 (the three lines in the test, verbatim)
Why it looks unintended
  • a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/package-info.java:36-70
  • a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/trec/QueryDriver.java:96-98; lucene/benchmark/src/test/org/apache/lucene/benchmark/quality/TestQualityRun.java:85-86
Suggested fix
  • a Lucene main checkout (645d4fe14a20) lucene/benchmark/src/java/org/apache/lucene/benchmark/quality/trec/QueryDriver.java:96-98
  • a Lucene clone: releases/lucene/10.6.0 package-info.java:38 (<pre class="prettyprint">); 378ca8d1bbf (#15573) is not in 10.6.0 (git merge-base --is-ancestor)
History
  • a Lucene clone: releases/lucene/10.6.0 package-info.java:41, :65 and QualityBenchmark.java:96, :167 (read)
Independent checks
  • a Lucene clone: git diff ea57360912ed 645d4fe14a20 -- lucene/benchmark (empty)

Other statements trace to the hunt's working files (models, logs, reviews and briefs), which are not published.

Repro files

About the diagrams

Six steps and a summary card (about 83 s), drawn from compiles executed on main 645d4fe14a20: the verbatim block (';' expected at line 41), the block with only the : fixed (the single execute error) and the patched block (compiles); every drawn fact is asserted against snapshots of the code and the run records. The PNG is the summary frame.

Built 2026-11-06 from the hunt's record of this finding and its doc file. Lucene main under test in this hunt: ea57360912ed. Every listed finding was re-run on Lucene main e1faeba08bde on 2026-11-02.