!lymvtcwDJ7ZA9Npq:lix.systems

Lix Development

402 Members
(Technical) development of Lix, the package manager, a Nix implementation. Please be mindful of ongoing technical conversations in this channel.135 Servers

Load older messages


SenderMessageTime
9 Nov 2025
@aloisw:julia0815.dealoisw Weirdly nrOpUpdateValuesCopied is still 2 on my machine. 17:41:18
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)Ah sorry I was confused omg lol. Don't mind the noise17:43:37
@aloisw:julia0815.dealoisw Also it doesn't give false if replacing f by an integer. So it's related to the pointer/function mess. 17:45:45
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)

Yeah so doing this does help:

diff --git a/lix/libexpr/eval.cc b/lix/libexpr/eval.cc
index f1ba9e01c..5a5acd6aa 100644
--- a/lix/libexpr/eval.cc
+++ b/lix/libexpr/eval.cc
@@ -2682,6 +2682,7 @@ bool EvalState::eqValues(Value & v1, Value & v2, const PosIdx pos, std::string_v
 
         /* Functions are incomparable. */
         case nFunction:
+           if (pointerEq()) return true;
             return false;
 
         case nExternal:

But I'm not sure about all the consequences :)

17:49:35
@xokdvium:matrix.orgSergei Zimmerman (xokdvium) *

Yeah so doing this does help:

diff --git a/lix/libexpr/eval.cc b/lix/libexpr/eval.cc
index f1ba9e01c..5a5acd6aa 100644
--- a/lix/libexpr/eval.cc
+++ b/lix/libexpr/eval.cc
@@ -2682,6 +2682,7 @@ bool EvalState::eqValues(Value & v1, Value & v2, const PosIdx pos, std::string_v
 
         /* Functions are incomparable. */
         case nFunction:
+            if (pointerEq()) return true;
             return false;
 
         case nExternal:

But I'm not sure about all the consequences :)

17:49:49
@xokdvium:matrix.orgSergei Zimmerman (xokdvium) *

~~What's even more cursed is this~~:

  • xokdvium got confused, don't mind the noise *
17:53:14
@aloisw:julia0815.dealoisw let a = { f = x: x; }; in a.f == a.f would now return true. 17:58:31
@aloisw:julia0815.dealoiswI think https://git.lix.systems/lix-project/lix/commit/80654b84b610f4c0622dd10f0af78a8a2ce97048 is the offending change btw. Currently building that and its parent to confirm.18:01:20
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)Worth mentioning on https://gerrit.lix.systems/c/lix/+/4556. But the cat is out of the bag on this and compat with cppnix wasn't a design decision for that patch?18:01:28
@aloisw:julia0815.dealoisw
In reply to @aloisw:julia0815.de
I think https://git.lix.systems/lix-project/lix/commit/80654b84b610f4c0622dd10f0af78a8a2ce97048 is the offending change btw. Currently building that and its parent to confirm.
It's not, weirdly enough I get true there?
18:06:22
@aloisw:julia0815.dealoisw Ah fuck I forgot to change f back to a function. 18:10:03
@aloisw:julia0815.dealoiswConfirmed this is the breaking change.18:12:25
@raitobezarius:matrix.orgraitobezarius https://gerrit.lix.systems/c/lix/+/4556 18:16:23
@raitobezarius:matrix.orgraitobezariusnot totally18:16:49
@raitobezarius:matrix.orgraitobezariuswe looked hard and we were not able to disprove our theory that we were enabling more correctness18:17:03
@raitobezarius:matrix.orgraitobezariuslike we ran evaluation regression testing and we had no failure but new successes18:17:22
@raitobezarius:matrix.orgraitobezariusafter looking hard at the new success, we were unable to say "ah it's wrong", but more like: ah it's possibly a fun eq ptr bug18:17:44
@raitobezarius:matrix.orgraitobezariusput in another way, breaking bug to bug compatibility: yes, by having a behavior that agrees on successes: yes, new failures: not an intended objective18:19:11
@raitobezarius:matrix.orgraitobezarius* put in another way, breaking bug to bug compatibility: yes, by having a behavior that agrees on existing successes: yes, new failures: not an intended objective18:19:21
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)
In reply to @raitobezarius:matrix.org
put in another way, breaking bug to bug compatibility: yes, by having a behavior that agrees on existing successes: yes, new failures: not an intended objective
Yeah, that’s why I meant by compat.
18:19:38
@raitobezarius:matrix.orgraitobezariusin general, i'd like to kick pointer inequality out of the lang18:20:18
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)Seems like it would be beneficial to run a regression on older nixpkgs as well, since apparently it suffers much more from pointer equality footguns.18:20:18
@raitobezarius:matrix.orgraitobezariusyep18:20:25
@raitobezarius:matrix.orgraitobezariuswe should definitely do that18:20:30
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)
In reply to @raitobezarius:matrix.org
in general, i'd like to kick pointer inequality out of the lang
Indeed. I doubt anybody wants to keep it around, but it’s not like frontend semantics where one can just copy the parser code. If one wants to keep the ability to eval legacy nix code then it doesn’t seem possible to get the object model benefits (like single-pointer values) without also keeping bug-for-bug compat
18:24:26
@shine:proqqul.netTaeer Bar-Yam

I've been talking with Sergei Zimmerman (xokdvium) about this issue over the last couple weeks, and one idea that I had was to go further in the opposite direction. Rather than running pointer equality on functions (or perhaps in addition), have functions compare equal if they comprise the same Expr and Env.

Also be aware I haven't looked at Lix code only CppNix, so maybe this doesn't make sense given how they've diverged.

18:25:21
@xokdvium:matrix.orgSergei Zimmerman (xokdvium)
In reply to @raitobezarius:matrix.org
in general, i'd like to kick pointer inequality out of the lang
* Indeed. I doubt anybody wants to keep it around, but it’s not like frontend semantics where one can just copy the parser code. If one wants to keep the ability to eval legacy nix code then it doesn’t seem possible to get the object model benefits (like single-pointer values) without also ~~keeping~~ yeeting bug-for-bug compat
18:26:18
@shine:proqqul.netTaeer Bar-YamMy thinking is that people are much more likely to depend on the behaviour "these equal functions compare equal" than "these equal functions compare non-equal". So if you're going to break backward-compatibility in some direction, it should probably be in the direction of allowing more functions to compare equal when they are, in fact, equal as functions.18:27:14
@raitobezarius:matrix.orgraitobezariusIndeed, it was an opportunistic naive attempt we could not disprove (until you provided the example and thank you!) its soundness18:27:49
@raitobezarius:matrix.orgraitobezariusThe bar for changing that is going to be much higher now18:27:56

Show newer messages


Back to Room ListRoom Version: 10