feat(vector): compile ordered signal mutations - #183
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b25f24e8e
ℹ️ 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".
| normalized = raw.mask(raw.isna(), 0) | ||
| result[f"nfi_exec_{column}"] = normalized.shift( |
There was a problem hiding this comment.
Preserve boolean signals in a numeric form
When a strategy assigns boolean signals (for example dataframe['enter_long'] = dataframe['cond'], which Freqtrade/Python treats as enabled because True == 1), this now preserves the boolean dtype into nfi_exec_enter_long. The Rust vector reader still routes signal columns through required_number, which rejects Arrow Boolean, so valid boolean signal strategies will fail in the native lane after the vector worker writes the Feather artifact; normalize boolean signal columns to a numeric 0/1 representation before serialization while still leaving non-one numeric values unpromoted.
AGENTS.md reference: AGENTS.md:L30-L31
Useful? React with 👍 / 👎.
| phase = phase_by_function.get(node["function"]) | ||
| if phase is None: | ||
| continue |
There was a problem hiding this comment.
Account for helper-owned signal writes
If populate_entry_trend or populate_exit_trend delegates its final DataFrame mutation to a helper, _SignalCompiler records that helper's frame-write in final_mutations, but validation skips every helper-owned write here and recomputes signal_outputs only from entrypoint-owned nodes. As a result, a strategy such as dataframe = self.set_entry(dataframe); return dataframe, where set_entry writes enter_long, makes compile_signal_program() reject its own compiled program with final output inventory differs instead of producing the ordered mutation program.
Useful? React with 👍 / 👎.
Implements roadmap M21-01.
Validation:
Risk: signal transport semantics changed from nonzero to the exact Freqtrade comparison value == 1. Existing X7 emits only 0/1; focused Python and Rust boundary tests cover 2, -1, string 1, NaN, and null.