Skip to content

fix(analysis): solve loop-aware buffer lifetimes - #170

Merged
zhen8838 merged 9 commits into
tile-ai:mainfrom
zhen8838:fix/loop-aware-lifetimes
Sep 21, 2026
Merged

zhen8838 merged 9 commits into
tile-ai:mainfrom
zhen8838:fix/loop-aware-lifetimes

Conversation

@zhen8838

@zhen8838 zhen8838 commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

Why

What

  • Record structured SSA intervals plus real/synthetic use events, so carry ties reject later old-value uses without a second HIR traversal.
  • Traverse HIR nodes with AllocationConstraintVisitor; derive exact loop-aware operand-to-result relations from the existing polyhedral access maps.
  • Compile independent insert_slice result/destination and result/update relations only inside each gmem/smem address space.
  • Keep every logical SSA box in CP-SAT, seed one complete feasible assignment, and return after the first validated placement.
  • Report rmem as the largest logical value and lock all 52 existing Analysis corpus cases to exact per-level peaks.

Contract

  • gmem/smem peak_bytes is the returned placement high-water; rmem is the largest projected value.
  • Capacity remains a post-solve, non-fatal MemoryMetadata.errors/JSON/# error report.
  • solver_status=feasible does not claim a minimum.
  • New liveness/allocation helpers remain package-internal.

Risk

  • Scheme B preserves iteration-dependent offsets in ISL but compiles translated subviews as containment. Exact affine byte offsets remain a localized future upgrade in apply_constraints().

Comment thread src/tilefoundry/analysis/liveness.py Outdated
@zhen8838 zhen8838 changed the title fix(analysis): model loop-aware value lifetimes fix(analysis): solve loop-aware buffer lifetimes Sep 21, 2026
Comment thread src/tilefoundry/analysis/allocation.py Outdated
Comment thread src/tilefoundry/analysis/allocation.py Outdated
@zhen8838
zhen8838 merged commit 0c14ffd into tile-ai:main Sep 21, 2026
1 check passed
@zhen8838
zhen8838 deleted the fix/loop-aware-lifetimes branch September 21, 2026 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(analysis): give a loop-carried value the residency the loop gives it

1 participant