Skip to content

lattigo: lattigo.bootstrap needs ResetsLevelOpInterface#3226

Open
AlexanderViand wants to merge 1 commit into
google:mainfrom
AlexanderViand:fix-lattigo-bootstrap-alloctoinplace
Open

lattigo: lattigo.bootstrap needs ResetsLevelOpInterface#3226
AlexanderViand wants to merge 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
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants