summaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAgeFilesLines
* perf: avoid copying the current directory twice in cdperf/cd-microSean Kurtz5 days1-2/+1
|
* Merge pull request #29 from skurtz97/chore/c23-idiomsSean Kurtz5 days20-175/+287
|\ | | | | C23 idioms, 64-bit default link, script charset; docs at the new numbers
| * docs: the z/OS tables and prose at 64-bit, C23 and the LPASean Kurtz5 days4-105/+137
| | | | | | | | | | | | | | | | | | README's benchmark table is the 64-bit run with the run-time in the LPA and zsh installed (it was the 2.1-era table, and its zsh column was the 31 ms start-up, not zsh). bench/README.md keeps the 2.1 numbers as the history of what the LPA fixed, and gains the start-up table it now has a measurement for. investigation.md's ยง2 recommendation was still "build 31-bit"; it now says what happened instead.
| * Makefile: make zash on z/OS links the 64-bit build itselfSean Kurtz5 days1-2/+12
| | | | | | | | | | exec-ing into make zos-ascii hung here with no child processes, and the shell target is the same command line anyway.
| * C23: constexpr internal linkage, naming and trailing commas; clangd at C23Sean Kurtz5 days15-69/+134
| | | | | | | | | | | | | | | | A constexpr at file scope has external linkage, so the CSI offsets and CSI_MAX_CALLS now say static. The naming check gets the C23 spellings wrap the check itself: typed constants keep the macro case, and a local static constexpr table keeps the variable case. .clangd says -std=c23, which it still did not, so the editor could not read constexpr at all.
| * z/OS: convert a script's character set only in an ASCII buildfix/zos-script-charsetSean Kurtz5 days1-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | input_push_fd() called sys_input_cvt() for every script on z/OS, and that routine converts to the program's own CCSID. In an ASCII build reading an IBM-1047 system it therefore either asked for EBCDIC-to-EBCDIC conversion, which is a no-op that returns 0, or read the bytes unconverted; SETCVTON on a descriptor that sys_dupfd() has renumbered returns 0 and converts nothing on this system either. The parser then saw EBCDIC and dropped the script. An EBCDIC build reads IBM-1047 natively and never wanted the call. With the conversion left to ASCII builds, posix/traps and scripts/signals pass on z/OS: 93 passed, 4 skipped, 0 failed. The untagged-file case still depends on SETCVTON with an explicit fccsid, which is unverified, so the VERIFY note stays.
* | Merge pull request #30 from skurtz97/fix/zos-gitattributesSean Kurtz5 days1-0/+12
|\ \ | |/ |/| z/OS: keep ISO8859-1 checkout working for every file
| * z/OS: keep ISO8859-1 checkout working for every fileSKURTZ5 days1-0/+12
|/ | | | A blanket zos-working-tree-encoding=ISO8859-1 makes a fresh checkout fail on three binaries and seven files with characters outside Latin-1. Mark those UTF-8 or binary after the blanket rules, matching zopen per-file exceptions, so git worktree add and clone succeed while all other text is tagged ISO8859-1.
* Merge pull request #27 from skurtz97/feat/web-siteSean Kurtz6 days19-1/+1312
|\ | | | | web: a Hugo site for zash
| * web: a Hugo site for zashfeat/web-siteSean Kurtz6 days19-1/+1312
|/ | | | | | | | | | | | | | | | | | | | | | | | | | A site in web/, built with Hugo and no theme module, so it builds offline from one Go binary: hugo server --source web preview on localhost:1313 hugo --source web --minify -> web/public, which is ignored Pages: a home page with the shell's pitch, a terminal card, the four properties that define it and a short benchmark table, plus three docs pages (building, development, status) in a section with a sidebar. The palette comes from packaging/zash-logo.svg: mainframe navy, periwinkle, a signal blue. Dark only, monospace where a shell would be monospaced. Highlighting uses classes (`markup.highlight.noClasses = false`) against assets/css/chroma.css generated with `hugo gen chromastyles --style= tokyonight-night`, so code sits in the page instead of a monokai box. site.css and copy.js go through Hugo's minify+fingerprint pipeline. Two .gitignore fixes this needed: `docs/` matched web/content/docs/ (the generated Doxygen output is at the root, so it is `/docs/` now), and Hugo's .hugo_build.lock is ignored. Not published yet: zash is private and Pages is not available for a private repository on a free plan, so web/README.md records the options.
* C23: nullptr for null pointers, constexpr for typed constantsSean Kurtz6 days34-244/+251
| | | | | | | | | | | | | | nullptr in every place a null pointer constant was meant; NULL is gone from src/. constexpr where it improves on #define without costing anything: the IGGCSI00 work-area offsets and sizes, and the scalar sizes MVS_DSN_MAX, CSI_FIELD_LEN, CSI_WORK_MIN, PDS_DIRBLK, CSI_WORK, CSI_MAX_CALLS. A constexpr in C is a constant expression, so it still bounds the arrays that use it, and it now carries a type and can be checked with static_assert. Feature switches (#if), the CSIETYPE/EBCDIC byte constants read as octets, and the related-constant enum sets stay as they were.
* repo: drop patches/, move spec-pdf.sh out of scripts/Sean Kurtz6 days3-125/+1
| | | | | | | patches/ held one file, a byte-identical copy of LICENSE; no port patches anything (ZOPEN_TYPE=LOCAL builds the checkout). The single script was the typst spec builder, which is a build step, so it lives beside the other build machinery.
* Merge pull request #26 from skurtz97/chore/c23Sean Kurtz6 days12-44/+44
|\ | | | | C23: compile as C23 and use its spelling
| * C23: compile as C23 and use its spellingSean Kurtz6 days12-44/+44
|/ | | | | | | | | | | | | | | | | | | | | | | The z/OS toolchain would not take C23 when this was first written; IBM Open XL C/C++ 2.2 does (clang 21.1, __STDC_VERSION__ 202311), and so does the clang on Linux. -std=c23 in the Makefile, and the standard attributes in place of the ones that were macros: _Noreturn -> [[noreturn]] (on declarations and definitions) _Static_assert -> static_assert _Alignas -> alignas NODISCARD -> [[nodiscard]] FALLTHROUGH -> [[fallthrough]] PRINTFLIKE and UNREACHABLE() stay macros: [[gnu::format]] and [[gnu::unreachable]] are vendor attributes, and the standard has no [[format]] or [[unreachable]] for a header-only project yet. Standard-library additions newer than the libc of either system (<stdbit.h>, <stdckdint.h>) are not used, so gcc -std=c2x still builds the tree warning-free. The suite, ASan/UBSan and the z/OS lint pass as before; linux/i-dscomplete remains the one local failure it was on main.
* Merge pull request #25 from skurtz97/build/zos-64bitSean Kurtz6 days6-96/+185
|\ | | | | build/zos 64bit
| * build: make the 64-bit z/OS build the defaultSean Kurtz6 days5-72/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | zash is built 64-bit on z/OS now: -m64 for the ASCII and the EBCDIC build and for the debug build, and `make` as well as `make zash` land on zos-ascii there. The 31-bit build existed for the 64-bit start and fork costs, which were the C run-time being loaded out of the linklist; with CELQ* in the LPA the widths measure the same and the shell is built at the width IBM builds for. The catalog and dynamic-allocation modules are AMODE 31 and OS_UPSTACK does not exist at -m64, so both are declared with plain OS linkage, which is the 64-bit glue for an AMODE 31 callee. Neither module is installed on the test system, so that path is unverified there; csi_call() still catches a program check and retires the catalog. IGGCSI00's VL bit comes from the width of a pointer, not 0x80000000. Documentation follows: README gains a Recommendations section for the LPA change and loses the 31-bit rationale; DESIGN.md's cost model, catalog linkage and open questions match the measurements; bench/README states the current width and the rerun numbers; investigation.md records the decision.
| * build: 64-bit on z/OSSean Kurtz6 days2-24/+26
|/ | | | | | | | | | | | | | | | | | The 31-bit choice existed for one reason: a 64-bit start cost 29 ms against 1 ms and a 64-bit fork() 4.2 ms against 0.10. That was the 64-bit C run-time being loaded out of CEE.SCEERUN2 on the linklist on every start; with CELQ* in the dynamic LPA both widths cost 1.5 ms and fork() 0.10 ms (notes/investigation.md has the before and after). So build the shell at the width IBM builds for: -m64 for both the ASCII and the EBCDIC build, and for the debug build. OS_UPSTACK does not exist at -m64, so the two AMODE 31 services (IGGCSI00, BPXWDY2) are declared with plain OS linkage, which is what the 64-bit glue implements. IGGCSI00's VL bit is set from the width of a pointer now, not with 0x80000000. Neither module loads on this system, so the linkage itself stays unverified; csi_call() still traps a program check and retires the catalog if it abends.
* Merge pull request #24 from skurtz97/docs/no-hostnameSean Kurtz6 days3-10/+10
|\ | | | | docs: name the system by release, not by its hostname
| * docs: name the system by release, not by its hostnameSean Kurtz6 days3-10/+10
|/
* Merge pull request #23 from skurtz97/notes/rebench-before-afterSean Kurtz6 days1-6/+35
|\ | | | | notes: 64-bit before and after the LPA change, side by side with 31-bit
| * notes: 64-bit before and after the LPA change, side by side with 31-bitSean Kurtz6 days1-6/+35
|/
* notes: rebench 64-bit against 31-bit after the LPA change (#22)Sean Kurtz6 days1-0/+7
|
* Merge pull request #21 from skurtz97/notes/celq-lpa-permanentSean Kurtz6 days3-5/+83
|\ | | | | notes: make the 64-bit runtime LPA residency permanent
| * notes: make the 64-bit runtime LPA residency permanentSean Kurtz6 days3-5/+83
|/ | | | | | | | PROGLE already puts the 31-bit runtime in the dynamic LPA with three LPA ADD statements, so the 64-bit one is a fourth statement there, activated with SET PROG=LE and no IPL. Say where this LPAR keeps the statements (LOADC3 -> SYS3.CBT.PARMLIB.V3R1, IEASYS01, PROGLE) and add the SDSF exec and its batch JCL for re-applying them after an IPL.
* bench: the 64-bit start-up cost was the runtime not being in the LPA (#20)Sean Kurtz6 days2-28/+103
| | | | | | | Adding the CELQ members of CEE.SCEERUN2 to the dynamic LPA takes a trivial 64-bit start from 5.83 ms to 1.63 ms, the fork() cost from 4.20 ms to 0.10 ms, and /bin/zsh from 31.4 ms to 3.6 ms. The 27x ratio this repo has been explaining since PR #15 was a system not following IBM's own advice for the 64-bit runtime.
* notes: the 64-bit runtime is loaded from the linklist, not the LPA (#19)Sean Kurtz6 days3-8/+55
| | | | | | | * bench: keep the HLASM probe comments out of the continue column Also fixes the tiny64.s header, which named tiny31.s. * notes: the 64-bit runtime is loaded from the linklist, not the LPA
* Merge pull request #18 from skurtz97/bench/probes-in-repoSean Kurtz6 days7-73/+129
|\ | | | | bench: keep the start-up and fork probes in bench/probes
| * bench: keep the start-up and fork probes in bench/probesSean Kurtz6 days7-73/+129
|/ | | | | | | | | The probe sources only existed inline in the docs and in a scratch directory on the z/OS box, so the numbers in bench/README.md could not be reproduced from the repository. fk3.c (fork cost against parent storage), tiny.c (start-up cost) and the HLASM pair tiny31.s/tiny64.s (start-up with no C runtime) now live in bench/probes/, with run.sh building and timing them at both widths; the docs point at them instead of repeating them.
* Wording pass on the 64-bit start-up write-up (#17)Sean Kurtz6 days2-39/+37
| | | | | | | | | * notes: plainer wording in the 64-bit start-up write-up Same findings, less staging: no dash-as-connector, no bold cell, no "not X but Y" contrast, and one space after a full stop like the rest of the file. Also fixes "4-5 orders of magnitude" for a 5x difference. * tests: clang-format spawn.c
* Measure why 64-bit start-up is slow, and record the answer (#16)Sean Kurtz6 days6-6/+423
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bench: time one start with a parent that is not an LE program `bench/startup.sh` times a shell loop, so on z/OS every child pays the 31-bit shell's own price and the 64-bit start-up cost cannot be separated from it. `tests/tools/spawn` forks one child at a time and reports wall and child CPU per start, and `bench/le-init.sh` builds the 31-bit, 64-bit and HLASM programs it times in a work directory, so the table needs nothing checked in but the script. The child's environment is built by hand and passed to `execve`: `putenv` after LE has initialized is not handed to the child, and `_CEE_RUNOPTS` exported to an LE parent makes that parent's `execl` fail, which a fork loop that does not check exit status reports as a fast start. * notes: the 64-bit start-up cost is LE waiting, not the address mode Measured on the CBT z/OS 29.00 system: a 64-bit HLASM program with no LE starts in 1.39 ms, the same source at -m32 in 1.5-1.8 ms, so the address space, the loader and XPLINK are free. A -m64 start spends 4.5-28 ms before the first instruction of main, of which only 1.0-1.25 ms is charged to the child: the rest is wall time on something shared, which does not overlap between concurrent starts while it is at 28 ms and does once it drops to 5.8 ms. No _CEE_RUNOPTS option moves it. That retracts an earlier POSIX(OFF) result in these notes: exporting the option to an LE parent makes its execl fail, so the run timed failed execs. Applied to the child, POSIX(OFF) changes nothing.
* Merge pull request #15 from skurtz97/bench/startupSean Kurtz6 days6-15/+195
|\ | | | | bench: measure start-up wall time against the other shells
| * bench: take a shell path that is relative to where run.sh was calledbench/startupSean Kurtz6 days1-0/+1
| | | | | | | | | | The harness chdirs to a work directory, so `./zash`, the form the usage line shows, resolved to nothing.
| * bench: start-up table in the README, measured on z/OS and LinuxSean Kurtz6 days1-12/+54
| | | | | | | | | | | | bench/startup.sh had to exist before the README could stop saying the number was missing. On z/OS zash starts in 1.33 ms against 2.20 ms for /bin/sh and 31.4 ms for zsh.
| * bench: measure start-up wall time against the other shellsSean Kurtz6 days4-2/+121
| | | | | | | | | | | | | | | | | | | | | | run.sh times CPU, so the milliseconds a process spends before it runs anything never appear in it: zash can read 0.00 in a subshell row while zash -c : costs a few ms of wall time. bench/startup.sh measures that directly, one start per command, and bench/README.md now has a table instead of a warning that the number is missing. The clock is tests/tools/now.c, ten lines, because /bin/date on z/OS has no sub-second format.
| * test: keep child reports out of the leak comparisonSean Kurtz6 days1-2/+15
| | | | | | | | | | | | | | | | A child inherits _CEE_DMPTARG and writes its own heap report, so the substitution and the pipeline added a report per iteration: growth measured 2 MB over 900 children, none of it zash's. The forked commands now turn heap checking off for themselves, and the test fails if anything but one report came back.
| * test: leak-check the spawn, redirection and pipeline paths tooSean Kurtz6 days1-1/+6
| | | | | | | | | | | | | | The loop body had builtins only, so nothing but parsing, expansion and variables was measured. A substitution, a redirection, a forked command and a pipeline per iteration put the storage those paths keep under the same comparison.
* | Merge pull request #14 from skurtz97/test/zos-leakcheckSean Kurtz6 days3-2/+94
|\| | | | | test: fail when zash leaks under LE's heap checker
| * test: report leak checking as a verdict, not an exact figureSean Kurtz6 days2-2/+6
| | | | | | | | | | | | | | | | The growth over 10x the work is 0 or 8 bytes depending on how the environment copy lands on an 8-byte boundary, so printing it made the expectation depend on the caller's environment. Print the finding only when the limit is exceeded; the reports in build/leaks keep the numbers.
| * test: fail when zash leaks under LE's heap checkerSean Kurtz6 days3-2/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HEAPCHK with a call depth and no per-call walk makes LE write the heap storage diagnostics into a CEEDUMP at normal termination: every allocation still live at exit, with the traceback that made it. A shell leaves working storage live on purpose, so the total says nothing by itself; a leak shows as the total growing with the work done. tests/zos/leak.sh therefore runs one builtin-only loop body at 100 and 1000 iterations in the same shell, sums the live bytes out of each report, and fails if the second run is more than 2 KiB larger. `make zos-leakcheck` is the target: it points _CEE_DMPTARG at build/leaks and skips zash/limits, which recurses deep enough to run out of storage under the checker.
* | Merge pull request #13 from skurtz97/docs/startup-probeSean Kurtz6 days4-183/+331
|\| | | | | docs: the 64-bit start-up cost is LE, not the address mode
| * docs: humanize the markdown docsdocs/startup-probeSean Kurtz6 days4-215/+219
| | | | | | | | | | | | | | | | | | Plain sentences where the prose had decorative bold lead-ins, em dashes and one-line closers. Claims, numbers and commands are unchanged, except two corrections that the startup probe settled: README said the remaining z/OS gap was the price of the address mode, and DESIGN's open question on `a | b &` said the gain depended on the address mode. Both are the 64-bit C run-time, not the address mode.
| * docs: keep the probe write-up in notes/investigation.mdSean Kurtz6 days3-27/+114
| | | | | | | | | | | | The assembler-vs-C experiment, its method and the questions it leaves open get a tracked home outside the generated docs/ tree; bench/README keeps the result table and points there.
| * docs: the 64-bit start-up cost is LE, not the address modeSean Kurtz6 days2-18/+75
| | | | | | | | | | | | | | | | | | An AMODE 64 HLASM program that returns 0 without any C run-time starts in 0.8 ms, the same as the AMODE 31 copy, while the same empty program in C costs 29.4 ms at -m64 and 2.0 ms at -m32. So the 28 ms is Language Environment's 64-bit initialization, not the address space, and the 31-bit LE start is about 1 ms. Records the probe and corrects the claims in bench/README.md and DESIGN.md.
* | Merge pull request #12 from skurtz97/fix/zopen-check-harnessSean Kurtz7 days5-3/+142
|\ \ | |/ |/| zopen: run checks in the foreground and package on z/OS
| * docs: describe the zopen build and ship patches/LICENSESean Kurtz7 days2-0/+128
| |
| * fix: stop make check after the z/OS test passesSean Kurtz7 days1-2/+5
| |
| * test: check the PATH suffix without a line-length-limited grepSean Kurtz7 days1-1/+1
| |
| * fix: make zopen checks run in the foreground and tolerate a long CFLAGSSean Kurtz7 days1-0/+2
| |
| * fix: run zopen check in the foreground without injected compiler flagsSean Kurtz7 days1-0/+6
|/
* Merge pull request #11 from skurtz97/feat/zopen-portSean Kurtz7 days3-6/+59
|\ | | | | build: add zopen build configuration