Skip to content

feat(vector): compile ordered signal mutations - #183

Merged
vntrevx merged 4 commits into
mainfrom
feat/m21-signal-program
Aug 11, 2026
Merged

feat(vector): compile ordered signal mutations#183
vntrevx merged 4 commits into
mainfrom
feat/m21-signal-program

Conversation

@vntrevx

@vntrevx vntrevx commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Implements roadmap M21-01.

  • Adds the versioned signal-program-v1 schema, static compiler, validator, Python reference executor, CLI, and modular documentation.
  • Preserves Freqtrade entry-before-exit, masked/full-column assignment, read-after-write, nullable Boolean mask, and source-order last-write semantics without Signal-number runtime branches.
  • Captures a pinned Freqtrade 2026.5.1 advise_entry/advise_exit oracle and fixes exact numeric-one signal activation plus wrapper initialization/legacy rename behavior in the current vector lane.
  • Keeps tag generation explicitly fail-closed for M21-02 and records latest X7 self.config as the next typed lowering boundary; no Full Native latest-X7 claim.

Validation:

  • Python: 786 passed
  • Future compatibility: 143 passed
  • Rust: 143 sim-core + 66 vector-core + 3 vector-io passed
  • Ruff, basedpyright, rustfmt, workspace Clippy -D warnings passed
  • Spot and Futures full fixtures: trade surface and full-state exact

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +219 to +220
normalized = raw.mask(raw.isna(), 0)
result[f"nfi_exec_{column}"] = normalized.shift(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +117 to +119
phase = phase_by_function.get(node["function"])
if phase is None:
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@vntrevx
vntrevx merged commit 0148c87 into main Aug 11, 2026
11 checks passed
@vntrevx
vntrevx deleted the feat/m21-signal-program branch August 11, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant