From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: MPS: weak hash tables Date: Sun, 07 Jul 2024 13:48:03 +0200 Message-ID: References: <878qyeffjh.fsf@localhost> <8734olzlws.fsf@gmail.com> 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="38456"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Helmut Eller , Ihor Radchenko , Eli Zaretskii , emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 07 13:49:15 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 1sQQOJ-0009lt-6J for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Jul 2024 13:49:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQQNJ-0007z5-Gw; Sun, 07 Jul 2024 07:48:13 -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 1sQQNH-0007yo-0I for emacs-devel@gnu.org; Sun, 07 Jul 2024 07:48:11 -0400 Original-Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sQQNE-0001Rn-W5; Sun, 07 Jul 2024 07:48:10 -0400 Original-Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-425809eef0eso20467865e9.3; Sun, 07 Jul 2024 04:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720352885; x=1720957685; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=72+EawIIlVY77Angt+iYFzzUWNIkbOqxBuCBBkQ+vEE=; b=B8+4ZEEWXF5uHXbtHa8+Ko4CNylo1JWTssMLu9wT0jPrG1/R1ha0uV04wdSwrVg3Dh F+YcWWJTpUZ1DUGFCbfbgOe3XbGrNgd28GZsGBf9epx2lDLECOQGC7NTlVC2Fh0n6jBQ 2GwtxJ1TfkZZQZ/YKaGmMmDgT3sWKutW8rxOEnnJ2yy2FlhEwViFyEiQ5LPdo1ECr4ys ArcN3qs5ipZau0eK/Cx0tYBaU5bclJ1ZyVWFy1KRvvHYkXzFkDA6c5woff6ZDtBdCGbM AmcEROym4BTBQxMehVyk4cOtCfmxNZ6Rs3909E300VpRyT5IcJBcjmXumBwP3s+wqUaq 9q6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720352885; x=1720957685; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=72+EawIIlVY77Angt+iYFzzUWNIkbOqxBuCBBkQ+vEE=; b=pyXaT4ny1hwnCKraTZAhaUKL+L+K+g3Y49J1GSXN0vd6sCauisQWjZ8EORgaksNsov lG5LeST8aGnKPYJTJ1uP+69DB1smcfoZCszlHrOIJGfhLGHqbjCXZaL0JJKIzPvv2Izg YdZ7b7AyusvJ/vWJhAqcuElVeSQtVEtJLzcHF0sMJDjj+/0cYtkQPfMms6eF0tFkJSqE qsBcYvpyahV7HscYR5YntLauk6ZjEtPIa4oea3JmrTk0vymLgiWEyKj3QBOY7iW0W9p3 Qy1kzA4a5yiUmkb8tNcr/4tb2Fw7nQSgzhPWasamwirs1oAlW115z77S8Ll0NSknFph7 EKzA== X-Forwarded-Encrypted: i=1; AJvYcCUKJ/MZZsn8HQjLEUH4BxtQ+cil9iaWrH4OzmWJerf0Hr8lW3CzqQRPE7xE1z/s+PqSyhd1ybnuN3ETimoe+OBzFPAO7f63mySb2MpUAqW33MI= X-Gm-Message-State: AOJu0YyG1Xod4gSo50IZw4ZjIr08QDaQr3elbRpyPURk1gOSf9svh/CQ Q7ruSyWNu9/tNSEvd9dcLw+wmU+HXMfPhY5Df0LwYenXTgh+2yzsftef9g== X-Google-Smtp-Source: AGHT+IGCqhCUuSat8VJ+guxHYwn6O+sbXD2puPQPW77aqbVjDiKKfLLxvDlyI0RH3FPH/dU9S5zznA== X-Received: by 2002:a5d:4009:0:b0:367:99a7:42df with SMTP id ffacd0b85a97d-3679de7c9bbmr5823163f8f.46.1720352885166; Sun, 07 Jul 2024 04:48:05 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a778.dip0.t-ipconnect.de. [79.227.167.120]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3679983882csm8992526f8f.78.2024.07.07.04.48.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jul 2024 04:48:04 -0700 (PDT) In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Sun, 07 Jul 2024 13:35:45 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=gerd.moellmann@gmail.com; helo=mail-wm1-x32d.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.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:321482 Archived-At: Gerd M=C3=B6llmann writes: > Pip Cet writes: > >>> The big >>> difference to the non-MPS case is that struct interval is subject to GC >>> at all, they are malloc'd without igc. I didn't see another way to >>> handle their plist otherwise. Making them malloc'd roots would have >>> meant too many roots for my taste. I have currently ca. 20.000 live >>> intervals for example, after GC. >> >> Does there have to be a big difference at all, > > The only thing i can think of is what Helmut already suspected, namely > barriers. OTOH, it's not really noticeable in other cases, at least here > on macOS. In any case, I wouldn't expect anything remotely that big. > After all, it's not like a barrier is hit, the client runs a bit, and > the barrier goes up again. > >> or is it possible the test is broken on vanilla Emacs, and it just so >> happens that GC happens at the right time and hides that bug? > > ERT is a dark chapter for me. Digged through it once for the debugger > handling and giving the right backtraces in condition-case, and didn't > like it :-). I'd say everything is possible. > >> The attached patch to Emacs master makes >> >> make -C test lisp/emacs-lisp/ert-tests >> >> run out of memory for me (again, on master, nothing special). I don't >> think it should: all it does is modify the test that runs before. >> >> So is it possible this isn't all that MPS-specific? > > I have to admit I don't understand how that has the effect it has. Can > you see where it gets stuck? Maybe it helps when I describe how I understand the test, so that others can add something or correct me. (ert-deftest ert-test-run-tests-batch-expensive () :tags (if (getenv "EMACS_EMBA_CI") '(:unstable)) Let's start with the purpose which is not apparent. AFAIU, this tests if ert-batch-print-level and ert-batch-print-length work. Which is already obvious from the test name, but I looked at the git history instead. (let* ((complex-list '((:1 (:2 (:3 (:4 (:5 (:6 "abc")))))))) (failing-test-1 (make-ert-test :name 'failing-test-1 :body (lambda () (should (equal complex-list 1)))))) Anove, we have a test that always fails. When it does it prints something, and apparently what it prints depends on the ert-batch-xy options. (let ((ert-debug-on-error nil) messages) (cl-letf* (((symbol-function 'message) (lambda (format-string &rest args) (push (apply #'format format-string args) messages)))) Setting the symbol function lets us catch what gets printed for the failing test. (save-window-excursion (let ((case-fold-search nil) (ert-batch-backtrace-right-margin nil) (ert-batch-backtrace-line-length nil) (ert-batch-print-level 6) (ert-batch-print-length 11)) (ert-run-tests-batch `(member ,failing-test-1))))) Run test failing test. (let ((frame "ert-fail(((should (equal complex-list 1)) :form (equa= l ((:1 (:2 (:3 (:4 (:5 (:6 \"abc\"))))))) 1) :value nil :explanation (diffe= rent-types ((:1 (:2 (:3 (:4 (:5 (:6 \"abc\"))))))) 1)))") found-frame) This is what it should print with the given print-level and length. (cl-loop for msg in (reverse messages) do (unless found-frame Someone didn't know while or until. :-) (setq found-frame (cl-search frame msg :test 'equal)))) Check that what we expect was printed. (should found-frame))))) =F0=9F=A4=B7