Skip to content

fix(PackConstants): don't start new storage buffer if current one is still empty#23927

Open
schuermans-roofline wants to merge 1 commit intoiree-org:mainfrom
schuermans-roofline:pack-constants-avoid-empty-buffer
Open

fix(PackConstants): don't start new storage buffer if current one is still empty#23927
schuermans-roofline wants to merge 1 commit intoiree-org:mainfrom
schuermans-roofline:pack-constants-avoid-empty-buffer

Conversation

@schuermans-roofline
Copy link
Copy Markdown
Contributor

The PackConstants pass introduces a new buffer when a constant cannot be packed into the current buffer without exceeding the maximum size. However, if a constant is itself larger than the limit, it gets still added, but in a separate buffer.
This change fixes a bug in the packing logic when a constant bigger than the limit is encountered when the current buffer is still empty. In this case, the current buffer stayed empty and the big constant got added to a new buffer. The empty buffer caused errors of size 0 buffers not being supported in following passes or in the runtime. This change avoids adding a new buffer is the current one is empty and thus avoids these errors.

…still empty

The PackConstant pass introduces a new buffer when a constant cannot be packed
into the current buffer without exceeding the maximum size. However, if a
constant is itself larger than the limit, it gets still added, but in a
separate buffer.
This change fixes a bug in the packing logic when a constant bigger than the
limit is encountered when the current buffer is still empty. In this case,
the current buffer stayed empty and the big constant got added to a new
buffer. The empty buffer caused errors of size 0 buffers not being supported
in following passes. This change avoids adding a new buffer is the current
one is empty and thus avoids these errors.

Signed-off-by: Stefan Schuermans <schuermans@roofline.ai>
@schuermans-roofline
Copy link
Copy Markdown
Contributor Author

schuermans-roofline commented Mar 25, 2026

This PR is a suggested fir for #23926

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