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: MPS: weak hash tables Date: Sat, 06 Jul 2024 09:13:04 +0000 Message-ID: <9dD8TJnank8JpArVkh2SPWHAv07Ock1BliLAKmIthSJLfie-mHistAN6cU8sFuVlW_FSKsZOAjs-RZox5hknXSklMEXmGEGrojsyCHonwvY=@protonmail.com> References: <864j946kbe.fsf@gnu.org> <3hUiHuwpNB-2QtvUKSxx3e3-ZUX_xSI4WMW-BDSuybaKMQ3WTjpI2oVBe4Xato-h8bE-d24VQq9I8tE4x-G1-wyKuBD8cGkwaFggC91ndNM=@protonmail.com> <86wmlz59uk.fsf@gnu.org> <86jzhz57iz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10486"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, eller.helmut@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jul 06 13:00:54 2024 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 1sQ39y-0002aW-BO for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Jul 2024 13:00:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQ39K-0001Rh-VS; Sat, 06 Jul 2024 07:00:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sQ1Tl-0004sD-Ss for emacs-devel@gnu.org; Sat, 06 Jul 2024 05:13:13 -0400 Original-Received: from mail-40134.protonmail.ch ([185.70.40.134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sQ1Tj-0000js-Rc; Sat, 06 Jul 2024 05:13:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1720257188; x=1720516388; bh=v1EUfMu25KxTl4fYJoZt6xKB1VuOG+VTCCbgT5NaOcs=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=dhUGSili/asAZEvj7yYkPyxMVnEwXSm+yPI+xUTHSyL3VhfPa15RbQDAJ241Dl4pu zQndQS+onIAAI3Na80F/CrpkS2ch1LUMqJ5DLxEeB5Upa4nJcWLLMoXwLym5+hP0JG xe2BpjT7/HI7MUDVk3+el8UpS3UfInKHm4bx1ECOlIs5+tvY2lTWyEEHA2fyFiqkxa mgvoQGGn9Kgj356mS5XBXTuaobqNWyN8zV4kfYEZY+sMJj/z/gSahjhr6y2jdgJCs+ KTYwm9wnXjdRSfHm124Higg948D8W9kz+0hj11IYrbkvU+D8V4jM6OvWkxMx/L8HMF KCiImxmSqKJ4Q== In-Reply-To: <86jzhz57iz.fsf@gnu.org> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 966ca91fa92cda683235a8294f353b2a214de043 Received-SPF: pass client-ip=185.70.40.134; envelope-from=pipcet@protonmail.com; helo=mail-40134.protonmail.ch 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, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 06 Jul 2024 07:00:13 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:321420 Archived-At: On Saturday, July 6th, 2024 at 07:00, Eli Zaretskii wrote: > > Date: Sat, 06 Jul 2024 06:31:14 +0000 >=20 > > From: Pip Cet pipcet@protonmail.com > > Cc: gerd.moellmann@gmail.com, eller.helmut@gmail.com, emacs-devel@gnu.o= rg > >=20 > > On Saturday, July 6th, 2024 at 06:10, Eli Zaretskii eliz@gnu.org wrote: > >=20 > > > > Date: Fri, 05 Jul 2024 20:35:34 +0000 > > >=20 > > > > From: Pip Cet pipcet@protonmail.com > > > > Cc: gerd.moellmann@gmail.com, eller.helmut@gmail.com, emacs-devel@g= nu.org > > > >=20 > > > > > > At least we've excluded WIDE_EMACS_INT :-) > > > > > > Which is a pity, IMNSHO, and a major disappointment for me pers= onally, > > > > > > since I'm a happy user of that configuration for many years. > > > >=20 > > > > Interesting. It's not too hard to fit a 62-bit integer into two 32-= bit integers which are not 4-bit aligned, of course. I'm not sure what else= would go wrong though :-) > > >=20 > > > The problem, AFAIU, is the MPS assumption that Lisp objects can fit > > > into a "word", which in their parlance means integral data type whose > > > width is the same as a pointer's. And that is false in WIDE_EMACS_INT > > > builds, because Lisp objects are 64-bit wide, whereas pointers are > > > still 32-bit. > >=20 > > I may be misunderstanding something. When talking about normal (strong)= objects, MPS assumes very little about how the actual objects are represen= ted, as long as they can be turned into references for tracing. I don't thi= nk that's going to be a problem. When dealing with weak options, the IA-32 = problem does mean that pointers need to be aligned and non-pointers need to= be non-aligned or 0, so we'd need to mangle big fixnums before storing the= m in what, to MPS, is two 32-bit words. >=20 > Just by randomly picking keywords from the above, I can tell you that > we do make sure pointers are 8-byte aligned in the 32-bit builds > (which is not easy, at least on MS-Windows, but we succeed anyway). >=20 > The way the WIDE_EMACS_INT configuration works, most Lisp objects have > their high 30 bits (out of 64) cleared, the only exception being > fixnums. Oh. I must be doing something else then, because I'm seeing objects like th= is one: (gdb) p/x key = = $1 =3D 0xc0000000a7b4e4e8 = = =20 IOW, MSB tags in the high 32 bits, a plain pointer in the low 32 bits. Can you tell me more about your build configuration? > Not sure this answers or refutes some of what you wrote. At the time > Gerd flatly declined to invest any effort in the WIDE_EMACS_INT build, > or even explain what needs to be modified in igc.c and elsewhere to > make that work, so my build of 32-bit Emacs doesn't use that, because > I don't understand MPS innards well enough to do that on my own in > what little time I have to dedicate to this branch. Just building MPS > with MinGW (a configuration it doesn't support) in a way that passes > its test suite was enough of an effort. I will be much happier if the > WIDE_EMACS_INT would be supported on the branch. WIDE_EMACS_INT with LSB tags, which I don't think we currently support, mig= ht be possible. Using MSB tags would require some work, particularly for am= biguous scanning which might need to look at symbols, but I think it's also= possible. Weak objects (not "options", sorry) require the whole non-alignm= ent song and dance. Pip