Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove inner product types from generic test. #264

Merged

Conversation

Abiji-2020
Copy link
Contributor

@Abiji-2020 Abiji-2020 commented Oct 12, 2024

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

Rationale for this change

The tests in the base directory was all modified with the updated from

Curve25519Scalar -> TestScalar
RistrettoPoint -> NaiveCommitment
InnerProductProof -> TestEvaluationProof

Notes

During the previous commit , I accidentally modified the function which needs to be done in Curve25519Scalar , which was modified in the latest commit

closes #230
/claim #230

What changes are included in this PR?

all the test files, (unit tests) are modified.

Are these changes tested?

yes

@Abiji-2020 Abiji-2020 changed the title Remove inner product types from generic test. fix: Remove inner product types from generic test. Oct 12, 2024
@Abiji-2020
Copy link
Contributor Author

Abiji-2020 commented Oct 12, 2024

image

ci failing on

image

@JayWhite2357 @stuarttimwhite @iajoiner What can we do in this matter, as the methods are not implemented for the TestEvaluationProof

@Abiji-2020
Copy link
Contributor Author

@JayWhite2357 Need help on this 😶

@JayWhite2357
Copy link
Contributor

@Abiji-2020 Sorry for the delay, I was out of office the first half of the week and I'm playing catchup 😬.
Those specific test_random_ipa are actually testing the InnerProductProof itself, so they don't need to be changed over.

Copy link
Contributor

@JayWhite2357 JayWhite2357 left a comment

Choose a reason for hiding this comment

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

Looks excellent. Breaking this down into these commits was super helpful.

Two changes that are easy to make because of your clean commit history:

You can just drop this commit: 3eb4eb8

For da37c77,
I would actually ask that you rename the tests and still use TestScalar instead of reverting back to Curve25519Scalar.

(Additionally, it would be nice, but not necessary, if you could use git rebase --interactive or similar to edit the commits to fix the typos wherever they originated rather than putting it in a separate commit.)

Finally, I would prefer, but not require a rebase rather than a merge: c28f27e. That way we can merge all of your commits rather than doing a squash merge.

@Abiji-2020 Abiji-2020 force-pushed the remove-innerProduct-types-test branch from c28f27e to 71b680b Compare October 19, 2024 03:51
@Abiji-2020
Copy link
Contributor Author

Looks excellent. Breaking this down into these commits was super helpful.

Two changes that are easy to make because of your clean commit history:

You can just drop this commit: 3eb4eb8

For da37c77, I would actually ask that you rename the tests and still use TestScalar instead of reverting back to Curve25519Scalar.

(Additionally, it would be nice, but not necessary, if you could use git rebase --interactive or similar to edit the commits to fix the typos wherever they originated rather than putting it in a separate commit.)

Finally, I would prefer, but not require a rebase rather than a merge: c28f27e. That way we can merge all of your commits rather than doing a squash merge.

Currently all the modifications are done in the files named as test. Will update the tests in other files within the directory and update. Untill marking the PR as draft.

@Abiji-2020 Abiji-2020 marked this pull request as draft October 19, 2024 05:10
@Abiji-2020 Abiji-2020 force-pushed the remove-innerProduct-types-test branch from 8533fa9 to f0a357b Compare October 19, 2024 09:46
@Abiji-2020 Abiji-2020 marked this pull request as ready for review October 19, 2024 10:16
@Abiji-2020 Abiji-2020 force-pushed the remove-innerProduct-types-test branch from c1cb096 to d8c75c7 Compare October 19, 2024 10:32
@Abiji-2020
Copy link
Contributor Author

@JayWhite2357 sorry for this much commit, after rebasing with the main branch, this commit was messed up heavily. I tried to make it clean as possible .

@Abiji-2020 Abiji-2020 force-pushed the remove-innerProduct-types-test branch 2 times, most recently from e453d14 to 024eb55 Compare October 20, 2024 02:34
Copy link
Contributor

@JayWhite2357 JayWhite2357 left a comment

Choose a reason for hiding this comment

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

I've done a thorough review. If you do these changes and resolve the conflicts with main, this should be ready to go.

Copy link
Contributor

Choose a reason for hiding this comment

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

This file does not appear to be changed. Please be sure it is not included in the git diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had tried to not include it in the git diff but it is still showing in the git diff

Copy link
Contributor

Choose a reason for hiding this comment

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

Do something like git checkout main scripts/run_ci_checks.sh. Then commit that version of the file. My guess is that there is some issue with line endings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JayWhite2357 yes now it was removed from the git diff. I downloaded the file from the main branch and replaced in the current branch.

Comment on lines 450 to 461
CommittableColumn::BigInt(&front_emptied_column_a),
CommittableColumn::VarChar(
front_emptied_column_b
.iter()
.map(Into::<TestScalar>::into)
.map(Into::<[u64; 4]>::into)
.collect(),
),
];

let expected_commitments =
NaiveCommitment::compute_commitments(&committable_columns, 0, &());
Copy link
Contributor

@JayWhite2357 JayWhite2357 Oct 20, 2024

Choose a reason for hiding this comment

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

Something like this is better.

Suggested change
CommittableColumn::BigInt(&front_emptied_column_a),
CommittableColumn::VarChar(
front_emptied_column_b
.iter()
.map(Into::<TestScalar>::into)
.map(Into::<[u64; 4]>::into)
.collect(),
),
];
let expected_commitments =
NaiveCommitment::compute_commitments(&committable_columns, 0, &());
CommittableColumn::BigInt(&column_a[3..]),
CommittableColumn::VarChar(
column_b[3..]
.iter()
.map(Into::<TestScalar>::into)
.map(Into::<[u64; 4]>::into)
.collect(),
),
];
let expected_commitments =
NaiveCommitment::compute_commitments(&committable_columns, 3, &());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified it

@@ -91,9 +92,11 @@ pub trait ArrayRefExt {
impl ArrayRefExt for ArrayRef {
#[cfg(any(test, feature = "test"))]
#[cfg(feature = "blitzar")]
fn to_curve25519_scalars(
#[cfg(test)]
fn to_test_scalars(
Copy link
Contributor

Choose a reason for hiding this comment

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

This is dead code. Let's just remove this and all the tests in this file that are testing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the code and its tests

@@ -41,7 +41,7 @@ pub enum Column<'a, S: Scalar> {
/// i128 columns
Int128(&'a [i128]),
/// Decimal columns with a max width of 252 bits
/// - the backing store maps to the type [`crate::base::scalar::Curve25519Scalar`]
/// - the backing store maps to the type [`crate::base::scalar::test_scalar::TestScalar`]
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// - the backing store maps to the type [`crate::base::scalar::test_scalar::TestScalar`]
/// - the backing store maps to the type `S`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified

@@ -263,7 +263,7 @@ pub enum ColumnType {
/// Mapped to i64
#[serde(alias = "TIMESTAMP", alias = "timestamp")]
TimestampTZ(PoSQLTimeUnit, PoSQLTimeZone),
/// Mapped to [`Curve25519Scalar`](crate::base::scalar::Curve25519Scalar)
/// Mapped to [`TestScalar`](crate::base::scalar::test_scalar::TestScalar)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Mapped to [`TestScalar`](crate::base::scalar::test_scalar::TestScalar)
/// Mapped to `S`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified

@Abiji-2020 Abiji-2020 force-pushed the remove-innerProduct-types-test branch from 7b9a784 to 4791e85 Compare October 20, 2024 04:09
@Abiji-2020 Abiji-2020 force-pushed the remove-innerProduct-types-test branch 4 times, most recently from 6be62ce to c28ad44 Compare October 21, 2024 15:12
@Abiji-2020
Copy link
Contributor Author

@JayWhite2357 any updates on this?

@Abiji-2020 Abiji-2020 force-pushed the remove-innerProduct-types-test branch 4 times, most recently from a44f61b to d04e6f7 Compare October 23, 2024 00:06
@Abiji-2020
Copy link
Contributor Author

@JayWhite2357 now you can check it

@Abiji-2020 Abiji-2020 force-pushed the remove-innerProduct-types-test branch 2 times, most recently from 5d8696b to ca6e336 Compare October 29, 2024 00:28
@Abiji-2020
Copy link
Contributor Author

Abiji-2020 commented Oct 29, 2024

@JayWhite2357 could you merge it, as the auto merge was cancelled, when the main repo was updated. Only done rebaseing with the main after the approval .

@Abiji-2020 Abiji-2020 force-pushed the remove-innerProduct-types-test branch 6 times, most recently from 0d3f5ae to 239348d Compare October 31, 2024 14:19
@Abiji-2020
Copy link
Contributor Author

Abiji-2020 commented Oct 31, 2024

@JayWhite2357 could you merge this PR

@Abiji-2020 Abiji-2020 force-pushed the remove-innerProduct-types-test branch 2 times, most recently from ccc1195 to 60b0b0e Compare November 6, 2024 03:05
@Abiji-2020 Abiji-2020 force-pushed the remove-innerProduct-types-test branch from 60b0b0e to cebd80c Compare November 6, 2024 15:42
@JayWhite2357
Copy link
Contributor

@Abiji-2020 hmmm. I missed this one. I'll merge it.

@Abiji-2020
Copy link
Contributor Author

@Abiji-2020 hmmm. I missed this one. I'll merge it.

Thanks @JayWhite2357, I was rebasing it for the past week. Hoping it to merge daily.

@JayWhite2357 JayWhite2357 merged commit efdbb21 into spaceandtimelabs:main Nov 6, 2024
11 checks passed
Copy link

github-actions bot commented Nov 6, 2024

🎉 This PR is included in version 0.36.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove InnerProduct types from generic tests within base directory
2 participants