Skip to content

Intern addresses as &[G; 32] to cut kernel FFT cost#417

Merged
arthurpaulino merged 1 commit into
mainfrom
ap/kernel-opts
May 19, 2026
Merged

Intern addresses as &[G; 32] to cut kernel FFT cost#417
arthurpaulino merged 1 commit into
mainfrom
ap/kernel-opts

Conversation

@arthurpaulino
Copy link
Copy Markdown
Member

@arthurpaulino arthurpaulino commented May 19, 2026

Replace the by-value [G; 32] address type with type Addr = &[G; 32]. Aiur store content-dedups structurally equal arrays to one canonical pointer, so address equality reduces to pointer subtraction and every function carrying addresses drops 31 columns per address argument.

lake exe kernel String.Internal.append: total FFT 2515875651 ->
2152947064 (-14.4%), total width 48210 -> 37903. ixvm test suite: 283 pass, 0 fail.

Comment thread Ix/IxVM/Ingress.lean
-- io_get_info is unconstrained; the prover provides (0, 0) for blob addresses.
-- Soundness: if the prover lies and skips a real constant, type checking will fail.
let (_, len) = io_get_info(addr);
let (_, len) = io_get_info(load(addr));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe this is doing a lookup and loading the addresses into columns JUST to get a hint. The hint should somehow come from the pointer alone. Is this possible? Perhaps that will need a new io_load_info operation or something?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nice idea

@arthurpaulino arthurpaulino mentioned this pull request May 19, 2026
@arthurpaulino arthurpaulino enabled auto-merge (squash) May 19, 2026 21:52
Comment thread Ix/IxVM/Ingress.lean
Replace the by-value `[G; 32]` address type with `type Addr = &[G; 32]`.
Aiur `store` content-dedups structurally equal arrays to one canonical pointer,
so address equality reduces to pointer subtraction and every function carrying
addresses drops 31 columns per address argument.

`lake exe kernel String.Internal.append`: total FFT 2515875651 ->
2152947064 (-14.4%), total width 48210 -> 37903. ixvm test suite: 283 pass, 0 fail.
@arthurpaulino arthurpaulino merged commit 51f270b into main May 19, 2026
14 checks passed
@arthurpaulino arthurpaulino deleted the ap/kernel-opts branch May 19, 2026 23:33
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.

2 participants