Skip to content

Factorization optimization: Emit factors incrementally and add optional small-degree screening - #172

Merged
odraccir1 merged 2 commits into
masterfrom
ra/incremental_factor_callbacks
Oct 13, 2026
Merged

odraccir1 merged 2 commits into
masterfrom
ra/incremental_factor_callbacks

Conversation

@odraccir1

@odraccir1 odraccir1 commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

The PR contains two changes to when factorization performs work and delivers factors.

  1. Deliver irreducible factors as each degree group is discovered.

Previously, complete factorization discovered all degree groups, then split them into irreducible factors and called the callback. Now, whenever it discovers a group, it immediately splits that group and calls the callback after each irreducible factor. If the callback requests a stop, both splitting and further degree discovery stop.
This lets norm recovery reject H as soon as it encounters an unsuitable odd-multiplicity factor. Even multiplicities retain their existing handling.

  1. Optionally screen small degrees before constructing the full baby-step table.

The new option is: options.distinct_degree_screening_limit = 1; A positive limit screens small degrees before constructing the full Kaltofen–Shoup baby-step table. Screening reuses the initial Frobenius power, and its computed powers become the table prefix if factorization continues. The default remains zero.
With this setting, for each nonlinear square-free part B, the algorithm:
- Computes X^Q mod B and prepares the initial Frobenius composition cache.
- Computes gcd(B, X^Q − X), obtaining the group of linear factors.
- Splits that group and immediately invokes the factor callbacks.
- Stops if a callback rejects. Otherwise, removes the classified group and continues with the normal blocked search, reusing the Frobenius powers already computed.

@odraccir1 odraccir1 changed the title Factorization optimization: Incremental factor callbacks Factorization optimization: Emit factors incrementally and add optional small-degree screening Oct 13, 2026
@odraccir1
odraccir1 requested a review from spaceships October 13, 2026 18:11
@odraccir1
odraccir1 merged commit 82fff5f into master Oct 13, 2026
2 checks passed
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.

1 participant