Self step 5: the fixpoint self/fixpoint.sh, make fixpoint: the seed builds self/ (stage 1), that builds it (stage 2), that again (stage 3); stages 2 and 3 are the same file (so is stage 1, 547,000 bytes). Stage 3 stands in for ./raz and make check passes on it (661 tests), as does make bench (493,000 lines a second at the run, 870,000 at another). The seed's last tag can now be the bootstrap; the split of src/ is the owner's to decide.
| @@ -42,6 +42,11 @@ | ||
| 42 | 42 | self-bench: raz | build |
| 43 | 43 | self/bench.sh |
| 44 | 44 | |
| 45 | +# the seed builds self/, that builds self/, that builds it again: the | |
| 46 | +# last two must be the same file; check and bench then run on it | |
| 47 | +fixpoint: raz | build | |
| 48 | + self/fixpoint.sh | |
| 49 | + | |
| 45 | 50 | # line numbers: gdb stops at a line and names it |
| 46 | 51 | gdb: raz |
| 47 | 52 | test/gdb.sh |
| @@ -156,4 +161,4 @@ | ||
| 156 | 161 | site: raz |
| 157 | 162 | python3 site/build.py |
| 158 | 163 | |
| 159 | -.PHONY: units tests self self-bench check gdb bench kernels stress fmt loc man pdf dist site clean install uninstall | |
| 164 | +.PHONY: units tests self self-bench fixpoint check gdb bench kernels stress fmt loc man pdf dist site clean install uninstall |
| @@ -39,9 +39,12 @@ | ||
| 39 | 39 | builds, tested by compiling 409 programs, the library and the compiler |
| 40 | 40 | itself with both and comparing the executables, messages and status; |
| 41 | 41 | 452,000 lines a second, the seed's 815,000. |
| 42 | -5. Fixpoint: the seed builds `self`, that builds `self`, that builds | |
| 43 | - `self` again, and the last two are byte for byte the same. Then | |
| 44 | - the seed's last tag is the bootstrap, and the split of `src/` from | |
| 42 | +5. Fixpoint (done: `self/fixpoint.sh`, `make fixpoint`): the seed builds `self`, that builds `self`, that builds | |
| 43 | + `self` again, and the last two are byte for byte the same (all | |
| 44 | + three are, 547,000 bytes: the seed and this compiler make the same | |
| 45 | + code from `self/`). `make check` passes on the compiler it made, | |
| 46 | + 661 tests, and `make bench` gives 493,000 to 870,000 lines a second. | |
| 47 | + Then the seed's last tag is the bootstrap, and the split of `src/` from | |
| 45 | 48 | the rest is the owner's to decide. |
| 46 | 49 | |
| 47 | 50 | Done when step 5 passes with `make check` and `make bench` on the |
| @@ -9,6 +9,7 @@ | ||
| 9 | 9 | |
| 10 | 10 | make self # each unit against the seed's, on the same files |
| 11 | 11 | make self-bench # the scanner's speed against the seed's |
| 12 | + make fixpoint # the seed builds self, that builds self, that builds it again | |
| 12 | 13 | |
| 13 | 14 | `Chunk` and `Sym` have no input files to read, so each has a dumper |
| 14 | 15 | pair, `test/ChunkDump` and `test/SymDump`, that runs one fixed |
| @@ -48,6 +49,14 @@ | ||
| 48 | 49 | options each test has. The executable, the messages, and the status |
| 49 | 50 | must be the same for every file: 409 of them, 289 of which are errors. |
| 50 | 51 | `make self-bench` gives the speed of both. |
| 52 | + | |
| 53 | +`make fixpoint` (`fixpoint.sh`) is the proof that the port is whole: | |
| 54 | +the seed builds `Raz.raz` (stage 1), stage 1 builds it (stage 2), and | |
| 55 | +stage 2 builds it again (stage 3). Stages 2 and 3 must be the same | |
| 56 | +file; they are, and so is stage 1, since the seed and the port make the | |
| 57 | +same code. Stage 3 then stands in for `./raz`, and `make check` and | |
| 58 | +`make bench` run on it. Each stage is built by the same command in the | |
| 59 | +same place, since a program holds the paths it was made from. | |
| 51 | 60 | |
| 52 | 61 | `check.sh` builds a dumper for each side, `test/ScanDump.pas` over the |
| 53 | 62 | seed's units and `test/ScanDump.raz` over these, and has both read the |
| @@ -0,0 +1,27 @@ | ||
| 1 | +#!/bin/sh | |
| 2 | +# The fixpoint: the seed builds self/ (stage 1), that builds self/ | |
| 3 | +# (stage 2), that builds it again (stage 3), and stages 2 and 3 must | |
| 4 | +# be the same file. A program holds the paths it was made from, so each | |
| 5 | +# stage is built by the same command in the same place, from the | |
| 6 | +# compiler before it copied to build/fix/raz. Run from the repository | |
| 7 | +# root, after `make raz`. Then stage 3 stands in for ./raz (messages name | |
| 8 | +# the library by its path from the compiler, so it must be at the root) | |
| 9 | +# while `make check` and `make bench` run on it; the seed's comes back. | |
| 10 | +set -e | |
| 11 | +d=build/fix | |
| 12 | +rm -rf $d | |
| 13 | +mkdir -p $d/v | |
| 14 | +ln -s ../../lib $d/lib | |
| 15 | +printf 'module Version;\nconst Text* = "%s";\nend Version.\n' "$(tr -d "'" < build/version.inc)" >$d/v/Version.raz | |
| 16 | +cp raz $d/stage0 | |
| 17 | +for n in 1 2 3; do | |
| 18 | + cp $d/stage$((n - 1)) $d/raz | |
| 19 | + $d/raz -Werror -I self -I $d/v -o $d/stage$n self/Raz.raz | |
| 20 | +done | |
| 21 | +cmp $d/stage2 $d/stage3 | |
| 22 | +echo "fixpoint: stages 2 and 3 are the same, $(wc -c <$d/stage3) bytes" | |
| 23 | +cp raz $d/seed | |
| 24 | +trap 'cp $d/seed raz' EXIT | |
| 25 | +cp $d/stage3 raz | |
| 26 | +make check | |
| 27 | +make bench |