Skip to content

Research: Tai-e-inspired semantic fact assertions and selective precision (bounded spike) #443

Open

Description

@PhysShell

Classification

  • Type: bounded research / semantic-invariant testing and selective interprocedural precision spike
  • Priority: P2 / backlog; not a request to port Tai-e, introduce a new production solver, or rewrite the Own.NET pipeline
  • Area: Roslyn → OwnIR → resource identity / aliases → call frontier & method summaries → ownership diagnostics
  • Prior art: pascal-lab/Tai-e, a Java/Android static-analysis framework, not a reusable C#/.NET analyzer backend
  • Default outcome: documented evidence and a small isolated pilot; production changes require a separately justified decision

Motivation

Own.NET needs stronger ways to distinguish a correct internal semantic result from a diagnostic that only happens to match an expected label. Recent soundness/utility work exposed the risk of validating only final warning counts: intermediate alias, call-target, ownership-transfer, reachability, and summary facts can be wrong while the final diagnostic still looks plausible.

Tai-e has three relevant architectural ideas:

  1. Analysis assertions / test oracles. Its pointer-analysis assertion plugin checks expected properties of points-to sets, alias relationships, call targets and reachable methods. The transferable idea is to assert semantic facts at the analysis boundary, not merely emitted diagnostics.
  2. Explicit analysis dependencies / result management. Analyses can consume declared prerequisite analyses and results. This suggests auditing Own.NET's existing stage contracts and completeness/failure propagation before adding new abstractions.
  3. Incremental points-to solver + plugins and selective context sensitivity. Tai-e supports solver callbacks on new points-to facts, discovered methods, and call edges; context sensitivity can be configured. This is prior art for an experiment, not evidence that its monotone points-to machinery directly models typestate / disposal / move / ownership.

Useful references:

Scope A — semantic fact assertion pilot (first / preferred)

  1. Inventory what already exists in Own.NET for IR- and analysis-level oracle assertions, dual-engine/shadow parity, trace/witness checks, and deterministic test fixtures. Reuse instead of building a competing harness.
  2. Choose 6–10 compact C# fixtures spanning:
    • resource alias vs non-alias;
    • local transfer and transfer through a call;
    • disposal and double-dispose;
    • virtual/interface dispatch with one or multiple possible targets;
    • missing/opaque call target or unknown effect;
    • path-dependent disposal or conditional escape.
  3. For each fixture, assert intermediate facts at an agreed, stable boundary (e.g. OwnIR identities/call facts, abstract ownership-state transitions, summary facts), not just final SARIF/diagnostics. Distinguish MUST, MAY, and UNKNOWN / incomplete; never convert a conservative may-alias fact to proven ownership or non-alias.
  4. Introduce a small test-only adapter/fixture format only if existing introspection is insufficient. Avoid a public DSL/API until demonstrated useful.
  5. Check whether ≥ 3 targeted semantic mutations (e.g. dropping an alias edge, a call target, a transfer effect, or a disposal transition) are detected by intermediate assertions in circumstances where diagnostic-only checks miss or ambiguously localize the error. Record both detected and surviving mutants.

The assertion surface should preserve source/IR provenance and the distinction between not observed, not evaluated, unknown, and proven false. A failed analysis must not produce a vacuous PASS.

Scope B — selective precision feasibility (second / gated)

Only if concrete real-world diagnostic errors are traceable to alias/call-context imprecision:

  1. Pick 2–3 reproducing cases from actual Own.NET diagnostics and record the expected ownership outcome and the failing intermediate fact.
  2. Compare baseline with a minimal localized precision increase at the relevant call/alias frontier, using existing engine hooks if available.
  3. Measure changed false positives / false negatives, solver or pipeline time, memory if measurable, and completeness of calls/unknowns.
  4. Explicitly document where Tai-e's monotone, may-points-to accumulation is insufficient for path-sensitive resource lifecycle facts (move, dispose, escape, conditional execution). No global context-sensitive solver by default.

Relationship to existing work

Deliverables

  • Short donor-to-Own.NET design map: Tai-e API/feature → exact Own.NET seam → transferable invariant → non-transferable Java/points-to assumptions.
  • Inventory of existing tests/oracles and gaps; no duplicate harness.
  • 6–10 deterministic semantic-fact fixtures (or documented reason blocked by missing instrumentation).
  • Mutation outcomes: semantic assertion vs final diagnostic detection; surviving mutants listed.
  • At least one demonstrated additional, non-vacuous failure detected earlier than diagnostic-only testing, or explicit STOP / no demonstrated value.
  • If Scope B is justified: 2–3 controlled cases, baseline vs localized precision, runtime/memory/completeness and false-positive/false-negative deltas.
  • Decision: ADOPT-TEST-ONLY, PROPOSE-FOLLOWUP, or STOP-NO-BENEFIT, with reproducible evidence.

Non-goals / guardrails

  • No Java-to-C# port of Tai-e, Soot/WALA stack, or wholesale solver rewrite.
  • No claim that points-to precision implies ownership soundness.
  • No promotion of MAY to MUST, no suppression of warnings because a plugin returned incomplete results.
  • No change to Proven criteria without an independent soundness check.
  • No production merge purely because synthetic fixtures pass; useful changes must survive relevant existing/regression corpora.
  • Keep this issue backlog research, not an interruption of higher-priority correctness/diagnostic work.

Activity

  1. PhysShell commented on Nov 20, 2026

    @PhysShell
    OwnerAuthor

    anti-slop donor: preserving known type/effect evidence (20.11.2026)

    Research page · upstream.

    The TS/Oxlint project's most transferable heuristic is known precise evidence → explicit widening/erasure → narrower assertion without new validation. Key rules: no-widen-then-assert, no-chained-type-assertions, no-known-value-widening. For OwnIR this is a methodological analogy, not a request to port TS syntax or invent a new analyzer pass. Examine whether existing transfer/summary facts are unnecessarily widened to unknown/assumed and then restored as stronger diagnostics without a new proof witness. Compare with #445/#460 proof/assumption boundaries.

    KILL-FIRST: 6–10 synthetic positive/negative fixtures with known source/IR facts, legitimate explicit abstraction boundaries, and a genuine evidence-erasure mutation. Require actionable newly detected confidence loss relative to existing precision checks; log first failing transformation and independently validated witness. Distinguish syntactic heuristic from semantic correctness. Stop if no incremental defect or if all flagged cases are valid abstraction; no production analyzer change, no CI gate.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions