From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gPrqNdyCc2Hx7wAAgWs5BA (envelope-from ) for ; Sat, 23 Oct 2021 05:34:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id IDtpMdyCc2FSJAAAbx9fmQ (envelope-from ) for ; Sat, 23 Oct 2021 03:34:52 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1AF1FD1AD for ; Sat, 23 Oct 2021 05:34:52 +0200 (CEST) Received: from localhost ([::1]:58978 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1me7o3-0001nw-9p for larch@yhetil.org; Fri, 22 Oct 2021 23:34:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49566) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1me7mJ-0008JR-0l for bug-guix@gnu.org; Fri, 22 Oct 2021 23:33:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50789) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1me7mI-0007JB-OD for bug-guix@gnu.org; Fri, 22 Oct 2021 23:33:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1me7mI-0002MV-H3 for bug-guix@gnu.org; Fri, 22 Oct 2021 23:33:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#50672: nnpack is not reproducible Resent-From: Kyle Meyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 23 Oct 2021 03:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50672 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 50672-submit@debbugs.gnu.org id=B50672.16349599799070 (code B ref 50672); Sat, 23 Oct 2021 03:33:02 +0000 Received: (at 50672) by debbugs.gnu.org; 23 Oct 2021 03:32:59 +0000 Received: from localhost ([127.0.0.1]:34102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1me7mF-0002MD-H9 for submit@debbugs.gnu.org; Fri, 22 Oct 2021 23:32:59 -0400 Received: from out10.migadu.com ([46.105.121.227]:63844) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1me7mB-0002M2-9r for 50672@debbugs.gnu.org; Fri, 22 Oct 2021 23:32:57 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1634959973; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QT/HTpeYDAYXyfzH3QVhAa/aRDODw3qGJc44T4imny8=; b=snZ95C5t+2rcNPC7voDkUyGVwhOX+U3/N0h5q49iV5o0R4iVjI4HvLItR9wx0Kzl44cTUm 0D1V+ZVjygDTCpv66g+zN3+ivBOp+VBXwEeL+EpLlRO+AgMEv/sRtdeW1ypHzpnlKigaBl R/n4A8w55qli1d1+zDF7vXSmuWlQ9VQ62asO4TQI7si13hzM83EK1HomYCXbc3+MEl1d4r QaUWyJCVarReXL+sUNZU8kb37SZK0Z7a092NtgCrtucn3/01ongJrvuCXMioy7w1O8VYCI dltGydbd2ClpM3sbqIewmFfte8l3io4/iGyFw/47XUB68VmZ7ILvJPaFm+LGSA== From: Kyle Meyer In-Reply-To: <87pmrxt6tf.fsf_-_@gnu.org> References: <875yuwsxad.fsf@inria.fr> <87a6k6j6uu.fsf@gnu.org> <87tuiam5ni.fsf@gnu.org> <87ilylf3yn.fsf@inria.fr> <87pmrxt6tf.fsf_-_@gnu.org> Date: Fri, 22 Oct 2021 23:32:50 -0400 Message-ID: <87ee8ch0v1.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 50672@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1634960092; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=QT/HTpeYDAYXyfzH3QVhAa/aRDODw3qGJc44T4imny8=; b=jcJi7g2YXYBy5czGo9IxoQzYjlMoU9cc9gu5i0z7BcvgoS2uGktDBwdu6pbwWDVWVlPhqq jSeu9ikjoeMFsNBU00OFpXGaM7ys0nMoglYKuShve8yqPa4SiED6EQt2FrDp/VhgHbZCSh cMNeT2LkUSG0wEmojsZ4v031Eh91WytJLADOqFBzE+FBaYUj1XSPjd5VStbh7vtNDgD75x bDCDQEC47inRxfM7g5ugdbWXAyaxIRaxV5Y+FB6AjwbXPafVC5oSEuhCIjc+DTjY/ByrNP G1KFwdHTq2SokVSt4R7YEgxcGjRBwrBwZAXKoPqECkp7li8BgcOfIFrK8fGUfQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634960092; a=rsa-sha256; cv=none; b=Ro3X/t2BRCVbrG9YYMhiof+kYUHH8U2TsEg+Ls+kspXv9BQ5YP2Gq1dVaSOZCAIuis14Yv gS1gnmGyMl/hzw8tyuTtyKQe8+acY0cWapKerf42/ZG1enItKuzMqa8nqXIU5j/VpqUEvY HYuv4o8EHP2XoUUQLCfyKV0+oC71mKPrgBti+kfKiQ4upiMH8L6mWHVFtr6Ot7ipSIg3Ij 87/OcWH+LMRw5m/Qv9hqsTBrUOza495RcwrnFlMhleHvpM+6xtR83NAmR9FVS2YRJ6Fhvi NAlByaQfCjgYzP/eB4S2PMryDKw2bVyhHoTECpLzoagWmsZgyaN+iMuY8/N1UQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kyleam.com header.s=key1 header.b=snZ95C5t; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: 0.07 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kyleam.com header.s=key1 header.b=snZ95C5t; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 1AF1FD1AD X-Spam-Score: 0.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: RzgU1FUXIQmE Ludovic Court=C3=A8s writes: > For the record, I tried the attached patch in an attempt to sort things > as discussed in the issue above, but it doesn=E2=80=99t have the intended > effect. There must be other unsorted dictionaries elsewhere. Hmm, I don't think dictionaries are a likely culprit here because Python's dict implementation preserves the insertion order as of Python v3.6 (and that behavior is declared as part of the language spec with v3.7). > diff --git a/peachpy/name.py b/peachpy/name.py > index b6a03dc..c069fc2 100644 > --- a/peachpy/name.py > +++ b/peachpy/name.py > @@ -95,6 +95,10 @@ class Namespace: > self.prenames[scope_name.prename].add(scope) >=20=20 > def assign_names(self): > + # Step 0: sort the dictionary for deterministic output > + self.prenames =3D dict(sorted(self.prenames.items(), > + key=3Dlambda item: "" if item[0] =3D= =3D None else item[0])) > + In cases where the order of the keys isn't specified (i.e. Python 3.5 and below), I think the end result after your change is the same: it creates a new dictionary for sorted _input_, but things won't necessarily come out in the same order. I'm not familiar with PeachPy, but taking a peek at name.py, the sets used for the values of the prenames dictionary could be the problem. And if that's the case, one solution would be switching those values from sets to dictionaries. With the change below (on top of PeachPy's 257881e), nnpack builds reliably for me across a couple of attempts: $ guix-dev build --with-git-url=3Dpython-peachpy=3D$local --no-grafts --c= heck nnpack successfully built /gnu/store/7z4nl55gssrf9na7wsvmw1dsqgawnj2p-nnpack-0.0= -1.c07e3a0.drv successfully built /gnu/store/7z4nl55gssrf9na7wsvmw1dsqgawnj2p-nnpack-0.0= -1.c07e3a0.drv /gnu/store/4ihjil42fbk53q73gpvdakynbv9q5q09-nnpack-0.0-1.c07e3a0 diff --git a/peachpy/name.py b/peachpy/name.py index b6a03dc..412079d 100644 --- a/peachpy/name.py +++ b/peachpy/name.py @@ -86,13 +86,13 @@ def add_scoped_name(self, scoped_name): self.names[scope_name.name] =3D scope else: assert scope_name.name is None - self.prenames.setdefault(scope_name.prename, set()) + self.prenames.setdefault(scope_name.prename, {}) if subscoped_name: for subscope in iter(self.prenames[scope_name.prename]): if isinstance(subscope, Namespace) and subscope.scope_= name is scope_name: subscope.add_scoped_name(subscoped_name) return - self.prenames[scope_name.prename].add(scope) + self.prenames[scope_name.prename][scope] =3D None =20 def assign_names(self): # Step 1: assign names to symbols with prenames with no conflicts