unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56255: 28.1.50; sxhash-equal does not change when object is modified
@ 2022-06-27 12:27 Ihor Radchenko
  2022-06-27 22:56 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Ihor Radchenko @ 2022-06-27 12:27 UTC (permalink / raw)
  To: 56255

Hi,

I just stumbled upon an unexpected behavior of sxhash-equal.

According to its docstring:

sxhash-equal is a function defined in fns.c.

Documentation
Return an integer hash code for OBJ suitable for equal.

If (equal A B), then (= (sxhash-equal A) (sxhash-equal B)).

So, if A is changed, I expect (sxhash-equal A) to change as well.

Now, consider the following code:

(setq a (avl-tree--create #'org-element--cache-compare))
(avl-tree-enter a '(headline (:begin 2)))
(avl-tree-enter a '(headline (:begin 4)))
(sxhash-equal a) ;; some value
(plist-put (nth 1 (avl-tree-first a)) :begin 10)
(sxhash-equal a) ;; the value does not change!

The result of sxhash-equal does not change despite `a' object being
changed.

Best,
Ihor

In GNU Emacs 28.1.50 (build 1, x86_64-pc-linux-gnu, cairo version 1.16.0)
 of 2022-05-26 built on localhost
Repository revision: a9f17ccce336ad5d384a6271f205a84141980019
Repository branch: emacs-28
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Gentoo Linux

Configured using:
 'configure --prefix=/usr --build=x86_64-pc-linux-gnu
 --host=x86_64-pc-linux-gnu --mandir=/usr/share/man
 --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc
 --localstatedir=/var/lib --datarootdir=/usr/share
 --disable-silent-rules --docdir=/usr/share/doc/emacs-28.1.9999
 --htmldir=/usr/share/doc/emacs-28.1.9999/html --libdir=/usr/lib64
 --program-suffix=-emacs-28-vcs --includedir=/usr/include/emacs-28-vcs
 --infodir=/usr/share/info/emacs-28-vcs --localstatedir=/var
 --enable-locallisppath=/etc/emacs:/usr/share/emacs/site-lisp
 --without-compress-install --without-hesiod --without-pop
 --with-file-notification=inotify --with-pdumper --enable-acl
 --with-dbus --with-modules --without-gameuser --with-libgmp
 --without-gpm --with-native-compilation --with-json --without-kerberos
 --without-kerberos5 --without-lcms2 --with-xml2 --without-mailutils
 --with-selinux --with-gnutls --without-libsystemd --with-threads
 --with-wide-int --with-zlib --with-sound=oss --with-x --without-ns
 --without-gconf --without-gsettings --without-toolkit-scroll-bars
 --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xpm
 --with-imagemagick --with-xft --with-cairo --with-harfbuzz
 --without-libotf --without-m17n-flt --with-x-toolkit=no
 --with-dumping=pdumper 'CFLAGS=-march=native -O3 -pipe'
 'LDFLAGS=-Wl,-O1 -Wl,--as-needed''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS HARFBUZZ IMAGEMAGICK JPEG
JSON LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY OLDXMENU
PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF X11 XDBE XIM XPM ZLIB

Important settings:
  value of $LC_COLLATE: C
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  pyvenv-mode: t
  git-email-notmuch-mode: t
  git-email-piem-mode: t
  piem-notmuch-mode: t
  org-edna-mode: t
  eros-mode: t
  pdf-occur-global-minor-mode: t
  which-key-mode: t
  diredfl-global-mode: t
  winner-mode: t
  eval-sexp-fu-flash-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  el-patch-use-package-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  recentf-mode: t
  hl-todo-mode: t
  pretty-symbols-mode: t
  company-mode: t
  persistent-scratch-autosave-mode: t
  savehist-mode: t
  helm-adaptive-mode: t
  helm-mode: t
  helm-minibuffer-history-mode: t
  helm-ff-icon-mode: t
  shell-dirtrack-mode: t
  helm--remap-mouse-mode: t
  async-bytecomp-package-mode: t
  boon-mode: t
  boon-local-mode: t
  global-hl-line-mode: t
  global-page-break-lines-mode: t
  page-break-lines-mode: t
  shackle-mode: t
  override-global-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  global-prettify-symbols-mode: t
  prettify-symbols-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  window-divider-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Load-path shadows:
/usr/share/emacs/site-lisp/cmake-mode hides /usr/share/emacs/site-lisp/cmake/cmake-mode
/home/yantar92/.emacs.d/straight/build/dash/dash hides /usr/share/emacs/site-lisp/dash/dash
/usr/share/emacs/site-lisp/desktop-entry-mode hides /usr/share/emacs/site-lisp/desktop-file-utils/desktop-entry-mode
/home/yantar92/.emacs.d/straight/build/f/f hides /usr/share/emacs/site-lisp/f/f
/home/yantar92/.emacs.d/straight/build/s/s hides /usr/share/emacs/site-lisp/s/s
/home/yantar92/.emacs.d/straight/build/with-editor/with-editor hides /usr/share/emacs/site-lisp/with-editor/with-editor
/home/yantar92/.emacs.d/straight/build/transient/transient hides /usr/share/emacs/28.1.50/lisp/transient
/home/yantar92/.emacs.d/straight/build/project/project hides /usr/share/emacs/28.1.50/lisp/progmodes/project
/home/yantar92/.emacs.d/straight/build/xref/xref hides /usr/share/emacs/28.1.50/lisp/progmodes/xref
/home/yantar92/.emacs.d/straight/build/org/ob-C hides /usr/share/emacs/28.1.50/lisp/org/ob-C
/home/yantar92/.emacs.d/straight/build/org/ob-R hides /usr/share/emacs/28.1.50/lisp/org/ob-R
/home/yantar92/.emacs.d/straight/build/org/ob-awk hides /usr/share/emacs/28.1.50/lisp/org/ob-awk
/home/yantar92/.emacs.d/straight/build/org/ob-calc hides /usr/share/emacs/28.1.50/lisp/org/ob-calc
/home/yantar92/.emacs.d/straight/build/org/ob-clojure hides /usr/share/emacs/28.1.50/lisp/org/ob-clojure
/home/yantar92/.emacs.d/straight/build/org/ob-comint hides /usr/share/emacs/28.1.50/lisp/org/ob-comint
/home/yantar92/.emacs.d/straight/build/org/ob-core hides /usr/share/emacs/28.1.50/lisp/org/ob-core
/home/yantar92/.emacs.d/straight/build/org/ob-css hides /usr/share/emacs/28.1.50/lisp/org/ob-css
/home/yantar92/.emacs.d/straight/build/org/ob-ditaa hides /usr/share/emacs/28.1.50/lisp/org/ob-ditaa
/home/yantar92/.emacs.d/straight/build/org/ob-dot hides /usr/share/emacs/28.1.50/lisp/org/ob-dot
/home/yantar92/.emacs.d/straight/build/org/ob-emacs-lisp hides /usr/share/emacs/28.1.50/lisp/org/ob-emacs-lisp
/home/yantar92/.emacs.d/straight/build/org/ob-eshell hides /usr/share/emacs/28.1.50/lisp/org/ob-eshell
/home/yantar92/.emacs.d/straight/build/org/ob-eval hides /usr/share/emacs/28.1.50/lisp/org/ob-eval
/home/yantar92/.emacs.d/straight/build/org/ob-exp hides /usr/share/emacs/28.1.50/lisp/org/ob-exp
/home/yantar92/.emacs.d/straight/build/org/ob-forth hides /usr/share/emacs/28.1.50/lisp/org/ob-forth
/home/yantar92/.emacs.d/straight/build/org/ob-fortran hides /usr/share/emacs/28.1.50/lisp/org/ob-fortran
/home/yantar92/.emacs.d/straight/build/org/ob-gnuplot hides /usr/share/emacs/28.1.50/lisp/org/ob-gnuplot
/home/yantar92/.emacs.d/straight/build/org/ob-groovy hides /usr/share/emacs/28.1.50/lisp/org/ob-groovy
/home/yantar92/.emacs.d/straight/build/org/ob-haskell hides /usr/share/emacs/28.1.50/lisp/org/ob-haskell
/home/yantar92/.emacs.d/straight/build/org/ob-java hides /usr/share/emacs/28.1.50/lisp/org/ob-java
/home/yantar92/.emacs.d/straight/build/org/ob-js hides /usr/share/emacs/28.1.50/lisp/org/ob-js
/home/yantar92/.emacs.d/straight/build/org/ob-julia hides /usr/share/emacs/28.1.50/lisp/org/ob-julia
/home/yantar92/.emacs.d/straight/build/org/ob-latex hides /usr/share/emacs/28.1.50/lisp/org/ob-latex
/home/yantar92/.emacs.d/straight/build/org/ob-lilypond hides /usr/share/emacs/28.1.50/lisp/org/ob-lilypond
/home/yantar92/.emacs.d/straight/build/org/ob-lisp hides /usr/share/emacs/28.1.50/lisp/org/ob-lisp
/home/yantar92/.emacs.d/straight/build/org/ob-lob hides /usr/share/emacs/28.1.50/lisp/org/ob-lob
/home/yantar92/.emacs.d/straight/build/org/ob-lua hides /usr/share/emacs/28.1.50/lisp/org/ob-lua
/home/yantar92/.emacs.d/straight/build/org/ob-makefile hides /usr/share/emacs/28.1.50/lisp/org/ob-makefile
/home/yantar92/.emacs.d/straight/build/org/ob-matlab hides /usr/share/emacs/28.1.50/lisp/org/ob-matlab
/home/yantar92/.emacs.d/straight/build/org/ob-maxima hides /usr/share/emacs/28.1.50/lisp/org/ob-maxima
/home/yantar92/.emacs.d/straight/build/org/ob-ocaml hides /usr/share/emacs/28.1.50/lisp/org/ob-ocaml
/home/yantar92/.emacs.d/straight/build/org/ob-octave hides /usr/share/emacs/28.1.50/lisp/org/ob-octave
/home/yantar92/.emacs.d/straight/build/org/ob-org hides /usr/share/emacs/28.1.50/lisp/org/ob-org
/home/yantar92/.emacs.d/straight/build/org/ob-perl hides /usr/share/emacs/28.1.50/lisp/org/ob-perl
/home/yantar92/.emacs.d/straight/build/org/ob-plantuml hides /usr/share/emacs/28.1.50/lisp/org/ob-plantuml
/home/yantar92/.emacs.d/straight/build/org/ob-processing hides /usr/share/emacs/28.1.50/lisp/org/ob-processing
/home/yantar92/.emacs.d/straight/build/org/ob-python hides /usr/share/emacs/28.1.50/lisp/org/ob-python
/home/yantar92/.emacs.d/straight/build/org/ob-ref hides /usr/share/emacs/28.1.50/lisp/org/ob-ref
/home/yantar92/.emacs.d/straight/build/org/ob-ruby hides /usr/share/emacs/28.1.50/lisp/org/ob-ruby
/home/yantar92/.emacs.d/straight/build/org/ob-sass hides /usr/share/emacs/28.1.50/lisp/org/ob-sass
/home/yantar92/.emacs.d/straight/build/org/ob-scheme hides /usr/share/emacs/28.1.50/lisp/org/ob-scheme
/home/yantar92/.emacs.d/straight/build/org/ob-screen hides /usr/share/emacs/28.1.50/lisp/org/ob-screen
/home/yantar92/.emacs.d/straight/build/org/ob-sed hides /usr/share/emacs/28.1.50/lisp/org/ob-sed
/home/yantar92/.emacs.d/straight/build/org/ob-shell hides /usr/share/emacs/28.1.50/lisp/org/ob-shell
/home/yantar92/.emacs.d/straight/build/org/ob-sql hides /usr/share/emacs/28.1.50/lisp/org/ob-sql
/home/yantar92/.emacs.d/straight/build/org/ob-sqlite hides /usr/share/emacs/28.1.50/lisp/org/ob-sqlite
/home/yantar92/.emacs.d/straight/build/org/ob-table hides /usr/share/emacs/28.1.50/lisp/org/ob-table
/home/yantar92/.emacs.d/straight/build/org/ob-tangle hides /usr/share/emacs/28.1.50/lisp/org/ob-tangle
/home/yantar92/.emacs.d/straight/build/org/ob hides /usr/share/emacs/28.1.50/lisp/org/ob
/home/yantar92/.emacs.d/straight/build/org/oc-basic hides /usr/share/emacs/28.1.50/lisp/org/oc-basic
/home/yantar92/.emacs.d/straight/build/org/oc-biblatex hides /usr/share/emacs/28.1.50/lisp/org/oc-biblatex
/home/yantar92/.emacs.d/straight/build/org/oc-csl hides /usr/share/emacs/28.1.50/lisp/org/oc-csl
/home/yantar92/.emacs.d/straight/build/org/oc-natbib hides /usr/share/emacs/28.1.50/lisp/org/oc-natbib
/home/yantar92/.emacs.d/straight/build/org/oc hides /usr/share/emacs/28.1.50/lisp/org/oc
/home/yantar92/.emacs.d/straight/build/org/ol-bbdb hides /usr/share/emacs/28.1.50/lisp/org/ol-bbdb
/home/yantar92/.emacs.d/straight/build/org/ol-bibtex hides /usr/share/emacs/28.1.50/lisp/org/ol-bibtex
/home/yantar92/.emacs.d/straight/build/org/ol-docview hides /usr/share/emacs/28.1.50/lisp/org/ol-docview
/home/yantar92/.emacs.d/straight/build/org/ol-doi hides /usr/share/emacs/28.1.50/lisp/org/ol-doi
/home/yantar92/.emacs.d/straight/build/org/ol-eshell hides /usr/share/emacs/28.1.50/lisp/org/ol-eshell
/home/yantar92/.emacs.d/straight/build/org/ol-eww hides /usr/share/emacs/28.1.50/lisp/org/ol-eww
/home/yantar92/.emacs.d/straight/build/org/ol-gnus hides /usr/share/emacs/28.1.50/lisp/org/ol-gnus
/home/yantar92/.emacs.d/straight/build/org/ol-info hides /usr/share/emacs/28.1.50/lisp/org/ol-info
/home/yantar92/.emacs.d/straight/build/org/ol-irc hides /usr/share/emacs/28.1.50/lisp/org/ol-irc
/home/yantar92/.emacs.d/straight/build/org/ol-man hides /usr/share/emacs/28.1.50/lisp/org/ol-man
/home/yantar92/.emacs.d/straight/build/org/ol-mhe hides /usr/share/emacs/28.1.50/lisp/org/ol-mhe
/home/yantar92/.emacs.d/straight/build/org/ol-rmail hides /usr/share/emacs/28.1.50/lisp/org/ol-rmail
/home/yantar92/.emacs.d/straight/build/org/ol-w3m hides /usr/share/emacs/28.1.50/lisp/org/ol-w3m
/home/yantar92/.emacs.d/straight/build/org/ol hides /usr/share/emacs/28.1.50/lisp/org/ol
/home/yantar92/.emacs.d/straight/build/org/org-agenda hides /usr/share/emacs/28.1.50/lisp/org/org-agenda
/home/yantar92/.emacs.d/straight/build/org/org-archive hides /usr/share/emacs/28.1.50/lisp/org/org-archive
/home/yantar92/.emacs.d/straight/build/org/org-attach-git hides /usr/share/emacs/28.1.50/lisp/org/org-attach-git
/home/yantar92/.emacs.d/straight/build/org/org-attach hides /usr/share/emacs/28.1.50/lisp/org/org-attach
/home/yantar92/.emacs.d/straight/build/org/org-capture hides /usr/share/emacs/28.1.50/lisp/org/org-capture
/home/yantar92/.emacs.d/straight/build/org/org-clock hides /usr/share/emacs/28.1.50/lisp/org/org-clock
/home/yantar92/.emacs.d/straight/build/org/org-colview hides /usr/share/emacs/28.1.50/lisp/org/org-colview
/home/yantar92/.emacs.d/straight/build/org/org-compat hides /usr/share/emacs/28.1.50/lisp/org/org-compat
/home/yantar92/.emacs.d/straight/build/org/org-crypt hides /usr/share/emacs/28.1.50/lisp/org/org-crypt
/home/yantar92/.emacs.d/straight/build/org/org-ctags hides /usr/share/emacs/28.1.50/lisp/org/org-ctags
/home/yantar92/.emacs.d/straight/build/org/org-datetree hides /usr/share/emacs/28.1.50/lisp/org/org-datetree
/home/yantar92/.emacs.d/straight/build/org/org-duration hides /usr/share/emacs/28.1.50/lisp/org/org-duration
/home/yantar92/.emacs.d/straight/build/org/org-element hides /usr/share/emacs/28.1.50/lisp/org/org-element
/home/yantar92/.emacs.d/straight/build/org/org-entities hides /usr/share/emacs/28.1.50/lisp/org/org-entities
/home/yantar92/.emacs.d/straight/build/org/org-faces hides /usr/share/emacs/28.1.50/lisp/org/org-faces
/home/yantar92/.emacs.d/straight/build/org/org-feed hides /usr/share/emacs/28.1.50/lisp/org/org-feed
/home/yantar92/.emacs.d/straight/build/org/org-footnote hides /usr/share/emacs/28.1.50/lisp/org/org-footnote
/home/yantar92/.emacs.d/straight/build/org/org-goto hides /usr/share/emacs/28.1.50/lisp/org/org-goto
/home/yantar92/.emacs.d/straight/build/org/org-habit hides /usr/share/emacs/28.1.50/lisp/org/org-habit
/home/yantar92/.emacs.d/straight/build/org/org-id hides /usr/share/emacs/28.1.50/lisp/org/org-id
/home/yantar92/.emacs.d/straight/build/org/org-indent hides /usr/share/emacs/28.1.50/lisp/org/org-indent
/home/yantar92/.emacs.d/straight/build/org/org-inlinetask hides /usr/share/emacs/28.1.50/lisp/org/org-inlinetask
/home/yantar92/.emacs.d/straight/build/org/org-install hides /usr/share/emacs/28.1.50/lisp/org/org-install
/home/yantar92/.emacs.d/straight/build/org/org-keys hides /usr/share/emacs/28.1.50/lisp/org/org-keys
/home/yantar92/.emacs.d/straight/build/org/org-lint hides /usr/share/emacs/28.1.50/lisp/org/org-lint
/home/yantar92/.emacs.d/straight/build/org/org-list hides /usr/share/emacs/28.1.50/lisp/org/org-list
/home/yantar92/.emacs.d/straight/build/org/org-macro hides /usr/share/emacs/28.1.50/lisp/org/org-macro
/home/yantar92/.emacs.d/straight/build/org/org-macs hides /usr/share/emacs/28.1.50/lisp/org/org-macs
/home/yantar92/.emacs.d/straight/build/org/org-mobile hides /usr/share/emacs/28.1.50/lisp/org/org-mobile
/home/yantar92/.emacs.d/straight/build/org/org-mouse hides /usr/share/emacs/28.1.50/lisp/org/org-mouse
/home/yantar92/.emacs.d/straight/build/org/org-num hides /usr/share/emacs/28.1.50/lisp/org/org-num
/home/yantar92/.emacs.d/straight/build/org/org-pcomplete hides /usr/share/emacs/28.1.50/lisp/org/org-pcomplete
/home/yantar92/.emacs.d/straight/build/org/org-plot hides /usr/share/emacs/28.1.50/lisp/org/org-plot
/home/yantar92/.emacs.d/straight/build/org/org-protocol hides /usr/share/emacs/28.1.50/lisp/org/org-protocol
/home/yantar92/.emacs.d/straight/build/org/org-refile hides /usr/share/emacs/28.1.50/lisp/org/org-refile
/home/yantar92/.emacs.d/straight/build/org/org-src hides /usr/share/emacs/28.1.50/lisp/org/org-src
/home/yantar92/.emacs.d/straight/build/org/org-table hides /usr/share/emacs/28.1.50/lisp/org/org-table
/home/yantar92/.emacs.d/straight/build/org/org-tempo hides /usr/share/emacs/28.1.50/lisp/org/org-tempo
/home/yantar92/.emacs.d/straight/build/org/org-timer hides /usr/share/emacs/28.1.50/lisp/org/org-timer
/home/yantar92/.emacs.d/straight/build/org/org-version hides /usr/share/emacs/28.1.50/lisp/org/org-version
/home/yantar92/.emacs.d/straight/build/org/org hides /usr/share/emacs/28.1.50/lisp/org/org
/home/yantar92/.emacs.d/straight/build/org/ox-ascii hides /usr/share/emacs/28.1.50/lisp/org/ox-ascii
/home/yantar92/.emacs.d/straight/build/org/ox-beamer hides /usr/share/emacs/28.1.50/lisp/org/ox-beamer
/home/yantar92/.emacs.d/straight/build/org/ox-html hides /usr/share/emacs/28.1.50/lisp/org/ox-html
/home/yantar92/.emacs.d/straight/build/org/ox-icalendar hides /usr/share/emacs/28.1.50/lisp/org/ox-icalendar
/home/yantar92/.emacs.d/straight/build/org/ox-koma-letter hides /usr/share/emacs/28.1.50/lisp/org/ox-koma-letter
/home/yantar92/.emacs.d/straight/build/org/ox-latex hides /usr/share/emacs/28.1.50/lisp/org/ox-latex
/home/yantar92/.emacs.d/straight/build/org/ox-man hides /usr/share/emacs/28.1.50/lisp/org/ox-man
/home/yantar92/.emacs.d/straight/build/org/ox-md hides /usr/share/emacs/28.1.50/lisp/org/ox-md
/home/yantar92/.emacs.d/straight/build/org/ox-odt hides /usr/share/emacs/28.1.50/lisp/org/ox-odt
/home/yantar92/.emacs.d/straight/build/org/ox-org hides /usr/share/emacs/28.1.50/lisp/org/ox-org
/home/yantar92/.emacs.d/straight/build/org/ox-publish hides /usr/share/emacs/28.1.50/lisp/org/ox-publish
/home/yantar92/.emacs.d/straight/build/org/ox-texinfo hides /usr/share/emacs/28.1.50/lisp/org/ox-texinfo
/home/yantar92/.emacs.d/straight/build/org/ox hides /usr/share/emacs/28.1.50/lisp/org/ox
/home/yantar92/.emacs.d/straight/build/org/org-loaddefs hides /usr/share/emacs/28.1.50/lisp/org/org-loaddefs
/home/yantar92/.emacs.d/straight/build/let-alist/let-alist hides /usr/share/emacs/28.1.50/lisp/emacs-lisp/let-alist
/home/yantar92/.emacs.d/straight/build/map/map hides /usr/share/emacs/28.1.50/lisp/emacs-lisp/map

Features:
(shadow sort footnote emacsbug sendmail helm-imenu cus-start macrostep-c
cmacexp boon-main boon-hl boon-arguments multiple-cursors
mc-separate-operations rectangular-region-mode mc-mark-pop mc-edit-lines
mc-hide-unmatched-lines-mode mc-mark-more mc-cycle-cursors
multiple-cursors-core boon-regs mule-util boon-moves boon-utils
er-basic-expansions expand-region-core expand-region-custom vc ffap
org-table-sticky-header cl-print oc-basic helm-command helm-elisp
helm-eval tramp-archive tramp-gvfs helm-x-files helm-for-files
helm-bookmark helm-external helm-net highlight-indentation flymake-proc
flymake elpy elpy-rpc pyvenv eshell esh-cmd esh-ext esh-opt esh-proc
esh-io esh-arg esh-module esh-groups esh-util elpy-shell elpy-profile
elpy-django elpy-refactor grep scimax-jupyter ob-jupyter jupyter-tramp
tramp-cache jupyter-server jupyter-server-ioloop jupyter-ioloop-comm
jupyter-ioloop zmq zmq-core jupyter-rest-api jupyter-org-extensions
jupyter-org-client git-email-magit magit-patch git-email-notmuch
git-email-piem git-email git-email-autoloads project-autoloads
xref-autoloads piem-notmuch piem piem-maildir mail-extr piem-autoloads
org-crypt helm-notmuch helm-notmuch-autoloads ol-notmuch org-eldoc
org-table-sticky-header-autoloads posframe posframe-autoloads ob-async
ob-async-autoloads ob-latex ob-dot ob-calc calc-store calc-trail
ob-gnuplot ob-ditaa ob-C cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs ob-python ob-perl ob-org
ob-shell ob-mathematica org-tempo tempo org-archive ox-md ox-beamer
engrave-faces engrave-faces-autoloads ox-extra orgdiff orgdiff-autoloads
doct ya-org-capture ya-org-capture-autoloads doct-autoloads
org-capture-pop-frame org-capture-pop-frame-autoloads org-protocol
org-analyzer-autoloads pomidor-autoloads alert-autoloads log4e-autoloads
gntp-autoloads helm-org-ql helm-org org-clock org-autosort
org-autosort-autoloads helm-org-ql-autoloads helm-org-autoloads
org-ql-search org-ql-view ov org-super-agenda org-ql peg ts
org-ql-autoloads peg-autoloads ov-autoloads org-super-agenda-autoloads
org-quick-peek org-quick-peek-autoloads calfw-org calfw-org-autoloads
calfw holidays hol-loaddefs calfw-autoloads org-attach cdlatex texmathp
cdlatex-autoloads org-capture-ref org-ref-url-utils org-ref org-ref-core
org-ref-glossary org-ref-bibtex doi-utils org-ref-utils org-ref-export
citeproc citeproc-itemgetters citeproc-biblatex citeproc-bibtex
ol-bibtex citeproc-cite citeproc-subbibs citeproc-sort citeproc-name
citeproc-formatters citeproc-number rst citeproc-proc citeproc-disamb
citeproc-itemdata citeproc-generic-elements citeproc-macro
citeproc-choose citeproc-date citeproc-context citeproc-prange
citeproc-style citeproc-locale citeproc-term citeproc-rt citeproc-lib
citeproc-s queue ox-pandoc ox-org ox-odt rng-loc rng-uri rng-parse
rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok
nxml-util ox-latex ox-icalendar ox-html table ox-ascii ox-publish ox
org-ref-misc-links org-ref-label-link org-ref-ref-links
org-ref-citation-links org-ref-bibliography-links bibtex-completion
biblio biblio-download biblio-dissemin biblio-ieee biblio-hal
biblio-dblp biblio-crossref biblio-arxiv timezone biblio-doi biblio-core
ido parsebib bibtex org-ref-autoloads ox-pandoc-autoloads
citeproc-autoloads string-inflection-autoloads queue-autoloads
bibtex-completion-autoloads biblio-autoloads biblio-core-autoloads
parsebib-autoloads htmlize-autoloads scimax-inkscape
scimax-inkscape-autoloads org-pdftools pdf-annot facemenu org-noter
org-pdftools-autoloads org-noter-autoloads org-capture org-checklist
org-habit org-edna org-edna-autoloads org-inlinetask org-drill persist
org-agenda org-drill-autoloads persist-autoloads ol-info ol-w3m ol-doi
org-link-doi speed-type speed-type-autoloads ement ement-notify
ement-room ewoc ement-lib ement-api ement-structs ement-macros dns
ement-autoloads ts-autoloads svg-lib-autoloads
taxy-magit-section-autoloads taxy-autoloads map-autoloads plz
plz-autoloads 0x0 0x0-autoloads notmuch-calendar-x
notmuch-calendar-x-autoloads notmuch notmuch-tree notmuch-jump
notmuch-hello notmuch-show notmuch-print notmuch-crypto notmuch-mua
notmuch-message notmuch-draft notmuch-maildir-fcc notmuch-address
notmuch-company notmuch-parser notmuch-wash coolj notmuch-query
goto-addr icalendar diary-lib diary-loaddefs notmuch-tag notmuch-lib
notmuch-version notmuch-compat mm-view mml-smime smime dig w3m-autoloads
elfeed-score elfeed-score-maint elfeed-score-scoring elfeed-score-serde
elfeed-score-rule-stats elfeed-org org-element org-persist
elfeed-org-autoloads quick-peek quick-peek-autoloads elfeed-show
elfeed-search hideshow display-fill-column-indicator eros
rainbow-delimiters highlight-numbers parent-mode easy-escape
license-snippets yasnippet-snippets-autoloads yasnippet-snippets
yasnippet elfeed-csv elfeed elfeed-curl elfeed-log elfeed-db elfeed-lib
avl-tree url-queue xml-query elfeed-score-rules elfeed-score-log
elfeed-score-autoloads elfeed-autoloads ytel-show-autoloads ytel
ytel-autoloads qrencode-el-autoloads tb-keycast tb-keycast-autoloads
gif-screencast xdg gif-screencast-autoloads yaml-mode
yaml-mode-autoloads mingus libmpdee cl mingus-autoloads
libmpdee-autoloads calctex calc-sel calctex-autoloads
shell-pop-autoloads eterm-256color-autoloads xterm-color-autoloads vterm
term ehelp vterm-module term/xterm xterm vterm-autoloads diffpdf
diffpdf-autoloads pdf-view-restore pdf-view-restore-autoloads pdf-occur
ibuf-ext ibuffer ibuffer-loaddefs tablist tablist-filter
semantic/wisent/comp semantic/wisent semantic/wisent/wisent
semantic/util-modes semantic/util semantic semantic/tag semantic/lex
semantic/fw mode-local cedet pdf-isearch pdf-misc pdf-tools cus-edit
cus-load pdf-roll pdf-view jka-compr pdf-cache pdf-info tq pdf-util
pdf-macs pdf-tools-autoloads tablist-autoloads image-roll
image-roll-autoloads scimax-jupyter-autoloads pretty-hydra
pretty-hydra-autoloads jupyter jupyter-repl jupyter-kernel-manager
jupyter-channel jupyter-widget-client websocket bindat simple-httpd
jupyter-kernelspec jupyter-env jupyter-client jupyter-mime
jupyter-comm-layer jupyter-messages hmac-def jupyter-base eieio-base
jupyter-autoloads websocket-autoloads simple-httpd-autoloads
zmq-autoloads scimax-ob avy scimax-ob-autoloads wolfram-mode
wolfram-mode-autoloads ledger-mode-autoloads auctex-autoloads tex-site
ebuild-mode skeleton sh-script smie executable ebuild-mode-autoloads
lua-mode lua-mode-autoloads gnuplot-autoloads eros-autoloads nameless
lisp-mnt nameless-autoloads paredit paredit-autoloads company-jedi
company-jedi-autoloads jedi jedi-core python-environment epc ctable
concurrent auto-complete jedi-autoloads auto-complete-autoloads
jedi-core-autoloads python-environment-autoloads epc-autoloads
ctable-autoloads concurrent-autoloads elpy-autoloads pyvenv-autoloads
highlight-indentation-autoloads python tramp-sh helm-info which-key
which-key-autoloads helm-descbinds helm-descbinds-autoloads elisp-demos
elisp-demos-autoloads helpful edebug info-look help-fns radix-tree
elisp-refs helpful-autoloads elisp-refs-autoloads tldr tldr-autoloads
lsp-ui-autoloads lsp-mode-autoloads spinner-autoloads macrostep
macrostep-autoloads highlight-refontification
highlight-refontification-autoloads font-lock-profiler
font-lock-profiler-autoloads font-lock-studio font-lock-studio-autoloads
memory-usage memory-usage-autoloads bug-hunter bug-hunter-autoloads
lorem-ipsum lorem-ipsum-autoloads debug backtrace
license-snippets-autoloads yasnippet-autoloads move-text
move-text-autoloads aggressive-indent aggressive-indent-autoloads
visual-regexp-autoloads magit-bookmark bookmark pp helm-bm compile
helm-bm-autoloads bm bm-autoloads helm-dash dash-docs
helm-dash-autoloads dash-docs-autoloads disk-usage disk-usage-autoloads
dired-git-info-autoloads dired-hide-dotfiles-autoloads
dired-filter-autoloads diredfl diredfl-autoloads
all-the-icons-dired-autoloads dired-async dired-open-autoloads
dired-avfs dired-avfs-autoloads dired-narrow-autoloads dired-hacks-utils
dired-hacks-utils-autoloads dired+ image-file image-converter dired-x
dired-aux dired+-autoloads winner windower emacs-windower-autoloads
goggles pulse skip-buffers-mode avy-autoloads eval-sexp-fu
eval-sexp-fu-autoloads goggles-autoloads easy-escape-autoloads
highlight-numbers-autoloads parent-mode-autoloads
rainbow-delimiters-autoloads highlight-parentheses
highlight-parentheses-autoloads flycheck-tip error-tip notifications
dbus popup flycheck-tip-autoloads flycheck flycheck-autoloads
pkg-info-autoloads epl-autoloads wordnut wordnut-history wordnut-u
wordnut-autoloads smog smog-autoloads writegood-mode
writegood-mode-autoloads el-patch-autoloads el-patch el-patch-stub
flyspell ispell hi-lock ediff ediff-merg ediff-mult ediff-wind
ediff-diff ediff-help ediff-init ediff-util browse-at-remote vc-git
vc-dispatcher f browse-at-remote-autoloads f-autoloads code-review
code-review-actions code-review-comment code-review-section
code-review-bitbucket code-review-faces shr kinsoku svg xml dom emojify
apropos tar-mode arc-mode archive-mode ht code-review-gitlab
code-review-utils code-review-parse-hunk code-review-github
code-review-db uuidgen calc-misc calc-ext calc calc-loaddefs rect
calc-macs a code-review-interfaces deferred forge-list forge-commands
forge-semi forge-bitbucket buck forge-gogs gogs forge-gitea gtea
forge-gitlab glab forge-github ghub-graphql treepy gsexp ghub let-alist
gnutls forge-notify forge-revnote forge-pullreq forge-issue forge-topic
yaml bug-reference forge-post markdown-mode thingatpt forge-repo forge
forge-core forge-db closql emacsql-sqlite emacsql emacsql-compiler
url-http url-auth url-gw nsm magit-submodule magit-obsolete magit-blame
magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch
magit-clone magit-remote magit-commit magit-sequence magit-notes
magit-worktree magit-tag magit-merge magit-branch magit-reset
magit-files magit-refs magit-status magit package browse-url
url-handlers magit-repos magit-apply magit-wip magit-log which-func
imenu magit-diff smerge-mode diff diff-mode git-commit log-edit message
rmc puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util
rmail rmail-loaddefs text-property-search mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr
mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log magit-core
magit-autorevert magit-margin magit-transient magit-process with-editor
magit-mode transient magit-git magit-base magit-section crm compat-27
compat-26 code-review-autoloads emojify-autoloads ht-autoloads
deferred-autoloads uuidgen-autoloads a-autoloads forge-autoloads
yaml-autoloads markdown-mode-autoloads ghub-autoloads treepy-autoloads
let-alist-autoloads emacsql-sqlite-autoloads emacsql-autoloads
closql-autoloads magit-autoloads magit-section-autoloads
git-commit-autoloads with-editor-autoloads transient-autoloads
autorevert recentf tree-widget wid-edit disp-table hl-todo
pretty-symbols company-oddmuse company-keywords company-etags etags
fileloop generator xref project company-gtags company-dabbrev-code
company-dabbrev company-files company-clang company-capf company-cmake
company-semantic company-template company-bbdb company
persistent-scratch persistent-scratch-autoloads savehist
backup-walker-autoloads company-autoloads helm-adaptive helm-mode
helm-misc helm-files image-dired image-mode dired dired-loaddefs exif
filenotify tramp tramp-loaddefs trampver tramp-integration files-x
tramp-compat shell parse-time iso8601 ls-lisp helm-buffers helm-occur
helm-tags helm-locate helm-grep helm-regexp helm-utils helm-help
helm-types helm helm-core async-bytecomp helm-global-bindings
helm-easymenu helm-source helm-multi-match helm-lib async helm-autoloads
popup-autoloads helm-core-autoloads face-remap pyim pyim-hacks
pyim-cloudim url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf mailcap pyim-probe pyim-cregexp xr
pyim-dict pyim-autoselector pyim-indicator pyim-preview pyim-page
pyim-process pyim-cstring pyim-punctuation pyim-outcome pyim-candidates
pyim-codes pyim-imobjs pyim-pinyin pyim-pymap pyim-entered pyim-dcache
url-util url-parse auth-source eieio eieio-core eieio-loaddefs
password-cache json map url-vars pyim-scheme pyim-common pyim-autoloads
xr-autoloads async-autoloads reverse-im quail reverse-im-autoloads hydra
lv boon-qwerty color olivetti straight-x boon boon-keys boon-core
boon-loaddefs boon-autoloads multiple-cursors-autoloads
expand-region-autoloads meta-functions org-id org-refile dash
meta-functions-autoloads dash-autoloads hl-line memoize
memoize-autoloads info-colors info-colors-autoloads hl-todo-autoloads
latex-pretty-symbols latex-pretty-symbols-autoloads
pretty-symbols-autoloads page-break-lines page-break-lines-autoloads
edmacro kmacro adaptive-wrap adaptive-wrap-autoloads olivetti-autoloads
shackle trace shackle-autoloads use-package-diminish all-the-icons
all-the-icons-faces data-material data-weathericons data-octicons
data-fileicons data-faicons data-alltheicons all-the-icons-autoloads org
ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote
org-src ob-comint org-pcomplete pcomplete comint ansi-color ring
org-list org-entities time-date noutline outline org-version
ob-emacs-lisp ob-core ob-eval org-cycle org-font-lock org-font-lock-core
org-element-match org-faces org-table ol org-fold org-fold-core org-keys
oc org-compat advice org-font-lock-obsolete org-macs org-loaddefs
format-spec find-func cal-menu calendar cal-loaddefs
modus-operandi-theme modus-themes modus-themes-autoloads s s-autoloads
pcase asoc asoc.el-autoloads no-littering compat no-littering-autoloads
compat-autoloads hydra-autoloads lv-autoloads finder-inf
use-package-bind-key org-contrib-autoloads comp comp-cstr warnings rx
bind-key easy-mmode diminish diminish-autoloads use-package-core
use-package-autoloads bind-key-autoloads straight-autoloads info cl-seq
cl-extra help-mode seq byte-opt straight subr-x cl-macs gv cl-loaddefs
cl-lib bytecomp byte-compile cconv server site-gentoo iso-transl tooltip
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify dynamic-setting font-render-setting cairo x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 6640792 1584580)
 (symbols 48 83706 1504)
 (strings 32 570057 296114)
 (string-bytes 1 75546444)
 (vectors 16 314161)
 (vector-slots 8 5434095 14347567)
 (floats 8 6713 24116)
 (intervals 56 188583 30856)
 (buffers 992 60))





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#56255: 28.1.50; sxhash-equal does not change when object is modified
  2022-06-27 12:27 bug#56255: 28.1.50; sxhash-equal does not change when object is modified Ihor Radchenko
@ 2022-06-27 22:56 ` Lars Ingebrigtsen
  2022-06-27 23:00   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-27 22:56 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: 56255

Ihor Radchenko <yantar92@gmail.com> writes:

> The result of sxhash-equal does not change despite `a' object being
> changed.

Here's a self-contained example:

(require 'org-element)
(setq c (avl-tree--create #'org-element--cache-compare))
(avl-tree-enter c '(headline (:begin 2)))

(setq d (avl-tree--create #'org-element--cache-compare))
(avl-tree-enter d '(headline (:begin 5)))

(equal c d)
nil

(sxhash-equal c)
1776904311275
(sxhash-equal d)
1776904311275

This is due to:

/* Maximum depth up to which to dive into Lisp structures.  */
#define SXHASH_MAX_DEPTH 3

Since this record nests to a depth of 4, and that's where the difference
is.

So I think the doc string overstates things. 

--
If (equal A B), then (= (sxhash-equal A) (sxhash-equal B)).
--

Is not remotely true, but:

--
If (= (sxhash-equal A) (sxhash-equal B)) then it's quite likely that
(equal A B), but the opposite is not true for deeply nested structures.
--



-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#56255: 28.1.50; sxhash-equal does not change when object is modified
  2022-06-27 22:56 ` Lars Ingebrigtsen
@ 2022-06-27 23:00   ` Lars Ingebrigtsen
  2022-06-28 12:58     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-27 23:00 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: 56255

Lars Ingebrigtsen <larsi@gnus.org> writes:

> So I think the doc string overstates things. 
>
> --
> If (equal A B), then (= (sxhash-equal A) (sxhash-equal B)).
> --
>
> Is not remotely true, but:
>
> --
> If (= (sxhash-equal A) (sxhash-equal B)) then it's quite likely that
> (equal A B), but the opposite is not true for deeply nested structures.
> --

Sorry, that's all wrong, and what the doc string says is true.  That is,
if they're equal, then the hash is =.

But (= (sxhash-equal A) (sxhash-equal B)) does not imply that
(equal A B), and the doc string should say that explicitly.

It's the manual that's wrong here:

     If the two objects are not ‘equal’, the values returned by
     ‘sxhash-equal’ are usually different, but not always; once in a
     rare while, by luck, you will encounter two distinct-looking
     objects that give the same result from ‘sxhash-equal’.

It's not "once in a rare while" for deeply nested structures.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#56255: 28.1.50; sxhash-equal does not change when object is modified
  2022-06-27 23:00   ` Lars Ingebrigtsen
@ 2022-06-28 12:58     ` Lars Ingebrigtsen
  2022-06-29  1:58       ` Ihor Radchenko
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-28 12:58 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: 56255

Lars Ingebrigtsen <larsi@gnus.org> writes:

> It's the manual that's wrong here:

I've now clarified the manual and doc strings here in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#56255: 28.1.50; sxhash-equal does not change when object is modified
  2022-06-28 12:58     ` Lars Ingebrigtsen
@ 2022-06-29  1:58       ` Ihor Radchenko
  2022-06-29 10:01         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Ihor Radchenko @ 2022-06-29  1:58 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56255

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> It's the manual that's wrong here:
>
> I've now clarified the manual and doc strings here in Emacs 29.

Thanks!

Off topic: Do you know any other way to detect if deeply nested object
has changed (other than creating a deep copy and using equal)?

Best,
Ihor





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#56255: 28.1.50; sxhash-equal does not change when object is modified
  2022-06-29  1:58       ` Ihor Radchenko
@ 2022-06-29 10:01         ` Lars Ingebrigtsen
  2022-06-29 10:12           ` Ihor Radchenko
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-29 10:01 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: 56255

Ihor Radchenko <yantar92@gmail.com> writes:

> Off topic: Do you know any other way to detect if deeply nested object
> has changed (other than creating a deep copy and using equal)?

Printing the object to a buffer and then using `buffer-hash' should be
OK for most structures, but would be very slow for large objects.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#56255: 28.1.50; sxhash-equal does not change when object is modified
  2022-06-29 10:01         ` Lars Ingebrigtsen
@ 2022-06-29 10:12           ` Ihor Radchenko
  2022-06-29 10:15             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Ihor Radchenko @ 2022-06-29 10:12 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56255

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Ihor Radchenko <yantar92@gmail.com> writes:
>
>> Off topic: Do you know any other way to detect if deeply nested object
>> has changed (other than creating a deep copy and using equal)?
>
> Printing the object to a buffer and then using `buffer-hash' should be
> OK for most structures, but would be very slow for large objects.

This is exactly the problem at hand. I was hoping to find a fast way to
detect if a large deeply nested object is changed. If not, do not print
that object for the purpose of saving it to disk cache. Printing can
take up to 2-3 seconds in some cases.

Best,
Ihor





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#56255: 28.1.50; sxhash-equal does not change when object is modified
  2022-06-29 10:12           ` Ihor Radchenko
@ 2022-06-29 10:15             ` Lars Ingebrigtsen
  2022-06-29 12:33               ` Ihor Radchenko
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-29 10:15 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: 56255

Ihor Radchenko <yantar92@gmail.com> writes:

> This is exactly the problem at hand. I was hoping to find a fast way to
> detect if a large deeply nested object is changed. If not, do not print
> that object for the purpose of saving it to disk cache. Printing can
> take up to 2-3 seconds in some cases.

I think you basically have to restructure the code to add a guard to
whatever's updating the structure to see whether it's "dirty" or not.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#56255: 28.1.50; sxhash-equal does not change when object is modified
  2022-06-29 10:15             ` Lars Ingebrigtsen
@ 2022-06-29 12:33               ` Ihor Radchenko
  2022-06-29 12:38                 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Ihor Radchenko @ 2022-06-29 12:33 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56255

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Ihor Radchenko <yantar92@gmail.com> writes:
>
>> This is exactly the problem at hand. I was hoping to find a fast way to
>> detect if a large deeply nested object is changed. If not, do not print
>> that object for the purpose of saving it to disk cache. Printing can
>> take up to 2-3 seconds in some cases.
>
> I think you basically have to restructure the code to add a guard to
> whatever's updating the structure to see whether it's "dirty" or not.

This is only possible when I have access to the code making changes to
the object.

The original idea was to detect changed objects in most generic way, as
a part of persistent storage library. Oh well.

Best,
Ihor





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#56255: 28.1.50; sxhash-equal does not change when object is modified
  2022-06-29 12:33               ` Ihor Radchenko
@ 2022-06-29 12:38                 ` Lars Ingebrigtsen
  2022-06-29 12:56                   ` Ihor Radchenko
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-29 12:38 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: 56255

Ihor Radchenko <yantar92@gmail.com> writes:

> The original idea was to detect changed objects in most generic way, as
> a part of persistent storage library. Oh well.

We could make SXHASH_MAX_DEPTH into a defvar -- or pass the depth in to
`sxhash-equal'.  However, the hash it's computing is geared towards hash
tables, so collisions are OK -- it's not a cryptographic hash, so I'm
not sure it would fit your use case anyway.  I.e., our sxhash_combine is
very simple.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#56255: 28.1.50; sxhash-equal does not change when object is modified
  2022-06-29 12:38                 ` Lars Ingebrigtsen
@ 2022-06-29 12:56                   ` Ihor Radchenko
  2022-06-30  9:06                     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Ihor Radchenko @ 2022-06-29 12:56 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56255

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Ihor Radchenko <yantar92@gmail.com> writes:
>
>> The original idea was to detect changed objects in most generic way, as
>> a part of persistent storage library. Oh well.
>
> We could make SXHASH_MAX_DEPTH into a defvar -- or pass the depth in to
> `sxhash-equal'.  However, the hash it's computing is geared towards hash
> tables, so collisions are OK -- it's not a cryptographic hash, so I'm
> not sure it would fit your use case anyway.  I.e., our sxhash_combine is
> very simple.

Well. In my scenario, the object structure creates so bad case that
_all_ the hashes for _all possible_ avl-tree structures collide
(actually, I use plists containing avl-tree structures).

As for the hash tables and collisions. Are you sure that collisions are
OK? Consider the following example:

(setq a (avl-tree--create #'org-element--cache-compare))
(avl-tree-enter a '(headline (:begin 2)))
(setq tbl (make-hash-table :test #'equal))
(puthash a 'value tbl)
(gethash a tbl)
(plist-put (nth 1 (avl-tree-first a)) :begin 10)
(gethash a tbl) ;; the value does not change!

Best,
Ihor





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#56255: 28.1.50; sxhash-equal does not change when object is modified
  2022-06-29 12:56                   ` Ihor Radchenko
@ 2022-06-30  9:06                     ` Lars Ingebrigtsen
  2022-06-30 11:16                       ` Ihor Radchenko
  0 siblings, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2022-06-30  9:06 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: 56255

Ihor Radchenko <yantar92@gmail.com> writes:

> As for the hash tables and collisions. Are you sure that collisions are
> OK? Consider the following example:
>
> (setq a (avl-tree--create #'org-element--cache-compare))
> (avl-tree-enter a '(headline (:begin 2)))
> (setq tbl (make-hash-table :test #'equal))
> (puthash a 'value tbl)
> (gethash a tbl)
> (plist-put (nth 1 (avl-tree-first a)) :begin 10)
> (gethash a tbl) ;; the value does not change!

That has nothing to do with collisions -- you're free to alter a key as
much as you want.  It's just a normal Lisp object.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#56255: 28.1.50; sxhash-equal does not change when object is modified
  2022-06-30  9:06                     ` Lars Ingebrigtsen
@ 2022-06-30 11:16                       ` Ihor Radchenko
  0 siblings, 0 replies; 13+ messages in thread
From: Ihor Radchenko @ 2022-06-30 11:16 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 56255

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> (setq a (avl-tree--create #'org-element--cache-compare))
>> (avl-tree-enter a '(headline (:begin 2)))
>> (setq tbl (make-hash-table :test #'equal))
>> (puthash a 'value tbl)
>> (gethash a tbl)
>> (plist-put (nth 1 (avl-tree-first a)) :begin 10)
>> (gethash a tbl) ;; the value does not change!
>
> That has nothing to do with collisions -- you're free to alter a key as
> much as you want.  It's just a normal Lisp object.

You are indeed right. Thanks for the clarification!

Best,
Ihor





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-06-30 11:16 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-27 12:27 bug#56255: 28.1.50; sxhash-equal does not change when object is modified Ihor Radchenko
2022-06-27 22:56 ` Lars Ingebrigtsen
2022-06-27 23:00   ` Lars Ingebrigtsen
2022-06-28 12:58     ` Lars Ingebrigtsen
2022-06-29  1:58       ` Ihor Radchenko
2022-06-29 10:01         ` Lars Ingebrigtsen
2022-06-29 10:12           ` Ihor Radchenko
2022-06-29 10:15             ` Lars Ingebrigtsen
2022-06-29 12:33               ` Ihor Radchenko
2022-06-29 12:38                 ` Lars Ingebrigtsen
2022-06-29 12:56                   ` Ihor Radchenko
2022-06-30  9:06                     ` Lars Ingebrigtsen
2022-06-30 11:16                       ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).