Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(drawing): add drawing objects as data runtime#43

Merged
luisleo526 merged 2 commits into
mainfrom
feat/drawing-objects-as-data
Jun 29, 2026
Merged

feat(drawing): add drawing objects as data runtime#43
luisleo526 merged 2 commits into
mainfrom
feat/drawing-objects-as-data

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

Summary

  • Add header-only Pine v6 drawing runtime data structures for line/box/label/linefill/chart.point.
  • Implement value-view handles over per-type DrawingArena with monotonic ids, tombstones, FIFO cap eviction, dead/na access errors, and visual no-op sink.
  • Add drawing runtime unit tests, including cap-zero hardening.

Scope / caveats

  • No rendering or C ABI changes.
  • egoigor trade-count parity remains out of scope; matched trades are price-exact, but it is not trade-for-trade.
  • Working tree has a pre-existing uncommitted corpus submodule pointer that is not part of this PR.

Verification

  • cmake --build build -j4
  • ctest --test-dir build --output-on-failure -R drawing
  • ./scripts/run_corpus.sh && python scripts/verify_corpus.py --all → 246 strategies: excellent=245, anomaly=1, fail=0

luisleo526 and others added 2 commits June 29, 2026 10:50
New header-only include/pineforge/drawing.hpp (all inline) backing the
codegen drawing feature: value-view handles (Line/Box/Label/Linefill),
ChartPoint value struct, per-type DrawingArena<Rec> (monotonic ids,
tombstoned slots, exact-cap FIFO eviction), and the pf_* free functions
for line/box/label/linefill geometry + the pf_noop visual sink.

Dead/na-handle access throws pine_drawing_error (: std::runtime_error),
caught by BacktestEngine::run() -> halts the backtest exactly like
TradingView. Always-on, no flag. line.get_price does real infinite-line
interpolation (throws on xloc.bar_time, na on degenerate). copy() is a
deep arena copy; delete() is a silent no-op on na/dead.

tests/test_drawing.cpp (ctest) covers alloc/monotonic ids, mutate-through
aliased handle, deep-copy independence, dead-handle throw, FIFO eviction,
get_price interp/degenerate/bar_time, chart.point value copy, na<Handle>().
Nothing here is exported via the C ABI (codegen-emitted in-process calls).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@luisleo526 luisleo526 merged commit 02c7564 into main Jun 29, 2026
5 checks passed
@luisleo526 luisleo526 deleted the feat/drawing-objects-as-data branch June 29, 2026 03:25
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