Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
42 changes: 42 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy Ray Tracer Demo to GitHub Pages

on:
push:
branches: [main]
paths:
- 'docs/**'

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v5
with:
enablement: true

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'docs'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
39 changes: 25 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
.calva
.clj-kondo/*
!.clj-kondo/config.edn
!.clj-kondo/net.clojars.john
.cpcache
/out
.nrep-port
target
shadow_dashboard/node_modules
shadow_dashboard/resources/public
!shadow_dashboard/resources/public/index.html
shadow_dashboard/.shadow-cljs
.shadow-cljs/
.clj-kondo/
out/
node_modules/
.cpcache/
.nrepl-port
*.log
.DS_Store
target/
.proxy-java-shim.env
.proxy-shim.pid
claude-code-web-bootstrap-clojure-sandbox/
script/proxy_shim.py
.chrome/
test-results/
docs/js/
**/cljs-runtime/
!docs/**/cljs-runtime/
linux-install-*.sh
ex/**/docs/
ex/**/.calva/
ex/reagami/
*.calva-repl
.portal/
.lsp/
.portal
.vscode
build/
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.1.0-alpha.5] - 2025-02-19

### Added
- EVE (Epoch-Versioned Entities) shared-memory persistent data structures
- `atom`, `hash-map`, `hash-set`, `vector`, `list` backed by SharedArrayBuffer
- Epoch-based garbage collection for safe cross-worker memory reclamation
- WASM-accelerated bitmap allocator with SIMD optimizations
- Debug logging module with goog-define DCE support
- Comprehensive documentation (13 guides)
- Raytracer example demonstrating parallel worker performance
- X-RAY memory diagnostics for slab allocator debugging

### Changed
- Improved error handling with debug-gated logging
- Better cross-origin isolation documentation

### Fixed
- Advanced compilation compatibility with shadow-cljs :node-test targets
- Worker module loading under code splitting

## [0.1.0-alpha.4] - 2025-01-XX

### Added
- Service Worker fallback for environments without COOP/COEP headers
- DOM proxy for cross-worker DOM access
- Binding conveyance for dynamic vars

### Changed
- Fat kernel architecture for worker initialization
- Improved sync layer performance

## [0.1.0-alpha.3] - 2024-XX-XX

### Added
- Initial alpha release
- Core threading primitives: `spawn`, `in`, `future`, `pmap`, `pcalls`, `pvalues`, `=>>`
- Browser (Web Workers) and Node.js (worker_threads) support
- Auto-detection of platform capabilities

[Unreleased]: https://github.com/johnmn3/cljs-thread/compare/v0.1.0-alpha.5...HEAD
[0.1.0-alpha.5]: https://github.com/johnmn3/cljs-thread/compare/v0.1.0-alpha.4...v0.1.0-alpha.5
[0.1.0-alpha.4]: https://github.com/johnmn3/cljs-thread/compare/v0.1.0-alpha.3...v0.1.0-alpha.4
[0.1.0-alpha.3]: https://github.com/johnmn3/cljs-thread/releases/tag/v0.1.0-alpha.3
108 changes: 108 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Contributing to cljs-thread

Thank you for your interest in contributing to cljs-thread!

## Development Setup

### Prerequisites

- Clojure CLI (1.11+)
- Node.js (18+)
- npm

### Getting Started

```bash
# Clone the repository
git clone https://github.com/johnmn3/cljs-thread.git
cd cljs-thread

# Install dependencies
npm install

# Start shadow-cljs watch for development
npx shadow-cljs watch app
```

### Running Tests

The unified test runner auto-discovers `*_test.cljs` files, compiles, and runs them:

```bash
clj -M:thread-test :node # all tests via Node.js
clj -M:thread-test :tier slab :node # slab tier only
clj -M:thread-test :tier pure :node # pure tier (no prerequisites)
clj -M:thread-test :ns "map" :node # filter by namespace regex
clj -M:thread-test :dry-run # show test plan without running
clj -M:thread-test slab # run the slab suite by name
clj -M:thread-test :advanced slab # :advanced optimizations
clj -M:thread-test :list # list suites and discovered namespaces
```

### Adding a Test

Just create a `*_test.cljs` file under `test/` — no configuration changes needed. The runner discovers it automatically and infers the tier from the directory or namespace:

```bash
# test/cljs_thread/eve/my_feature_test.cljs → auto-detected as :slab tier
clj -M:thread-test :ns "my-feature" :node
```

See [Testing](doc/10-testing.md) for the full reference including tier system, reporters, filtering, and the `cljs-thread.test` blocking helpers.

## Project Structure

```
src/cljs_thread/
├── core.cljs # Public API entry point
├── spawn.cljs # Worker spawning
├── in.cljs # Cross-worker execution
├── future.cljs # Deferred computation
├── pmap.cljs # Parallel map/calls/values
├── sync.cljs # Synchronization layer
├── platform.cljs # Browser/Node abstraction
├── eve/ # EVE shared-memory structures
│ ├── shared_atom.cljs # SharedAtom implementation
│ ├── map.cljs # Persistent HashMap
│ ├── vec.cljs # Persistent Vector
│ └── deftype_proto/ # Low-level allocator
└── dom/ # DOM proxy for workers
```

## Code Style

- Follow existing patterns in the codebase
- Use debug logging via `cljs-thread.debug/log` for development output
- Add docstrings to public functions
- Keep macros minimal; prefer runtime functions when possible

## Pull Request Process

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/my-feature`)
3. Write tests for new functionality
4. Ensure all tests pass
5. Update documentation if needed
6. Submit a pull request

## Architecture Notes

See [doc/07-architecture.md](doc/07-architecture.md) for details on:
- Fat kernel design
- Sync layer implementation
- Worker mesh topology

See [doc/11-agent-guide.md](doc/11-agent-guide.md) for AI agent onboarding.

## Reporting Issues

Please include:
- ClojureScript/Clojure versions
- Browser/Node.js version
- shadow-cljs version
- Minimal reproduction case
- Error messages and stack traces

## License

By contributing, you agree that your contributions will be licensed under the MIT License.
Loading