xlstream: centralize formula registration (single registry)#182
Merged
Conversation
Add bitflags dependency and pure metadata types for the centralized function registry.
…llect_lookup_keys
- 225 handle_* wrappers in builtins/mod.rs (uniform Value-returning sig) - pub mod registry in lib.rs - fix resolve.rs doctest for fn_lookup callback
- 13 registry unit tests (lookup, aliases, flag consistency) - interp.rs: registry::dispatch replaces builtins::dispatch - evaluate.rs: registry::lookup_meta replaces no_meta placeholder - remove old 300-line dispatch match and agg() helper
- classify_function() routes via FnCaps/FnCategory from fn_lookup - rewrite_node() routes via meta.category and meta.caps.LOOKUP - collect_from_node() gates on LOOKUP flag - agg_kind_for() removed (replaced by meta.agg_kind) - sets.rs: removed 5 sets, kept UNSUPPORTED only - integration tests use real registry; unit tests use test_meta mock
- CHANGELOG.md: add centralized registry entry under [Unreleased] - roadmap: tick formula registry checkbox, mark v1 spec superseded - cli: use registry::lookup_meta instead of no_meta placeholder - prelude_plan tests: use real registry for classify/rewrite - fix parse-crate doctests for registry-gated routing
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 709cc55 | Previous: cf9a571 | Ratio |
|---|---|---|---|
conditional/iferror |
103 ns/iter (± 0) |
78 ns/iter (± 1) |
1.32 |
date/year |
258 ns/iter (± 4) |
200 ns/iter (± 3) |
1.29 |
date/datedif |
512 ns/iter (± 12) |
405 ns/iter (± 2) |
1.26 |
info/isnumber |
85 ns/iter (± 0) |
70 ns/iter (± 0) |
1.21 |
info/row_no_arg |
55 ns/iter (± 0) |
37 ns/iter (± 0) |
1.49 |
info/column_no_arg |
61 ns/iter (± 0) |
44 ns/iter (± 0) |
1.39 |
info/rows_range |
64 ns/iter (± 0) |
51 ns/iter (± 0) |
1.25 |
This comment was automatically generated by workflow using github-action-benchmark.
…andle_* - delete 58 pass-through wrappers (34 sub-module, 24 local) - rename 25 builtin_* in mod.rs to handle_* for consistent naming - registry points directly at sub-module functions where possible - bump conditional, lookup, multi_conditional, subtotal to pub(crate)
1. fix EXPON.DIST flag: remove incorrect RANGE_EXPAND 2. fix collect_from_node: use meta.name for inner match 3. widen FnCaps from u8 to u16 for future flags 4. make FunctionEntry::handler pub(crate) 5. exact entry count test (208) 6. aggregate-implies-NEEDS_PRELUDE invariant test
4 tasks
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.
Summary
xlstream-eval/src/registry.rsFunctionEntrystructs withFunctionMeta(caps, category, agg_kind) + handler fn pointer + aliasesclassify(),rewrite(),collect_lookup_keys()take afn_lookupcallback — parse never imports evalregistry::dispatch()replaces the old 300-line match inbuiltins/mod.rsclassify_function()routes viaFnCaps/FnCategoryflags instead of 5sets::is_*()callssets.rsreduced from 8 phf_sets to 3 (kept: UNSUPPORTED, DYNAMIC_ARRAY, VOLATILE_UNSUPPORTED)docs/roadmap/v0.4/02-formula-registry-cleanup-v2.mdTest plan
make checkpasses (fmt, clippy, test, doctest)