Skip to content

feat(vector): compile exact ordered tag programs - #186

Merged
vntrevx merged 3 commits into
mainfrom
feat/m21-tag-program
Aug 11, 2026
Merged

feat(vector): compile exact ordered tag programs#186
vntrevx merged 3 commits into
mainfrom
feat/m21-tag-program

Conversation

@vntrevx

@vntrevx vntrevx commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Implements roadmap M21-02.

Intent:

  • add the versioned tag-program-v1 compiler and reference executor
  • preserve Freqtrade wrapper initialization, source-order writes, compound tags, and raw whitespace
  • lower formatted Signal IDs as program data instead of runtime branches
  • add a pinned Freqtrade 2026.5.1 tag oracle and exact regression tests

Risk:

  • vector contract and CLI change; no simulator or release workflow change
  • latest X7 remains fail-closed at strategy.py:13034:13 until later compile-context lowering

Local validation:

  • 800 Python tests passed
  • 143 future-NFI compatibility tests passed
  • 212 Rust workspace tests passed
  • Ruff, basedpyright, rustfmt, and Clippy passed
  • Spot and Futures trade-surface plus full-state fixtures exact

Evidence identity:

  • implementation commit a85ae58
  • oracle fingerprint 11219ab2fae512e0e833f05c323a5cb8e47a724154a9d50ac126c6d8dbadba77

@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: 5593064e7d

ℹ️ 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 +267 to +270
if column in TAG_COLUMNS and self.nodes[int(value[1:]) - 1]["op"] == "column-read":
self.nodes[int(value[1:]) - 1]["value_type"] = "string-column"
self.node_types[value] = "string-column"
self.required_input_columns.discard(column)

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 Reject future-phase tag reads

When populate_entry_trend reads dataframe['exit_tag'], this branch rewrites the column-read to string-column and removes exit_tag from required_input_columns just because it is a tag column. The tag contract only initializes enter_tag before entry and exit_tag before exit, so a future-phase tag read is either a real input/stale column or should be unsupported; advertising no input lets Native callers omit the column and then fail or diverge at execution. Please only suppress required inputs for tags already initialized by the wrapper, and fail closed otherwise.

AGENTS.md reference: AGENTS.md:L38-L40

Useful? React with 👍 / 👎.

Comment on lines +274 to +276
if isinstance(node.op, ast.Add):
left = self.expression(node.left)
right = self.expression(node.right)

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 Avoid emitting numeric-add operands twice

Whenever a tag expression uses numeric + (for example dataframe['a'] + dataframe['b'] > 0 in a tag mask), these calls emit both operands before deciding no string concat is needed, and super().binary then emits the same operands again. Since the runtime walks every node in function['node_ids'], the dead subgraph is still executed and nested additions can blow up the tag program/executor work compared with the source. Reuse the already-emitted operands for numeric add or inspect types without emitting.

Useful? React with 👍 / 👎.

@vntrevx
vntrevx merged commit f434c0f into main Aug 11, 2026
11 checks passed
@vntrevx
vntrevx deleted the feat/m21-tag-program branch August 11, 2026 10:02
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