Commit Graph

42462 Commits

Author SHA1 Message Date
Matthew Flatt
128892c996 add fx{+,-,*,lshift}/wraparound
Expose machine-level operations that stay within the fixnum range,
which can be useful for things like hash-code computations where it's
ok to just lose bits. Operations like `unsafe-fx+` turn out to do that
already in the current implementation, but with no guarantee (and with
no checking of arguments).

For Racket BC, before this commit, JIT-inlined `fxlshift` incorrectly
handled a negative second argument like `arithmetic-shift` instead of
erroring.
2020-11-18 17:39:18 -07:00
Sam Tobin-Hochstadt
bec35108b4
Increase hash-mem timeout. 2020-11-18 13:03:35 -05:00
Matthew Flatt
9a3eb15d8b cs & thread: fix scheduler timer event in atomic mode
When the thread-scheduler timer fires while a thread is in atomic
mode, the thread could check for breaks even when it shouldn't. Worse,
if the atomic region was to implement terminating a thread, the path
to check for a break could end up ressurecting the thread from the
persspective of `thread-dead?`.
2020-11-18 04:10:06 -07:00
Matthew Flatt
b28d682ec4 reference: correct some details on reader syntax for characters
Closes #3506 and #3507
2020-11-17 13:12:18 -07:00
Paulo Matos
4268091c7b Remove deprecated set-env directive from CI files
set-env were removed due to security concerns.
https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
2020-11-17 06:51:30 +01:00
Paulo Matos
5dd687b77d
Check that user correctly regenerated build.md (#3505) 2020-11-17 06:38:37 +01:00
kurinoku
3f9f01e520 Fix mutator listing in struct-auto-info. 2020-11-16 12:42:07 -05:00
Matthew Flatt
117f22e3d6 render build guide to "build.md"
Also, tweak to follow a documentation convention.
2020-11-16 08:28:18 -07:00
Paulo Matos
c3aa63db37
Add ARM32 version of PR fast build workflow (#3503)
Unfortunately, due to bug https://github.com/moby/moby/issues/41217,
ARM and ARM64 versions cannot share the same jobs through a matrix
setting.
2020-11-16 15:46:35 +01:00
Paulo Matos
c8e34be4d9 Remove fetch-depth: 0 from actions/checkout
Apparently fetch-depth: 0 means fetch everything.
Pointed out by @xxyzz in #3502 but I mistakingly pushed before fixing.
2020-11-16 15:41:43 +01:00
Paulo Matos
c057d5e7a6
Add workflow to scribble build guide (#3502)
This should avoid breaking changes being committed.
2020-11-16 15:25:20 +01:00
Paulo Matos
06d852683c
Fix scribble hyperlink 2020-11-16 08:57:12 +01:00
Matthew Flatt
5656073637 repair mismatch in fixnum mixing
Scheme code and C code did not compute the same result for negative
fixnums for 64-bit machines.
2020-11-14 12:42:34 -07:00
Matthew Flatt
dc82685ce0 fix mutable hash tables for certain likely fixnum distibutions
A mutable hash table only uses the lower few bits of a hash code,
because it masks the hash code by [one less than] the power-of-two
size of the bucket array. That truncation interacts badly with the
hashing function for fixnums, which is the identity function; if the
the lower several bits of the fixnum stay the same for many keys and
the upper bits change, then there are many hash collisions --- and
that's a relatively likely distribution.

Fix the mutable hash-table implementations by mixing the hash code to
let higher bits influence the lower bits: xor the high half of the
bits with the lower half (which doesn't lose information, because
xoring again would recover the original number), then do the same for
the high one-fourth of bits in the low half, and then (on a 64-bit
platform) the high one-eighth of the low one-fourth of the bits.

Instead if blaming the way the mutable hash-table implementations only
use the lower bits of a hash code, we could blame the hash function on
fixnums for not performing this kind of mixing. In this patch, though,
we take the view that the hash function's job is to map variation in
its domain to variation in the fixnum hash code, and then the hash
table's job is to use that fixnum effectively. That separation of
responsibilities is now documented with `gen:equal+hash`.

There are also improvements here to the hashing function for bignums
in CS and to the secondary hashung function for fixnums and bignums in
BC.

Thanks to Alex Harsanyi for reporting the problem.
2020-11-14 10:45:15 -07:00
Matthew Flatt
b37cc53b70 cs: fix {{,fx,fl}vector,string,bytes}-ref error-message rewrite
Fix the ending index, since it's inclusive.

Thanks to Matthias for the report.
2020-11-13 17:37:38 -07:00
Matthew Flatt
78b09313a0 fix Racket bootstrap for Chez Scheme for 32-bit platforms 2020-11-13 11:34:51 -07:00
Matthew Flatt
fcd9e9448c Chez Scheme: improve guidance from configure 2020-11-13 11:34:51 -07:00
Paulo Matos
355d384e3c
Changes required to compile Racket with C99+exts (#3497)
With these changes RacketCS and RacketBC can be compiled with:
     `-std=c99 -D_DEFAULT_SOURCE`

Also added some documentation on contribution guidelines.
2020-11-13 19:34:12 +01:00
Paulo Matos
83e256cce6
Ensure DEST exists before calling find (#3496)
On raw racket clones when compiling with `--enable-racket` (i.e. no
pb), there are `find` warnings that DEST does not exist and
compilation still succeeds.

This change however, ensures that we do not have build warnings and
that the symlinks are properly created.
2020-11-13 14:43:22 +01:00
Paulo Matos
09c3d215e2 Use racket cify variant for building 3m and cs in ARM CI 2020-11-13 07:13:30 +01:00
Matthew Flatt
b33f26415b Chez Scheme: fix double counting of some adminstrative GC overhead 2020-11-12 18:57:09 -07:00
Matthew Flatt
e782490e3e fix error-message test for racket/generic
Should have been part of 5f4480e39e.
2020-11-11 17:26:42 -07:00
Matthew Flatt
5f4480e39e generics: adjust generated error messages 2020-11-11 12:54:28 -07:00
Paulo Matos
9dbfeb2c6a Reduce number of tested configurations on ARM64
Currently we don't have enough HW to smoothly test on arm64 all
possible configurations. Reducing configurations by removing matrix
elements and leaving the matrix in-place, so it is easier to re-add
these in the future.
2020-11-11 14:17:54 +01:00
Paulo Matos
145d6c8e8c Use different filenames for BS and CS UBsan error logs 2020-11-11 07:10:31 +01:00
Matthew Flatt
7975bdf25d traditional Windows directory paths are limited to 247 characters
... not 259 characters, which is the limit on file paths.
2020-11-10 14:53:07 -07:00
Matthew Flatt
23710d5862 cs & io: avoid overlong Windows paths
Convert paths to "\\?\" as needed to avoid the 259-character limit on
a path length.
2020-11-10 14:53:07 -07:00
Matthew Flatt
0342804b18 rktio on windows: fix buffer size for getting OS current directory
Relevant to #3493
2020-11-10 14:00:43 -07:00
Matthew Flatt
aea024736a unbreak cify 2020-11-10 11:31:41 -07:00
Matthew Flatt
e050c82896 makefile: fix DIST_CATALOGS_q propagation
The `DIST_CATALOGS_q` variable was propagated incorrectly, which
mainly affected the `client-compile-any` target that is used for
creating source bundles.
2020-11-10 10:36:21 -07:00
Matthew Flatt
1ac6c15207 add #:unsafe option for #%declare
Finally give in and add an option to compile a module as unsafe. This
was going to be easy, since the option already exists at the linklet
level, but it turns out that a lot of plumbing was needed to propagate
the argument, and even more to preserve unsafety with cross-module
inlining.

Macros can effectively conditoinalize their expansion in unsafe mode
by generating the pattern

 (if (variable-reference-from-unsafe? (#%variable-reference))
     <unsafe variant>
     <safe variant>)

The compiler will only keep one of the two variants, because it
promises to optimize `(variable-reference-from-unsafe?
(#%variable-reference))` to a literal boolean. The expander will still
expand both variants, however, so avoid putting code in both variants
that itself can have safety variants.
2020-11-10 10:36:03 -07:00
Matthew Flatt
c85659b905 Chez Scheme: fix compiler bug introduced with unboxing
When simplifying certain expressions, a non-pointer variable was
created to hold a pointer value.
2020-11-09 13:23:39 -07:00
Matthew Flatt
c017ecbafe cs: avoid inlining error path internally 2020-11-09 11:44:12 -07:00
Matthew Flatt
91e3065991 Chez Scheme: fix typo for flvector operation 2020-11-09 11:43:36 -07:00
Matthew Flatt
a17516f5b6 rktio: repair for subprocesses on Unix witthout threads
A list of pending process records was not managed correctly when
interest in a subprocess is abandoned before the subprocess completes.
2020-11-09 09:24:05 -07:00
Matthew Flatt
a0375111a3 Chez Scheme: fix flvector-copy for 32-bit platforms
Closes #3490
2020-11-09 05:55:47 -07:00
Paulo Matos
4892d2ad80 Fix workflow syntax 2020-11-09 13:44:04 +01:00
Paulo Matos
3369bf6658 Allow test-cgc to fail without failing the workflow
Related to #3491
2020-11-09 13:40:56 +01:00
Matthew Flatt
fe54cbc63f Chez Scheme: avoid copying huge objects during GC 2020-11-08 19:22:09 -07:00
Matthew Flatt
42f3825738 docs: correct recent addition on make-caching-managed-compile-zo 2020-11-08 08:48:24 -07:00
Matthew Flatt
d2b954c428 reference: specify time complexities for many list and vector operations 2020-11-08 07:52:01 -07:00
Matthew Flatt
3a47af217e docs: more clarifications on compiler/cm and namespaces 2020-11-08 07:34:34 -07:00
Matthew Flatt
e40e86ae5a Chez Scheme: unbreak 32-bit build 2020-11-08 05:56:56 -07:00
Matthew Flatt
7a12b4ac93 cs & thread: repair suspending a thread that is currently in sleep
Thanks to Greg Rosenblatt for the report.
2020-11-07 17:35:30 -07:00
Matthew Flatt
db195a52b5 raco decompile: avoid static-generation code
Update the decompiler to avoid hard-coding the static-generation
numebr, which changed.
2020-11-07 14:08:36 -07:00
Matthew Flatt
7c8d9c6523 bc: avoid bad floating-point roundoff in seconds->date
Thanks, Xsmith!

Closes #3489
2020-11-07 12:52:38 -07:00
Matthew Flatt
09c9901f6b bc: don't drop operations when impersonators can interpose
For example, if the result of `(when (box? x) (unbox x))` is not used,
then the `(unbox x)` still must be done, because the box might be an
impersonator. In contrast, `(when (box*? x) (unbox* x))` can be
dropped, since `unbox*` is an authentic unbox.

This change applies to unsafe operations like `unsafe-struct-ref`,
too, and applies to struct accessors for non-authentic structure
types.

Racket CS already preserves operations appropriately.

Relevant to #3487
2020-11-07 10:53:44 -07:00
Matthew Flatt
1149bb8b2c reader: extend error message for disabled #lang
Try to give more hints to help somone who writes `#lang` twice.
2020-11-07 07:55:20 -07:00
Matthew Flatt
2b7e36b5f4 Chez Scheme: fix version mismatch for install 2020-11-07 07:54:46 -07:00
Matthew Flatt
2b945d12fb Chez Scheme: add flvectors
To make room in the type encoding, remove immutable fxvectors from
Chez Scheme --- which had been added just to go along with immutable
strings, vectors, and bytevectors, but immutable fxvectors do not seem
useful, and they have no counterpart in Racket.
2020-11-07 07:34:33 -07:00