Repository navigation
Conversation
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 069041b1e0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
The required lookup silently misses explicitly annotated fields, ClassValue subtypes, and uncommitted contract uses. These omissions can leave contract violations out of the reviewer’s checklist.
🤖 Bits Code Review · Commit 069041b
70572f7 to
a3284cc
Compare
069041b to
9f3af05
Compare
There was a problem hiding this comment.
The required contract lookup omits staged and unstaged changes and fails to recognize subclasses of implied contract types such as ClassValue, leaving relevant declarations outside its mandatory review list.
🤖 Bits Code Review · Commit 9f3af05
4b608c0 to
c339477
Compare
9f3af05 to
30dd6d3
Compare
There was a problem hiding this comment.
The lookup silently skips staged and unstaged changes covered by the main workflow, and it omits ClassValue subclasses covered by the static-lifetime contract.
🤖 Bits Code Review · Commit 30dd6d3
The contract checks (#8-#10) fire on code that never names the annotation, and contracts.md listed the @NoEscape types by hand. That list was already stale: it was missing TagMap.Internals. Step 1b in SKILL.md now runs a lookup that prints: 1. each contract annotation and the type or method it marks, including the types @ImpliedFor lists, from files that import the annotations (so javax.inject.Singleton and similar are left out); 2. class-level fields and methods declared with a marked type, one hop; methods only match when qualified by their declaring class, since names like of() and next() are everywhere; 3. the added, non-comment lines of the diff that use either list. The reviewer checks every line in list 3 against contracts.md. It runs under bash explicitly, since it relies on word splitting. contracts.md drops its hand-kept lists, and #10 gains two rules: stay silent when a call can't be resolved to a marked type with confidence, and don't raise a flag-as-measure finding for the per-span core when its foreground is only inferred. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
c339477 to
df28da1
Compare
30dd6d3 to
01d5bda
Compare
There was a problem hiding this comment.
The lookup silently omits local Java edits included in the main review and fields declared with subclasses of implied-contract types. These omissions leave relevant contract checks dependent on incidental manual discovery.
🤖 Bits Code Review · Commit 01d5bda
The lookup now reads the working tree by default, as Step 1 does, and takes REV for a commit or PATHS for a direct review of files. It also: - expands the @ImpliedFor types to their subtypes; - recognizes annotated fields, including annotations on the same line; - matches calls through locals and parameters of marked types in the files under review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
The PR adds repository-based performance-contract discovery, and this update fixes the earlier omissions of uncommitted edits and implied-type subclasses. One issue remains in direct-file reviews: setting both REV and PATHS discovers contracts from the selected commit but scans working-tree contents, which can omit the intended code.
🤖 Bits Code Review · Commit 67fa53e
tooling/contract_lookup.py replaces the bash in SKILL.md Step 1b, with the same three lists and --rev / --paths / --diff-base options. Fixture tests cover the cases review found: implied subtypes, annotated fields, calls through locals and parameters, uncommitted edits, and file mode. A CI job runs them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
More details
The supplied revision covers the lookup gaps discussed in human review, including working-tree edits, implied subtypes, annotated fields, and local receivers. No actionable defect was identified through static inspection; execution remains unverified.
🤖 Bits Code Review · Commit 2410649
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
The PR adds contract-usage discovery and CI coverage, addressing earlier snapshot and discovery gaps. One confirmed issue remains: diff.noprefix=true makes the lookup silently omit all added-line hits; a localized suggestion forcing stable Git prefixes was verified against the reproduced failure.
🤖 Bits Code Review · Commit 364f2fc
With diff.noprefix, color.diff=always or an external diff, the "+++ b/" headers the lookup parses change and list 3 came back empty. The diff now passes explicit prefixes, --no-color and --no-ext-diff. A test sets diff.noprefix and color.diff in the fixture repo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
More details
The PR adds contract-usage discovery, review guidance, and CI coverage while addressing earlier snapshot and discovery gaps. The reported Git-prefix issue is fixed: added contract uses remain visible with diff.noprefix enabled and forced color, and no findings remain open.
🤖 Bits Code Review · Commit 05868bd
AlexeyKuznetsov-DD
left a comment
There was a problem hiding this comment.
I left a suggestion for running the lookup and its tests as Java 25 source files, along with three cases where the current lookup misses candidates.
| stage: tests | ||
| needs: [] | ||
| script: | ||
| - python3 -m unittest discover -s tooling/tests -p 'test_contract_lookup.py' |
There was a problem hiding this comment.
Could we move the lookup and its fixture tests to Java source launchers, following .gitlab/collect-result/CollectResults.java? Java 25 can run both the lookup and a sibling test entry point directly with java File.java, so the skill and CI can keep a one-command invocation with no Gradle build or separate compilation step. CI can use the tooling JDK through the existing .gitlab/java-utils.sh resolver.
The main benefit would be using JavacTask.parse() to read annotations, fields, and supertypes across line breaks. It can parse source without resolving the project's dependencies. We could keep Git for revision selection and diff ranges, and use Java's syntax trees for declaration discovery.
| decl = declaration_pattern(types, "=;(") | ||
| decl_re = re.compile(posix_to_python(decl)) | ||
| fields, methods = set(), set() | ||
| pattern = rf"(public|protected|private|static)[^=;(]*(^|[^A-Za-z0-9_.]){decl}" |
There was a problem hiding this comment.
Could the holder lookup include package-private instance fields? In a fixture with final Cache encodingCache and static final Cache SHARED_CACHE, the lookup surfaced Holder.SHARED_CACHE.encode() but omitted holder.encodingCache.encode() from the same @ForegroundSafe method in another file. Both calls directly reach the marked cache type. The modifier requirement here excludes the first field. I'd add this pair as a regression test.
| declaration = re.compile(r"\b(?:class|interface)\s+(\w+)") | ||
| while new: | ||
| names = "|".join(sorted(new)) | ||
| pattern = (r"(class|interface)[[:space:]]+[A-Za-z0-9_]+[^{;]*(extends|implements)[^{;]*" |
There was a problem hiding this comment.
The earlier subtype fix now catches same-line declarations. I reproduced a remaining case where class SplitNames and extends ClassValue<String> are on separate lines. An added field of type SplitNames stayed out of list 3, while a same-line control appeared. Could we cover this layout in the fixture suite and discover the full declaration? This is one case where the Java parser would help.
| yield path, number, line | ||
| return | ||
| path, number = None, 0 | ||
| for line in source.diff(base, MAIN).splitlines(): |
There was a problem hiding this comment.
Could we use a file-level scan when a diff removes a contract exemption? I tried removing only @Singleton from a class with a final instance field of a ClassValue subtype. The field then falls under check #9, but the branch scan returned no candidates because the hunk has no added lines. Scanning the same file with --paths surfaced the field.
Stacked on #13376 ("Rewrite perf-review checks in a Flag / Not when format (AI perf review)"), which is stacked on #13375 and #13373. Merge those first.
What does this PR do?
The performance-contract checks (#8
@NoEscape, #9@StaticLifetime, #10@BackgroundOnly) fire on code that never names the annotation. Examples are a field whose type is@NoEscape, or a call into a class marked@BackgroundOnly. Until now the reviewer had to notice those on its own, andcontracts.mdlisted the@NoEscapetypes by hand. That list was already stale: it was missingTagMap.Internals.Step 1b in
SKILL.mdnow runstooling/contract_lookup.py, which prints three lists:@ImpliedForlists onStaticLifetimeand their subtypes (QualifiedClassNameCache,Codecand others extendClassValue). Only files that import the contract annotations count, sojavax.inject.Singletonin the Play smoke tests is left out.TraceMapperV0_4.TAG_CACHE(aSimpleUtf8Cache). Methods only match when qualified by their declaring class (SubSequence.of(), because names likeof()andnext()are everywhere.--pathsfor a direct review. In those files, a call through a local or parameter of a marked type (cache.getUtf8(...)) counts too.The reviewer checks every line in list 3 against
contracts.md, however large the diff is. A hit is a place to look, not a finding. The lookup reads the working tree by default, including uncommitted edits, so it covers the same code as Step 1;--revscans a commit instead.The lookup is a standard-library Python script rather than a shell snippet in
SKILL.md, so an agent runs one short command and its behavior doesn't depend on the shell.tooling/tests/test_contract_lookup.pybuilds a small fixture repository and covers implied subtypes, annotated fields, calls through locals and parameters, uncommitted edits versus--rev, and--paths. A newtest-perf-review-toolingCI job runs it.contracts.mddrops its hand-kept lists and points at the lookup. #10 gains two rules:How was this checked?
The fixture tests above cover the lookup itself. On this repository, the script's output matches the earlier bash version's line for line.
The blind cross-check can't test this, because its reviewers have no repository. Instead, with the earlier bash version of the lookup, I made three throwaway local probe commits (not pushed) and reviewed each with this skill and with #13376's skill, two reviewers each, with the repository available.
TagMap.Internalsin a field, callsSimpleUtf8Cacheper span)TAG_CACHE.getUtf8), plus a call through the unmarkedEncodingCacheinterfaceTAG_CACHElineTAG_CACHEcalls in a 1,580-line diff: one on the application thread, one on the serializer threadTAG_CACHElinesWhat changed:
git grep.What this does not yet show is a reviewer missing a contract use that the lookup catches. In the third probe, the 1,570 re-added lines were byte-identical to an earlier commit, so every reviewer skipped them and the real change was 10 lines. The case this is meant for, a large diff of genuinely new code, is still untested.
The lookup found nothing in the 1,570 lines of real code it scanned, apart from the planted calls. Before restricting method matches to qualified calls,
ofandnextgave 77 false matches on the same diff.Limits
tags.internals()is missed. TheTagMap.Internalsfield declaration that refactoring skel #8 checks is still found.Follow-ups
invokevirtual SimpleUtf8Cache.getUtf8orgetstatic TraceMapperV0_4.TAG_CACHE:LSimpleUtf8Cache;. Runningjavap -c -pon the changed classes would find uses with no name collisions and handletags.internals(). It needs compiled, current classes, so it would be a preferred path with this grep lookup as the fallback.roadmap.mdnotes. They see the same resolved types at compile time and make this lookup unnecessary.🤖 Generated with Claude Code