From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: feature/native-comp 5bc0855 2/2: Don't treat '=' as simple equality emitting constraints (bug#46812) Date: Tue, 2 Mar 2021 17:14:39 +0000 Message-ID: References: <20210228230215.15472.12941@vcs0.savannah.gnu.org> <20210228230217.1971E20E1B@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22297"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 02 18:18:53 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lH8fc-0005h4-W2 for ged-emacs-devel@m.gmane-mx.org; Tue, 02 Mar 2021 18:18:52 +0100 Original-Received: from localhost ([::1]:41370 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lH8fc-0006zR-2K for ged-emacs-devel@m.gmane-mx.org; Tue, 02 Mar 2021 12:18:52 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lH8cC-0004Yh-Jh for emacs-devel@gnu.org; Tue, 02 Mar 2021 12:15:20 -0500 Original-Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]:40430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lH8cA-0000kV-2X for emacs-devel@gnu.org; Tue, 02 Mar 2021 12:15:20 -0500 Original-Received: by mail-ot1-x331.google.com with SMTP id b8so20669045oti.7 for ; Tue, 02 Mar 2021 09:15:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aaAKZhRJ9bSUaTeT1Aa5E4n9ZlK02HhIPpgtZxcumcA=; b=h2U2wSf9jyNLq91W9SVJ9VsJc8L0yRth8G5x+soxnoyPFwfDT0aKCmjzYdkgPgdNyH jR15l9FXfRb809Ml2rpzA4p/GvFrzEsXTtHfkvYK+svwjcxcrLeD4Curg6u6dZdTXGgl K1/E1EoLwQXxMd4417XoU8w6F2buIpRKEBu3r69QgnvMOHXmlElLGA4WKI4xq+OXS1a8 mglgbuCQdd/PbBQlgSeXHZwooGrWR1afLUorqzIGMEW35KkziVJimJsvP5cYU+b2NWy0 4xQB1u5miL5VQauxNuBvrIwJ66U/D6vyfPB+fDZgxpk5/zw+bcvQgkv/LyFvAdvo4qIC 5Alg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aaAKZhRJ9bSUaTeT1Aa5E4n9ZlK02HhIPpgtZxcumcA=; b=BvdUJKDR2DLIkICwJFFZl5uMTqi+96sbDbrVujFt90GUd8zucdzRYMf428lQu+bXCo BXyW0f5LtAAZ0+dRykQfm3TU+vJbJBYvlfpDUjYDhIe7USSs7oBS05jXCTlQRT7+O383 vQLLRV07nFl8pVVaXDhAmMqEIF39Yw2nJoNyRy7OwO6OaVxnzxtw325pC8Zfb1HyrKIY fe15Xw3n/CNBX/vMsYTmZRDA1n4mPsvY5cuqCaVz+lubMv0shPC1J/mRXueb1gy+saBa SKqDbih7jjylSl2PgxrECGo8Ux2XWivCmXUNckHNBJ9qMMoMviIAa+qRFJ4sG0EvUkd2 Tj5Q== X-Gm-Message-State: AOAM5312a9ofl7I+9ATjvma13lZ4yL9msYkO5OyEO5FS9XNAURkg2UY+ jZT5DEfR0S+JmDX/M+PhgLNxE+siYmHeHPMcvag= X-Google-Smtp-Source: ABdhPJwUieL1NlgMk6S+2gfDJmg5Kxqweq+j8hAhpq90oO19mDsn/CIkIIUYwXOdomofT3YmWg253+oScu6HOmpeNyc= X-Received: by 2002:a05:6830:3090:: with SMTP id f16mr18630576ots.292.1614705316876; Tue, 02 Mar 2021 09:15:16 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::331; envelope-from=pipcet@gmail.com; helo=mail-ot1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:265841 Archived-At: On Tue, Mar 2, 2021 at 2:30 PM Andrea Corallo wrote: > Pip Cet writes: > > On Tue, Mar 2, 2021 at 1:47 PM Andrea Corallo wrote: > >> > It's not working either, as far as I can tell: (lambda (x) (and > >> > (floatp x) (= x 0) x)) always returns nil when compiled. > >> > >> Right, I think a better approach is to relax the inputs before > >> intersecting them so intersection is not cutting off already constrained > >> inputs. > > > > That should work. > > > >> 8c7228e8cd for now follows this conservative approach and adds > >> some testing for the case. > > > > Indeed, and it breaks trying to compile (lambda (x) (unless (= x > > 1.0e+INF) (error "")) x). (And please don't forget NaNs, they're > > numbers too! Except they're not.) > > Is there a better way to guard against these cases than catching the > error around truncate? I don't think so, but wrapping it into (float-rational-p) or something would be nice. Even catching the error, by the way, isn't going to handle the -0.0 / 0.0 special case properly. (That is because there is no nice way to handle it, because 0.0 and -0.0 are the same number and always will be.) Don't forget this one either (currently miscompiled to have subr-type ((t) nil)): (lambda (x) (unless (= x 0.0) (error "")) (unless (eql x -0.0) (error "")) x) There are also some aesthetic issues with how you handle integers too large to be accurately represented as floats and such, but I'm focussing on correctness right now. Pip