Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ee5f4cc
fix(tas): wire TAStudio piano-roll edits to the emulator + robust .bk…
doublegate Aug 4, 2026
595a707
feat(ui): detachable/floating tool windows (v2.2.9 "Studio II")
doublegate Aug 4, 2026
aef2d25
chore(release): bump to v2.2.9 "Studio II" + docs
doublegate Aug 4, 2026
7aa5836
fix(ui): preserve per-panel window geometry in detachable_window (Cop…
doublegate Aug 4, 2026
ec26e22
license: relicense to GPL-3.0-or-later — RustyNES is a derivative wor…
doublegate Aug 4, 2026
53df792
docs: bump README version badge to v2.2.9
doublegate Aug 4, 2026
f7ba36c
docs(provenance): add GPLv3 SPDX + per-file provenance headers to der…
doublegate Aug 4, 2026
ab89ced
fix: address CodeRabbit #346 review + add the provenance-failure post…
doublegate Aug 4, 2026
d5c0bab
docs(postmortem): the black-box instruction was given but not enforce…
doublegate Aug 4, 2026
78f6de9
docs(postmortem): formatting + self-consistency pass on the maintaine…
doublegate Aug 4, 2026
0268a56
docs(provenance): correct the laundered per-function comments at port…
doublegate Aug 5, 2026
a3ea528
docs: add the themed PDF of the provenance-failure post-mortem (ref-d…
doublegate Aug 5, 2026
f485500
docs: add ingestible provenance/license guardrails for AI-assisted em…
doublegate Aug 5, 2026
905fe02
docs: restyle the post-mortem PDF — calm cool palette, sans-serif, 4pp
doublegate Aug 5, 2026
8b982bc
docs(guardrails): make the provenance guardrails a standalone, consol…
doublegate Aug 5, 2026
5c4fa67
docs(pdf): convert provenance post-mortem to full-width single-column…
doublegate Aug 5, 2026
c6b4e47
docs(provenance): unquote maintainer's statement; italicize it in the…
doublegate Aug 5, 2026
11f0450
docs(provenance): render the section cross-reference as bold "7. Less…
doublegate Aug 5, 2026
9769ec8
docs(pdf): render "Fiskbit" bold and upright in the maintainer's NOTE
doublegate Aug 5, 2026
928453d
docs(ref): add themed PDF of the AI-emulator provenance guardrails
doublegate Aug 5, 2026
cd3b726
docs(pdf): fix the paste-ready guardrail block sizing in the guardrai…
doublegate Aug 5, 2026
ab73ecf
docs(agents): ingest the provenance/license firewall as the top devel…
doublegate Aug 5, 2026
198211b
docs(provenance): normalize in-source reference citations to upstream…
doublegate Aug 5, 2026
bacbd14
docs: account for the ref-proj/ removal + reference firewall across d…
doublegate Aug 5, 2026
9a31307
docs: document the reference firewall + guardrails in README and CHAN…
doublegate Aug 5, 2026
5a202e7
docs(provenance): align the §1 derivation table with the in-source ci…
doublegate Aug 5, 2026
2d21e47
docs: resolve CodeRabbit provenance-firewall review on the tooling/ig…
doublegate Aug 5, 2026
9b39e60
fix(core): bound .bk2 LogKey parsing against #-group allocation ampli…
doublegate Aug 5, 2026
c96dba3
docs(changelog): correct windowing scope, fold guardrails into the v2…
doublegate Aug 5, 2026
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
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
stage="rustynes-${{ steps.tag.outputs.tag }}-${{ matrix.target }}"
mkdir -p "$stage"
cp "target/${{ matrix.target }}/release/${{ matrix.bin_name }}" "$stage/"
cp README.md LICENSE-MIT LICENSE-APACHE NOTICE CHANGELOG.md "$stage/"
cp README.md LICENSE NOTICE CHANGELOG.md "$stage/"
echo "stage=${stage}" >> "$GITHUB_ENV"

- name: Create archive (tar.gz)
Expand Down Expand Up @@ -247,7 +247,7 @@ jobs:
cp pgo-bin/rustynes "$stage/rustynes"
chmod +x "$stage/rustynes"
strip "$stage/rustynes"
cp README.md LICENSE-MIT LICENSE-APACHE NOTICE CHANGELOG.md "$stage/"
cp README.md LICENSE NOTICE CHANGELOG.md "$stage/"
tar -czf "${stage}.tar.gz" "$stage"
echo "asset=${stage}.tar.gz" >> "$GITHUB_ENV"

Expand Down
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,17 @@ flamegraph.svg
# Large local NESdev wiki mirror (~208M, reference only).
/nesdev_wiki/

# --- Reference projects (external cloned repos) ---
# --- Reference projects (external cloned repos) — REFERENCE FIREWALL ---
# ref-proj/ held local clones of reference emulators used ONLY as black-box
# behavioral oracles. Their licenses are project-specific: Mesen2, puNES, FCEUX,
# and GeraNES are copyleft (GPL), and reproducing that source makes RustyNES a
# derivative work (which it now is, GPL-3.0-or-later); TriCNES is MIT. The
# directory has been REMOVED from disk and stays ignored here as a firewall guard
# so the copyleft source can never re-enter the working tree. Do NOT re-clone
# reference-emulator source into the repo; implement hardware behavior from
# docs/test ROMs. (The MIT TriCNES source is instead deliberately vendored, with
# attribution, under crates/rustynes-test-harness/golden/tricnes/.) See
# docs/ai-emulator-provenance-guardrails.md and the "MOST IMPORTANT RULE" of AGENTS.md.
/ref-proj/

# --- Temporary files ---
Expand Down
21 changes: 17 additions & 4 deletions AGENTS.md

Large diffs are not rendered by default.

118 changes: 118 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,124 @@ cycle-accurate core later replaced.

## [Unreleased]

## [2.2.9] - 2026-08-04 - "Studio II" (relicense to GPLv3 + TAS/movie wiring + detachable tool windows)

The fourth step of the **v2.2.6 → v2.3.0** NESdev-remediation line. Its headline
is a **licensing and provenance correction**: RustyNES is **relicensed to
GPL-3.0-or-later** because it is a derivative work of GPL emulators. It also
addresses three forum items — TAStudio piano-roll edits that never reached the
emulator, `.bk2` movies that imported but did not play back, and tool windows
trapped inside the main OS window on Windows 10. The code changes are
frontend-only, so the deterministic chip stack, save-states, and every golden
vector are byte-identical (AccuracyCoin 141/141, nestest 0-diff).

> **Windowing — honest scope.** The detach affordance is **native-only and
> currently *embeds***: the frontend is a single-viewport `egui_winit`
> integration, so `show_viewport_immediate` renders a detached panel *inside* the
> main window rather than as a separate OS window — so this does **not** yet fully
> resolve the Windows-10 "trapped window" report. True OS-window detach needs
> multi-viewport render-loop wiring (`set_embed_viewports(false)` + per-viewport
> winit windows), tracked as a v2.3.0 follow-up (see the detailed "Fixed" entry).

### Changed — License: MIT/Apache-2.0 → GPL-3.0-or-later

- **RustyNES is relicensed to GPL-3.0-or-later** (ADR 0036). A NESdev community
review established that the project **incorporates and is derived from code from
GPL-licensed emulators** — principally **Mesen2** (GPL-3.0-or-later: CPU unstable
stores, the PPU sprite-evaluation/OAM model, ~15 mapper boards, the Bisqwit NTSC
filter tables, EEPROM models, the UNIF tables, the debug-symbol importer, the PGO
harness) and, for several mappers and the FDS drive model, **puNES / FCEUX /
Nestopia** (GPL-2.0-or-later: JV001/mapper-147 bit-for-bit, the FDS per-CRC drive
table, UNIF handling). This is derivation, not oracle use — the project's own
pre-v2.2.5 comments said so ("Faithful port of Mesen2's …", "Ported bit-for-bit
from puNES `JV001.c`") — which makes RustyNES a derivative work distributable only
under the GPL.
- **The v2.2.5 "no GPL source incorporated" / MIT-Apache position was wrong and is
withdrawn.** `LICENSE` is now the GPLv3 text; `LICENSE-MIT` / `LICENSE-APACHE` are
removed; the workspace + `rustynes-cheevos` `license` fields and the `cargo-deny`
allow-list are updated.
- **Credit is given, per subsystem.** `docs/originality-and-provenance.md` is
rewritten to lead with the file-by-file derivation table and the derivative-work
declaration; `NOTICE` attributes every GPL upstream and the code derived from it.
Each derived source file now carries an accurate `SPDX-License-Identifier:
GPL-3.0-or-later` header plus a specific provenance note naming its upstream
(e.g. Mesen2 `NesPpu.cpp`, puNES `JV001.c`) and pointing to the audited record.
The old scattered, imprecise per-line "port of" comments are not restored — the
SPDX + provenance headers are their accurate replacement. Incorporated permissive
components (emu2413/MIT, TriCNES/MIT, rcheevos/MIT, blip_buf/LGPL-2.1-or-later,
fonts) are GPL-compatible and keep their notices. Zero emulation-core behavior
change.

### Added — Provenance & license firewall (+ import hardening)

- **Guardrails ruleset + post-mortem.** `docs/ai-emulator-provenance-guardrails.md`
— a preventive, console-agnostic ruleset (reference firewall, four attribution
surfaces, license accounting, mechanical CI enforcement, a pre-development
checklist, a paste-ready block, red flags) that stops the copyleft-source-lifting
failure from recurring in any AI-assisted emulator project (shared as community
best-guidance) — and `docs/provenance-failure-postmortem.md`, the forensic
root-cause analysis of how GPL code was reproduced despite a black-box
instruction and then laundered, and how it was corrected. Themed PDFs of both in
`ref-docs/`. The guardrails are **ingested into `AGENTS.md`** (via the
`CLAUDE.md` / `GEMINI.md` symlinks) as the **"MOST IMPORTANT RULE"** section and
into the project memory bank, so every session loads the reference firewall as
standing context. A "Provenance & Licensing" section links them from
`docs/DOCUMENTATION_INDEX.md` + the mkdocs nav, and `README.md` carries a
reference-firewall note.
- **Reference firewall — the reference-emulator clone removed.** The local
reference-emulator clone has been **removed from disk**; it stays gitignored (and
excluded from `.dockerignore` / `.markdownlintignore` / pre-commit / CodeRabbit)
as a firewall guard so the *copyleft* references' source (Mesen2 / puNES / FCEUX /
GeraNES, GPL) is out of the agent's reach by design. In-source provenance
citations were normalized from the removed local-clone path to upstream-relative
form (comments-only — the deterministic core is byte-identical; nothing
laundered), and the `docs/originality-and-provenance.md` §1 derivation table was
audited so every upstream header a file's comments cite is listed. **MIT TriCNES
is the deliberate exception**, vendored in-repo with attribution under
`crates/rustynes-test-harness/golden/tricnes/`; the tooling docs
(`oracle-tooling-setup.md`, `ppu-trace-tooling.md`) scope the out-of-tree /
never-reproduce rule to the copyleft references accordingly.
- **`.bk2` import hardened against a `LogKey` allocation-amplification DoS.**
`bk2_interop::parse_log_key` now reads only the console/P1/P2 groups from the
`split('#')` iterator instead of collecting every `#`-group, so a hostile movie
padded with `#` delimiters can no longer amplify into an unbounded `Vec<&str>`
on import. Behavior is identical for valid movies (guarded by a new
`log_key_bounded_against_pathological_group_padding` regression test); the
deterministic core is unaffected.

### Fixed

- **TAStudio piano-roll edits now drive the emulator.** `App::handle_tas_requests`
applied `TasRequest::SetInput` to the `TasEditor::input_log` only and never
re-seeked the `Nes`, so a cell edit was invisible until an unrelated seek. It
now marks the buffer dirty and re-derives through `TasEditor::seek` after the
batch — the same path the scripting bridge (`apply_tas_commands`) already used.
- **`.bk2` playback honors the movie's `LogKey` column order.** The importer
mapped controller columns by a fixed built-in order and ignored the `LogKey:`
header, so real BizHawk movies whose columns are ordered differently drove the
wrong buttons. `bk2_interop` now parses the actual `LogKey:` order (falling back
to the standard order when absent), and import parse errors surface on the
on-screen status bar instead of only `eprintln!`.

### Added

- **Detachable / floating tool windows (native).** A shared `detachable_window`
helper gives each debugger/tool panel a "⧉ Detach" button (and a "⧉ Reattach"
affordance) that pops it out via egui's `show_viewport_immediate`; 18 panels are
routed through it (PPU, OAM, APU, Memory, Event Viewer, NSF, Mapper, Watch,
Trace, Cheats, ROM Database, Performance, Documentation, Input Display, Audio
Mixer, Replay/TAS, Memory Compare, ROM Info), each preserving its prior
first-open geometry via a `WindowCfg`. Native-only (wasm stays docked in an
`egui::Window`, unchanged), clippy-clean on both wasm feature sets.
- **Known limitation (honest scope).** RustyNES's frontend is currently a
*single-viewport* `egui_winit` integration, so `show_viewport_immediate`
renders the detached panel **embedded in the main window** rather than as a
separate OS window — i.e. this does **not** yet fully resolve the Windows-10
"trapped inside the main window" report. True OS-window detach requires wiring
multi-viewport (`set_embed_viewports(false)` + per-viewport winit windows) into
the render loop; the affordance, `WindowCfg` geometry, and `ViewportBuilder`
plumbing are in place for when that lands. Tracked as follow-up.

## [2.2.8] - 2026-08-04 - "Aperture II" (gamma-aware scanlines + sharper CRT)

A **presentation-fidelity** release addressing the NESdev-forum feedback on
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ The repository ships test ROMs (`tests/roms/`) that are individually CC0 or publ

## License

By contributing to RustyNES, you agree that your contributions will be dual-licensed under both the [MIT License](LICENSE-MIT) and the [Apache License 2.0](LICENSE-APACHE).
By contributing to RustyNES, you agree that your contributions will be licensed under the [GNU General Public License v3.0 or later](LICENSE).

---

Expand Down
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ members = [
default-members = ["crates/rustynes-libretro"]

[workspace.package]
version = "2.2.8"
version = "2.2.9"
edition = "2024"
rust-version = "1.96"
license = "MIT OR Apache-2.0"
license = "GPL-3.0-or-later"
authors = ["DoubleGate <parobek@gmail.com>"]
repository = "https://github.com/doublegate/RustyNES"
readme = "README.md"
Expand Down
Loading