Raymond Toy pushed to branch issue-288-re-enable-deftransform-random-int at cmucl / cmucl
Commits:
23c5bc24 by Raymond Toy at 2024-03-27T10:40:24-07:00
Checkout ansi-test issue-288-new-failures
We have new failures in ansi-tests. Checkout the ansi-test branch
that has the new failures listed.
- - - - -
1 changed file:
- bin/run-ansi-tests.sh
Changes:
=====================================
bin/run-ansi-tests.sh
=====================================
@@ -41,7 +41,7 @@ else
fi
cd ../ansi-test
-git checkout cmucl-expected-failures
+git checkout issue-288-new-failures
make LISP="$LISP batch -noinit -nositeinit"
# There should be no unexpected successes or failures; check these separately
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/23c5bc242a62fa40f271057…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/23c5bc242a62fa40f271057…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-275b-signal-float-underflow at cmucl / cmucl
Commits:
bb8eb44c by Raymond Toy at 2024-03-26T08:25:46-07:00
Fix bad merge
Actually need to remove `with-float-traps-masked`. Duh!
- - - - -
1 changed file:
- src/code/reader.lisp
Changes:
=====================================
src/code/reader.lisp
=====================================
@@ -1869,16 +1869,15 @@ the end of the stream."
;; Otherwise the number might fit, so we carefully compute the result.
(handler-case
- (with-float-traps-masked (:underflow)
- (let* ((ratio (/ (* (expt 10 exponent) number)
- divisor))
- (result (coerce ratio float-format)))
- (when (and (zerop result) (not (zerop number)))
- ;; The number we've read is so small that it gets
- ;; converted to 0.0, but is not actually zero. Signal an
- ;; error. See CLHS 2.3.1.1.
- (error _"Underflow"))
- result))
+ (let* ((ratio (/ (* (expt 10 exponent) number)
+ divisor))
+ (result (coerce ratio float-format)))
+ (when (and (zerop result) (not (zerop number)))
+ ;; The number we've read is so small that it gets
+ ;; converted to 0.0, but is not actually zero. Signal an
+ ;; error. See CLHS 2.3.1.1.
+ (error _"Underflow"))
+ result)
(floating-point-underflow ()
;; Resignal the underflow, but allow the user to continue with
;; 0.
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/bb8eb44c424cc0ab2dba0e4…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/bb8eb44c424cc0ab2dba0e4…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-275b-signal-float-underflow at cmucl / cmucl
Commits:
059069f8 by Raymond Toy at 2024-03-24T23:16:11+00:00
Fix #287: Clean up make-float-aux
- - - - -
ad88cf63 by Raymond Toy at 2024-03-24T23:16:13+00:00
Merge branch 'issue-287-clean-up-make-float-aux' into 'master'
Fix #287: Clean up make-float-aux
Closes #287
See merge request cmucl/cmucl!196
- - - - -
e2c9eeea by Raymond Toy at 2024-03-25T14:33:02+00:00
Fix #290: Neatly pprint with-float-traps-masked and friends
- - - - -
8ed3d1d3 by Raymond Toy at 2024-03-25T14:33:07+00:00
Merge branch 'issue-290-pprint-with-float-traps' into 'master'
Fix #290: Neatly pprint with-float-traps-masked and friends
Closes #290
See merge request cmucl/cmucl!199
- - - - -
23f449e4 by Raymond Toy at 2024-03-26T07:46:47-07:00
Merge branch 'master' into issue-275b-signal-float-underflow
- - - - -
488cbe98 by Raymond Toy at 2024-03-26T07:47:46-07:00
Add a comment about continuing with 0
- - - - -
3 changed files:
- src/code/pprint.lisp
- src/code/reader.lisp
- + tests/pprint.lisp
Changes:
=====================================
src/code/pprint.lisp
=====================================
@@ -2076,7 +2076,9 @@ When annotations are present, invoke them at the right positions."
(c:sc-case pprint-sc-case)
(c:define-assembly-routine pprint-define-assembly)
(c:deftransform pprint-defun)
- (c:defoptimizer pprint-defun)))
+ (c:defoptimizer pprint-defun)
+ (ext:with-float-traps-masked pprint-with-like)
+ (ext:with-float-traps-enabled pprint-with-like)))
(defun pprint-init ()
(setf *initial-pprint-dispatch* (make-pprint-dispatch-table))
=====================================
src/code/reader.lisp
=====================================
@@ -1868,17 +1868,20 @@ the end of the stream."
float-format (read-buffer-to-string)))))))
;; Otherwise the number might fit, so we carefully compute the result.
- (handler-case
- (let* ((ratio (/ (* (expt 10 exponent) number)
- divisor))
- (result (coerce ratio float-format)))
- (when (and (zerop result) (not (zerop number)))
- ;; The number we've read is so small that it gets
- ;; converted to 0.0, but is not actually zero. Signal an
- ;; error. See CLHS 2.3.1.1.
- (error "Underflow"))
- result)
+ (handler-case
+ (with-float-traps-masked (:underflow)
+ (let* ((ratio (/ (* (expt 10 exponent) number)
+ divisor))
+ (result (coerce ratio float-format)))
+ (when (and (zerop result) (not (zerop number)))
+ ;; The number we've read is so small that it gets
+ ;; converted to 0.0, but is not actually zero. Signal an
+ ;; error. See CLHS 2.3.1.1.
+ (error _"Underflow"))
+ result))
(floating-point-underflow ()
+ ;; Resignal the underflow, but allow the user to continue with
+ ;; 0.
(let ((zero (coerce 0 float-format)))
(restart-case
(error 'floating-point-underflow)
=====================================
tests/pprint.lisp
=====================================
@@ -0,0 +1,28 @@
+;; Tests for pprinter
+
+(defpackage :pprint-tests
+ (:use :cl :lisp-unit))
+
+(in-package "PPRINT-TESTS")
+
+(define-test pprint.with-float-traps-masked
+ (:tag :issues)
+ (assert-equal
+"
+(WITH-FLOAT-TRAPS-MASKED (:UNDERFLOW)
+ (PRINT \"Hello\"))"
+ (with-output-to-string (s)
+ (pprint '(ext:with-float-traps-masked (:underflow)
+ (print "Hello"))
+ s))))
+
+(define-test pprint.with-float-traps-enabled
+ (:tag :issues)
+ (assert-equal
+"
+(WITH-FLOAT-TRAPS-ENABLED (:UNDERFLOW)
+ (PRINT \"Hello\"))"
+ (with-output-to-string (s)
+ (pprint '(ext:with-float-traps-enabled (:underflow)
+ (print "Hello"))
+ s))))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/45532060060f711842edbf…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/45532060060f711842edbf…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-291-pprint-handler-case at cmucl / cmucl
Commits:
e2c9eeea by Raymond Toy at 2024-03-25T14:33:02+00:00
Fix #290: Neatly pprint with-float-traps-masked and friends
- - - - -
8ed3d1d3 by Raymond Toy at 2024-03-25T14:33:07+00:00
Merge branch 'issue-290-pprint-with-float-traps' into 'master'
Fix #290: Neatly pprint with-float-traps-masked and friends
Closes #290
See merge request cmucl/cmucl!199
- - - - -
e35e7327 by Raymond Toy at 2024-03-25T07:39:35-07:00
Merge branch 'master' into issue-291-pprint-handler-case
- - - - -
41522236 by Raymond Toy at 2024-03-25T08:16:46-07:00
Fix up typos in comments
- - - - -
2 changed files:
- src/code/pprint.lisp
- tests/pprint.lisp
Changes:
=====================================
src/code/pprint.lisp
=====================================
@@ -1460,8 +1460,8 @@ When annotations are present, invoke them at the right positions."
(defun pprint-handler-case (stream list &rest noise)
(declare (ignore noise))
- ;; Like pprint-handler-bind, but the each of the error clauses is
- ;; printed with declaractions and forms on a separate line, indented
+ ;; Like pprint-handler-bind, but each of the error clauses is
+ ;; printed with declarations and forms on a separate line, indented
;; like a function body. The handler-case part, "~:<~^~W~3I
;; ~:_~W~1I~@{ ~:@_...~:>" comes from pprint-handler-bind, but the
;; last "~W" is replaced to print out the error clauses in the way
@@ -2089,7 +2089,9 @@ When annotations are present, invoke them at the right positions."
(c:sc-case pprint-sc-case)
(c:define-assembly-routine pprint-define-assembly)
(c:deftransform pprint-defun)
- (c:defoptimizer pprint-defun)))
+ (c:defoptimizer pprint-defun)
+ (ext:with-float-traps-masked pprint-with-like)
+ (ext:with-float-traps-enabled pprint-with-like)))
(defun pprint-init ()
(setf *initial-pprint-dispatch* (make-pprint-dispatch-table))
=====================================
tests/pprint.lisp
=====================================
@@ -10,21 +10,10 @@
(assert-equal
"
(WITH-FLOAT-TRAPS-MASKED (:UNDERFLOW)
- (LET* ((RATIO
- (/ (* (EXPT 10 PPRINT-TESTS::EXPONENT) NUMBER)
- PPRINT-TESTS::DIVISOR))
- (PPRINT-TESTS::RESULT (COERCE RATIO PPRINT-TESTS::FLOAT-FORMAT)))
- (WHEN (AND (ZEROP PPRINT-TESTS::RESULT) (NOT (ZEROP NUMBER)))
- (ERROR \"Underflow\"))
- PPRINT-TESTS::RESULT))"
+ (PRINT \"Hello\"))"
(with-output-to-string (s)
(pprint '(ext:with-float-traps-masked (:underflow)
- (let* ((ratio (/ (* (expt 10 exponent) number)
- divisor))
- (result (coerce ratio float-format)))
- (when (and (zerop result) (not (zerop number)))
- (error "Underflow"))
- result))
+ (print "Hello"))
s))))
(define-test pprint.with-float-traps-enabled
@@ -32,21 +21,10 @@
(assert-equal
"
(WITH-FLOAT-TRAPS-ENABLED (:UNDERFLOW)
- (LET* ((RATIO
- (/ (* (EXPT 10 PPRINT-TESTS::EXPONENT) NUMBER)
- PPRINT-TESTS::DIVISOR))
- (PPRINT-TESTS::RESULT (COERCE RATIO PPRINT-TESTS::FLOAT-FORMAT)))
- (WHEN (AND (ZEROP PPRINT-TESTS::RESULT) (NOT (ZEROP NUMBER)))
- (ERROR \"Underflow\"))
- PPRINT-TESTS::RESULT))"
+ (PRINT \"Hello\"))"
(with-output-to-string (s)
(pprint '(ext:with-float-traps-enabled (:underflow)
- (let* ((ratio (/ (* (expt 10 exponent) number)
- divisor))
- (result (coerce ratio float-format)))
- (when (and (zerop result) (not (zerop number)))
- (error "Underflow"))
- result))
+ (print "Hello"))
s))))
(define-test pprint.handler-case
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/2f62e54cd7d4de4b46b841…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/2f62e54cd7d4de4b46b841…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
059069f8 by Raymond Toy at 2024-03-24T23:16:11+00:00
Fix #287: Clean up make-float-aux
- - - - -
ad88cf63 by Raymond Toy at 2024-03-24T23:16:13+00:00
Merge branch 'issue-287-clean-up-make-float-aux' into 'master'
Fix #287: Clean up make-float-aux
Closes #287
See merge request cmucl/cmucl!196
- - - - -
2 changed files:
- src/code/reader.lisp
- src/i18n/locale/cmucl.pot
Changes:
=====================================
src/code/reader.lisp
=====================================
@@ -1867,7 +1867,7 @@ the end of the stream."
(%reader-error stream _"Number not representable as a ~S: ~S"
float-format (read-buffer-to-string)))))))
- ;; Otherwise the number might fit, so we carefully compute the result
+ ;; Otherwise the number might fit, so we carefully compute the result.
(handler-case
(with-float-traps-masked (:underflow)
(let* ((ratio (/ (* (expt 10 exponent) number)
@@ -1875,24 +1875,10 @@ the end of the stream."
(result (coerce ratio float-format)))
(when (and (zerop result) (not (zerop number)))
;; The number we've read is so small that it gets
- ;; converted to 0.0, but is not actually zero. In this
- ;; case, we want to round such small numbers to
- ;; least-positive-foo-float. If it's still too small, we
- ;; want to signal an error saying that we can't really
- ;; convert it because the exponent is too small.
- ;; See CLHS 2.3.1.1.
- (let ((float-limit (ecase float-format
- ((short-float single-float)
- least-positive-single-float)
- (double-float
- least-positive-double-float)
- #+double-double
- (double-double-float
- ext:least-positive-double-double-float))))
- (if (>= (* 2 ratio) float-limit)
- (setf result float-limit)
- (error _"Underflow"))))
- result))
+ ;; converted to 0.0, but is not actually zero. Signal an
+ ;; error. See CLHS 2.3.1.1.
+ (error _"Underflow"))
+ result))
(error ()
(%reader-error stream _"Number not representable as a ~S: ~S"
float-format (read-buffer-to-string)))))
=====================================
src/i18n/locale/cmucl.pot
=====================================
@@ -8731,10 +8731,6 @@ msgstr ""
msgid "Number not representable as a ~S: ~S"
msgstr ""
-#: src/code/reader.lisp
-msgid "Underflow"
-msgstr ""
-
#: src/code/reader.lisp
msgid "Invalid ratio: ~S/~S"
msgstr ""
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/d82f9b92e9be439d4e4397…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/d82f9b92e9be439d4e4397…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-287-clean-up-make-float-aux at cmucl / cmucl
Commits:
b28a0a06 by Raymond Toy at 2024-03-24T15:25:04-07:00
Address nits from review
Mostly undoing the whitespace changes due to tabs vs spaces.
- - - - -
1 changed file:
- src/code/reader.lisp
Changes:
=====================================
src/code/reader.lisp
=====================================
@@ -1870,18 +1870,18 @@ the end of the stream."
;; Otherwise the number might fit, so we carefully compute the result.
(handler-case
(with-float-traps-masked (:underflow)
- (let* ((ratio (/ (* (expt 10 exponent) number)
+ (let* ((ratio (/ (* (expt 10 exponent) number)
divisor))
(result (coerce ratio float-format)))
- (when (and (zerop result) (not (zerop number)))
+ (when (and (zerop result) (not (zerop number)))
;; The number we've read is so small that it gets
;; converted to 0.0, but is not actually zero. Signal an
;; error. See CLHS 2.3.1.1.
- (error "Underflow"))
+ (error _"Underflow"))
result))
(error ()
- (%reader-error stream _"Number not representable as a ~S: ~S"
- float-format (read-buffer-to-string)))))
+ (%reader-error stream _"Number not representable as a ~S: ~S"
+ float-format (read-buffer-to-string)))))
(defun make-ratio (stream)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/b28a0a0600c79123f212e1f…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/b28a0a0600c79123f212e1f…
You're receiving this email because of your account on gitlab.common-lisp.net.