Skip to content

Commit a1de05b

Browse files
committed
Public-ready: MIT license, security and contributing docs; upgrade web dependencies
Adds LICENSE (MIT), SECURITY.md (private reporting through GitHub, scope) and CONTRIBUTING.md (setup, the checks CI runs, branch and PR conventions). Upgrades the web app to clear the open Dependabot alerts on main: - astro 5.18 -> 7.4.2 (with @astrojs/react 7), which clears the critical AVIF remote-code-execution and the high XSS and SSRF advisories; - vitest 2.1 -> 4.1.12, which clears the critical file-read advisory and the @vitest/mocker advisories (tinypool, vite and esbuild come in with these); - @playwright/test 1.48 -> 1.64.1, which clears the SSL advisory; - vite is now 8.3.5 and sharp 0.35.5, which clear their advisories. Astro 7 needs Node 22.23 or newer, so the web CI job moves to Node 22. Astro 7's preview runs as a daemon, which Playwright reads as an early exit, so the smoke test serves the built dist/ with a plain static server instead. Checks run locally after the upgrade: typecheck, lint, 4 unit tests, the build, and all 9 Playwright tests.
1 parent 388ef75 commit a1de05b

7 files changed

Lines changed: 1219 additions & 2597 deletions

File tree

‎.github/workflows/web.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
version: 9
2727
- uses: actions/setup-node@v4
2828
with:
29-
node-version: "20"
29+
node-version: "22"
3030
cache: pnpm
3131
cache-dependency-path: web/pnpm-lock.yaml
3232
- run: pnpm install --frozen-lockfile

‎CONTRIBUTING.md‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Contributing
2+
3+
Thanks for looking at TinyCompiler. It is a small compiler for a small tensor language, and the
4+
bar for changes is that every result stays checked against a numpy oracle on the real chips.
5+
6+
## Set up
7+
8+
```bash
9+
git submodule update --init
10+
python3 -m venv .venv && .venv/bin/pip install -e ".[dev]" && .venv/bin/pip install -e targets/tiny-gpu --no-deps
11+
source scripts/env.sh
12+
```
13+
14+
For the Compiler Explorer:
15+
16+
```bash
17+
cd web && pnpm install && pnpm dev
18+
```
19+
20+
`pnpm dev` regenerates the Python bundle and the example list first (`scripts/build_web.py`).
21+
22+
## Before you open a pull request
23+
24+
Run the same checks CI runs:
25+
26+
```bash
27+
ruff check . && black --check .
28+
pytest -q
29+
cd web && pnpm lint && pnpm typecheck && pnpm test && pnpm e2e
30+
```
31+
32+
- **Golden files** (`tests/golden/`) pin the emitted IR and assembly. If you change emitted
33+
output on purpose, review the diff and run `pytest --update-golden`.
34+
- **Measured numbers** in `docs/ARCHITECTURE.md` come from `scripts/opt_table.py --write`. A test
35+
fails if they drift.
36+
- Do not format `targets/` (the hardware submodules); the formatter config excludes it.
37+
38+
## Branches and pull requests
39+
40+
- Work on a `feat/*`, `fix/*` or `docs/*` branch. `main` is the default branch and is not pushed to
41+
directly.
42+
- Keep a pull request to one change. Describe what changed and how you checked it.
43+
- Add a regression test for each bug you fix. A minimized failing program can go in
44+
`tests/regressions/`.
45+
46+
## Reporting bugs
47+
48+
Open an issue with the `.tiny` program that fails, the command you ran, and what you expected. A
49+
minimal program makes the fix much faster. For security problems, see [SECURITY.md](SECURITY.md).

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Dineth Hettiarachchi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎SECURITY.md‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Security policy
2+
3+
## Supported versions
4+
5+
Only the latest code on `main` is supported. TinyCompiler is an educational compiler and
6+
simulator project; it has no releases yet.
7+
8+
## Reporting a vulnerability
9+
10+
Please do not open a public issue for a security problem.
11+
12+
Report it privately through GitHub: open the repository's **Security** tab and choose
13+
**Report a vulnerability**. The report stays private until a fix is ready.
14+
15+
Include, if you can:
16+
17+
- what you ran (a `.tiny` program, a command, or a page of the Compiler Explorer),
18+
- what you expected and what happened,
19+
- the commit you tested.
20+
21+
You should get an acknowledgement within a few days. A fix will land on `main`, and the report
22+
will be credited there unless you ask otherwise.
23+
24+
## Scope
25+
26+
In scope: the compiler (`tinyc/`), the runners (`runtime/`), the Compiler Explorer (`web/`), and
27+
the build and CI scripts.
28+
29+
Out of scope: the tiny-gpu and tiny-tpu hardware designs, which are separate projects with their
30+
own security contacts, and problems that need a compromised machine to exploit.

‎web/package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"e2e": "pnpm build && playwright test"
1616
},
1717
"dependencies": {
18-
"@astrojs/react": "^4.0.0",
18+
"@astrojs/react": "^7.1.1",
1919
"@codemirror/state": "^6.7.6",
20-
"astro": "^5.0.0",
20+
"astro": "^7.4.2",
2121
"codemirror": "^6.0.2",
2222
"framer-motion": "^12.43.0",
2323
"react": "^18.3.1",
@@ -26,14 +26,14 @@
2626
"devDependencies": {
2727
"@astrojs/check": "^0.9.12",
2828
"@eslint/js": "^9.39.5",
29-
"@playwright/test": "1.48.2",
29+
"@playwright/test": "1.64.1",
3030
"@types/react": "^18.3.12",
3131
"@types/react-dom": "^18.3.1",
3232
"eslint": "^9.39.5",
3333
"globals": "^15.15.0",
3434
"typescript": "^5.6.3",
3535
"typescript-eslint": "^8.72.0",
36-
"vitest": "^2.1.9"
36+
"vitest": "^4.1.12"
3737
},
3838
"pnpm": {
3939
"onlyBuiltDependencies": [

‎web/playwright.config.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { defineConfig, devices } from "@playwright/test";
22

3-
// The smoke test runs against `astro preview` of a fresh build (see the `e2e` script).
3+
// The smoke test runs against the static build in dist/ (the `e2e` script builds it first).
44
export default defineConfig({
55
testDir: "e2e",
66
timeout: 180_000,
77
use: { baseURL: "http://127.0.0.1:4321" },
88
webServer: {
9-
command: "pnpm preview --port 4321 --host 127.0.0.1",
9+
// A plain static server: Astro 7's `preview` daemonises, which Playwright reads as an early exit.
10+
command: "python3 -m http.server 4321 --bind 127.0.0.1 --directory dist",
1011
url: "http://127.0.0.1:4321/app",
1112
reuseExistingServer: true,
1213
timeout: 60_000,

0 commit comments

Comments
 (0)