FEAT: Python/Sollya driver that used for generates LUT/Constants#5
Open
seiko2plus wants to merge 1 commit into
Open
FEAT: Python/Sollya driver that used for generates LUT/Constants#5seiko2plus wants to merge 1 commit into
seiko2plus wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a Python/Sollya driver system for automatically generating lookup tables and mathematical constants used in trigonometric computations. The system enables precise generation of argument reduction tables, π splits for different architectures, compact lookup tables for trigonometric approximations, and precomputed sin/cos values.
Key changes include:
- Implementation of a comprehensive Sollya utility library with floating-point type descriptors and code generation helpers
- Python-based CLI tool for processing Sollya scripts with parallel execution and colored output
- Integration with the project's build system through pyproject.toml and spin commands
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/sollya/core.sol | Core Sollya utility library with type descriptors, bit manipulation, and code generation procedures |
| tools/sollya/main.py | Python CLI driver for processing Sollya scripts with parallel execution and error handling |
| tools/sollya/init.py | Package initialization exposing the main function |
| pyproject.toml | Project configuration with spin command integration |
| npsr/trig/data/reduction.h.sol | Sollya script generating Payne-Hanek reduction tables for trigonometric functions |
| npsr/trig/data/kpi16-inl.h.sol | Script generating sin/cos lookup tables for k·π/16 values with packed low-precision parts |
| npsr/trig/data/data.h.sol | Master header inclusion script for trigonometric data tables |
| npsr/trig/data/constants.h.sol | Script generating π-related constants for Cody-Waite reduction in various precisions |
| npsr/trig/data/approx.h.sol | Script generating 4-element lookup tables for fast trigonometric approximation |
| .spin/cmds.py | Spin command integration for the sollya code generation tool |
Comments suppressed due to low confidence (1)
tools/sollya/core.sol:1
- Corrected spelling of 'Tuble' to 'Table'.
// Sollya utility functions for generating C++ header files with mathematical constants and lookup tables
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
677b8ab to
17b3f33
Compare
Argument reduction & tables: - Payne–Hanek tables via chunked 4/π per exponent range (`reduction.h.sol`) - π splits for FMA/non-FMA and float/double (`constants.h.sol`) - Compact 4-term (value + derivatives) LUTs (`approx.h.sol`) - Precomputed sin/cos(k·π/16) for quadrant handling (`kpi16-inl.h.sol`) Sollya-driven codegen pipeline: - Tooling lives in `tools/sollya` with shared helpers - CLI: `spin sollya [-f]` (via `.spin/cmds.py`) to (re)generate headers - Project wiring: `pyproject.toml` matters for spin
17b3f33 to
e9da4dc
Compare
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.
Argument reduction & tables:
reduction.h.sol)constants.h.sol)approx.h.sol)kpi16-inl.h.sol)Sollya-driven codegen pipeline:
tools/sollyawith shared helpersspin sollya [-f](via.spin/cmds.py) to (re)generate headerspyproject.tomlmatters for spin