Repository navigation
D-PHT-1: phasors without transcendental calls (probe + board) - #1416
Conversation
Measures native sin_cos against a u32-turns phase LUT, CORDIC and a complex recurrence on two phasor-only observables: Wankel apex coordinates and coherent interference over 1,000 sources and 65,536 detectors. Probe only; no production primitive. - A 2^12 LUT with linear interpolation matches f32 sin_cos accuracy at about 4.5x its speed and 12x f64; 3θ is one wrapping_mul. - CORDIC is 2.6-4.8x slower than native f64 on this CPU. - ndarray vml sin/cos call scalar cos/sin per lane. - Two waves reduce to one cos(Δφ): 2.8x, 6x with the LUT. - The amplitude-bounded early exit equals the full fold on every detector; it saves 8-36x of the terms with heavy-tailed amplitudes and almost nothing with comparable ones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFw2WdKr1oxvaKCJC2ua2R
|
Warning Review limit reachedYour organization has reached its usage spending cap. Adjust your spending cap in the billing tab. Next included review available in 58 minutes. View limit detailsLimit details: You’ve used the included review currently available. Your 64 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (4)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Keeps both STATUS_BOARD sections (D-PHT and D-MHB from #1415) and regenerates the entries index. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFw2WdKr1oxvaKCJC2ua2R
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b44e85ff3b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| None => { | ||
| fallback += 1; | ||
| used_lut.push(n_src); |
There was a problem hiding this comment.
Execute the advertised exact fallback
When the LUT bound remains undecided—which the recorded results say occurs for 35–2,679 detectors—this branch only increments a counter and never performs or validates the promised f64 fallback. Those detectors therefore receive no classification, so the probe cannot support its claim that the LUT path equals the full fold on every detector; its work counts also omit the additional reference evaluation. Run the reference fold here and assert or return its decision.
Useful? React with 👍 / 👎.
This PR adds a probe and a board entry. No production primitive and no ndarray change.
The question: can two observables that need only phasors avoid every transcendental call in the hot path?
z_k(θ) = e·e^{i3θ} + R·e^{i(θ + 2πk/3)}.I = |Σ A_i e^{iφ_i}|², over 1,000 sources and 65,536 detectors.The phase is a
u32in turns, so3θisphase.wrapping_mul(3)and wraparound is free.Files:
crates/lance-graph-mask-risc/examples/phasor_trig_probe.rsentries/2026-10-08-phasor-trig-probe.md, plus aSTATUS_BOARDrowInventory
sin/cosanywhere in ndarray or lance-graph.ndarray::hpc::vml::vscos/vssincall scalarcos/sinper lane inside anF32x16wrapper.Measured
Medians of 5 runs.
Wankel apex, 1M phases
sin_cossin_cosvmlInterference, 1,000 × 65,536
sin_cossin_cos√Two waves:
I = A1² + A2² + 2A1A2 cos Δφreplaces two complex phasors with one cosine.Trajectory, 1M steps:
Amplitude-bounded early exit for
I ≥ T, withmax(0, |S| − R)² ≤ I ≤ (|S| + R)²:|S|grows like √N while R shrinks like N, so the bound only closes at the very end.i^-1.5): needs only 28–122 of 1,000 terms.Falsifiers
R√3, rotor centre at distancee, threefold symmetry, and the 3:1 law.u64.R = 0decision made through√. Both are fixed and described in the entry.Verdicts
u32-turns phase with an interpolated 2^12 LUT, exposed throughndarray::simd, plus an integer phase accumulator for trajectories.vmlas SIMD.Not done: a SIMD gather of the LUT, the rotor as a moving mask, the VSA comparison, and log buckets.
Checks
cargo clippy -p lance-graph-mask-risc --examples -D warnings: clean.fmt: clean.STATUS_BOARDsection above D-RPF and both regenerate the entries index. Whichever merges second needs a merge plus a regenerated index.🤖 Generated with Claude Code
https://claude.ai/code/session_01EFw2WdKr1oxvaKCJC2ua2R
Generated by Claude Code