Add primary Massey products to ExtAlgebra - #247
Conversation
Introduce `ExtAlgebra::massey` and `ExtAlgebra::massey_family` in the new `ext_algebra/massey.rs`, computing triple Massey products <a, b, c> (and the optimized <a, b, -> family over all valid third factors). The result type `MasseyResult` carries a coset representative plus the indeterminacy a·Ext + Ext·c (computed when M == k, otherwise the zero subspace). These wrap `ChainHomotopy`: for each candidate c we lift the multiplication map, build the null-homotopy of the composite with b, and read off the bracket by pairing with a; the valid c are the kernel of multiplication by b. No new linear algebra is added — this repackages the logic of the `massey` example. Refactors the `massey` example onto `massey_family`; output is byte-identical to before (verified on S_2). Adds a unit test for the relation <h0, h1, h0> = h1^2 and that <h0, h1, h1> is undefined. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XYWcvWZPm3YJkVpCmeGYsP
|
Warning Review limit reached
More reviews will be available in 31 minutes and 47 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds Massey-product computation support to ChangesMassey product API and fixtures
Sequence Diagram(s)sequenceDiagram
participant Example as ext/examples/massey.rs
participant ExtAlgebra as ExtAlgebra
participant MasseyResult as MasseyResult
participant AffineSubspace as AffineSubspace
Example->>ExtAlgebra: from_resolution(...)
Example->>ExtAlgebra: unit_generator(a_deg), unit_generator(b_deg)
Example->>ExtAlgebra: massey_iter_c(&a, &b)
ExtAlgebra-->>Example: Vec<(BidegreeElement, MasseyResult)>
Example->>MasseyResult: contains_zero()
MasseyResult->>AffineSubspace: contains_zero()
Example->>Example: print each coset
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ext/src/ext_algebra/massey.rs`:
- Around line 118-134: The homotopy construction in massey_iter_b is using b_hom
beyond its current range because it is only extended to shift while the rest of
the path runs to tot; extend b_hom to tot before creating ChainHomotopy and
calling homotopy.extend(tot), matching the pattern already used in massey_iter_a
before s_bc.extend(tot), so the b_hom and homotopy lifetimes/ranges stay
aligned.
- Around line 3-5: The module docs reference a non-existent
ExtAlgebra::massey_family API, so update the documentation in massey.rs to point
to the actual public method name (massey_iter_c or massey_iter_a) unless you
intend to add a massey_family wrapper. If adding the wrapper, define it on
ExtAlgebra and ensure it delegates to the existing Massey iteration logic;
otherwise, remove the broken doc link and describe the correct method name.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4be6a489-58f4-4ec2-ad1b-2e647cee78ef
📒 Files selected for processing (7)
ext/crates/fp/src/matrix/affine.rsext/examples/benchmarks/massey-C2-Pext/examples/benchmarks/massey-Ceta-Pext/examples/benchmarks/massey-S_2-Pext/examples/massey.rsext/src/ext_algebra/massey.rsext/src/ext_algebra/mod.rs
The module docs referenced ExtAlgebra::massey_family, which does not exist, breaking the `docs` CI build (rustdoc broken-intra-doc-links under -D warnings). Point to the actual method massey_iter_c, and document massey_iter_a alongside it so the module overview covers all three entry points (massey, massey_iter_c, massey_iter_a) and the shared ChainHomotopy machinery. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| /// Whether the origin lies in this coset, equivalently whether it is a linear subspace. | ||
| /// | ||
| /// The offset is kept reduced modulo the linear part (see [`AffineSubspace::new`]), so this | ||
| /// holds exactly when the stored offset is zero. |
There was a problem hiding this comment.
| /// Whether the origin lies in this coset, equivalently whether it is a linear subspace. | |
| /// | |
| /// The offset is kept reduced modulo the linear part (see [`AffineSubspace::new`]), so this | |
| /// holds exactly when the stored offset is zero. | |
| /// Returns whether the coset contains zero |
| <a, b, x_(18, 3, 0)> = [0] | ||
| <a, b, x_(18, 7, 0)> = [1] | ||
| <a, b, x_(18, 8, 0)> = [1] | ||
| <a, b, x_(0, 0, [1])> = [1] + {} |
There was a problem hiding this comment.
Why did the name of x change?
There was a problem hiding this comment.
We used to only compute on basis elements, now we compute on a basis of the kernel of multiplication by b. Those don't have to be basis elements of the ambient space, so we display BidegreeElement instead of BidegreeGenerator.
We also now display the indeterminacy and remove those that contain 0, so there are some lines "missing"
| /// the indeterminacy subspace. | ||
| #[derive(Debug, Clone)] | ||
| pub struct MasseyResult { | ||
| /// The bidegree of the bracket, `a.degree() + b.degree() + c.degree() - (1, 0)`. |
There was a problem hiding this comment.
| /// The bidegree of the bracket, `a.degree() + b.degree() + c.degree() - (1, 0)`. |
There was a problem hiding this comment.
I think stating the output bidegree once is good for documentation. We should clarify that (1,0) is
in (s,t) coordinates though
| } | ||
|
|
||
| impl MasseyResult { | ||
| /// A representative of the Massey product, as an element of the bracket's bidegree. |
There was a problem hiding this comment.
| /// A representative of the Massey product, as an element of the bracket's bidegree. | |
| /// Returns a representative element of the Massey product |
| /// Whether `0` lies in the Massey product, i.e. the representative lies in the indeterminacy. | ||
| /// Such brackets carry no information and are typically omitted from output. |
There was a problem hiding this comment.
| /// Whether `0` lies in the Massey product, i.e. the representative lies in the indeterminacy. | |
| /// Such brackets carry no information and are typically omitted from output. | |
| /// Whether the Massey product contains zero. |
Such brackets carry no information
Lies.
There was a problem hiding this comment.
Find me a use for them then 😛
There was a problem hiding this comment.
The fact that it contains zero carries the information that it is possible to construct a cell complex with prescribed Atiyah-Hirzebruch differentials.
hoodmane
left a comment
There was a problem hiding this comment.
Seems fine but see my comments on the comments.
|
Caution Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted. Error details |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ext/src/ext_algebra/massey.rs`:
- Around line 7-11: The module-level overview in the Massey algebra docs is out
of sync with the implemented homotopy path: it mentions the wrong composite (`a
∘ b`) for the shown flow. Update the comment near the `massey_iter_a` and
`massey_iter_c` explanation so it consistently describes the actual behavior,
where `massey_iter_c` rebuilds the `b ∘ c` homotopy per `c` and `massey_iter_a`
reuses it for fixed `b, c`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: ccad5a2b-af9e-4bf0-995c-7d2f6bd65d82
📒 Files selected for processing (1)
ext/src/ext_algebra/massey.rs
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
53b94c6 to
33b34a1
Compare
* Add primary Massey products to ExtAlgebra
Introduce `ExtAlgebra::massey` and `ExtAlgebra::massey_iter_{a,c}` in the new
`ext_algebra/massey.rs`, computing triple Massey products <a, b, c> (and the
optimized <a, b, -> family over all valid third factors). The result type
`MasseyResult` carries a coset representative plus the indeterminacy
a·Ext + Ext·c (computed when M == k, otherwise the zero subspace).
These wrap `ChainHomotopy`: for each candidate c we lift the multiplication
map, build the null-homotopy of the composite with b, and read off the bracket
by pairing with a; the valid c are the kernel of multiplication by b. No new
linear algebra is added — this repackages the logic of the `massey` example.
Refactors the `massey` example onto `massey_family`; output is byte-identical
to before (verified on S_2). Adds a unit test for the relation
<h0, h1, h0> = h1^2 and that <h0, h1, h1> is undefined.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XYWcvWZPm3YJkVpCmeGYsP
* Fix broken doc link and round out massey module docs
The module docs referenced ExtAlgebra::massey_family, which does not exist,
breaking the `docs` CI build (rustdoc broken-intra-doc-links under -D warnings).
Point to the actual method massey_iter_c, and document massey_iter_a alongside
it so the module overview covers all three entry points (massey, massey_iter_c,
massey_iter_a) and the shared ChainHomotopy machinery.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Improve docs
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
* Change return type to descriptive struct
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
* Add ab == 0 check
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
* Add primary Massey products to ExtAlgebra
Introduce `ExtAlgebra::massey` and `ExtAlgebra::massey_iter_{a,c}` in the new
`ext_algebra/massey.rs`, computing triple Massey products <a, b, c> (and the
optimized <a, b, -> family over all valid third factors). The result type
`MasseyResult` carries a coset representative plus the indeterminacy
a·Ext + Ext·c (computed when M == k, otherwise the zero subspace).
These wrap `ChainHomotopy`: for each candidate c we lift the multiplication
map, build the null-homotopy of the composite with b, and read off the bracket
by pairing with a; the valid c are the kernel of multiplication by b. No new
linear algebra is added — this repackages the logic of the `massey` example.
Refactors the `massey` example onto `massey_family`; output is byte-identical
to before (verified on S_2). Adds a unit test for the relation
<h0, h1, h0> = h1^2 and that <h0, h1, h1> is undefined.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XYWcvWZPm3YJkVpCmeGYsP
* Fix broken doc link and round out massey module docs
The module docs referenced ExtAlgebra::massey_family, which does not exist,
breaking the `docs` CI build (rustdoc broken-intra-doc-links under -D warnings).
Point to the actual method massey_iter_c, and document massey_iter_a alongside
it so the module overview covers all three entry points (massey, massey_iter_c,
massey_iter_a) and the shared ChainHomotopy machinery.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Improve docs
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
* Change return type to descriptive struct
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
* Add ab == 0 check
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
…o it
The secondary Massey example hand-rolled ~500 lines of Z/p² + λ bookkeeping —
building the two secondary lifts, the chain homotopy, the E3 kernel, and the
Mod_{Cλ²} read-off — the same plumbing SpectralSequences#247 abstracted for primary Massey.
Encapsulate it as `SecondaryExtModule::secondary_massey(a, b, job)`, the
Mod_{Cλ²} analogue of `ExtModule::massey_iter_a`. `a ∈ Ext(M, k)` comes from the
module side, `b, - ∈ Ext(k, k)` from the shared ring side; both are
`SecondaryClass`es (an Ext part plus an optional λ part, since secondary Massey
needs non-standard lifts). A new `SecondaryClass` input type and a shared
`build_secondary_hom` helper (generalising the example's `get_hom`) construct the
secondary lift + optional λ chain map from coordinates. `job = Some(s)` shards the
chain-homotopy computation, matching the other secondary scripts.
The read-off is ported verbatim, so behaviour is unchanged: a new regression test
(`test_sphere_secondary_massey`) pins `<-, h_0, h_1>` on S_2 against the exact
bracket family the pre-refactor example printed, and the refactored example
reproduces that output byte-for-byte. `secondary_massey.rs` is now just the
interactive front-end (querying classes, formatting output).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nk9J57zb6GpvZxrduhGSdY
…o it
The secondary Massey example hand-rolled ~500 lines of Z/p² + λ bookkeeping —
building the two secondary lifts, the chain homotopy, the E3 kernel, and the
Mod_{Cλ²} read-off — the same plumbing SpectralSequences#247 abstracted for primary Massey.
Encapsulate it as `SecondaryExtModule::secondary_massey(a, b, job)`, the
Mod_{Cλ²} analogue of `ExtModule::massey_iter_a`. `a ∈ Ext(M, k)` comes from the
module side, `b, - ∈ Ext(k, k)` from the shared ring side; both are
`SecondaryClass`es (an Ext part plus an optional λ part, since secondary Massey
needs non-standard lifts). A new `SecondaryClass` input type and a shared
`build_secondary_hom` helper (generalising the example's `get_hom`) construct the
secondary lift + optional λ chain map from coordinates. `job = Some(s)` shards the
chain-homotopy computation, matching the other secondary scripts.
The read-off is ported verbatim, so behaviour is unchanged: a new regression test
(`test_sphere_secondary_massey`) pins `<-, h_0, h_1>` on S_2 against the exact
bracket family the pre-refactor example printed, and the refactored example
reproduces that output byte-for-byte. `secondary_massey.rs` is now just the
interactive front-end (querying classes, formatting output).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nk9J57zb6GpvZxrduhGSdY
…o it
The secondary Massey example hand-rolled ~500 lines of Z/p² + λ bookkeeping —
building the two secondary lifts, the chain homotopy, the E3 kernel, and the
Mod_{Cλ²} read-off — the same plumbing SpectralSequences#247 abstracted for primary Massey.
Encapsulate it as `SecondaryExtModule::secondary_massey(a, b, job)`, the
Mod_{Cλ²} analogue of `ExtModule::massey_iter_a`. `a ∈ Ext(M, k)` comes from the
module side, `b, - ∈ Ext(k, k)` from the shared ring side; both are
`SecondaryClass`es (an Ext part plus an optional λ part, since secondary Massey
needs non-standard lifts). A new `SecondaryClass` input type and a shared
`build_secondary_hom` helper (generalising the example's `get_hom`) construct the
secondary lift + optional λ chain map from coordinates. `job = Some(s)` shards the
chain-homotopy computation, matching the other secondary scripts.
The read-off is ported verbatim, so behaviour is unchanged: a new regression test
(`test_sphere_secondary_massey`) pins `<-, h_0, h_1>` on S_2 against the exact
bracket family the pre-refactor example printed, and the refactored example
reproduces that output byte-for-byte. `secondary_massey.rs` is now just the
interactive front-end (querying classes, formatting output).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nk9J57zb6GpvZxrduhGSdY
…o it
The secondary Massey example hand-rolled ~500 lines of Z/p² + λ bookkeeping —
building the two secondary lifts, the chain homotopy, the E3 kernel, and the
Mod_{Cλ²} read-off — the same plumbing SpectralSequences#247 abstracted for primary Massey.
Encapsulate it as `SecondaryExtModule::secondary_massey(a, b, job)`, the
Mod_{Cλ²} analogue of `ExtModule::massey_iter_a`. `a ∈ Ext(M, k)` comes from the
module side, `b, - ∈ Ext(k, k)` from the shared ring side; both are
`SecondaryClass`es (an Ext part plus an optional λ part, since secondary Massey
needs non-standard lifts). A new `SecondaryClass` input type and a shared
`build_secondary_hom` helper (generalising the example's `get_hom`) construct the
secondary lift + optional λ chain map from coordinates. `job = Some(s)` shards the
chain-homotopy computation, matching the other secondary scripts.
The read-off is ported verbatim, so behaviour is unchanged: a new regression test
(`test_sphere_secondary_massey`) pins `<-, h_0, h_1>` on S_2 against the exact
bracket family the pre-refactor example printed, and the refactored example
reproduces that output byte-for-byte. `secondary_massey.rs` is now just the
interactive front-end (querying classes, formatting output).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nk9J57zb6GpvZxrduhGSdY
…o it
The secondary Massey example hand-rolled ~500 lines of Z/p² + λ bookkeeping —
building the two secondary lifts, the chain homotopy, the E3 kernel, and the
Mod_{Cλ²} read-off — the same plumbing SpectralSequences#247 abstracted for primary Massey.
Encapsulate it as `SecondaryExtModule::secondary_massey(a, b, job)`, the
Mod_{Cλ²} analogue of `ExtModule::massey_iter_a`. `a ∈ Ext(M, k)` comes from the
module side, `b, - ∈ Ext(k, k)` from the shared ring side; both are
`SecondaryClass`es (an Ext part plus an optional λ part, since secondary Massey
needs non-standard lifts). A new `SecondaryClass` input type and a shared
`build_secondary_hom` helper (generalising the example's `get_hom`) construct the
secondary lift + optional λ chain map from coordinates. `job = Some(s)` shards the
chain-homotopy computation, matching the other secondary scripts.
The read-off is ported verbatim, so behaviour is unchanged: a new regression test
(`test_sphere_secondary_massey`) pins `<-, h_0, h_1>` on S_2 against the exact
bracket family the pre-refactor example printed, and the refactored example
reproduces that output byte-for-byte. `secondary_massey.rs` is now just the
interactive front-end (querying classes, formatting output).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nk9J57zb6GpvZxrduhGSdY
Introduce
ExtAlgebra::masseyandExtAlgebra::massey_familyin the newext_algebra/massey.rs, computing triple Massey products <a, b, c> (and the optimized <a, b, -> family over all valid third factors). The result typeMasseyResultcarries anAffineSubspace.These wrap
ChainHomotopy: for each candidate c we lift the multiplication map, build the null-homotopy of the composite with b, and read off the bracket by pairing with a; the valid c are the kernel of multiplication by b. No new linear algebra is added — this repackages the logic of themasseyexample.Refactors the
masseyexample ontomassey_iter_{a,c}; output is byte-identical to before (verified on S_2). Adds a unit test for the relation <h0, h1, h0> = h1^2 and that <h0, h1, h1> is undefined.Claude-Session: https://claude.ai/code/session_01XYWcvWZPm3YJkVpCmeGYsP
Summary by CodeRabbit