Skip to content

Fix x64 tests with GFNI enabled, remove Canonical type#887

Closed
GraDKh wants to merge 1 commit intomainfrom
dgordon/fix_x64_tests_with_gfni
Closed

Fix x64 tests with GFNI enabled, remove Canonical type#887
GraDKh wants to merge 1 commit intomainfrom
dgordon/fix_x64_tests_with_gfni

Conversation

@GraDKh
Copy link
Copy Markdown
Contributor

@GraDKh GraDKh commented Sep 1, 2025

TL;DR

Remove the Canonical associated type from the TowerField trait and related code. This fixes the unit tests that were not passing with GFNI enabled because is_canonical was returning a wrong value

What changed?

  • Removed the Canonical associated type from the TowerField trait
  • Removed implementations of this associated type from all implementors of TowerField
  • Removed the is_canonical_tower function and its usages
  • Removed the tower-to-AES and AES-to-tower mapping constants that were used for conversions
  • Removed the linear_transform function that was no longer needed
  • Simplified the invert_or_zero implementation to only handle AES tower fields without conversion

How to test?

  • Run the existing test suite to ensure all functionality still works correctly
  • Verify that code using binary fields still compiles and functions as expected
  • Check that GFNI-based field operations still work correctly

Why make this change?

This change simplifies the binary field implementation by removing the concept of "canonical" tower fields. The code previously supported conversions between different representations of tower fields, but this added complexity wasn't necessary. By removing this abstraction, the code becomes more straightforward and easier to maintain while preserving all required functionality.

Copy link
Copy Markdown
Contributor Author

GraDKh commented Sep 1, 2025


How to use the Graphite Merge Queue

Add the label merge-ready to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@GraDKh GraDKh requested review from jadnohra and jimpo September 1, 2025 08:12
@GraDKh GraDKh marked this pull request as ready for review September 1, 2025 08:12
@GraDKh GraDKh changed the base branch from dgordon/test_against_native_cpu_in_ci to graphite-base/887 September 1, 2025 10:53
@GraDKh GraDKh force-pushed the dgordon/fix_x64_tests_with_gfni branch from 996fe65 to 380aa9b Compare September 1, 2025 10:53
@GraDKh GraDKh changed the base branch from graphite-base/887 to main September 1, 2025 10:53
@graphite-app
Copy link
Copy Markdown

graphite-app bot commented Sep 2, 2025

Merge activity

  • Sep 2, 2:03 PM UTC: GraDKh added this pull request to the Graphite merge queue.
  • Sep 2, 2:03 PM UTC: CI is running for this pull request on a draft pull request (#915) due to your merge queue CI optimization settings.
  • Sep 2, 2:10 PM UTC: Merged by the Graphite merge queue via draft PR: #915.

graphite-app bot pushed a commit that referenced this pull request Sep 2, 2025
### TL;DR

Remove the `Canonical` associated type from the `TowerField` trait and related code. This fixes the unit tests that were not passing with GFNI enabled because `is_canonical` was returning a wrong value

### What changed?

- Removed the `Canonical` associated type from the `TowerField` trait
- Removed implementations of this associated type from all implementors of `TowerField`
- Removed the `is_canonical_tower` function and its usages
- Removed the tower-to-AES and AES-to-tower mapping constants that were used for conversions
- Removed the `linear_transform` function that was no longer needed
- Simplified the `invert_or_zero` implementation to only handle AES tower fields without conversion

### How to test?

- Run the existing test suite to ensure all functionality still works correctly
- Verify that code using binary fields still compiles and functions as expected
- Check that GFNI-based field operations still work correctly

### Why make this change?

This change simplifies the binary field implementation by removing the concept of "canonical" tower fields. The code previously supported conversions between different representations of tower fields, but this added complexity wasn't necessary. By removing this abstraction, the code becomes more straightforward and easier to maintain while preserving all required functionality.
@graphite-app graphite-app bot closed this Sep 2, 2025
@graphite-app graphite-app bot deleted the dgordon/fix_x64_tests_with_gfni branch September 2, 2025 14:10
lockedloop pushed a commit that referenced this pull request Sep 8, 2025
### TL;DR

Remove the `Canonical` associated type from the `TowerField` trait and related code. This fixes the unit tests that were not passing with GFNI enabled because `is_canonical` was returning a wrong value

### What changed?

- Removed the `Canonical` associated type from the `TowerField` trait
- Removed implementations of this associated type from all implementors of `TowerField`
- Removed the `is_canonical_tower` function and its usages
- Removed the tower-to-AES and AES-to-tower mapping constants that were used for conversions
- Removed the `linear_transform` function that was no longer needed
- Simplified the `invert_or_zero` implementation to only handle AES tower fields without conversion

### How to test?

- Run the existing test suite to ensure all functionality still works correctly
- Verify that code using binary fields still compiles and functions as expected
- Check that GFNI-based field operations still work correctly

### Why make this change?

This change simplifies the binary field implementation by removing the concept of "canonical" tower fields. The code previously supported conversions between different representations of tower fields, but this added complexity wasn't necessary. By removing this abstraction, the code becomes more straightforward and easier to maintain while preserving all required functionality.
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