-
Notifications
You must be signed in to change notification settings - Fork 0
Development and Performance
| Path | Role |
|---|---|
src/traits.rs |
Core automaton capabilities. |
src/explicit.rs |
Stored weighted automata and lazy indexes. |
src/combinators/ |
Product, inverse homomorphism, mapping, determinization. |
src/algebras/ |
Algebra interfaces and string/tree implementations. |
src/codec.rs, src/codecs/
|
Typed codec registries and concrete grammar readers. |
src/irtg.rs |
Interpretations and the high-level parsing API. |
src/materialize.rs |
General and condensed chart construction. |
src/astar.rs, src/astar/
|
Exact one-best search and specialized indexes. |
src/run.rs, src/viterbi.rs, src/sorted_language.rs
|
Automaton consumers. |
src/corpus.rs, src/parseval.rs
|
Corpus I/O and evaluation. |
src/bin/eval.rs |
Main corpus parsing frontend. |
tools/alto-compare/, scripts/
|
Cross-language benchmarks against Alto. |
docs/ |
Detailed experiment reports and implementation notes. |
packed-term-arena is downloaded from crates.io with the other Rust
dependencies. From rusty-alto:
cargo test
cargo doc --no-deps --all-features
cargo build --release --bin evalRelease mode is essential for meaningful parser timings.
The Package and publish GitHub Actions workflow runs tests and verifies the
crates.io archive on pull requests and pushes to main. Publishing a matching
GitHub Release uploads the crate to crates.io. docs.rs then builds and hosts the
public API documentation for that immutable release.
Wiki source lives in wiki/ in the main repository. The Wiki workflow
synchronizes it to GitHub's separate wiki repository after changes reach
main. Keeping the source beside the code makes architectural edits reviewable
in normal pull requests.
- Start with a clean, algebra-independent abstraction.
- Add specialization for measured common cases, especially rule arities up to two and deterministic transitions.
- Avoid per-query allocation in transition and join hot paths.
- Build expensive indexes lazily.
- Use dense IDs,
FxHashMap, borrowed hash lookups, and small inline buffers where profiling supports them. - Preserve a correct general fallback when a specialization does not apply.
The current string A* implementation illustrates this approach. A general candidate generator handles arbitrary condensed automata and rule arities. A product-aware span sibling finder accelerates unary and binary string rules without changing the public A* or automaton interfaces.
Alto's source is the first place to look when an algorithmic choice is subtle,
especially for IRTG parsing and language enumeration. The Java harnesses under
tools/alto-compare/ run equivalent workloads through Alto; scripts under
scripts/ compare outputs and timings.
Before accepting a performance change:
- Verify semantic equality with unit tests and, where relevant, Alto output.
- Measure a representative release workload.
- Record counters that explain the change, not just wall-clock time.
- Keep the simpler general path unless the specialization has a demonstrated benefit.
Historical measurements and active bottleneck analyses live in docs/, in
particular docs/performance.md, docs/benchmark-results.md, and the A*
design notes.
The GUI handoff for file loading, value visualization, and Copy menus is
documented in docs/codec-infrastructure.md.