Skip to content

Tracking: 2026-07 multi-perspective deep review findings (performance, generator, tests, tooling) #320

Description

@DJGosnell

Master tracking issue for the 2026-07-07 multi-agent deep review of the entire Quarry system (runtime, generated code, source generator, tests, benchmarks, analyzers, migration tooling, CLI). Eight reviewer agents covered fundamentally different perspectives; every critical/high finding was independently adversarially verified (attempted refutation with code evidence; several reproduced end-to-end against the built generator or the published nupkg).

Review verdict summary

Perspective Grade Perspective Grade
Runtime hot-path performance A- Runtime API & public surface B+
Generated code quality B+ Test suite B+
Benchmark methodology B+ Generator architecture B-
Generator warm-build performance C+ Tooling (analyzers/convert/CLI) C-

Headline: the runtime hot path genuinely earns the Dapper-competitive claim (one carrier allocation per chain, static SQL, typed-ordinal readers, [UnsafeAccessor] extraction — verified against real generated output). The critical defects cluster in the conditional-mask model (the one place the fail-loud philosophy breaks), the generator's incremental-caching seams, and the tooling periphery.

Reviewer note: the "stale generated entities on schema edit at design time" finding was assessed as not an issue for this project — Quarry is operated as a build-time generator (per-edit regeneration would be too slow on large codebases). The underlying schema-parse structure work is folded into #309 as build-time efficiency.

Tracked issues

Correctness (fix first)

Performance (the paramount goal)

API & feature gaps

Guardrails

Tooling

Maintainability

Suggested ordering

  1. Conditional clause mask model: unconditional Limit/Offset/Distinct + runtime crash on else-if / multi-clause branches #307 (silent wrong results / crashes on documented flagship pattern) and the two quick wins in Runtime hot-path fixes: IN-cache hash collision, per-row NavigationList allocation, OpId gating, ConfigureAwait, RawSql mapper caching #308 (IN-cache exact-length check, NavigationList singleton).
  2. Migration model duplication drift: diverged builders + SnapshotCompiler whitelist silently degrade migrate add/diff to an empty baseline #313 immediate CLI bug fix + Diagnostic pipeline reliability: bind-stage QRY900 drain-discarded, deferred-diagnostic registry silently drops unregistered IDs (3rd occurrence), ThreadStatic trace/cancellation hazards #311 registry fail-loud (small changes, close silent-failure classes).
  3. Test suite guardrails: hollow incremental-caching tests, no perf regression gate, concurrency insurance, row-order flakes, manifest goldens, streaming/cancellation #314 incremental-caching test rewrite + perf gate — the guardrails that catch regressions from everything else.
  4. Transaction support: no BeginTransaction API, DbCommand.Transaction never assigned, dead defaultIsolation parameter #312 transactions (adoption blocker), Display-class prediction robustness: stale UnsafeAccessorType names on cross-partial ordinal shifts; generic containing types/methods unguarded (runtime TypeLoadException) #310, Generator warm-build performance: incremental caching seams defeat per-edit granularity (Stage 2.5/emission CompilationProvider combines, schema-parse walks, discovery predicate, Collect barrier) #309.
  5. QRA analyzers & code fixes: CodeFixes nupkg packs to lib/ (fixes dead for consumers), QRA402 fires on every query, QRA201 fix breaks code, dead rules, analyzer perf #316/QRM conversion & CLI safety: nonexistent Sql.Like, Sql.Raw placeholder corruption, hardcoded db. receiver, destructive migrate remove/squash ordering #317 tooling pass, Benchmark methodology: throughput bypasses the carrier path (stale QRY032 claim), cold-start measures warm caches, PreparedQuery/streaming/large-result/concurrency unmeasured #315 benchmark corrections, Generator IR maintainability: RawCallSite copy-method divergence drops CTE metadata (bug), AnalyzeChainGroup god-method, decentralized dialect logic with permissive defaults #318 refactors, Runtime API polish: inconsistent exception wrapping, dead TypeMappingRegistry, Quarry.Index collision, joined-builder GroupBy/Having gap, silent unloaded NavigationList, doc drift #319 polish.

Cross-cutting themes to keep in mind

  1. Recurring structural patterns generated repeated bugs: the stringly-typed deferred-diagnostic registry (3 occurrences), hand-maintained copy methods (CTE drop), duplicated migration models (live CLI bug), permissive dialect switch defaults. Prefer fixes that kill the class (fail-loud miss paths, records/with, single-source models) over instance fixes.
  2. Mutable state excluded from equality on cached pipeline objects appears in three issues (Generator warm-build performance: incremental caching seams defeat per-edit granularity (Stage 2.5/emission CompilationProvider combines, schema-parse walks, discovery predicate, Collect barrier) #309, Display-class prediction robustness: stale UnsafeAccessorType names on cross-partial ordinal shifts; generic containing types/methods unguarded (runtime TypeLoadException) #310, Diagnostic pipeline reliability: bind-stage QRY900 drain-discarded, deferred-diagnostic registry silently drops unregistered IDs (3rd occurrence), ThreadStatic trace/cancellation hazards #311) — one modeling convention fixes all three.
  3. The fail-loud philosophy holds everywhere except Conditional clause mask model: unconditional Limit/Offset/Distinct + runtime crash on else-if / multi-clause branches #307 — restoring it there is the highest-leverage correctness work in the repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions