mit-scheme.git
6 years agoHalfway fix some broken tests.
Taylor R Campbell [Wed, 7 Nov 2018 05:08:02 +0000 (05:08 +0000)]
Halfway fix some broken tests.

- Use with-test-properties, not run-sub-test.

- Disable run-sub-test in the test environment; it doesn't make sense
  for tests to call it.

- Add a rudimentary expect-failure.  (Feel free to spruce this up
  with a message detailing the nature of the expectation, a note in
  the final report, &c.)

- Partly fix test-char-set.scm, which was silently nonfunctional
  because of run-sub-test.  Leave an xfail for the part I don't know
  how to fix.  (Chris -- if you could fix this, that would be great!)

6 years agoDepend on x11-const directly, not via a stamp and submake.
Taylor R Campbell [Wed, 7 Nov 2018 04:03:28 +0000 (04:03 +0000)]
Depend on x11-const directly, not via a stamp and submake.

Going via the submake means parallel make can get confused and cause
two processes to try to build the same thing at the same time and
stomp on each other's toes.

6 years agoMake the C compiler warnings that we subscribe to fatal.
Taylor R Campbell [Wed, 7 Nov 2018 03:08:47 +0000 (03:08 +0000)]
Make the C compiler warnings that we subscribe to fatal.

6 years agoConfirm the primitive respects the bounds too.
Taylor R Campbell [Wed, 7 Nov 2018 03:08:28 +0000 (03:08 +0000)]
Confirm the primitive respects the bounds too.

6 years agoSimplify construction of chacha core test vector tests.
Taylor R Campbell [Wed, 7 Nov 2018 02:52:37 +0000 (02:52 +0000)]
Simplify construction of chacha core test vector tests.

6 years agoTest fenceposts in chacha core primitives.
Taylor R Campbell [Wed, 7 Nov 2018 02:52:17 +0000 (02:52 +0000)]
Test fenceposts in chacha core primitives.

6 years agoUnfix the fix for an off-by-zero.
Taylor R Campbell [Wed, 7 Nov 2018 02:39:25 +0000 (02:39 +0000)]
Unfix the fix for an off-by-zero.

arg_ulong_index_integer(argno, n) takes n as _exclusive_ upper bound.

In this case, n - 64 is a valid starting index.  So the exclusive
upper bound is n - 64 + 1 = n - 63.

6 years agoFix more formatting.
Taylor R Campbell [Wed, 7 Nov 2018 02:39:20 +0000 (02:39 +0000)]
Fix more formatting.

6 years agoEliminate unused variable warnings.
Chris Hanson [Tue, 6 Nov 2018 05:53:04 +0000 (21:53 -0800)]
Eliminate unused variable warnings.

6 years agoFix a bug in prchacha: compiler warned of unused variable.
Chris Hanson [Tue, 6 Nov 2018 05:51:23 +0000 (21:51 -0800)]
Fix a bug in prchacha: compiler warned of unused variable.

Also there was an off-by-one thinko, and incorrect PRIMITIVE_HEADER arguments.
While I was at it I tweaked the formatting a little.

6 years agoFix sign of (flo:ulp -infinity). Simplify.
Taylor R Campbell [Mon, 5 Nov 2018 04:41:14 +0000 (04:41 +0000)]
Fix sign of (flo:ulp -infinity).  Simplify.

flo:ulp is supposed to return a positive magnitude, in particular the
absolute distance from x to the next larger floating-point number in
magnitude.

6 years agoTidy up ieee754.scm, add some tests, and export some of it.
Taylor R Campbell [Mon, 5 Nov 2018 04:40:00 +0000 (04:40 +0000)]
Tidy up ieee754.scm, add some tests, and export some of it.

6 years agoAllow sequences to contain zero elements.
Chris Hanson [Sun, 4 Nov 2018 04:55:19 +0000 (21:55 -0700)]
Allow sequences to contain zero elements.

6 years agoDon't use upper-case symbols in loader.
Chris Hanson [Fri, 2 Nov 2018 05:07:12 +0000 (22:07 -0700)]
Don't use upper-case symbols in loader.

The system might be in a non-case-fold mode.

6 years agoDon't print internals of promises.
Chris Hanson [Fri, 2 Nov 2018 03:31:37 +0000 (20:31 -0700)]
Don't print internals of promises.

6 years agoFix printing of promises.
Chris Hanson [Fri, 2 Nov 2018 03:29:37 +0000 (20:29 -0700)]
Fix printing of promises.

6 years agoMerge branch 'release-10'
Chris Hanson [Thu, 1 Nov 2018 05:42:43 +0000 (22:42 -0700)]
Merge branch 'release-10'

6 years agoMake macos dmg file read only.
Chris Hanson [Thu, 1 Nov 2018 05:41:45 +0000 (22:41 -0700)]
Make macos dmg file read only.

6 years agoFix problem with building and installing x11 plugin from native dist.
Chris Hanson [Thu, 1 Nov 2018 01:55:47 +0000 (18:55 -0700)]
Fix problem with building and installing x11 plugin from native dist.

6 years agoComment what log-logistic and logit-exp are for.
Taylor R Campbell [Wed, 31 Oct 2018 16:44:43 +0000 (16:44 +0000)]
Comment what log-logistic and logit-exp are for.

6 years agoDefine (flo:ulp x) to be distance to next float in direction of x.
Taylor R Campbell [Wed, 31 Oct 2018 16:37:32 +0000 (16:37 +0000)]
Define (flo:ulp x) to be distance to next float in direction of x.

Thus, (flo:ulp 1.) = (flo:ulp -1.) = flo:ulp-of-one.  Bottoms out at
infinity: (flo:ulp x) = x if x is infinite.  This definition applies
to zero, too, giving the smallest subnormal.

6 years agoAdd Mode: C line on request from mejja.
Taylor R Campbell [Wed, 31 Oct 2018 16:35:54 +0000 (16:35 +0000)]
Add Mode: C line on request from mejja.

(Not keen to otherwise reformat this code from an upstream, though.)

6 years agoClarify some comments.
Taylor R Campbell [Tue, 30 Oct 2018 16:16:38 +0000 (16:16 +0000)]
Clarify some comments.

6 years agoReorganize logsumexp for clarity. No functional change.
Taylor R Campbell [Tue, 30 Oct 2018 16:04:13 +0000 (16:04 +0000)]
Reorganize logsumexp for clarity.  No functional change.

6 years agoMask underflow exception in logsumexp because it doesn't matter.
Taylor R Campbell [Tue, 30 Oct 2018 15:59:04 +0000 (15:59 +0000)]
Mask underflow exception in logsumexp because it doesn't matter.

6 years agoAdd (logsumexp (list 1 2 3)) = (log (+ (exp 1) (exp 2) (exp 3))).
Taylor R Campbell [Tue, 30 Oct 2018 15:41:22 +0000 (15:41 +0000)]
Add (logsumexp (list 1 2 3)) = (log (+ (exp 1) (exp 2) (exp 3))).

6 years agoDon't assume that it's possible to run MIT_SCHEME_EXE during configuration.
Chris Hanson [Tue, 30 Oct 2018 04:30:33 +0000 (21:30 -0700)]
Don't assume that it's possible to run MIT_SCHEME_EXE during configuration.

This won't work with a native distribution, since there may not be a working
scheme on the host.  Instead use other ways to do the necessary work.

6 years agoBump revision to 10.1.1 to fix stupid bug.
Chris Hanson [Tue, 30 Oct 2018 01:43:02 +0000 (18:43 -0700)]
Bump revision to 10.1.1 to fix stupid bug.

6 years agoReduce default heap size for 32-bit systems.
Chris Hanson [Sun, 28 Oct 2018 23:08:29 +0000 (16:08 -0700)]
Reduce default heap size for 32-bit systems.

During build was getting sporadic "unable to mmap heap" errors.

6 years agoFix typo in previous change.
Chris Hanson [Sun, 28 Oct 2018 22:10:02 +0000 (15:10 -0700)]
Fix typo in previous change.

6 years agoEliminate flo:epsilon.
Taylor R Campbell [Sun, 28 Oct 2018 19:56:35 +0000 (19:56 +0000)]
Eliminate flo:epsilon.

The name is confusing.  It means two different things: the distance
from 1 to the next positive floating-point number, and the maximum
relative error of rounding to the nearest floating-point number.
Provide the separate names flo:ulp-of-one and flo:error-bound for
these so that you're not even tempted to be confused by the name
`epsilon'.

(But continue to say `eps' in the proofs in the comments where it's
obvious that we're talking about relative error bounds and a short
name for that is essential for legibility.)

6 years agoTidy up error analysis of logit and logistic.
Taylor R Campbell [Sun, 28 Oct 2018 04:13:26 +0000 (04:13 +0000)]
Tidy up error analysis of logit and logistic.

Add (logit1/2+ p) = (logit (+ 1/2 p)) and (logistic-1/2 x) = (-
(logistic x) 1/2), for reasons like log1p and expm1.  Add some
trivial tests of the edge cases they cover where logit and logistic
are ill-conditioned.

6 years agoMerge branch 'release-10'
Chris Hanson [Sun, 28 Oct 2018 03:43:38 +0000 (20:43 -0700)]
Merge branch 'release-10'

6 years agoNo need to separately configure plugins.
Chris Hanson [Fri, 26 Oct 2018 02:02:51 +0000 (19:02 -0700)]
No need to separately configure plugins.

6 years agoChange "module" to "plugin".
Chris Hanson [Fri, 26 Oct 2018 02:02:36 +0000 (19:02 -0700)]
Change "module" to "plugin".

6 years agoEliminate compiler warning.
Chris Hanson [Sun, 28 Oct 2018 03:41:15 +0000 (20:41 -0700)]
Eliminate compiler warning.

6 years agoUse create-dmg script to automate building of macOS image.
Chris Hanson [Sat, 27 Oct 2018 23:49:09 +0000 (16:49 -0700)]
Use create-dmg script to automate building of macOS image.

6 years agoFix a couple of compiler warnings from 32-bit system.
Chris Hanson [Sat, 27 Oct 2018 22:40:58 +0000 (15:40 -0700)]
Fix a couple of compiler warnings from 32-bit system.

6 years agoMerge branch 'release-10' of git.sv.gnu.org:/srv/git/mit-scheme into release-10
Chris Hanson [Sat, 27 Oct 2018 05:20:16 +0000 (22:20 -0700)]
Merge branch 'release-10' of git.sv.gnu.org:/srv/git/mit-scheme into release-10

6 years agoFix thinko.
Chris Hanson [Sat, 27 Oct 2018 05:19:58 +0000 (22:19 -0700)]
Fix thinko.

6 years agoEliminate unavailable (and unused) load option.
Chris Hanson [Sat, 27 Oct 2018 05:19:42 +0000 (22:19 -0700)]
Eliminate unavailable (and unused) load option.

6 years agoForgot to define this. Ummm, I guess cref accidentally made it work?
Taylor R Campbell [Sat, 27 Oct 2018 02:45:23 +0000 (02:45 +0000)]
Forgot to define this.  Ummm, I guess cref accidentally made it work?

6 years agoExpose flo:radix = 2 too, just for good measure, and for assertions.
Taylor R Campbell [Sat, 27 Oct 2018 02:37:06 +0000 (02:37 +0000)]
Expose flo:radix = 2 too, just for good measure, and for assertions.

6 years agoExport primitive flonum-denormalize as flo:ldexp and flo:scalbn.
Taylor R Campbell [Sat, 27 Oct 2018 02:21:06 +0000 (02:21 +0000)]
Export primitive flonum-denormalize as flo:ldexp and flo:scalbn.

These are the familiar -- and when FLT_RADIX = 2, equivalent -- names
for the operation in libm.

`Denormalize' is not right: neither does it turn a normal number into
a subnormal, nor does it put anything into a canonical interval like
[1/2, 1) or [1, 2).  I personally favour `shift' -- it is, in Z, the
same as the bitwise shift operation.  But unless anyone else wants to
join me against this windmill I'll just stay with the familiar if
ugly libm names.

6 years agoDisable errno checking in libm functions.
Taylor R Campbell [Sat, 27 Oct 2018 02:11:27 +0000 (02:11 +0000)]
Disable errno checking in libm functions.

If there's a floating-point exception, we have a mechanism for
dealing with it -- and continuing without a trap if the user so
desires.

Leave in the restriction on flo:log1p and flo:expm1 because those are
implementation limitations in the i386 compiler; the full functions
are implemented in the runtime.

6 years agolog1pexp(x) is never exactly x even if that's the best approximation.
Taylor R Campbell [Sat, 27 Oct 2018 02:11:14 +0000 (02:11 +0000)]
log1pexp(x) is never exactly x even if that's the best approximation.

6 years agoTabify.
Taylor R Campbell [Sat, 27 Oct 2018 02:05:18 +0000 (02:05 +0000)]
Tabify.

6 years agoUse named constants rather than magic numbers.
Taylor R Campbell [Sat, 27 Oct 2018 02:04:17 +0000 (02:04 +0000)]
Use named constants rather than magic numbers.

6 years agoDefine and export some more floating-point parameters.
Taylor R Campbell [Sat, 27 Oct 2018 01:39:58 +0000 (01:39 +0000)]
Define and export some more floating-point parameters.

6 years agoFix typo.
Chris Hanson [Sat, 27 Oct 2018 00:52:46 +0000 (17:52 -0700)]
Fix typo.

6 years agoUpdate make-doc-files to work with plugins.
Chris Hanson [Sat, 27 Oct 2018 00:38:36 +0000 (17:38 -0700)]
Update make-doc-files to work with plugins.

6 years agotest-driver is autocrud too.
Taylor R Campbell [Sat, 27 Oct 2018 00:37:54 +0000 (00:37 +0000)]
test-driver is autocrud too.

6 years agoChange way that plugins are registered so that lib and doc are separate.
Chris Hanson [Sat, 27 Oct 2018 00:38:05 +0000 (17:38 -0700)]
Change way that plugins are registered so that lib and doc are separate.

This is needed when building just the documentation, as for the release.

6 years agoSimple-minded criterion to compute x^-y by 1/x^y was too simple.
Taylor R Campbell [Sat, 27 Oct 2018 00:23:12 +0000 (00:23 +0000)]
Simple-minded criterion to compute x^-y by 1/x^y was too simple.

For any |x| > 1, we can't do this without comparing the size of
log(x) and y well enough to discern what might yield subnormal, so
might as well just compute the general case then.

6 years agoOmit unnecessary case for logistic. Add a test for this case.
Taylor R Campbell [Sat, 27 Oct 2018 00:03:42 +0000 (00:03 +0000)]
Omit unnecessary case for logistic.  Add a test for this case.

The relative error is small in naive evaluation of 1/(1 + e^{-x})
even if x is very negative.

6 years agoFix potential shell portability issues.
Chris Hanson [Fri, 26 Oct 2018 23:47:16 +0000 (16:47 -0700)]
Fix potential shell portability issues.

6 years agoExtend expt to generate subnormals with exact integer exponents.
Taylor R Campbell [Fri, 26 Oct 2018 23:41:39 +0000 (23:41 +0000)]
Extend expt to generate subnormals with exact integer exponents.

6 years agoExpose the minimum and maximum finite normal floating-point exponents.
Taylor R Campbell [Fri, 26 Oct 2018 23:32:37 +0000 (23:32 +0000)]
Expose the minimum and maximum finite normal floating-point exponents.

6 years agoAdd some .gitignore files so I can use git status.
Taylor R Campbell [Fri, 26 Oct 2018 16:53:13 +0000 (16:53 +0000)]
Add some .gitignore files so I can use git status.

6 years agoNew primitives for ChaCha stream cipher core.
Taylor R Campbell [Fri, 26 Oct 2018 16:20:09 +0000 (16:20 +0000)]
New primitives for ChaCha stream cipher core.

Should maybe provide a version that produces many blocks of output,
and perhaps xor's them into an existing message, but this will do for
my needs now.  Plan to use this for a PRNG.

6 years agoFix unparser->print method fallout.
Taylor R Campbell [Fri, 26 Oct 2018 16:17:41 +0000 (16:17 +0000)]
Fix unparser->print method fallout.

6 years agoAvoid using uninitialized stack garbage.
Taylor R Campbell [Fri, 26 Oct 2018 16:17:10 +0000 (16:17 +0000)]
Avoid using uninitialized stack garbage.

6 years agoclock() returns (clock_t)-1 on error, not necessarily negative.
Taylor R Campbell [Fri, 26 Oct 2018 16:15:28 +0000 (16:15 +0000)]
clock() returns (clock_t)-1 on error, not necessarily negative.

If clock_t is unsigned, n < 0 is always false.  Compare for equality
with (clock_t)-1.

6 years agoAdd plugin docs to doc files.
Chris Hanson [Fri, 26 Oct 2018 03:15:52 +0000 (20:15 -0700)]
Add plugin docs to doc files.

6 years agoMore version numbers.
Chris Hanson [Fri, 26 Oct 2018 03:15:40 +0000 (20:15 -0700)]
More version numbers.

6 years agoRemove no-longer-needed args to configure.
Chris Hanson [Fri, 26 Oct 2018 03:15:26 +0000 (20:15 -0700)]
Remove no-longer-needed args to configure.

6 years agoMore version numbers.
Chris Hanson [Fri, 26 Oct 2018 02:20:04 +0000 (19:20 -0700)]
More version numbers.

6 years agoUpdate some version numbers.
Chris Hanson [Fri, 26 Oct 2018 02:06:25 +0000 (19:06 -0700)]
Update some version numbers.

6 years agoNo need to separately configure plugins.
Chris Hanson [Fri, 26 Oct 2018 02:02:51 +0000 (19:02 -0700)]
No need to separately configure plugins.

6 years agoChange "module" to "plugin".
Chris Hanson [Fri, 26 Oct 2018 02:02:36 +0000 (19:02 -0700)]
Change "module" to "plugin".

6 years agoBug reported by Arthur: case-fold-string was dropping tail of string.
Chris Hanson [Thu, 25 Oct 2018 21:21:08 +0000 (14:21 -0700)]
Bug reported by Arthur: case-fold-string was dropping tail of string.

6 years agoAdd --no-init-file to those places that might be calls to 9.2.
Chris Hanson [Thu, 25 Oct 2018 20:59:31 +0000 (13:59 -0700)]
Add --no-init-file to those places that might be calls to 9.2.

This isn't needed any more since --no-init-file is implied by --batch-mode, and
can be removed after the next release.

6 years agoApply the same bound to the other region.
Taylor R Campbell [Thu, 25 Oct 2018 05:33:57 +0000 (05:33 +0000)]
Apply the same bound to the other region.

6 years ago...yes, I know how to count.
Taylor R Campbell [Thu, 25 Oct 2018 05:25:37 +0000 (05:25 +0000)]
...yes, I know how to count.

6 years agoCatch more stray `.' loitering around.
Taylor R Campbell [Thu, 25 Oct 2018 05:22:00 +0000 (05:22 +0000)]
Catch more stray `.' loitering around.

6 years agoClarify justification for ditching the denominator.
Taylor R Campbell [Thu, 25 Oct 2018 05:21:46 +0000 (05:21 +0000)]
Clarify justification for ditching the denominator.

6 years agolog(a/b), not log(a)/log(b).
Taylor R Campbell [Thu, 25 Oct 2018 05:20:53 +0000 (05:20 +0000)]
log(a/b), not log(a)/log(b).

6 years agoOmit stray sentence terminator.
Taylor R Campbell [Thu, 25 Oct 2018 05:16:50 +0000 (05:16 +0000)]
Omit stray sentence terminator.

6 years agoThe bounds of Lemma 4 are <=, not <, as is this branch's condition.
Taylor R Campbell [Thu, 25 Oct 2018 05:09:48 +0000 (05:09 +0000)]
The bounds of Lemma 4 are <=, not <, as is this branch's condition.

6 years agoInadvertently substituted d0 for d2. Fix.
Taylor R Campbell [Thu, 25 Oct 2018 05:05:59 +0000 (05:05 +0000)]
Inadvertently substituted d0 for d2.  Fix.

No change in conclusion -- there was no convenient cancellation or
anything as a consequence of this.

6 years agoI accidentally a predicate.
Taylor R Campbell [Thu, 25 Oct 2018 05:02:39 +0000 (05:02 +0000)]
I accidentally a predicate.

6 years agoFix stray line, clarify, and simplify.
Taylor R Campbell [Thu, 25 Oct 2018 04:57:30 +0000 (04:57 +0000)]
Fix stray line, clarify, and simplify.

6 years agoAllow overlap of imports provided that the imported values are eqv?.
Chris Hanson [Thu, 25 Oct 2018 04:26:11 +0000 (21:26 -0700)]
Allow overlap of imports provided that the imported values are eqv?.

6 years agoImplement scheme-report-environment and null-environment.
Chris Hanson [Thu, 25 Oct 2018 02:14:01 +0000 (19:14 -0700)]
Implement scheme-report-environment and null-environment.

6 years agoAdd SRFI libraries.
Chris Hanson [Thu, 25 Oct 2018 01:53:11 +0000 (18:53 -0700)]
Add SRFI libraries.

6 years agoMerge branch 'riastradh-logisticerrbounds'
Taylor R Campbell [Thu, 25 Oct 2018 02:46:45 +0000 (02:46 +0000)]
Merge branch 'riastradh-logisticerrbounds'

6 years agoCompiling stuff depends on the cdecls' *-const.bin files.
Taylor R Campbell [Thu, 25 Oct 2018 02:45:40 +0000 (02:45 +0000)]
Compiling stuff depends on the cdecls' *-const.bin files.

6 years agoTest some more edge cases.
Taylor R Campbell [Thu, 25 Oct 2018 01:47:22 +0000 (01:47 +0000)]
Test some more edge cases.

6 years agoTest some edge cases for logit(near 1/2).
Taylor R Campbell [Thu, 25 Oct 2018 01:44:12 +0000 (01:44 +0000)]
Test some edge cases for logit(near 1/2).

6 years agoUse (assert-<= (relerr ...) bound) for better error messages.
Taylor R Campbell [Thu, 25 Oct 2018 01:43:40 +0000 (01:43 +0000)]
Use (assert-<= (relerr ...) bound) for better error messages.

6 years agoFix sense of test. Do this part only if 1 - p is guaranteed exact.
Taylor R Campbell [Thu, 25 Oct 2018 01:42:22 +0000 (01:42 +0000)]
Fix sense of test.  Do this part only if 1 - p is guaranteed exact.

6 years agoUse and prove bounds for a better formula for logit-exp.
Taylor R Campbell [Thu, 25 Oct 2018 01:41:53 +0000 (01:41 +0000)]
Use and prove bounds for a better formula for logit-exp.

6 years agoClarify some of the proofs and logic.
Taylor R Campbell [Thu, 25 Oct 2018 01:40:10 +0000 (01:40 +0000)]
Clarify some of the proofs and logic.

Style: Avoid log1p for anything but the floating-point approximation
just to be extra-clear; write log(1 + ...) in the math otherwise.

Reverse order of branches to make the condition (<= lo x hi) clearer.

6 years agoDon't show compilation dependencies by default.
Chris Hanson [Thu, 25 Oct 2018 00:09:59 +0000 (17:09 -0700)]
Don't show compilation dependencies by default.

6 years agoUse better formulas for logistic(negative) and logit(near 1/2).
Taylor R Campbell [Thu, 25 Oct 2018 00:05:37 +0000 (00:05 +0000)]
Use better formulas for logistic(negative) and logit(near 1/2).

Prove some error bounds in comments.

6 years agoFix up code to clean test subdirs.
Chris Hanson [Wed, 24 Oct 2018 21:03:55 +0000 (14:03 -0700)]
Fix up code to clean test subdirs.

6 years agoGet FFI tests working when run from a build directory.
Chris Hanson [Wed, 24 Oct 2018 20:57:24 +0000 (13:57 -0700)]
Get FFI tests working when run from a build directory.

6 years agoFix capitalization of error messages.
Chris Hanson [Wed, 24 Oct 2018 04:40:42 +0000 (21:40 -0700)]
Fix capitalization of error messages.

6 years agoImplement let-values and let*-values.
Chris Hanson [Wed, 24 Oct 2018 04:28:42 +0000 (21:28 -0700)]
Implement let-values and let*-values.

6 years agoChange scode libraries to carry both imports and imports-used.
Chris Hanson [Wed, 24 Oct 2018 04:26:45 +0000 (21:26 -0700)]
Change scode libraries to carry both imports and imports-used.