Skip to content

comptime not modeled (CFG excludes it; no comptime-aware rules) #22

Description

@ericsssan

Summary

comptime is not modeled. The CFG lowering explicitly excludes it, and there are no rules targeting comptime-specific bug classes. Code paths gated on or executed at comptime are collapsed to .plain / lowering_gap, so anything happening inside them is invisible.

Evidence

src/flow/cfg.zig:18-22, under "What we DON'T model (yet)": lists "generics / comptime".

No rule in src/rule_catalog.zig targets comptime evaluation, comptime-bounds, or comptime control flow.

Impact

  • Comptime-evaluated logic (type construction, comptime loops/branches, comptime-known values that bound runtime behavior) is opaque.
  • Comptime-known facts that would refine runtime analysis (e.g. a comptime length that proves a slice non-empty) aren't available to the value/flow tracks.

Suggested direction

Two separable goals:

  1. Use comptime-known values to refine runtime reasoning (the higher-value, more tractable half — feeds the value/flow track).
  2. Check comptime-specific bug classes (e.g. unbounded comptime recursion) — lower priority.

Coverage roadmap item; the refinement half likely pays off sooner than dedicated comptime rules.

Activity

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

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions