feat: hysteresis condition operator and lookup table support#9
Merged
Conversation
- Hysteresis operator (ARBITER_OP_HYSTERESIS = 13): - Schema: hysteresis op with rising/falling thresholds - C model: aux_value field in condition_def, static bitmask state - C eval: deadband logic with persistent per-condition state - Python evaluator: matching hysteresis with persistent state dict - Compiler: canonical.py maps rising->value, falling->aux_value - Emitters: emit_c.py, emit_blob.py updated for new op + aux_value - Lookup tables (ARBITER_EXPR_LOOKUP = 15): - Schema: tables array with id/keys/values, lookup expression op - C model: ARBITER_table_def struct, tables/table_count in model - C eval: linear interpolation with endpoint clamping - Python evaluator: _table_lookup helper with matching interpolation - Compiler: canonical.py flattens tables, resolves table references - Emitters: emit_c.py emits const arrays + table_def, emit_blob.py - Tests: 24 new tests covering hysteresis edges/deadband/persistence and lookup exact keys/interpolation/clamping/multiple tables Co-Authored-By: Oz <oz-agent@warp.dev>
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.
Hysteresis Condition Operator & Lookup Table Support
Hysteresis Operator (
ARBITER_OP_HYSTERESIS = 13)hysteresiscondition op withrisingandfallingthreshold fieldsaux_valuefield added toARBITER_condition_def; static bitmask for per-condition state_hyst_statedictcanonical.pymapsrising→value,falling→aux_valueemit_c.pyandemit_blob.pyupdated for new op andaux_valueLookup Tables (
ARBITER_EXPR_LOOKUP = 15)tablesarray withid/keys/values;lookupexpression op withtablefieldARBITER_table_defstruct;tables/table_countfields inARBITER_modeltable_lookup()_table_lookup()helper with matching integer interpolationcanonical.pyflattens and sorts tables, resolves table name referencesemit_c.pyemits const key/value arrays andARBITER_table_def;emit_blob.pyupdatedTests
test_hysteresis_lookup.pyConversation: https://app.warp.dev/conversation/d8b819b9-1d77-4bd5-9187-ff3c2289793d
Run: https://oz.warp.dev/runs/019e8993-e9a3-7c21-baff-810d0ea0d7c3
This PR was generated with Oz.