Skip to content

Const / precompute Phase 2 (taint tracking, Computed, cross-slot folding) #20

Open

Description

@JuroOravec

Phase 2 of the Const/precompute optimization.

Phase 1 is built (the Const marker, detection, the body cache keyed by const signature, and the precompute pass that folds constant expressions/attributes, drops untaken <c-if> branches, and unrolls small const <c-for> loops): packages/py/citry/citry/constness.py, design in docs/design/constness.md.

Phase 2, parked by design (constness.md section 11):

  • Taint tracking: propagate Const through arbitrary Python operations (indexing, iteration, method calls) so values derived from const inputs are themselves const.
  • Computed(lambda: ...) explicit const-derived values.
  • Deep const for literal collections.
  • Const folding across a slot boundary (precompute a <c-slot> away).
  • Recursive / self-referential component handling in the const body cache.

Upstream context: django-components#1083.

Parked: design first, not yet scheduled.

Activity

  1. added
    enhancement
    on Jul 1, 2026
  2. added
    next-sprint
    on Oct 28, 2026
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

    enhancementnext-sprint

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions