Skip to content

Remove dead capture arm, fix the name-scan benchmark, make two messages say the fix - #310

Merged
electricessence merged 6 commits into
masterfrom
refactor/rc18-internal
Dec 3, 2026
Merged

electricessence merged 6 commits into
masterfrom
refactor/rc18-internal

Conversation

@electricessence

Copy link
Copy Markdown
Collaborator

Internal changes, no public API change.

  • Removes ICaptureSource.Arm and CaptureSource.Arm; the capture claim calls TryArm directly.
  • The two-argument QueryCore of a definition's call becomes a default parameter (options = QueryOptions.None) on the three-argument one. Callers resolve as before.
  • Drops the captured local in the bound-call capture helper. The call is built in the same order (the capture is constructed before WithCapture), which nothing can observe.
  • Fixes TextNameScanBenchmarks: it looked for a name-set constructor of one or two parameters and called Match without its third argument, so its setup threw. It now fills every parameter after the names with its default and passes a null subject. A dry run (in process, all eight parameter combinations) completes all 40 runs; no timed numbers were taken.
  • Two exception messages now say what is wrong and the fix, each with one wording: a blank command text from a query definition ("Pass the SQL text or the name of the stored procedure.", through one DbQuery.Checked that the command's own check calls), and taking a single connection that is still in use (wait for the running call, or create the command from a connection factory or pool; one constant used by the provider and the command's guard). Only the text of these two exceptions changes. A new test pins the provider's message; the test constants for the same fact became one.

Cost: the blank-command check is one extra static call at command construction, not per row. Nothing else changes at run time.

Verification: solution Release and Debug (VS MSBuild) 0 warnings, 0 errors; Core.Tests 16154 passed with the generator on, 16133 passed and 16 skipped with it off; 267 sample checks passed; 28 style and analyzer checks 0 findings; docfx 0 warnings. Generator.Tests were 189 passed on the previous commit; the last commit is layout only and does not touch the generator.

Reviews: swarm on correctness (no defect) and on the project rules (layout findings applied in the last commit).

🤖 Generated with Claude Code

electricessence and others added 6 commits December 3, 2026 13:08
…esult

The capture source interface and its one implementation had both TryArm and
Arm, which did the same compare-exchange; Arm only dropped the result. The
claim of a capture set now calls TryArm for the captures after the first and
discards the result. Same compare-exchange per claim; one interface member and
one method fewer. Internal types only, no public API change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…an overload

The two-argument QueryCore for a call made from a definition only forwarded to
the three-argument one with no options. The three-argument one now takes
options with a default of none, and the forwarding overload is gone. Every
caller passes a call, so overload resolution is unchanged. Compile time only;
no run-time cost. Internal type, no public API change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The shared helper behind the capture methods of a bound call built the call
into a local, set the out parameter, and returned the local. It now sets the
out parameter and returns the call directly. The call is built the same way;
nothing is allocated or read differently. Public signatures unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The benchmark reaches the internal name set through expressions. It looked for
a name set constructor with one or two parameters, but the constructor takes
three (the names, where a procedure's set is kept, and its key), and the match
call left out the third argument (the subject of an ambiguity message). Both
expressions threw when the benchmark's setup ran. The constructor call now
fills every parameter after the names with its default, and the match call
passes a null subject. A dry run of the benchmark class (the Dry job, in
process, all eight parameter combinations, five benchmarks each) now completes
all 40 runs, which includes the setup check that every path finds the same
names. No timed numbers were taken. Benchmark project only; no library change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… each

Two exception messages said what was wrong but not what to do, while the same
condition raised elsewhere in Core already said the fix.

A blank command text from a query definition now says "Pass the SQL text or the
name of the stored procedure.", as the command constructors do. Both now go
through one check (DbQuery.Checked, which the command's own check calls), so the
wording and the null and blank behavior live in one place.

Taking a single connection that is still in use from the connection provider
now says to wait for the running call to finish, or to create the command from
a connection factory or pool. The provider and the command's own guard use one
constant for the text.

The test constants that pinned the old definition text now pin the one wording
(the two constants for the same fact became one), and a new test pins the
provider's message. Only the text of two exceptions changes; no run-time cost,
no public API change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t rules

Layout only; no behavior change. The shared connection-use message and the
blank command message are split into joined literals at phrase breaks (same
text), the throws that use them are wrapped and braced, and the tests that pin
them split their literals the same way while still asserting the full text. The
benchmark's constructor-argument chain now follows the one call per line rule
from the second call on, its comments are wrapped, and a comment on Run that
repeated the header is removed. The options doc line of the query core is
wrapped.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@electricessence
electricessence merged commit 5ee235f into master Dec 3, 2026
9 checks passed
@electricessence
electricessence deleted the refactor/rc18-internal branch December 3, 2026 21:44
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