Skip to content

Adjust over-large address register in Unlookup#2762

Closed
msoeken wants to merge 1 commit intomainfrom
msoeken/unlookup-bug
Closed

Adjust over-large address register in Unlookup#2762
msoeken wants to merge 1 commit intomainfrom
msoeken/unlookup-bug

Conversation

@msoeken
Copy link
Copy Markdown
Member

@msoeken msoeken commented Oct 30, 2025

We check in PhaseLookup whether the number of data bit-strings matches the address length. However, the address register may be larger than necessary (which is not a problem), in which case we need to shrink it to the required size. The computation of the required size and its validation is already present in the Unlookup operation.

@github-actions
Copy link
Copy Markdown

Change in memory usage detected by benchmark.

Memory Report for 3a60f66

Test This Branch On Main Difference
compile core + standard lib 24731350 bytes 24729454 bytes 1896 bytes


// Apply phase lookup to correct phases in the address register
PhaseLookup(address, phaseData);
PhaseLookup(address[...addressBitsNeeded - 1], phaseData);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need a test case for this.

billti pushed a commit that referenced this pull request Oct 30, 2025
Unit test for #2762 fix. Address
register is allowed to be larger than needed to address data.
Fails before the fix, passes after fix.
Includes the fix commit.

---------

Co-authored-by: Mathias Soeken <mathias.soeken@outlook.com>
Co-authored-by: Dmitry Vasilevsky <dmitryv@microsoft.com>
@billti
Copy link
Copy Markdown
Member

billti commented Oct 30, 2025

Merged as part of #2765

@billti billti closed this Oct 30, 2025
billti pushed a commit that referenced this pull request Nov 14, 2025
Unit test for #2762 fix. Address
register is allowed to be larger than needed to address data.
Fails before the fix, passes after fix.
Includes the fix commit.

---------

Co-authored-by: Mathias Soeken <mathias.soeken@outlook.com>
Co-authored-by: Dmitry Vasilevsky <dmitryv@microsoft.com>
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.

3 participants