Skip to content

Commit

Permalink
refactor!: remove Indexes (spaceandtimelabs#252)
Browse files Browse the repository at this point in the history
Please be sure to look over the pull request guidelines here:
https://github.com/spaceandtimelabs/sxt-proof-of-sql/blob/main/CONTRIBUTING.md#submit-pr.

# Please go through the following checklist
- [x] The PR title and commit messages adhere to guidelines here:
https://github.com/spaceandtimelabs/sxt-proof-of-sql/blob/main/CONTRIBUTING.md.
In particular `!` is used if and only if at least one breaking change
has been introduced.
- [x] I have run the ci check script with `source
scripts/run_ci_checks.sh`.

# Rationale for this change
`Indexes` is not useful since we only use dense indexes from 0 to output
table length anyway. Now it is time to remove it.
<!--
Why are you proposing this change? If this is already explained clearly
in the linked issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand
your changes and offer better suggestions for fixes.

 Example:
 Add `NestedLoopJoinExec`.
 Closes spaceandtimelabs#345.

Since we added `HashJoinExec` in spaceandtimelabs#323 it has been possible to do
provable inner joins. However performance is not satisfactory in some
cases. Hence we need to fix the problem by implement
`NestedLoopJoinExec` and speed up the code
 for `HashJoinExec`.
-->

# What changes are included in this PR?
- remove `Indexes`
<!--
There is no need to duplicate the description in the ticket here but it
is sometimes worth providing a summary of the individual changes in this
PR.

Example:
- Add `NestedLoopJoinExec`.
- Speed up `HashJoinExec`.
- Route joins to `NestedLoopJoinExec` if the outer input is sufficiently
small.
-->

# Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?

Example:
Yes.
-->
Yes
  • Loading branch information
iajoiner authored Oct 11, 2024
2 parents 61d850c + 5fd0ceb commit 25db238
Show file tree
Hide file tree
Showing 29 changed files with 255 additions and 734 deletions.
111 changes: 0 additions & 111 deletions crates/proof-of-sql/src/sql/proof/indexes.rs

This file was deleted.

218 changes: 0 additions & 218 deletions crates/proof-of-sql/src/sql/proof/indexes_test.rs

This file was deleted.

5 changes: 0 additions & 5 deletions crates/proof-of-sql/src/sql/proof/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,5 @@ pub(crate) use result_element_serialization::{
decode_and_convert, decode_multiple_elements, ProvableResultElement,
};

mod indexes;
pub(crate) use indexes::Indexes;
#[cfg(test)]
mod indexes_test;

mod result_builder;
pub(crate) use result_builder::ResultBuilder;
9 changes: 4 additions & 5 deletions crates/proof-of-sql/src/sql/proof/proof_builder_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
polynomial::{compute_evaluation_vector, CompositePolynomial, MultilinearExtension},
scalar::Curve25519Scalar,
},
sql::proof::{Indexes, SumcheckSubpolynomialType},
sql::proof::SumcheckSubpolynomialType,
};
use alloc::sync::Arc;
#[cfg(feature = "arrow")]
Expand Down Expand Up @@ -136,10 +136,9 @@ fn we_can_form_an_aggregated_sumcheck_polynomial() {
#[cfg(feature = "arrow")]
#[test]
fn we_can_form_the_provable_query_result() {
let result_indexes = Indexes::Sparse(vec![1, 2]);
let col1: Column<Curve25519Scalar> = Column::BigInt(&[10_i64, 11, 12]);
let col2: Column<Curve25519Scalar> = Column::BigInt(&[-2_i64, -3, -4]);
let res = ProvableQueryResult::new(&result_indexes, &[col1, col2]);
let col1: Column<Curve25519Scalar> = Column::BigInt(&[11_i64, 12]);
let col2: Column<Curve25519Scalar> = Column::BigInt(&[-3_i64, -4]);
let res = ProvableQueryResult::new(2, &[col1, col2]);

let column_fields = vec![
ColumnField::new("a".parse().unwrap(), ColumnType::BigInt),
Expand Down
Loading

0 comments on commit 25db238

Please sign in to comment.