Skip to content

bound the reallocation copy in BlockStorage and PointerTable - #9246

Open
soma0212 wants to merge 1 commit into
halide:mainfrom
soma0212:block-storage-realloc-bound
Open

bound the reallocation copy in BlockStorage and PointerTable#9246
soma0212 wants to merge 1 commit into
halide:mainfrom
soma0212:block-storage-realloc-bound

Conversation

@soma0212

Copy link
Copy Markdown
Contributor

Both resizable containers in the runtime over-read the old block when they grow:

  • resize() assigns the new entry count to count, then allocate() copies count entries out of the previous allocation, which only holds the old capacity
  • one append past the 32-entry default reads a single entry too far; a 64-entry fill on a 128-byte block reads 256 bytes
  • PointerTable::allocate has the same shape, reached from StringTable::append when the Vulkan extension and layer tables outgrow their initial capacity

Clamping the copy to what the old allocation actually holds leaves the rest of the grow path alone. Both new tests trip ASAN before the change and pass after.

Checklist

  • Tests added or updated (not required for docs, CI config, or typo fixes)
  • Documentation updated (if public API changed)
  • Python bindings updated (if public API changed)
  • Benchmarks are included here if the change is intended to affect performance.
  • Commits include AI attribution where applicable (see Code of Conduct)

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.26%. Comparing base (faa3500) to head (9487baf).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9246      +/-   ##
==========================================
+ Coverage   70.13%   70.26%   +0.13%     
==========================================
  Files         255      255              
  Lines       78895    78895              
  Branches    18865    18865              
==========================================
+ Hits        55332    55439     +107     
+ Misses      17866    17844      -22     
+ Partials     5697     5612      -85     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant