Skip to content

lattigo: lattigo.bootstrap needs ResetsLevelOpInterface - #3226

Merged
copybara-service[bot] merged 1 commit into
google:mainfrom
AlexanderViand:fix-lattigo-bootstrap-alloctoinplace
Jul 24, 2026
Merged

lattigo: lattigo.bootstrap needs ResetsLevelOpInterface#3226
copybara-service[bot] merged 1 commit into
google:mainfrom
AlexanderViand:fix-lattigo-bootstrap-alloctoinplace

Conversation

@AlexanderViand

Copy link
Copy Markdown
Collaborator

Driven by #3225, where I ran into

--- FAIL: TestLoLA (20.83s)
    lola_test.go:65: Lola__preprocessing took 522.491416ms
panic: cannot Rescale: input Ciphertext level is too low [recovered, repanicked]

The bug had a really simple fix (lattigo.bootstrap seems to have lost its level-analysis annotation when we switched from ResetsMulDepthOpInterface to ResetsLevelOpInterface) but really annoying to track down. As a result of the missing level reset annotation, AllocToInplace thought that a mul op after a bootstrap was still happening at basically level 0, so tried to re-use level-0 buffers for them. Lattigo, in its wisdom, would not throw an error upon using a too-small/too-low-level output buffer, but instead just force things down to level 0 and hence in the next step, we'd get an attempt to rescale a level 0 ciphertext 🤦

@AlexanderViand AlexanderViand added the dialect: lattigo Issues concerning the Lattigo dialect label Jul 22, 2026

@asraa asraa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

while i know this is right (hence lgtm).. it broke my compilation of lenet when i patched it :|

@j2kun j2kun added the pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing label Jul 22, 2026
@j2kun

j2kun commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

It looks like this PR still has //third_party/heir/tests/Dialect/Lattigo/Transforms:alloc_to_in_place_levels.mlir.test failing

@j2kun j2kun removed the pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing label Jul 22, 2026
@AlexanderViand

AlexanderViand commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator Author

It looks like this PR still has //third_party/heir/tests/Dialect/Lattigo/Transforms:alloc_to_in_place_levels.mlir.test failing

Oh, good catch, I had a simple error in the FileCheck, but now I'm very confused why the CI passed?
image

EDIT: is it possible that with pull_request_target, github.sha points to main, rather than the PR?

@AlexanderViand
AlexanderViand force-pushed the fix-lattigo-bootstrap-alloctoinplace branch from 0e5cb93 to e444771 Compare July 23, 2026 07:38
@asraa

asraa commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

EDIT: is it possible that with pull_request_target, github.sha points to main, rather than the PR?

I noticed the same thing with CI :|

@j2kun j2kun added the pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing label Jul 24, 2026
@copybara-service
copybara-service Bot merged commit f1279f6 into google:main Jul 24, 2026
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dialect: lattigo Issues concerning the Lattigo dialect pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants