Skip to content

test: add a second held-out sample to the benchmark - #61

Merged
sergiparpal merged 1 commit into
mainfrom
test/benchmark-second-held-out
Nov 3, 2026
Merged

sergiparpal merged 1 commit into
mainfrom
test/benchmark-second-held-out

Conversation

@sergiparpal

Copy link
Copy Markdown
Owner

Summary

The benchmark gets a second held-out split. The first one was measured after the 0.16.0 corrections and its disagreements were read, so benchmark/README.md requires a fresh one before the next correction is designed.

  • Sample: run_benchmark.py propose drew six pull requests each from encode/django-rest-framework, jd/tenacity, urllib3/urllib3, agronholm/anyio, and pypa/packaging. The libraries were chosen to reach the categories no label named, authorization and retry/timeout, and those named least, boundary and ordering. The pull requests themselves were not chosen by hand, and the analyses propose leaves beside the clones were deleted unread.
  • Labels: Claude Opus 5.5 labeled the 89 Python symbols they change outside the tests before reading the analyzer's output on them. sergiparpal then reviewed every label on a page that showed each symbol's diff and never the analyzer's findings, keeping 73 and correcting 16. The commit body gives each correction with its reason.
  • Coverage: of the 44 behavior changes, 9 name retry_timeout_change, which no label named before, 2 name boundary_change, and 1 names ordering_change. None touches authorization.
  • Splits: the new cases are the held_out split, and the first held-out cases join development, which now has 60.
  • Rules: benchmark/README.md adds the two rules the review settled. A function is labeled with the functions nested in it, as the analyzer reads it. Every Python file outside the tests is labeled, benchmarks and noxfile.py included.

docs/benchmark.md now says its results are the first round's and that the new split has not been measured. These labels are committed before any measurement on them; measuring 0.16.0 on the new split comes next, in its own pull request. CHANGELOG.md gains an Unreleased entry and tests/unit/test_benchmark.py counts 60 development cases.

No analyzer code, schema, golden, or security behavior changes.

Commands run

  • python -m pytest --cov=semantic_diff_weaver --cov-branch --cov-report=json:coverage.json: 1689 passed, 1 skipped
  • python scripts/check_coverage.py coverage.json
  • python -m ruff check . && python -m ruff format --check .
  • python -m mypy
  • python scripts/check_action_pins.py
  • python -m build && python scripts/verify_wheel.py dist
  • python scripts/run_benchmark.py propose --repo ... --count 6, for the sample; no measurement was run on it

🤖 Generated with Claude Code

The first held-out split was measured after the 0.16.0 corrections and
its disagreements were read, so by benchmark/README.md a fresh one must
be labeled before the next correction is designed. This adds it.

run_benchmark.py propose drew six pull requests each from
encode/django-rest-framework, jd/tenacity, urllib3/urllib3,
agronholm/anyio, and pypa/packaging, chosen to reach the categories no
label named, authorization and retry/timeout, and those named least,
boundary and ordering; the pull requests themselves were never chosen
by hand, and propose's analyses beside the clones were deleted unread.
Claude Opus 5.5 labeled the 89 Python symbols they change outside the
tests, found from the Git objects with its own ast walk, before reading
the analyzer's output on them. sergiparpal reviewed every label on a
page that showed each symbol's diff and never the analyzer's findings,
kept 73, and corrected 16. Of the 44 behavior changes, 9 name
retry_timeout_change, 2 boundary_change, and 1 ordering_change; none
touched authorization, which stays unlabeled.

The new cases are the held_out split; the first held-out cases join
development, which has 60. Every new case's reviewed_by names the
reviewer, sampled_from gains the five repositories, and the annotation
says how both samples were labeled. tests/unit/test_benchmark.py counts
60 development cases. benchmark/README.md describes the splits and adds
two rules the review settled: a function is labeled with the functions
nested in it, as the analyzer reads it, and every Python file outside
the tests is labeled, benchmarks and noxfile.py included.
docs/benchmark.md says its results are the first round's and that the
new split has not been measured yet; the labels are committed before
any measurement on them. No analyzer behavior changes.

Each correction and its reason, as the reviewer gave it:

- encode/django-rest-framework#10021
  ModelSerializer.get_unique_together_constraints: adds boundary and
  validation. Besides widening the yielded tuples, the selection
  changes: more than one field in constraint.fields was required, and
  now at least one field and more than one in the union with the
  condition's fields, so a single-field constraint conditioned on
  another field is included; the cardinality limit and the constraints
  that reach validation change.
- encode/django-rest-framework#10021 get_unique_validators: adds
  boundary. A UniqueValidator is produced only when the field and the
  condition's fields together have exactly one element, an explicit
  cardinality condition deciding when the validator is generated.
- jd/tenacity#741 BaseRetrying._run_wait and AsyncRetrying._run_wait:
  add error handling and default behavior. The implicit zero wait no
  longer covers every falsy value: the constructor normalizes None and
  values equal to 0, but an empty string or list reaches here and
  raises TypeError when called, where it meant no wait.
- jd/tenacity#645 Retrying.__call__ and AsyncRetrying.__call__: add
  state transition and output contract. With enabled=False the first
  attempt's result is returned, where a policy retrying on the result
  could return a later, different one; begin() and the retry
  statistics are skipped, which changes observable state.
- urllib3/urllib3#5083 HTTPResponse._init_length: adds error handling.
  A value int() took, such as +42, now falls back to length=None, and a
  Content-Length such as "+1, 2", which raised InvalidHeader for
  differing lengths, now falls back through ValueError.
- urllib3/urllib3#5083 HTTPResponse._update_chunk_length: adds error
  handling, state transition, and side effect. Sizes such as +A or 0xA
  became a chunk size; now they are rejected, close() is called, and
  InvalidChunkLength is raised, closing the response's resources.
- urllib3/urllib3#5330 PoolManager.urlopen: adds error handling and
  dependency interaction. default is now passed to Retry.from_int and
  sleep_for_retry is called, which parses Retry-After and can raise
  InvalidHeader on a malformed value where the redirect was followed
  without parsing it. sleep_for_retry does not check
  respect_retry_after_header, so the rationale no longer implies it.
- agronholm/anyio#1447 groupby: adds ordering. The comparison of keys
  is reversed, next_key != group_key before and, after an identity
  check, group_key == next_key now, so the method called changes, which
  matters with asymmetric comparisons or observable effects.
- agronholm/anyio#1443 MemoryObjectReceiveStream and
  MemoryObjectSendStream: add output contract. The new _waiters field
  is a dataclass field without repr=False, and eq=False does not turn
  the repr off, so the generated __repr__ now includes it.
- agronholm/anyio#1424 SocketStream.receive: adds side effect and
  dependency interaction. The finally also calls
  transport.pause_reading() when the wait ends by cancellation or an
  exception, a call to the transport that affects incoming data.
- agronholm/anyio#1410 BlockingPortal._call_func: adds dependency
  interaction. future.cancelled() gives way to the
  set_running_or_notify_cancel() protocol, which reserves the future's
  state atomically or notifies the cancellation.
- pypa/packaging#1460 TimeSpecSuite.setup: adds error handling. A
  parametrized benchmark's call that raised TypeError for its argument
  count now enters the method.
- agronholm/anyio#1358 TypedAttributeSet.__init_subclass__: adds error
  handling, settled from the reviewer's case note: a subclass whose
  public attribute is annotated in a superclass no longer raises
  TypeError.

Settled and kept: jd/tenacity#696 and #679 retry keep their categories,
the analyzer reading a function with the functions nested in it, as
werkzeug#3329's run_wsgi was labeled with run_wsgi.execute.

Rationales: twelve corrected labels' rationales now say what their
categories describe; the others already did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Semantic Diff Test Brief

Verdict: pass · Overall risk: low (0/100) · Confidence: 100%
Scope: 0/5 changed file(s) analyzed, 0 changed symbol(s), 0 omitted item(s), 5 excluded file(s).
Excluded files: 1 outside the configured include and exclude paths · 1 test file(s) left out by analyze_test_files: false · 3 not Python.

Inferred behavior changes

No reportable behavior change was inferred from the bounded static evidence.

Prioritized test obligations

No test obligations were generated.

Tests to run

The whole suite:

  • Tests may read changed files that are not Python: benchmark/README.md, benchmark/cases.json.

Limitations

  • Candidate test mapping is static and does not prove runtime coverage.
  • Only committed Python source at the resolved refs was inspected.
  • Repository code and tests were not imported, executed, built, installed, or modified.
  • The bounded diff contained no included changed Python source or API schema.

Advisory static analysis only: no tests or repository code were executed, and candidate test mappings do not verify runtime coverage.

@sergiparpal
sergiparpal merged commit 58e8505 into main Nov 3, 2026
12 checks passed
@sergiparpal
sergiparpal deleted the test/benchmark-second-held-out branch November 3, 2026 21:09
sergiparpal added a commit that referenced this pull request Nov 3, 2026
The second held-out split's labels are on main (#61), so 0.16.0, the
analyzer unchanged since its tag, is measured on the splits as they now
stand, before any correction is designed from the development cases.

Development, the first round's two splits together: 30 of 76 behavior
changes get a finding in an expected category, 32 of 84 findings
naming a category are right, and 28 of 71 unchanged symbols get a
finding. These are the first round's two 0.16.0 columns added up,
which checks the setup.

Held out, the 30 cases of encode/django-rest-framework, jd/tenacity,
urllib3/urllib3, agronholm/anyio, and pypa/packaging: every one of the
44 behavior changes gets a finding, 16 in an expected category; 16 of
the 50 findings naming a category are right; and 18 of the 29
unchanged symbols get a finding, 7 of them one naming a category. No
finding falls on an unlabeled symbol, so the labels cover every symbol
the analyzer reports.

Evaluation: for the held-out split only these measures are recorded.
Its findings by category and by case, and its disagreements, were not
printed and stay unread until a correction designed from development
is measured on it, so that nothing read from it shapes that
correction; the analyses run_benchmark.py leaves beside its clones
were deleted unread.

docs/benchmark.md gains the baseline ahead of the first round's
results and counts ninety pull requests from fifteen libraries;
CHANGELOG.md's entry for the split records the baseline. No analyzer
behavior changes.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
sergiparpal added a commit that referenced this pull request Nov 4, 2026
§24's benchmark item and §26's sixth question still described the
benchmark as it stood before its review and its second held-out split:
60 pull requests from ten repositories, labels awaiting review.

The benchmark now holds 90 pull requests from fifteen repositories, 30
of them the held-out split for the analyzer's next change, and a person
reviewed every one of its 251 labels, which a model wrote, correcting
42 (#58, #61). §24's item says so, and the roadmap's status date moves
to 2026-11-04; the release is still 0.16.0. §26's sixth question is
answered with the same facts, so all eight questions are.

Documentation only: no analyzer, schema, golden, or evaluation change.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@sergiparpal sergiparpal mentioned this pull request Nov 4, 2026
sergiparpal added a commit that referenced this pull request Nov 4, 2026
Bump pyproject.toml, plugin.yaml, .claude-plugin/plugin.json, and
semantic_diff_weaver.__version__ to 0.17.0, and close the Unreleased
changelog section under a summary. A minor release for #58, #61, #65,
and #66: a person's review of the benchmark's 162 labels, a second
held-out split of 30 pull requests from five more repositories, and a
second round of corrections designed against the 60 development cases.
A callable's parameter annotations alone, a module's or a plain class's
annotations and type variables, and a module's version string read as
no change, under the new SDW-RULE-REFACTOR-ANNOTATIONS,
SDW-RULE-REFACTOR-TYPING, and SDW-RULE-REFACTOR-VERSION. Held out,
unchanged symbols given a finding fall from 18 to 14 of 29. Schema 1.5
and every golden are unchanged.

The uses: sergiparpal/semantic-diff-weaver@vX.Y.Z examples in README.md
and docs/github-action.md name v0.17.0, so check_action_pins.py
--verify-remote fails until that tag exists. The specification's
roadmap status names this release, and docs/benchmark.md names 0.17.0
for the second round's measurement.

docs/evaluation.md records the 0.17.0 re-measurement:
- the corpus figures are unchanged, and no golden changes.
- 1,753 tests pass at 98.08% coverage, with every critical module at
  least 90% in branches; ast_diff/ is at 96.94%.
- the performance fixtures take 0.02, 0.43, 0.57, 0.78, 0.47, and 0.74
  seconds across six runs. 0.16.0's code, timed beside them, took 0.02,
  0.41, 0.53, 0.78, 0.47, and 0.74: the full-service fixture pays about
  0.04 seconds for the walk 0.17.0 adds, once #66 made it one walk
  instead of three.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant