Skip to content

tract-harvest-probe: facts from Tract's inference stage (7,620/7,620 values, 0 refused for missing facts) - #1852

Merged
AdaWorldAPI merged 3 commits into
mainfrom
ccr-0161f442-un1mrc
Oct 30, 2026
Merged

AdaWorldAPI merged 3 commits into
mainfrom
ccr-0161f442-un1mrc

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Summary

The probe gets dtype and shape facts from Tract, which the plan's WHEN guards check against. Until now it read them from Tract's typed model. That stage labels only the values that survive typing: 2,546 of the Jina graph's 7,620. So 169 nodes whose op was registered were refused anyway, because their shapes were UNKNOWN.

dr3::FactSources now reads both Tract stages and keeps them apart:

  • inference: the inference model after analyse. It keeps every source label. A fact there can be partial, so a shape is taken only when its rank and every dimension are determined. An undetermined dimension never becomes a symbol, because two undetermined dimensions need not be equal.
  • typed: as before.
  • merged() prefers the inference fact and fills a missing dtype or shape from the typed one. disagreements() compares the two wherever both describe a value.
  • When typing fails, the inference facts are kept and the error is recorded in typed_error. Tract refuses to type a graph with an undetermined input dimension, but its inference stage still runs.

Results (Jina v5 small, inputs pinned [1,10])

inference typed merged
values with a full fact, of 7,620 7,620 2,546 7,620
disagreements where both describe a value 0 (all 2,546 agree)
registry v1 coverage [WHEN-true / WHEN-not-true / unregistered] 3,751 / 169 / 3,700 4,146 / 0 / 3,474
  • All 169 refusals came from missing facts.
  • A further 226 nodes became registered once their dtype was known. WHEN-true counts went from 282 to 452 for Mul, 141 to 253 for Add, and 1 to 113 for Div.
  • What remains unregistered is whole op groups: Unsqueeze 888, Shape 430, Gather 373, Concat 284, MatMul 253, Reshape 228.

Tests

  • New: inference_stage_facts_cover_every_value_and_agree_with_typed, full_graph_facts_and_coverage (Jina, counts pinned exactly), undetermined_input_dim_gives_no_shape_and_typing_failure_is_recorded, and the unit test dr3::tests::fact_sources_disagree_and_merge. The unit test is needed because disagreements() reports 0 on every real fixture, so nothing else could show it ever fires.
  • Re-pinned: unknown_shapes_refuse. The threshold T now has a Tract fact (the typed stage had merged it with Z), so the first UNKNOWN is n_greater, not n_where.

Test plan

  • cargo fmt, cargo clippy --release --all-targets -D warnings
  • cargo test --release --no-fail-fast -- --include-ignored: 26 passed
  • 4 disable runs, each red on the named tests: merge from typed only; undetermined dim as a symbol; typed failure propagated; disagreements always empty
  • examples/stages on the full model (numbers above); plan §0.1, board entry and STATUS_BOARD updated

Generated by Claude Code

… typed stage

The typed stage labels only 2,546 of the Jina graph's 7,620 source values,
so 169 registered nodes had UNKNOWN shapes and were refused. The inference
model (after analyse) keeps every label; a shape is taken only when its
rank and every dimension are determined. FactSources keeps both stages
apart: merged() prefers inference and fills gaps from typed, and
disagreements() compares them.

Jina, inputs pinned [1,10]: inference 7,620/7,620 full facts, typed 2,546,
0 disagreements. Registry v1 coverage 3,751 / 169 / 3,700 -> 4,146 / 0 /
3,474 (WHEN-true / WHEN-not-true / unregistered). unknown_shapes_refuse
re-pinned: T now has a Tract fact, so n_greater is the first UNKNOWN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMMjKnig6MXTd41Lf2v
…rs for the fact sources

FactSources records the typed stage's error instead of failing: Tract
refuses to type a graph with an undetermined input dim, but the inference
stage still runs. An undetermined dim gives no shape (never a symbol).
Unit test for disagreements()/merged(), which had only ever reported 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMMjKnig6MXTd41Lf2v
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a7063942-78d9-4cd3-9fb1-90ce50688fa2
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review October 30, 2026 09:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T09:28:45.415043Z 40eaa80 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@AdaWorldAPI
AdaWorldAPI merged commit 2513828 into main Oct 30, 2026
12 checks passed
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.

2 participants