fix(examples): repair broken examples; restore v1 window-join semantics#261
Open
singaraiona wants to merge 1 commit into
Open
fix(examples): repair broken examples; restore v1 window-join semantics#261singaraiona wants to merge 1 commit into
singaraiona wants to merge 1 commit into
Conversation
Running every examples/rfl/*.rfl surfaced several breakages:
1. timeit swallowed errors: ray_timeit_fn discarded an error result and
always returned a timing, so a failing expression looked like it
succeeded (this hid the broken wj.rfl). It now propagates the error.
2. window-join diverged from v1 (the engine before the v2 rollup):
- intervals now take the v1 two-parallel-vector form (list lo_vec
hi_vec), one entry per left row, instead of per-row [lo hi] pairs.
- window-join (wj) and window-join1 (wj1) were the same function; they
are split again. wj seeds each window with the prevailing quote
(rightmost quote with time <= lo); wj1 is the strict [lo,hi] window.
3. Example fixes:
- flips.rfl: C8 (removed type) -> STR in the CSV schema.
- window.rfl: run a real window-join showing wj vs wj1.
- datalog.rfl: (get p 1) -> (get p 'name) (dicts are key-, not
index-addressed).
- journal.rfl: use the .log.* journaling API, not .ipc.open/write/read.
Window-join test assertions were converted to the v1 interval format and
expected values recomputed for the prevailing-quote semantics. Full suite
green (3460/3462, 0 failed).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Investigated all of
examples/rfl/and fixed every breakage found by running each example, plus restoredwindow-jointo its v1 behavior (the engine state before themerge: import v2 enginerollup).Engine
timeitno longer swallows errors (src/ops/builtins.c). It evaluated the expression, dropped the result on the error branch, and always returned a timing — so a failing expression printed a happy... time: X ms. This was masking the brokenwj.rfl. It now propagates the error and still times valid expressions.src/ops/query.c,src/lang/eval.c):intervalsnow takes the v1 two-parallel-vector form(list lo_vec hi_vec)(one entry per left row, themap-left/ literal shape the examples use), not per-row[lo hi]pairs.window-join(wj) andwindow-join1(wj1) were registered to the same function. They are split again: wj seeds each window with the prevailing quote (rightmost quote withtime <= lo); wj1 is the strict[lo,hi]window. Verified distinct fromasof-join.Examples
flips.rfl:C8(a removed type) →STRin the CSV schema (waserror: type).window.rfl: rewritten to run a realwindow-joinand show the wj[3 4 4]vs wj1[3 3 3]difference.datalog.rfl:(get p 1)→(get p 'name)(dicts are key-addressed, not positional).journal.rfl: rewritten to the real.log.*journaling API instead of.ipc.open+write/read.Tests
~40 window-join assertions converted to the v1 interval format with expected values recomputed by hand for the prevailing-quote semantics, across
joins.rfl,dump.rfl,query_coverage.rfl,query_branch_cov.rfl, and the opt/exec coverage files. Collection-testmap-rightusages (which test the builtin itself) were left untouched.Test plan
make test: 3460 of 3462 passed (2 skipped, 0 failed).examples/rfl/*.rflrun clean (flips.rflreports onlyerror: iosince it needs the user-provided/tmp/flips.csv, as documented in its header).timeitnow surfaces an error (rc=1) instead of a timing, and still times valid expressions.