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: dangling markers Date: Sun, 30 Jun 2024 12:54:42 +0000 Message-ID: References: <87v81u85hv.fsf@localhost> <868qynipph.fsf@gnu.org> <87wmm75xze.fsf@localhost> <7YYJyDLCuZhtkTAT_ry6S14y4KoAJtsV_2Ui8Dsy37afuN1zucoO6VPh6YAvKQCs-0OUP3-rTFogtJBLrv2wiZ9rq6lacV-p_M1qsSSgKOk=@protonmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_DVibPrzBNIbAK0hVaYjM1so7Ep38H0wddhfYUhhY" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27759"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Ihor Radchenko , Eli Zaretskii , monnier@iro.umontreal.ca, emacs-devel@gnu.org, eller.helmut@gmail.com To: =?utf-8?Q?Gerd_M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 30 15:13:18 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 1sNuMn-0006xi-C0 for ged-emacs-devel@m.gmane-mx.org; Sun, 30 Jun 2024 15:13:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNuM1-0003fU-C4; Sun, 30 Jun 2024 09:12:29 -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 1sNu51-0000Ab-Lt for emacs-devel@gnu.org; Sun, 30 Jun 2024 08:54:55 -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 1sNu4w-0004tx-GX; Sun, 30 Jun 2024 08:54:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1719752085; x=1720011285; bh=1PnBr5H9svwVEvN2WWx5YUE7yGhBWiF1eatxkjX6e2I=; 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=MdfmT75/8FtMUTrz5P9Y23OSfUBL1uJ3qJ8bsWOKOSXHKVOWdJn+rHOjG/zq+kKgk wtyGJCl6LWLpke3WoLyJvFBM3LMR/b/ApzWiUo0YIGHEcnBLtll3yi6QIM5VXwtM6c NX1oRuDK9PA3O0jz6JYKOBMLHIPw9iTZVSncP8yzw3yap7W2P3bREINI/RAmytT2OC g2mZhtXcU8ttkG2G2qKpMAOuucDkHeTpgJJOe2MYAMxxquWdIb/4Ngtk9lHfCgB6J9 x130pGbCuJhVyLeq76ObFeCZ/M7qyewjx2/CL/odmXM6KLMduv2EmOq4pXzvh58vcr HbpUtgQkMFOuQ== In-Reply-To: Feedback-ID: 112775352:user:proton X-Pm-Message-ID: f70d0a176dffaa1986e5aeb1d922cffc47f2f94b 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.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 30 Jun 2024 09:12:23 -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:320965 Archived-At: This is a multi-part message in MIME format. --b1_DVibPrzBNIbAK0hVaYjM1so7Ep38H0wddhfYUhhY Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sunday, June 30th, 2024 at 11:02, Gerd M=C3=B6llmann wrote: > Pip Cet pipcet@protonmail.com writes: > > > > And since we can't resize objects that may be pinned by ambiguous > > > > references, well, the weak hash table implementation would look qui= te > > > > different from the strong hash tables we have). > > > > > If we make-hash-table with weak keys and/or values, allocate the > > > Lisp_Hash_Table from the AWL pool using the weak_strong allocation > > > point. If neither keys nor values are weak, allocate the hash table f= rom > > > the default pool. > > > > > Allocate the key and the value vector according to the hash table's > > > weakness either from the strong or weak allocation point, or from the > > > default pool if the table isn't weak at all. (I've split the > > > key_and_value vector already in two, but you probably noticed that > > > already.) > > > > > > Dependent object of the key and value vectors could be the hash table > > > itself. > > > > Then we couldn't modify the value vector when the key gets splatted, > > or vice versa, so the table wouldn't be properly weak. > > True. I forgot to mention an important thing: When something is splat, > set flag(s) in the dependent hash table indicating that something must > be done because of that splatting. In gethash and so, check the flag and > do what's necessary. (I did something similar for the weak hash tables > in CMUCL, and it wasn't entirely bad. And weak tables should be rare.) Not necessarily rare, particularly not if we turn BUF_MARKERS into a weak h= ash table (I still don't see why we shouldn't do that, maybe I missed it). But, yes, that's a good idea and requires far fewer changes to the hash tab= le code than I've now made locally. However, I've decided to go through wit= h it and have just successfully splatted my first weak hash table entry. > > My understanding is we must allocate all strongly-referencing objects > > together in one object, all weakly-referencing objects together in > > another one, and make them depend on each other. > > > The first 2 points I think are true, and are the reason I split the 1 > vector in master containing both keys and values into two in igc, so > that keys and values can be weak or not, as necessary. > > The 3rd thing you wrote I'm not sure. My understanding is that > specifying a dependent object simply means that MPS makes it accessible > while scanning the depending object. I don't think MPS does anything to > the dependent object by itself. Hence the idea to make the hash table > the dependent object so that one at least can "notify" it that something > has happened, so that it can modify index and next vectors. You're right, if we choose to invalidate hash tables asynchronously and fix= them up later, it's perfectly okay for the dependent object to be the hash= table. > > And that means making the pseudovec a mere tuple of pointers to the > > strong and weak parts, because the conglomerate objects might need to > > be resized... > > I'm afraid I couldn't follow. Could you please explain? If we go with my original proposal (which I'm not at all sure about at this= point as the code is really ugly), we'd have to have something like: struct Lisp_Weak_Hash_Table { union vectorlike_header header; struct Lisp_Weak_Hash_Table_Strong_Part *strong; struct Lisp_Weak_Hash_Table_Weak_Part *weak; }; and store everything relevant in ->strong, which would be potentially resiz= ed and reallocated by Fputhash. Another disadvantage of my approach is that if we ever decide to dynamicall= y shrink hash tables, we'd have to have a notification mechanism anyway. VERY WIP patch attached. It doesn't actually register the dependent object = yet or resize the hash tables or anything, it's just enough to build "temac= s" (not emacs, the dumper part isn't there yet) and run: (setq table (make-hash-table :weakness 'key)) (setq key (cons 1 2)) (puthash key (cons 3 4) table) (gethash key table t) (hash-table-count table) (igc--collect) (setq key nil) (setq values nil) (igc--collect) (hash-table-count table) and get a 0 result. Pip --b1_DVibPrzBNIbAK0hVaYjM1so7Ep38H0wddhfYUhhY Content-Type: text/x-patch; name=0001-mps-weak-hash-tables.patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=0001-mps-weak-hash-tables.patch ZGlmZiAtLWdpdCBhL2xpc3AvZW1hY3MtbGlzcC9jbC1tYWNzLmVsIGIvbGlzcC9lbWFjcy1saXNw L2NsLW1hY3MuZWwKaW5kZXggMmU1MDEwMD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CS8qIERvbid0IHByaW50IG1vcmUgZWxlbWVudHMgdGhhbiB0aGUg c3BlY2lmaWVkIG1heGltdW0uICAqLworCQlpZiAoRklYTkFUUCAoVnByaW50X2xlbmd0aCkgJiYg WEZJWE5BVCAoVnByaW50X2xlbmd0aCkgPCBzaXplKQorCQkgIHNpemUgPSBYRklYTkFUIChWcHJp bnRfbGVuZ3RoKTsKKworCQlwcmludF9zdGFja19wdXNoICgoc3RydWN0IHByaW50X3N0YWNrX2Vu dHJ5KXsKKwkJICAgIC50eXBlID0gUEVfaGFzaCwKKwkJICAgIC51Lmhhc2gub2JqID0gb2JqLAor CQkgICAgLnUuaGFzaC5ub2JqcyA9IHNpemUgKiAyLAorCQkgICAgLnUuaGFzaC5pZHggPSAwLAor CQkgICAgLnUuaGFzaC5wcmludGVkID0gMCwKKwkJICAgIC51Lmhhc2gudHJ1bmNhdGVkID0gKHNp emUgPCBYRklYTlVNIChoLT5zdHJvbmctPmNvdW50KSksCisJCSAgfSk7CisJICAgICAgfQorCSAg ICBlbHNlCisJICAgICAgeworCQkvKiBFbXB0eSB0YWJsZTogd2UgY2FuIG9taXQgdGhlIGRhdGEg ZW50aXJlbHkuICAqLworCQlwcmludGNoYXIgKCcpJywgcHJpbnRjaGFyZnVuKTsKKwkJLS1wcmlu dF9kZXB0aDsgICAvKiBEb25lIHdpdGggdGhpcy4gICovCisJICAgICAgfQorCSAgICBnb3RvIG5l eHRfb2JqOworCSAgfQorCiAJY2FzZSBQVkVDX0JJR05VTToKIAkgIHByaW50X2JpZ251bSAob2Jq LCBwcmludGNoYXJmdW4pOwogCSAgYnJlYWs7CmRpZmYgLS1naXQgYS9zcmMvdGV4dGNvbnYuYyBi L3NyYy90ZXh0Y29udi5jCmluZGV4IDBlNDNiZDlkNDU4Li5kNGNjNGNlYmIxMSAxMDA2NDQKLS0t IGEvc3JjL3RleHRjb252LmMKKysrIGIvc3JjL3RleHRjb252LmMKQEAgLTQ3OCw3ICs0NzgsNyBA QCByZWNvc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