- In define-vrefs.lisp, emit define-missing-instruction forms for ,sap
and (setf ,sap) when the target instruction set is not available.
Prevents unattached definition errors during package validation
(e.g. F64.8-SAP-REF on hosts without AVX-512 support).
- In missing-instruction.lisp, use record-instruction-set and
record-name rather than instruction-record-* aliases so that
missing-instruction error reporting works for sap-ref and other
function records inheriting from base record.
- Verified under Intel SDE Haswell (-hsw) and Skylake (-skl) emulation
with 0 errors (737 tests, 9,992,078 checks passed).
- Verified natively on Zen 4 host with 0 regressions (737 tests,
13,860,908 checks passed).
- define-instruction-vops.lisp: only declare foldable on defknown when
the underlying instruction set is available on the host CPU.
- define-scalar-casts.lisp: gate sb-c:foldable on instruction-set-available-p.
- define-associatives.lisp, define-reducers.lisp, define-comparisons.lisp,
define-unequals.lisp, define-ifs.lisp: fallback to define-missing-instruction
when the instruction set is unavailable on the host. This prevents compile-time
constant folding from attempting to evaluate vector constructors or instructions
on host CPUs lacking the requisite instruction set extensions.
EXPT dispatches to INTEXP for a (COMPLEX RATIONAL) base as well as for
fixnums, bignums and ratios:
(((foreach fixnum (or bignum ratio) (complex rational)) integer)
(intexp base power))
GMP-INTEXP handles integers, ratios and 0/+-1, then sends everything else to
MPZ-POW, which only takes an integer. So merely loading the contrib - LOAD-GMP
calls INSTALL-GMP-FUNS itself, and again from an init hook - turns a working
EXPT into a type error:
* (expt #c(1/5 1) 1)
; Evaluation aborted on #<TYPE-ERROR expected-type: INTEGER
; datum: #C(1/5 1)>
Constant folding hides it from a toplevel REPL form, so it only shows up in
compiled code with a computed base. Maxima hits it through bernstein_poly,
where it fails one of the regression tests on any build linked against sb-gmp.
Send non-rational bases to ORIG-INTEXP, which handles them by repeated
squaring; GMP keeps the integer and ratio paths it was installed for.
concatenated-stream wasn't processing buffered input correctly.
two-way-stream and echo-stream should just return NIL, as
file-position can't apply to both streams.
- Conditionalize it on #+sb-doc.
- Drop Markdown blockquote support (it's not needed by any docstring
currently).
- Make the code more compact.
Without :SB-DOC, the core size impact is thus zero. With :SB-DOC, the
core size is increased by ~0.05% (~10kB).
This is mostly just building on what already existed, primarily
only defining and calling VOPs where the instruction set exists.
Also a phony simd-pack-256 type to allow building when that
type doesn't exist.
And disable the vref vop implementation outside x86oids, as it's entirely
specific to that instruction set.
... and normalize the indentation of their docstrings, too.
Doing this lazily in DOCUMENTATION allows interactive work on
docstrings (e.g. change a docstring, recompile its definition,
generate documentation from the image). I don't think the overhead in
DOCUMENTATION is a factor.
Put a magic marker on the value of the variable holding the dummy
section. Variables with these markers are recognized by PAX (from
v0.4.12) as lazy sections. So, (DREF @FAKE 'SECTION) works. Then,
whenever such a reference is RESOLVEd, the function following the
magic marker is called. That function is USE-PAX in this case.
The net effect of this hack is that PAX:DOCUMENTing a fake section
will unfake it.
Export USE-PAX for the remaining cases.
- Add docstrings for user-facing declaration.
- Fix the hacks for declarations in the manual.
- Add documentation of DOCUMENTATION extensions to the manual.
- Add a "Declaration Index" appendix to the manual.
Summary
-------
Implement of a subset of PAX so that we can write PAX:DEFSECTIONlike
forms that supports the same restricted Markdown that we use for
docstrings and generate doc/manual/*.texinfo files from them.
Without PAX
-----------
There is no hard dependency on PAX. When the new SB-MANUAL contrib is
loaded, one can M-. around in documentation (sections are variables),
and function docstrings can now link to sections.
The generated Texinfo files are quite close to the originals, with
some loss of "semantic" markup: e.g. Markdown has `FOO` but no
@var{FOO} and @code{FOO}. We didn't derive much practical benefit from
that distinction.
With PAX
--------
(SB-MANUAL::SWITCH-TO-PAX) ensures that PAX is loaded and patches things
up, as if everything had been defined with PAX to begin with. Now, we
get PAX::@BROWSING-LIVE-DOCUMENTATION for low-latency, interactive
documentation work and PAX::@GENERATING-DOCUMENTATION for auto-linked
documentation.
Notable features:
- auto-generated links within the manual: if SB-EXT:EXIT is mentioned,
then it's linked to its documentation.
- auto-generated links to the CLHS (these links are red in PDF)
- locatives (e.g. the "[function]" in "- [function] SB-EXT:EXIT" are
also links and they go to the sources on GitHub (in live browsing,
they tell Slime to open the definition)
Details
-------
- Factor out the Markdown-to-Texinfo code into a new SB-MANUAL
contrib.
- Convert doc/manual/*.texinfo files to PAXlike DEFSECTION format and
add each chapter as a contrib/sb-manual/doc/<chapter>.lisp file.
- Fix a *lot* of small issues during the conversion.
- Make doc/make-doc.sh regenerate the all .texinfo files except
sbcl.texinfo and backmatter.texinfo.
- Fix docstrings of Lisp definitions used in the manual to conform to
the supported Markdown syntax.
- Retain the Texinfo function, variable and type indicies but drop the
concept index. There is no obvious way to support that in Markdown,
and it was used rather sporadically rather incomplete.
- Even with the new features, the amount of Lisp code didn't change
significantly.
- See contrib/sb-manual/README for the Todo list