Sergei Zimmerman
2d9bb33ba2
libexpr: Make attribute set comparison use deterministic lexicographic order of attributes
...
See the added test case for the reasoning. Current order of comparison
depends on the global state and sneaks in an impurity. Introducing a
canonical order for comparisons is the only reasonable approach for
plugging this hole. The order was already unspecified and could change
for various reasons like changes to internal files/symbols used, so this
isn't exactly a breaking change.
While we have the option of choosing an arbitrary comparison order we
also choose a more efficient approach by first comparing all keys and
only then forcing any values. Notice that this is still compatible with
the non-deterministic iteration order that was used prior to this commit.
We just behave "as if" we choose the most efficient iteration order that
also happens to be strictly not less lazy.
I consider plugging this purity hole to be a requirement for adding
any sort of parallel/async eval, which would make the problem 100 times
worse by introducing true randomness to evaluation (depending on the
OS scheduling/order in which thunks finish evaluating).
Note that the choice of iteration order is consistent with snix [1],
which is good for reproducibility (modulo short circuit on non-matching keys).
[1]: a35d6558dd/snix/eval/src/value/mod.rs (L625-L628)
2026-02-26 15:53:47 +03:00
..
2026-02-19 01:50:17 +01:00
2026-01-14 20:42:20 +01:00
2025-11-09 16:52:51 +03:00
2026-01-27 12:32:41 -05:00
2025-11-07 00:17:37 -05:00
2026-01-25 23:56:44 +03:00
2026-02-24 13:05:16 -05:00
2026-02-05 00:52:02 +01:00
2026-01-09 14:57:21 +01:00
2026-02-26 15:53:47 +03:00
2025-01-24 17:04:02 +01:00
2026-01-25 22:03:16 +03:00
2024-12-09 17:19:47 +01:00
2025-09-29 10:52:17 -07:00
2025-08-07 02:57:02 +03:00
2025-11-29 01:10:26 +03:00
2025-10-12 19:16:06 +03:00
2024-08-14 15:35:40 -04:00
2025-01-07 05:42:03 +00:00
2024-06-12 16:58:25 -04:00
2025-01-24 17:04:02 +01:00
2024-06-20 14:54:11 +02:00
2026-02-18 21:30:37 +01:00
2024-06-20 14:54:11 +02:00
2025-07-07 10:33:42 +07:00
2025-07-07 10:33:42 +07:00
2025-09-22 16:54:30 -04:00
2024-06-20 14:54:11 +02:00
2025-01-24 17:04:02 +01:00
2025-10-29 02:15:41 -04:00
2025-01-24 17:04:02 +01:00
2024-05-28 12:46:24 -04:00
2025-04-14 11:20:07 -04:00
2024-06-20 14:54:11 +02:00
2024-05-28 12:32:22 -04:00
2025-06-22 16:49:44 +02:00
2024-05-28 12:46:24 -04:00
2024-05-28 12:46:24 -04:00
2024-06-20 14:54:11 +02:00
2024-06-20 14:54:11 +02:00
2025-06-22 16:49:44 +02:00
2024-05-28 12:46:24 -04:00
2025-12-30 14:39:54 -05:00
2026-02-17 12:54:24 -05:00
2025-01-24 17:04:02 +01:00
2024-09-05 19:26:10 +02:00
2025-09-22 21:06:26 +02:00
2025-03-25 06:12:19 +00:00
2025-11-19 15:48:10 -05:00
2025-01-24 17:04:02 +01:00
2024-06-20 14:54:11 +02:00
2025-01-24 17:04:02 +01:00
2025-08-27 09:48:31 +02:00
2025-02-19 12:47:28 +01:00
2024-08-14 15:35:40 -04:00
2025-09-24 18:56:00 -07:00
2024-06-20 14:54:11 +02:00
2024-05-28 12:46:24 -04:00
2024-11-11 15:21:34 +01:00
2025-09-24 18:59:41 -07:00
2025-09-25 07:53:29 +02:00
2024-06-20 14:54:11 +02:00
2025-10-24 11:11:03 +02:00
2025-01-24 17:04:02 +01:00
2025-09-24 19:11:00 -07:00
2025-04-14 13:43:46 -04:00
2025-12-10 15:30:12 -05:00
2025-09-25 09:24:39 +02:00
2024-09-05 16:41:15 +02:00
2025-09-25 10:33:40 -07:00
2024-12-31 14:24:06 +01:00
2026-01-06 02:34:48 +03:00
2024-06-12 17:41:16 -04:00
2025-01-24 17:04:02 +01:00
2025-09-25 10:35:01 -07:00
2025-09-25 12:45:40 -07:00
2026-02-16 23:20:10 -05:00
2024-11-11 15:21:34 +01:00
2024-05-28 12:46:24 -04:00
2025-01-24 17:04:02 +01:00
2025-10-24 11:11:03 +02:00
2026-02-05 00:52:02 +01:00
2026-01-09 14:57:21 +01:00
2026-01-09 14:57:21 +01:00
2026-02-05 01:04:32 +00:00
2026-01-09 14:57:21 +01:00
2026-02-05 00:52:02 +01:00
2024-10-16 17:18:07 +02:00
2024-06-20 14:54:11 +02:00
2025-10-13 22:23:26 +03:00
2025-01-24 17:04:02 +01:00
2024-06-12 17:41:16 -04:00
2025-09-26 08:41:30 -07:00
2025-09-26 08:41:30 -07:00
2025-07-25 10:19:08 -04:00
2025-12-08 16:50:25 -05:00
2025-05-25 15:53:01 +00:00
2025-01-24 17:04:02 +01:00
2025-09-29 09:17:24 -07:00
2025-05-22 19:18:53 +02:00
2024-06-12 17:41:16 -04:00
2025-09-29 09:18:50 -07:00
2025-09-29 09:22:45 -07:00
2025-09-29 09:20:02 -07:00
2025-01-24 17:04:02 +01:00
2025-09-29 09:21:47 -07:00
2025-09-29 09:23:41 -07:00
2026-01-30 11:05:10 -05:00
2026-01-30 11:52:34 -05:00
2024-10-30 08:27:06 -07:00
2025-01-24 17:04:02 +01:00
2025-12-05 15:12:08 -05:00
2025-01-07 05:42:04 +00:00
2025-02-07 11:20:18 +01:00
2025-01-24 17:04:02 +01:00
2025-01-24 17:04:02 +01:00
2025-12-08 19:16:44 +01:00
2025-12-08 19:16:44 +01:00
2025-01-24 17:04:02 +01:00
2026-02-05 00:52:02 +01:00
2024-11-11 15:21:34 +01:00
2024-06-20 14:54:11 +02:00
2024-05-28 12:46:24 -04:00
2025-09-29 10:52:17 -07:00
2025-03-24 16:38:20 +01:00
2024-07-22 17:46:08 +02:00
2026-01-06 17:26:20 +01:00
2024-05-28 12:46:24 -04:00
2025-01-24 17:04:02 +01:00
2025-09-29 10:52:17 -07:00
2025-09-29 10:52:17 -07:00
2026-01-26 15:08:08 -05:00
2025-09-29 10:52:17 -07:00
2025-01-24 17:04:02 +01:00
2025-09-29 10:52:17 -07:00
2025-01-24 17:04:02 +01:00
2025-12-08 03:26:03 +03:00
2026-01-21 06:06:19 +03:00
2025-09-29 10:52:17 -07:00
2025-09-29 10:52:17 -07:00
2024-11-11 15:21:34 +01:00
2025-09-29 10:52:17 -07:00
2025-09-29 10:52:17 -07:00
2025-09-29 10:52:17 -07:00
2025-09-29 10:52:17 -07:00
2025-09-29 10:52:17 -07:00
2024-05-28 12:46:24 -04:00
2025-07-21 19:03:49 +02:00
2026-02-25 16:26:01 -05:00
2026-02-16 21:06:55 +01:00
2026-02-25 17:29:56 -05:00
2025-09-29 10:52:17 -07:00
2025-09-29 10:52:17 -07:00
2025-11-07 15:24:26 -05:00
2025-09-29 10:52:17 -07:00
2025-01-24 17:04:02 +01:00
2025-09-29 10:52:17 -07:00
2025-09-30 19:52:44 -07:00
2025-09-30 19:53:33 -07:00
2025-12-08 16:50:25 -05:00
2025-01-24 17:04:02 +01:00
2025-09-30 19:54:29 -07:00
2024-11-03 16:42:38 -05:00
2025-10-29 02:15:41 -04:00
2026-02-05 00:52:02 +01:00
2025-09-30 20:15:34 -07:00
2025-01-24 17:04:02 +01:00
2025-09-30 20:15:34 -07:00
2025-01-24 17:04:02 +01:00
2025-09-30 20:15:34 -07:00
2025-09-30 20:15:34 -07:00
2025-09-30 20:15:34 -07:00
2025-09-30 20:17:54 -07:00
2026-02-25 23:09:12 +00:00
2026-02-05 00:52:02 +01:00
2024-11-11 15:21:34 +01:00
2024-06-20 14:54:11 +02:00
2025-01-24 17:04:02 +01:00
2025-09-30 20:17:55 -07:00
2025-09-30 20:17:55 -07:00
2025-01-24 17:04:02 +01:00
2025-12-12 18:04:37 -03:00
2025-08-04 23:50:02 +03:00
2024-07-07 00:23:22 +02:00
2024-07-07 14:49:52 +02:00
2025-09-30 20:17:55 -07:00
2026-02-25 17:29:56 -05:00
2025-12-08 16:50:25 -05:00
2025-01-24 17:04:02 +01:00
2025-09-30 20:18:48 -07:00
2024-11-11 15:21:34 +01:00
2025-11-22 23:29:31 +01:00
2024-08-14 15:16:06 +02:00
2025-09-05 04:14:36 +03:00
2026-01-26 15:08:08 -05:00
2025-05-24 00:40:06 +02:00
2025-10-08 22:15:33 +02:00
2026-01-07 18:00:27 +01:00
2024-08-14 15:16:06 +02:00
2024-08-14 15:16:06 +02:00
2025-09-30 20:19:27 -07:00
2024-11-11 15:21:34 +01:00
2025-02-11 20:58:48 +01:00
2026-02-15 10:16:54 -05:00
2026-01-25 22:03:16 +03:00
2024-11-03 16:42:38 -05:00
2024-11-11 15:21:34 +01:00
2025-12-15 16:21:01 -05:00
2025-09-30 20:19:47 -07:00
2024-06-11 16:05:57 +02:00
2025-01-24 17:04:02 +01:00
2024-09-05 20:37:26 +02:00
2025-09-30 20:20:13 -07:00
2025-09-30 20:27:50 -07:00
2025-09-30 20:23:02 -07:00
2025-01-24 17:04:02 +01:00
2024-05-28 12:46:24 -04:00
2025-09-30 20:27:51 -07:00
2024-11-04 14:52:56 +01:00