Severity: Low
sort, unique, min, max, group_by take document (StandardJson) input, so an
array built in the filter reaches them through the reindex bridge (to_json_for_reindex
→ re-index → from_number_bytes). A computed double whose shortest spelling looks
integral (869389897822472000, i.e. 869389897822471936.0) comes back as
NumberLiteral(Int(869389897822472000), …), and from then on compares exactly against a
real literal instead of equal (jq keeps it a double, and #2906's comparator treats the
literal 869389897822472004 as equal to it):
$ jq -n -c '[869389897822472004, (869389897822472000+0), 5] | sort' # [5,869389897822472004,869389897822472000]
$ sjq -n -c '[869389897822472004, (869389897822472000+0), 5] | sort' # [5,869389897822472000,869389897822472004]
$ jq -n -c '[5, 869389897822472004, (869389897822472000+0)] | max' # 869389897822472000
$ sjq -n -c '[5, 869389897822472004, (869389897822472000+0)] | max' # 869389897822472004
Identical before and after #2906 (the comparator is right; the bridge changes the
operand). Binary ==/< on the same values are correct because they never cross the
bridge. Recorded in docs/compliance/jq/limitations.md under the #2906 entry.
Possible fix directions: have the bridge re-bake an integral Float past 2^53 as a
Float-repr NumberLiteral (the text is still what jq would print, so display is
unchanged), or extend reindex_bridge_is_identity's bypass to jq-mode Floats whose
spelling is not mode-forked.
Severity: Low
sort,unique,min,max,group_bytake document (StandardJson) input, so anarray built in the filter reaches them through the reindex bridge (
to_json_for_reindex→ re-index →
from_number_bytes). A computed double whose shortest spelling looksintegral (
869389897822472000, i.e.869389897822471936.0) comes back asNumberLiteral(Int(869389897822472000), …), and from then on compares exactly against areal literal instead of equal (jq keeps it a double, and #2906's comparator treats the
literal
869389897822472004as equal to it):Identical before and after #2906 (the comparator is right; the bridge changes the
operand). Binary
==/<on the same values are correct because they never cross thebridge. Recorded in
docs/compliance/jq/limitations.mdunder the #2906 entry.Possible fix directions: have the bridge re-bake an integral
Floatpast2^53as aFloat-reprNumberLiteral(the text is still what jq would print, so display isunchanged), or extend
reindex_bridge_is_identity's bypass to jq-modeFloats whosespelling is not mode-forked.