Skip to content

chore: genericize databus#22648

Merged
ledwards2225 merged 4 commits into
merge-train/barretenbergfrom
lde/genericize-databus
Apr 20, 2026
Merged

chore: genericize databus#22648
ledwards2225 merged 4 commits into
merge-train/barretenbergfrom
lde/genericize-databus

Conversation

@ledwards2225

Copy link
Copy Markdown
Contributor

Make the databus mechanism generic on number of bus columns to facilitate extension

@ledwards2225 ledwards2225 force-pushed the lde/genericize-databus branch from cfe3a00 to 36997ba Compare April 17, 2026 21:08
@ledwards2225 ledwards2225 marked this pull request as ready for review April 17, 2026 21:11
@ledwards2225 ledwards2225 added the ci-full Run all master checks. label Apr 17, 2026
// Allocate only enough space for the databus data. For ZK, masking values are stored in MaskingTailData.
polynomials.calldata = Polynomial(calldata_size, dyadic_size());
polynomials.calldata_read_counts = Polynomial(calldata_size, dyadic_size());
// TODO(https://github.com/AztecProtocol/barretenberg/issues/1555): Minimum size >1 to avoid point at infinity

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Existing TODO, just moved. (I think this should go away with Sergei's ongoing work)

}
}
// Bus column k is selected by q_{k+1}; all other wire-linear selectors stay zero on this row.
// One line per bus column — Stage 1 adds siblings here when NUM_BUS_COLUMNS grows.

@ledwards2225 ledwards2225 Apr 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sigh.. comment is AI slop. Will remove in the follow on

@federicobarbacovi federicobarbacovi left a comment

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.

Looks great, thanks for doing this! Only a few minor comments

// Map bus_idx → wire-linear selector on the values struct (mirrors BusData<i>::selector in the relation).
const std::array<const FF*, NUM_BUS_COLUMNS> bus_selectors{ &values.q_l, &values.q_r, &values.q_o };

// Locate the bus column being read (exactly one selector should be hot on a busread row) and look up the

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.

Suggested change
// Locate the bus column being read (exactly one selector should be hot on a busread row) and look up the
// Locate the bus column being read (exactly one selector should be active on a busread row) and look up the

this->return_data,
this->return_data_read_counts,
this->return_data_inverses };
this->lookup_read_tags };

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.

Thanks for cleaning this up!

public:
using FF = FF_;
static constexpr size_t NUM_BUS_COLUMNS = 3; // calldata, secondary calldata, return data
// NUM_BUS_COLUMNS (= 3: calldata, secondary calldata, return data) is defined in databus.hpp so all consumers

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.

Runaway comment

@ledwards2225 ledwards2225 enabled auto-merge (squash) April 20, 2026 14:44
@ledwards2225 ledwards2225 merged commit c594768 into merge-train/barretenberg Apr 20, 2026
12 checks passed
@ledwards2225 ledwards2225 deleted the lde/genericize-databus branch April 20, 2026 15:28
dipkakwani pushed a commit to dipkakwani/aztec-packages that referenced this pull request Apr 22, 2026
BEGIN_COMMIT_OVERRIDE
chore: genericize databus (AztecProtocol#22648)
chore(ts): drop dead Plonk VK scaffolding and port AztecProtocol#22655 TS cleanup
(AztecProtocol#22657)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run all master checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants