Skip to content

Research: semantic subgroup analysis for Own.NET diagnostic quality (bounded pilot) #427

Open

Description

@PhysShell

Classification

Problem

An aggregate pass rate or precision/recall number can hide systematic failures concentrated in particular C# semantic shapes. For example, a detector may perform well on direct Dispose() but miss guarded release, aliasing, partial-class teardown, or interprocedural ownership. Today we need a reproducible way to ask which semantic subgroups are actually covered, and where verified false negatives/false positives cluster.

This is an evaluation issue, not a claim that statistical subgroup metrics establish analyzer soundness.

Proposed bounded pilot

  1. Inventory existing independently reviewed oracle cases (including clean/negative cases); reuse Research: semantic mutation testing harness for Own.NET analyzer coverage (bounded pilot) #405 valid mutants if/when available. Do not count an unreviewed synthetic mutant as ground truth merely because its generator intended to inject a defect.
  2. Add minimal case-level metadata with stable ID, source/revision, expected behavior, diagnostic family, and a small multi-label semantic taxonomy. Suggested initial tags: partial-type, aliasing, guarded-release, exception-path, async-lifetime, interprocedural. Tags describe observed case semantics, not assumed analyzer capabilities. Start with a handful of populated tags; avoid an exhaustive taxonomy.
  3. Run the existing analyzer at a pinned revision, matching diagnostics to expected family and relevant site, not just exit code or warning count. Preserve actual source examples and evidence for every discrepancy.
  4. Emit a deterministic JSON/CSV report and a short human-readable table: evaluated cases; TP/FN for known-positive cases; FP/TN for independently reviewed known-negative cases; unknown/unreviewed/invalid/infra cases reported separately. Provide per-tag counts and only a few preselected tag intersections where the denominators support interpretation.
  5. Investigate the worst count-backed subgroup(s) manually. Reproduce any new gap and distinguish an existing limitation, duplicate, oracle error, unsupported shape, or genuine previously untracked analyzer miss.

Important denominator rules: one case should not silently turn into multiple observations because multiple diagnostics were emitted; record both case-level outcome and finding-level details. Report raw numerators/denominators for every rate. Do not calculate precision without verified positives and negatives for the relevant population; do not label unreported real-world bugs as true negatives. For tiny slices, display counts and mark rates as insufficient evidence rather than ranking by percentages. Distinguish extraction failures/timeouts from misses.

Scope boundaries

  • Standalone/offline evaluator layered on existing fixtures and analyzer entry points; no AIF360 Python dependency.
  • No default CI gate, broad instrumentation of OwnIR, automatic issue spam, fairness/protected-attribute analysis, or claim of globally representative recall.
  • Research: semantic mutation testing harness for Own.NET analyzer coverage (bounded pilot) #405 generates/validates semantic mutants; this issue stratifies oracle-backed results across semantic features. Neither requires the other for the first pilot.
  • If there is no defensible mixed positive/negative oracle, explicitly produce a coverage/gap inventory instead of bogus precision/recall.

Deliverables / acceptance

  • A small, reviewed baseline corpus with stable case IDs, provenance, expected outcome, and semantic tags (reusing existing evidence where possible).
  • Reproducible one-command local run with pinned analyzer revision/toolchain; zero persistent changes to test source.
  • Machine-readable outcomes and concise per-tag/per-selected-intersection tables, with explicit denominators and unknown/invalid/infra buckets.
  • At least one manually audited apparent weak slice; link reproducer and classify each observed miss honestly.
  • Short GO/STOP decision: did subgroup analysis reveal a new actionable blind spot or meaningful regression signal beyond current tests/Research: semantic mutation testing harness for Own.NET analyzer coverage (bounded pilot) #405, at acceptable maintenance cost?

Stop / promotion gate

Timebox as a small spike. Stop if metadata oracles are unreliable, slices are too sparse to interpret, or every identified gap is already known. If useful, follow with narrowly targeted fixtures / mutation operators or an optional regression dashboard; defer CI thresholds until there is a stable, sufficiently populated benchmark.

Success is finding a concrete, validated weakness or demonstrating an efficient reproducible way to prevent regressions, not producing an attractive aggregate score.

Activity

  1. PhysShell commented on Nov 26, 2026

    @PhysShell
    OwnerAuthor

    LINTSCORE-01 — precision-weighted diagnostic utility, metric donor only (2026-11-26)

    P3 RESEARCH REFERENCE / REUSE-FIRST / KILL-FIRST / NO IMPLEMENTATION AUTHORIZED. Proselint philosophy @dbed789 proposes Lintscore = TP * (TP/(TP+FP))^k, k>0. Penalizes false alarms while rewarding useful findings; authors note lack of an open corpus for regularly tracking it. This is an old prose-linter metric, not validated for C# ownership analysis. No package dependency or runtime change.

    Question: On an identical frozen, independently reviewed Own.NET diagnostic oracle, would a precision-weighted supplemental utility view reveal a meaningful tradeoff that existing per-family/per-semantic-subgroup precision/recall, coverage, review cost and risk lanes do not? Preserve current #427 denominators, #405 mutant qualification, #201 real OSS oracle and #266 finding identity; don't alter taxonomy or existing acceptance gates.

    • Fix observation unit (case vs matched diagnostic), deduplicate findings by relevant family/site, predeclare k values (e.g. 1,2,4), identical cohort/version/config and labels, define empty prediction score (convention 0; precision N/A). Report TP/FP/FN/TN where valid, unknown/extraction failure/unsupported/not run separately. No precision/recall estimates from an unlabeled corpus. Never treat unsupported cases as safe.
    • Absolute score scales with corpus size and has no explicit FN term; cannot compare dissimilar corpora or use alone. Example with 100 real positives, k=2: A TP=10 FP=0 scores 10, recall 10%; B TP=100 FP=250 scores about 8.16, recall 100%. Ranking can reverse despite materially worse recall; must not incentivize suppressing high-risk ownership findings. Distinguish actual error costs per diagnostic family, not a single universal k.
    • If existing reviewed labels suffice, compute candidate views offline with current tooling only, compare ranking sensitivity and risk-lane tradeoffs, inspect any changed decision. No new benchmark corpus solely for this score, no automatic optimization, no global leaderboard. Retain only if a predeclared real decision benefits beyond existing metrics; otherwise reference-only. No experiments run in this review. Related OBM #11 prose linting and #16 code-quality advisory lane.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions