Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 14 additions & 25 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This repository contains the **WurstScript compiler**. Its main code lives in:
de.peeeq.wurstscript/
```

`HelperScripts/` holds the generators for the compiler's game-data resources and the stdlib's ability wrappers (see `HelperScripts/GAMEDATA.md`); change it only for that work. Design notes live in `docs/`. `BACKLOG.md` holds open work and standing notes (test conventions, benchmark flags).
`HelperScripts/` holds the generators for the compiler's game-data resources and the stdlib's ability wrappers (see `HelperScripts/GAMEDATA.md`); change it only for that work. Design notes live in `docs/`. `BACKLOG.md` holds open work and standing notes (test conventions).

**Read §11 and [`docs/WC3_RUNTIME.md`](docs/WC3_RUNTIME.md) before changing a backend, the optimiser or an interpreter mock.** The game differs from what the code, the interpreter and the tests suggest: Wurst has no garbage collector, the game's Lua is not the test Lua, and nothing optimises the emitted script at run time.

Expand Down Expand Up @@ -109,6 +109,7 @@ The Gradle wrapper lives inside `de.peeeq.wurstscript/` (not the repo root); run

* **Run the test classes you touched, not the suite.** The full suite takes 7-13 minutes (`build.gradle`, `testForkCount`) and needs memory for every fork. CI (`.github/workflows/build.yml`) runs it on pull requests and on pushes to master only, so a branch push alone tests nothing.
* To repeat a test use `--rerun --no-build-cache`: a cached result shows identical timings. The real stack trace is in `build/test-results/test/TEST-<class>.xml` when the console summary lacks it. Do not pipe gradle into `tail`: the pipe hides its exit code; read the XML.
* A compiler test gets 3 minutes and a HelperScripts test 1 (`TestTimeoutWatchdog`), then its worker prints every thread to the console and exits 124: that test has no XML report, so read the console or job log. Pass `-PtestTimeoutMillis=<ms>` for a deliberately longer local run, such as an oracle or a profile. The suite stops at its first failure (`failFast`).
* The harness writes an IM dump (`test-output/<name>.jim`) only for a test which asks with `test().imDump()`; a test which reads one must ask. `./gradlew test -PimDumps` writes them for every test, to read a failing test's IM.
* The test JVMs run ParallelGC (`-PtestGc='-XX:+UseG1GC'` or another flag overrides it): G1 spent 9-11% of a serial run in pauses, mostly mixed collections of data which lives for one test, and ParallelGC about 3%.
* Tests fetch the pinned stdlib first (`ensureStdLib`, about a minute on a fresh checkout). `InitialBuildProgressTest` and `LanguageWorkerTest` are in package `de.peeeq.wurstio.languageserver`, so a `--tests` filter needs that prefix.
Expand Down Expand Up @@ -180,10 +181,10 @@ compiler jar when the first session ends, and the sessions after it start from i
runtime's own base archive, which `deploy.gradle` makes (`jlink --generate-cds-archive`; macOS copies a full JDK, which
usually has one, and `assembleSlimCompilerDist` dumps one with `java -Xshare:dump` when the JDK has none: a copied JDK
need not ship one). `assembleSlimCompilerDist` then starts the runtime with `-Xshare:on`, which fails when
there is no usable archive. Without one the JVM silently runs without any, which is how the earlier attempt went
unnoticed. Pull-request CI packages nothing; the versioned release workflow packages every supported host, so a change
here is not tested on macOS before it merges. Java 27 enables compact object headers by default. The build clears the JVM option
environment variables when making and validating the base archive so it matches the shipped runtime defaults.
there is no usable archive; otherwise the JVM would silently run without one. Pull-request CI packages nothing; the
versioned release workflow packages every supported host, so a change here is not tested on macOS before it merges.
Java 27 enables compact object headers by default. The build clears the JVM option environment variables when making
and validating the base archive so it matches the shipped runtime defaults.
The extension passes `-Xlog:disable` because the JVM reports archive trouble on stdout, which is the protocol stream:
never print anything of your own there.

Expand Down Expand Up @@ -293,9 +294,9 @@ Rules for backend work:
* **Do not tell a cache which function changed; ask the function.** `ImFunction.modificationCount()` (the generator
counts the changes of a function and of everything below it, through every setter and list) is the same exactly
while nothing in the function was modified. A pass which is only needed for the functions which changed, or a
result which is kept for a function (the flatten does this), compares the count it saw. Prefer it to a
`functionChanged(f)` call which a pass has to remember. Facts which follow references outside the function also
validate those dependencies: the garbage removal checks the implementations of virtual call targets.
result which is kept for a function (the flatten does this), compares the count it saw, so no pass has to remember
to report its changes. Facts which follow references outside the function also validate those dependencies: the
garbage removal checks the implementations of virtual call targets.

### Lua performance policy

Expand Down Expand Up @@ -495,20 +496,8 @@ For refreshing object-data knowledge and ability-editing sources from the instal

## 13. Release summaries

When preparing and pushing an authorized semantic compiler release tag, the agent
must also write a short user-facing summary of the changes since the previous
semantic release. Group related changes into their overall impact (for example,
"Faster overall map builds"), rather than listing internal optimizations or PR
titles. Prioritize useful features, build performance, correctness, and compatibility;
do not invent benchmarks or benefits.

Prepare the release notes before pushing the tag. Start them with `## Highlights`
and one to three flat, single-line bullets of at most 160 characters each, followed
by the detailed changelog. Immediately after pushing the tag, create or update its
GitHub draft release with those notes while the release builds run. The existing
publish workflow preserves an existing draft's body; ensure the summary is present
before publication. GitHub's generated changelog may be appended using
`gh release create --draft --verify-tag --notes-file <file> --generate-notes`.

This summary is written by the release-preparing agent and belongs to the compiler's
GitHub release. The VS Code extension reads its `## Highlights` section automatically.
An agent which prepares and pushes an authorized semantic release tag also writes that release's notes, in the
format and at the step [`docs/RELEASING.md`](docs/RELEASING.md) gives: the extension shows their `## Highlights`.
Summarise the changes since the previous semantic release by their overall impact (for example, "Faster overall map
builds"), not by PR titles or internal optimizations. Put useful features, build performance, correctness and
compatibility first, and invent no benchmarks or benefits.
19 changes: 0 additions & 19 deletions BACKLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,6 @@ Notes; finished-work narrative does not.
distinguishes before replacing it with a tidier one.
- The suite is the specification. Before changing what the type checker accepts, grep the tests for
the shape being rejected.
- A test that hangs looks exactly like a test that is slow. If the suite stops making progress, take
a thread dump of the forked worker (`jstack <pid>`) before killing it.
Both Gradle test suites install `TestTimeoutWatchdog`: each test/configuration invocation has
3 minutes for compiler tests, 1 minute for helpers, then the worker dumps its threads and exits 124
(at most 2 seconds for diagnostics).
This keeps execution on the original thread and kills even uninterruptible work or stuck shutdown
hooks. A timed-out worker loses its pending XML report; its method name and stacks are in the job log.
Compiler/helper test tasks have 20/2-minute limits, CI jobs 25 minutes, release packaging 35 minutes;
suites and matrices stop at the first failure. `scripts/test-ci-timeouts.py` rejects unbounded jobs.
For deliberate longer local invocations only, use `-PtestTimeoutMillis=...`; CI job caps still apply.
- Method names are not what the frontend called them. `LuaDispatchPreparation.normalizeMethodNames`
renames a whole dispatch group to one name, records the slot segment on `ImTranslator`, and only
then does the backend run. A question about which Lua slot something lands in is a question about
Expand All @@ -253,15 +243,6 @@ Notes; finished-work narrative does not.
reach is bounded by how much of the roughly one thousand natives the shim models, so those tests
stay small and targeted. There is no Wurst-level end-to-end feature; correctness in a real map on
the Lua target is asserted in the agent workflow.
- `wurst_run.args` in a generated project turns on `-stacktraces` for runs and builds and `-inline` only
for builds, so every emitted function pays `wurst_stack` bookkeeping and a run inlines no leaf. Benchmarks that inform
stdlib design must use `-inline -localOptimizations` without `-stacktraces`, or they measure the
debug configuration.
- Test forks: eight forks won on eight cores (7m03s wall against 13m11s serial) even though each
test runs 2.6 times slower there. Wall time cannot go below the slowest class (`BugTests`, 73 s in
`test-class-weights.txt`) until it is split.
- The stdlib copy under `de.peeeq.wurstscript/temp/WurstStdlib2` is a fetched artefact for tests.
Real stdlib changes belong in the WurstStdlib2 repo.
- `WURST_LANGUAGE.md` ships as a compiler resource at
`de.peeeq.wurstscript/src/main/resources/agent-docs/WURST_LANGUAGE.md`, not at the repository
root. Keep it current in the PR that changes the behaviour.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- WURST_LANGUAGE_AGENT_DOC_VERSION: 2026-09-27 -->
<!-- WURST_LANGUAGE_AGENT_DOC_VERSION: 2026-10-16 -->
# WurstScript language digest

This is the compact, agent-oriented language reference shipped with the WurstScript compiler. It covers language semantics and compiler-facing syntax; standard-library APIs, dependency conventions, UI rules, and object-editor policies belong to the project or dependency documentation.
Expand Down
8 changes: 3 additions & 5 deletions docs/CROSS_OS_FOOTGUNS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ an unintended interactive call.
## Test tools and packaged runtimes differ by host

The [Intel macOS packaging failure](https://github.com/wurstscript/WurstScript/actions/runs/37778085905)
is one example of a host-specific runtime problem. See `deploy.gradle` and AGENTS.md's startup-archive notes:
macOS copies a signed full JDK, other hosts use jlink, and a copied JDK need not contain a base CDS archive.
Generate one when absent and verify the shipped runtime with `-Xshare:on`. Check the actual runtime image, and
clear JVM option environment variables when generating/validating its archive. JDK availability also differs:
the workflows use Zulu for Java 27 on Intel macOS.
is one example of a host-specific runtime problem: macOS copies a signed full JDK where other hosts use jlink, so
the base CDS archive comes about differently (AGENTS.md §5, "Language server startup archive", and `deploy.gradle`).
JDK availability also differs: the workflows use Zulu for Java 27 on Intel macOS.

The checked-in Linux Lua fallback needs `libreadline.so.6`, absent on current Ubuntu images. CI installs Lua 5.3
instead. Windows uses bundled `.exe` tools; macOS installs Homebrew Lua, whose version is not pinned to 5.3.
Expand Down
12 changes: 9 additions & 3 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ The release baseline is **2.0.0**, stored in `de.peeeq.wurstscript/version.txt`.
1. Merge the intended changes and version bump to master. Review the release scope and CI results.
2. Fetch master and tags, then check out the intended master commit. A release can use an older master commit when newer work is not ready.
3. Create an annotated tag matching that commit's version file, for example `git tag -a v2.0.0 -m "WurstScript 2.0.0"`.
4. Push that one tag: `git push origin v2.0.0`.
5. Watch **Release versioned compiler**. It validates the tag, version file, and master ancestry, runs tests and packages Windows x64, Linux x64, macOS x64, and macOS arm64. Publication waits for every platform to pass.
4. Write the release notes (below) into a file before pushing the tag: the build can finish before you do.
5. Push that one tag: `git push origin v2.0.0`.
6. Create the draft release with those notes right away: `gh release create v2.0.0 --draft --verify-tag --notes-file <file> --generate-notes`, which appends GitHub's generated changelog. If the workflow has already published the release, set the notes with `gh release edit v2.0.0 --notes-file <file>`.
7. Watch **Release versioned compiler**. It validates the tag, version file, and master ancestry, runs tests and packages Windows x64, Linux x64, macOS x64, and macOS arm64. Publication waits for every platform to pass.

The workflow assembles the complete assets in a draft release, uploads checksums, then publishes it. A published version is never overwritten. For a failed build, rerun the failed workflow; for a defect in a published compiler, bump the version and publish a new tag. Do not move an existing release tag.
The workflow assembles the complete assets in a draft release, uploads checksums, then publishes it. It keeps the body of a draft which already exists; without one it creates the release with only GitHub's generated notes. The assets of a published version are never replaced. For a failed build, rerun the failed workflow; for a defect in a published compiler, bump the version and publish a new tag. Do not move an existing release tag.

## Release notes

Start the notes with `## Highlights`: one to three flat, single-line bullets of at most 160 characters each, describing what users gain, then the detailed changelog. The VS Code extension shows those bullets in its status hover for the installed version and for an available update; it reads the first three, strips backticks and asterisks, and cuts each at 160 characters.

## Version metadata

Expand Down
Loading