Skip to content

Fix: Simplify LT bus packing to 2 elements per operand#240

Merged
MauroToscano merged 3 commits into
mainfrom
fix_lt_bus_packing
Jan 27, 2026
Merged

Fix: Simplify LT bus packing to 2 elements per operand#240
MauroToscano merged 3 commits into
mainfrom
fix_lt_bus_packing

Conversation

@MauroToscano
Copy link
Copy Markdown
Contributor

@MauroToscano MauroToscano commented Jan 26, 2026

Summary

  • Change LT bus receiver from 3× Direct packing to Packing::DWordHHW (2 elements)

  • Change CPU LT sender from 3 linear combinations to Packing::DWordBL (2 elements)

  • Both produce the same [lo32, hi32] fingerprint, enabling interoperability with DWordWL senders

  • Add constraints so everything is properly range checked

    Motivation

This change enables MEMW timestamps (DWordWL format) to send to the LT bus using Packing::DWordWL, which also produces [lo32, hi32]. Previously, LT expected 3 elements per operand which was incompatible.

Changes

  • prover/src/tables/lt.rs: Use Packing::DWordHHW for lhs/rhs (reads 3 columns, produces 2 bus elements)
  • prover/src/tables/cpu.rs: Use Packing::DWordBL for arg1/arg2 (reads 8 bytes, produces 2 bus elements)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 26, 2026

Benchmark Results for unmodified programs 🚀

Command Mean [ms] Min [ms] Max [ms] Relative
base binary_search 69.9 ± 11.2 62.3 89.8 1.05 ± 0.21
head binary_search 66.5 ± 8.2 62.2 89.3 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base bitwise_ops 65.4 ± 3.7 62.2 69.7 1.00 ± 0.08
head bitwise_ops 65.4 ± 3.8 62.3 69.9 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base fibonacci_26 67.6 ± 2.3 65.6 71.3 1.01 ± 0.05
head fibonacci_26 67.2 ± 2.2 65.6 71.2 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base hashmap 135.3 ± 2.3 132.8 139.7 1.00
head hashmap 135.7 ± 2.9 132.2 138.8 1.00 ± 0.03
Command Mean [ms] Min [ms] Max [ms] Relative
base keccak 133.1 ± 8.3 123.4 154.6 1.04 ± 0.07
head keccak 128.0 ± 3.3 124.5 135.7 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base matrix_multiply 68.7 ± 1.4 67.5 71.4 1.00 ± 0.03
head matrix_multiply 68.6 ± 1.2 67.4 71.5 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base modular_exp 65.0 ± 3.7 61.8 69.5 1.04 ± 0.06
head modular_exp 62.4 ± 0.7 61.7 63.3 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base quicksort 67.0 ± 1.6 66.1 71.3 1.00
head quicksort 67.3 ± 2.3 65.6 71.5 1.01 ± 0.04
Command Mean [ms] Min [ms] Max [ms] Relative
base sieve 72.7 ± 3.3 69.6 79.6 1.02 ± 0.06
head sieve 71.2 ± 2.5 69.5 75.8 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base sum_array 87.7 ± 20.1 77.8 144.4 1.00 ± 0.33
head sum_array 87.3 ± 20.2 79.2 144.6 1.00
Command Mean [ms] Min [ms] Max [ms] Relative
base syscall_commit 101.1 ± 5.1 96.2 107.2 1.00
head syscall_commit 109.3 ± 28.3 96.1 188.6 1.08 ± 0.29

@RobinJadoul
Copy link
Copy Markdown
Collaborator

If I'm understanding this correctly; you're essentially casting a HHW to a WL? Which will probably introduce unsoundness on the LT side, because the range-check assumptions (LT-A1/LT-A2) no longer necessarily hold if they're not enforced by the logup.

Copy link
Copy Markdown
Collaborator

@RobinJadoul RobinJadoul left a comment

Choose a reason for hiding this comment

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

Formally marking it as "request changes" to prevent accidental merging

Copy link
Copy Markdown
Collaborator

@RobinJadoul RobinJadoul left a comment

Choose a reason for hiding this comment

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

I don't know enough about the rest of the code, but this specific unsoundness should now be addressed 👍

@MauroToscano MauroToscano added this pull request to the merge queue Jan 27, 2026
Merged via the queue into main with commit dd0e72e Jan 27, 2026
8 checks passed
@MauroToscano MauroToscano deleted the fix_lt_bus_packing branch January 27, 2026 18:35
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