Commit graph

40 commits

Author SHA1 Message Date
Stas Boukarev 554360c906 xperfecthash
Some checks failed
CL-host / ecl (push) Waiting to run
CL-host / clisp (push) Waiting to run
CL-host / ccl (push) Waiting to run
CL-host / cmucl (push) Waiting to run
CL-host / sbcl (push) Waiting to run
CL-host / compare-xc-host-fasls (ccl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (clisp, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (cmucl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (self, false) (push) Blocked by required conditions
Linux / build (x86, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-unicode, ) (push) Waiting to run
Linux / build (x86-64, --with-mark-region-gc) (push) Waiting to run
Linux / build (x86-64, --with-sb-fasteval --without-sb-eval, fasteval) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, sse4) (push) Waiting to run
Linux / build (x86-64, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --without-sb-unicode, ) (push) Waiting to run
Mac / build (--without-sb-thread, x86-64) (push) Waiting to run
Mac / build (arm64, --with-mark-region-gc) (push) Waiting to run
Mac / build (arm64, --with-sb-thread) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc) (push) Waiting to run
Mac / build (x86-64, --with-sb-thread) (push) Waiting to run
Windows / build (push) Waiting to run
Linux qemu / ppc64le (push) Failing after 1s
2024-12-02 01:58:28 +03:00
Christophe Rhodes 5fe3559bb2 build-all-cores from empty xperfecthash files
Some checks failed
CL-host / ecl (push) Waiting to run
CL-host / clisp (push) Waiting to run
CL-host / ccl (push) Waiting to run
CL-host / cmucl (push) Waiting to run
CL-host / sbcl (push) Waiting to run
CL-host / compare-xc-host-fasls (ccl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (clisp, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (cmucl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (self, false) (push) Blocked by required conditions
Linux / build (x86, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-unicode, ) (push) Waiting to run
Linux / build (x86-64, --with-mark-region-gc) (push) Waiting to run
Linux / build (x86-64, --with-sb-fasteval --without-sb-eval, fasteval) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, sse4) (push) Waiting to run
Linux / build (x86-64, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --without-sb-unicode, ) (push) Waiting to run
Linux / build (x86, --with-sb-thread, ) (push) Waiting to run
Mac / build (--without-sb-thread, x86-64) (push) Waiting to run
Mac / build (arm64, --with-mark-region-gc) (push) Waiting to run
Mac / build (arm64, --with-sb-thread) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc) (push) Waiting to run
Mac / build (x86-64, --with-sb-thread) (push) Waiting to run
Windows / build (push) Waiting to run
Linux qemu / ppc64le (push) Failing after 1s
2024-11-29 12:18:31 +00:00
Douglas Katzman 741581124f build-all-cores 2024-11-13 23:45:01 +00:00
Douglas Katzman d6f5d95a8f Regenerate xperfecthash files 2024-10-18 23:31:37 +00:00
Douglas Katzman f15de2cca2 Run build-all-cores 2024-10-10 21:43:37 +00:00
Stas Boukarev 2cd499bdfa Revert "Remove >25% of xperfecthash by handling simple cases in Lisp"
Some checks are pending
CL-host / compare-xc-host-fasls (self, false) (push) Blocked by required conditions
CL-host / ecl (push) Waiting to run
CL-host / clisp (push) Waiting to run
CL-host / ccl (push) Waiting to run
CL-host / cmucl (push) Waiting to run
CL-host / sbcl (push) Waiting to run
CL-host / self (push) Waiting to run
CL-host / compare-xc-host-fasls (ccl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (clisp, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (cmucl, false) (push) Blocked by required conditions
Linux / build (x86, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-unicode, ) (push) Waiting to run
Linux / build (x86-64, --with-mark-region-gc) (push) Waiting to run
Linux / build (x86-64, --with-sb-fasteval --without-sb-eval, fasteval) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, sse4) (push) Waiting to run
Linux / build (x86-64, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --without-sb-unicode, ) (push) Waiting to run
Mac / build (--without-sb-thread, x86-64) (push) Waiting to run
Mac / build (arm64, --with-mark-region-gc) (push) Waiting to run
Mac / build (arm64, --with-sb-thread) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc) (push) Waiting to run
Mac / build (x86-64, --with-sb-thread) (push) Waiting to run
Windows / build (push) Waiting to run
This reverts commit 0e993a1615.

Fixes lp#2078847 lp#2078394
2024-09-06 04:03:33 +03:00
Douglas Katzman 0e993a1615 Remove >25% of xperfecthash by handling simple cases in Lisp
In fact, this hash function might be shorter. For example, according to the file,
the hash function for #(2 3 5 #xC #xE) performed a mask, two shifts, AREF,
and xor; while the quick function is merely + and LOGAND.
2024-08-29 19:31:45 +00:00
Douglas Katzman a841bd0c68 Shrink the xperfecthash files a little
Some checks are pending
CL-host / compare-xc-host-fasls (self, false) (push) Blocked by required conditions
CL-host / ecl (push) Waiting to run
CL-host / clisp (push) Waiting to run
CL-host / ccl (push) Waiting to run
CL-host / cmucl (push) Waiting to run
CL-host / sbcl (push) Waiting to run
CL-host / self (push) Waiting to run
CL-host / compare-xc-host-fasls (ccl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (clisp, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (cmucl, false) (push) Blocked by required conditions
Linux / build (x86, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-unicode, ) (push) Waiting to run
Linux / build (x86-64, --with-mark-region-gc) (push) Waiting to run
Linux / build (x86-64, --with-sb-fasteval --without-sb-eval, fasteval) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, sse4) (push) Waiting to run
Linux / build (x86-64, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --without-sb-unicode, ) (push) Waiting to run
Mac / build (--without-sb-thread, x86-64) (push) Waiting to run
Mac / build (arm64, --with-mark-region-gc) (push) Waiting to run
Mac / build (arm64, --with-sb-thread) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc) (push) Waiting to run
Mac / build (x86-64, --with-sb-thread) (push) Waiting to run
Windows / build (push) Waiting to run
by removing some default structure constructors
2024-08-25 09:29:55 +00:00
Douglas Katzman 8b73da5f39 build-all-cores 2024-08-21 16:11:08 +00:00
Douglas Katzman 9c702a2dad Run build-all-cores starting from empty files
Some checks are pending
CL-host / ecl (push) Waiting to run
CL-host / clisp (push) Waiting to run
CL-host / ccl (push) Waiting to run
CL-host / cmucl (push) Waiting to run
CL-host / sbcl (push) Waiting to run
CL-host / self (push) Waiting to run
CL-host / compare-xc-host-fasls (ccl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (clisp, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (cmucl, false) (push) Blocked by required conditions
CL-host / compare-xc-host-fasls (self, false) (push) Blocked by required conditions
Linux / build (x86, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86, --without-sb-unicode, ) (push) Waiting to run
Linux / build (x86-64, --with-mark-region-gc) (push) Waiting to run
Linux / build (x86-64, --with-sb-fasteval --without-sb-eval, fasteval) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --with-sb-thread, sse4) (push) Waiting to run
Linux / build (x86-64, --without-sb-thread, ) (push) Waiting to run
Linux / build (x86-64, --without-sb-unicode, ) (push) Waiting to run
Mac / build (--without-sb-thread, x86-64) (push) Waiting to run
Mac / build (arm64, --with-mark-region-gc) (push) Waiting to run
Mac / build (arm64, --with-sb-thread) (push) Waiting to run
Mac / build (x86-64, --with-mark-region-gc) (push) Waiting to run
Mac / build (x86-64, --with-sb-thread) (push) Waiting to run
Windows / build (push) Waiting to run
2024-08-01 16:00:10 +00:00
Douglas Katzman 1eaea7445c Streamline WILD-PATHNAME-P
Don't invoke WITH-PATHAME 6 times in the common case of checking all fields.

Also take https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/024a8b46 which was
surprisingly absent considering the author.
2024-07-31 18:04:08 +00:00
Douglas Katzman a68faa6204 Avoid TRUENAME until or unless required for error message display
Solves the problem that if you're building in a tree of symlinks where files
aren't on the local machine, load-as-source made 10x too many OS calls.
Based on strace it looks like it still invokes unix-access and unix-open
at least 2x too many times, but there's definitely less lstat() now
for source files that produce no style-warnings or other noise.
2024-07-18 16:37:28 +00:00
Douglas Katzman da9214a183 Run build-all-cores.sh 2024-07-18 16:24:52 +00:00
Douglas Katzman ff7acc4be0 Move simple-fun metadata into code-debug-info
This eliminates duplication between compiler/generic/core and compiler/dump.
And code-slots-per-simple-fun is mentioned in far fewer places.
The pristine core consumes 5% less code space, correspondingly more non-code,
but all other things being equal, the CPU's instruction cache will benefit.
2024-07-15 19:31:43 +00:00
Douglas Katzman e69a2fdd2d x86-64: Implement lisp linkage-space as per doc/internals-notes
Some checks failed
CL-host / ecl (push) Has been cancelled
CL-host / clisp (push) Has been cancelled
CL-host / ccl (push) Has been cancelled
CL-host / cmucl (push) Has been cancelled
CL-host / sbcl (push) Has been cancelled
CL-host / self (push) Has been cancelled
Linux / build (x86, --with-sb-thread, ) (push) Has been cancelled
Linux / build (x86, --without-sb-thread, ) (push) Has been cancelled
Linux / build (x86, --without-sb-unicode, ) (push) Has been cancelled
Linux / build (x86-64, --with-mark-region-gc) (push) Has been cancelled
Linux / build (x86-64, --with-sb-fasteval --without-sb-eval, fasteval) (push) Has been cancelled
Linux / build (x86-64, --with-sb-thread, ) (push) Has been cancelled
Linux / build (x86-64, --with-sb-thread, sse4) (push) Has been cancelled
Linux / build (x86-64, --without-sb-thread, ) (push) Has been cancelled
Linux / build (x86-64, --without-sb-unicode, ) (push) Has been cancelled
Mac / build (--without-sb-thread, x86-64) (push) Has been cancelled
Mac / build (arm64, --with-mark-region-gc) (push) Has been cancelled
Mac / build (arm64, --with-sb-thread) (push) Has been cancelled
Mac / build (x86-64, --with-mark-region-gc) (push) Has been cancelled
Mac / build (x86-64, --with-sb-thread) (push) Has been cancelled
Windows / build (push) Has been cancelled
CL-host / compare-xc-host-fasls (ccl, false) (push) Has been cancelled
CL-host / compare-xc-host-fasls (clisp, false) (push) Has been cancelled
CL-host / compare-xc-host-fasls (cmucl, false) (push) Has been cancelled
CL-host / compare-xc-host-fasls (self, false) (push) Has been cancelled
This rectifies many awkward aspects of the immobile space fdefns
which it replaces.

All other architectures should be unaffected by the patch.

Tested with with +/- {immobile-space, sb-thread, mark-region}
on linux, and the default config on windows and macOS.
2024-07-03 11:22:51 -04:00
Douglas Katzman 7c86a3348f Update xperfecthash files 2024-06-24 20:31:55 -04:00
Douglas Katzman f4a9886f76 Fix lp#942237 re FILTER-DOLIST-DECLARATIONS
The launchpad complaint was that if we claim the spec permits us to disregard
some type constraints, surely it meant that no matter how spelled; but it would
be very incompatible to force users to put an (OR NULL) in their type,
so this does it for them only at evaluation of the DOLIST result form.

Since this change generally performs more analysis of which declarations are
bound or free, it also hoists the free ones outside the loop like they are
in CCL and CLISP which potentially remove type-checks from inside the loop
for free declarations on lexically visible vars with no SET.
e.g (DECLARE (FIXNUM LOOPVAR FOO)) where FOO is lexically known to be INTEGER,
it still checks for FIXNUM on each loop iteration which seems like a bug.
2024-06-13 01:39:50 -04:00
Christophe Rhodes 5cd67d8c5d Update perfect hash files 2024-05-20 13:54:44 +01:00
Douglas Katzman f8088a8c08 Entirely remove ASSEMBLY-ROUTINE* fixup flavor
And introduce a new fixup-kind for x86-64 which removes x86-64
special-casing from architecture-independent fixup logic.
2024-05-06 16:28:13 -04:00
Douglas Katzman 0db2006024 Add a 32-bit fasteval test config 2024-05-04 15:01:04 -04:00
Douglas Katzman ff7cc435b2 Regenerate xperfecthashN.lisp-expr from scratch via build-all-cores
This hadn't been done ever since rev 790bca74 made SYMBOL-HASH less sensitive
to address-of-NIL. Consequently many of the lines are not needed now.
Additionally, add a small hack to avoid creating journal entries when
the static objects (symbols, fdefns) are changed.
2024-04-22 12:27:46 -04:00
Douglas Katzman 68c21e9010 build-all-cores 2024-04-18 17:08:19 -04:00
Douglas Katzman c42d3f9c76 build-all-cores 2024-04-16 15:12:54 -04:00
Douglas Katzman 78db7e42b6 Cater to a highly dubious code-walker in CASE/TYPECASE
Why not. It wasn't hard to find the problem, though I do not see how
this affected the number of perfect hashes needed during cross-compile.
Not sure if I should be worried.

Fixes lp#2060059
2024-04-02 18:26:41 -04:00
Douglas Katzman e227fe74d0 Run build-all-cores 2024-04-02 20:58:12 +00:00
Stas Boukarev 0548f32096 Switch from multiway-branch-generic-eq to jump-table on x86. 2024-03-18 20:36:36 +03:00
Charles Zhang fada230b97 Use the intended packed representation for COMPILED-DEBUG-FUN-VARS.
The COMPILED-DEBUG-FUN-VARS slot was designed to store a packed byte
vector where the names and packages of variables were dumped in a
packed representation with smarts to dump debug variables relative to
the current package or to flag them as uninterned, allowing the
omission of an explicit package name in the packed vector.

Due to bootstrapping reasons however, the initial SBCL commit changed
this to store symbols instead (as a necessity since package names were
dumped by xc like SB!C, not matching how they get loaded as SB!XC,
making the name+package strategy more difficult). The result was
significantly increasing the space usage of debug info relative to CMU
CL, since symbols needed to be loaded interned, taking up more space
to represent, even though most of the time interning is not even
needed outside of debugging contexts. Also space was wasted for
uninterned symbols. The vector for the slot was also no longer
dumpable as a byte vector, wasting a bunch of space. (later mitigated
by a hack on 64-bit where flags got packed together with scs).

Now that the bootstrap no longer involves package renaming and we have
a sane way of doing that, the original design using name+package and a
packed vector for COMPILED-DEBUG-FUN-VARS as in CMU CL can now be
brought back, saving ~400KB from a warm arm64 core. 32-bit targets
should benefit even more, since they didn't do the manual packing
mitigation.

So:

* We can get rid of the "large-fixnums" hack where scs got packed into
the flag, since now we just dump it all as a packed byte vector. In
particular 32-bit targets benefit now too from packing without having
to do manual packing.
* Symbols don't need to be needlessly interned before a debug fun even
gets parsed.
* A few FIXMEs are killed.
2024-03-15 00:41:27 +01:00
Douglas Katzman 3971c0e32c Update other xperfecthash files
After adding another #+ to avoid creating some extra lines
2024-03-14 18:10:40 -04:00
Douglas Katzman 2977ce717b build-all-cores 2024-03-11 12:01:43 -04:00
Douglas Katzman d82545340c More of xperfecthash 2024-03-05 19:06:40 -05:00
Douglas Katzman 1fe98b3b17 Run build-all-cores to update all xperfecthash files
This includes diffs from a pending change which adds many lines to the *63 file
2024-03-04 16:56:17 -05:00
Douglas Katzman 3221b3164a Add entries to the perfect hash files in advance of needing them
These are created by an ensuing commit, but it seems like commit emails
get lost when the diff exceeds a certain number of lines, and even if not,
this diff would cause clipping of the body of what is otherwise not
actually a very large change.
2024-03-01 16:07:02 -05:00
Douglas Katzman 1c9e8235ac 32-bit: Dissociate SYMBOL-HASH and (CAR NIL)
NIL-as-cons is overlayed with SYMBOL-FDEFN which is better since that's
supposed to be NIL.  Wth newfound freedom, assign NIL a name-based hash
so that the xperfecthash30 file is insensitive to NIL's address.

And every so often you should rearrange primitive object slots anyway
to ascertain that it's not impossible.
2024-02-29 21:24:44 -05:00
Douglas Katzman ac1e7191c1 Run build-all-cores and update x files 2024-02-25 09:35:59 -05:00
Stas Boukarev 99b9663dc3 Fix logtest encoding on PPC. 2024-02-17 15:20:04 +03:00
Douglas Katzman 4cda0e8e03 Improve hash-based find/position
* Assume that non-minimal perfect hash calculation is faster than minimal.
  The output value is bounded by pow2ceil(N) instead of N which avoids an
  array bound check since the compiler knows that the final step was LOGAND
  with a (2^N)-1 value exactly matching the key array.

* The ASSOC transform can use specialized vectors if the data are numeric.

* Run build-all-cores to generate new xperfecthash entries.
2024-02-14 15:01:25 -05:00
Douglas Katzman c4d1903ebf Attempt transforming ASSOC and RASSOC using a perfect hash 2024-02-05 02:32:59 -05:00
Douglas Katzman e61fb35c46 Use FIND/POSITION transform on const list for MEMBER too 2024-02-05 01:12:24 -05:00
Douglas Katzman 78a0ff78f9 Improve build-all-cores.sh
* Merge xperfecthash file diffs back into the main file
* Rather than hardwiring the choice of OS in pass-1.lisp, put the choice
  in the configuration params. Unfortunately stuff-groveled-from-headers
  may need to exist in different incarnations due to package issues.
2024-02-05 00:51:41 -05:00
Douglas Katzman 9363a353d2 Preserve more in perfect hash generator journal
* Store symbols as well as symbol-hash. In doing this it should be possible
  to alter CALC-SYMBOL-NAME-HASH without having to rebuild every target to
  infer what entries the file was supposed to contain (since we can't easily
  reverse-engineer symbols from their hashes). Using the symbols it is possible
  to "upgrade" to a new SYMBOL-HASH algorithm via a one-time conversion of the
  file, which might happen if we tack on a murmur3 final mix step or similar.

* Split the file into one per distinct value of N-FIXNUM-BITS so that a
  given collection of symbols almost always identifies a file entry uniquely
  (but not always, due to NIL having a hash that can vary)
2024-02-02 22:42:40 -05:00