Conversation
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
Scanning 1:R and testing membership keeps every index into the coordinate vector and the Cartan matrix provably in range, so an out-of-range node can no longer read past the end under @inbounds, and any container supporting `in` is accepted. `nothing` marks the full fold, whose membership test const-folds away.
Every fold goes through _fold_dominant! or _fold_dominant_with_word!, so checking there rather than at each caller means a future entry point taking a node set cannot reach a fold without the check. Free on the default path, where the check specializes to nothing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by HomogeneousTools/PartialFlagVarieties.jl#21: reflecting in only a subset
Sof the simple roots, so a weight can be folded into the dominant chamber of a Levi subgroup rather than of the whole group.API
An optional trailing
nodesargument, defaulting tonothing, which means all of them, onconjugate_dominant_weightconjugate_dominant_weight_with_elemconjugate_dominant_weight_with_lengthborel_weil_bottis_singularEverything routes through the two existing kernels
_fold_dominant!and_fold_dominant_with_word!. They still scan1:Rand now test membership innodes, rather than iterating over the node list. That matters for two reasons:@inbounds. Indexing a caller-supplied node list did exactly that: under the default--check-bounds=autoan out-of-range node silently returned a garbage weight, and only--check-bounds=yes— whichPkg.test()forces, so the suite is blind to it — threw. It is now anArgumentError, checked once at the public boundary;nodesmay be any container supportingin: tuple, vector, range orSet. Duplicates are harmless.nothingmarks the full fold, and being a singleton type its membership test const-folds away, so there is one code path and the hot one is unchanged.For
borel_weil_bottthe singularity test is restricted tonodesas well, which makes it the relative statement alongG/B → G/P_Iwithnodesthe nodes unmarked inI. Noteρ = ρ_Gstays the right shift even in the restricted case, sinceρ_G - ρ_Spairs to zero with every coroot inSand is thereforeW_S-invariant; that is recorded in the docstring.No regression on the default path
_fold_dominant!is the kernel every cohomology, dimension and Euler-characteristic call funnels through downstream, so the default path was measured, not assumed. 2000 random E₈ weights, minimum of a@benchmark:mainStraddles the
mainfigure, and results are identical. Thenodes === nothingtest const-folds after inlining, as the comment on the kernel claims.Tests
Full suite green, doctests green. 1000 new assertions in three testsets, over types A, B, C, D, G₂, F₄, E₆:
sub_dynkin_type_with_ordering— the ground truth for the whole change;S-dominant, the fold is idempotent, the word from_with_elemlies inS, has length equal to_with_length, and replaying it reproduces the folded weight;Sare untouched;borel_weil_bottmatches the absolute statement inside the sub-diagram, degree and weight, including agreement on when it vanishes;is_singular(λ + ρ, S)against the ground truth of pairingλ + ρwith every positive root of the subsystem, and againstborel_weil_bott(λ, S) === nothing, plus the implication that singular forSforces singular forG;Gbut singular forSand vice versa, and the degenerate empty node set.is_singularrestricted tonodesis exactly the vanishing criterion of the relativeborel_weil_bott, and the tests pin those two against each other.Follow-up, not in this PR
main, PartialFlagVarieties.jl can delete its local_fold_dominant_inand callborel_weil_bott(λ, S)directly, and itsSemisimplecompat bound moves to the release carrying this.