Skip to content

Phase 6C: add real-world MIDI playback corpus lane - #89

Open
EmergentMonk wants to merge 52 commits into
mainfrom
phase-6c/midi-real-world-corpus
Open

EmergentMonk wants to merge 52 commits into
mainfrom
phase-6c/midi-real-world-corpus

Conversation

@EmergentMonk

@EmergentMonk EmergentMonk commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Implements the next item in phase6c/LEGACY_PLAYBACK_IMPORT.md: the contributor-supplied MIDI real-world playback corpus.

This phase uses the six manifest-pinned SMF stem sets to move from a gentle real-world workload through dense tempo/polyphony/overlap stress and finally full 16-channel routing stress.

The corpus remains external/private. Raw MIDI and ZIP bytes are not committed and are not uploaded as evidence artifacts.

Stress progression

The observation order is frozen as:

  1. FM Doom — gentler baseline
  2. Celestial Mechanics — older composition/export behaviour
  3. Deterministic Pattern — controlled generation/follow-tempo behaviour
  4. Blue Glare — dense modern tempo-map workload
  5. Polyrhythmic Patterns — overlap/polyphony/event-ordering stress
  6. NGC3603 Quantum Demoscene — final routing stress, including all 16 MIDI channels

Executable corpus contract

phase6c/reference-corpus/manifest.json is upgraded to schema v2 and freezes:

  • the six existing archive SHA-256 identities;
  • stem counts;
  • note/overlap/polyphony observations;
  • tempo-event counts and ranges;
  • duration observations;
  • malformed exporter key-signature values;
  • zero-duration-pair presence;
  • NGC3603's 16-channel routing observation;
  • the progression order and private-workflow boundary.

The Python corpus analyser independently parses SMF1/480 input using only the standard library. It does not normalize the malformed key-signature metadata away.

Native C-Psycle import boundary

C-Psycle has a real MThd / MidiLoader SongReader path.

For every real stem, the donor lane freezes the untouched imported tracker graph before adding any sound source:

  • sequence/pattern/event counts;
  • imported note/release/MIDI-CC counts;
  • tempo-command count;
  • MIDI channel mask;
  • deterministic FNV-1a digest of imported event identity/timing;
  • confirmation that MIDI import itself created no sound-generating machines.

This is native MIDI import evidence, not an extension-only check.

Deterministic execution projection

SMF import does not choose an instrument or instantiate a machine. Therefore successful import alone is not treated as audible playback.

After the untouched graph is digested, the probe attaches one project-owned deterministic classic Sampler substrate:

  • machine slot 0;
  • deterministic looped mono sample;
  • deterministic instrument 0;
  • imported note numbers, event offsets, track geometry and tempo commands remain unchanged;
  • note/release/MIDI-CC machine routing is projected to the deterministic substrate;
  • playback is bounded to a 16-beat projection window;
  • production Player -> FileOutDriver renders a transient WAV;
  • the render must be non-silent and is SHA-256-bound before deletion.

The projection proves that the imported event graph can execute through the engine. It is explicitly not evidence of native MIDI instrument-selection semantics.

Frozen C++ candidate boundary

The sanitized C++ candidate has internal MIDI-event machinery but no retained SMF loader entry point (MThd / MidiLoader).

The private workflow runs one manifest-bound representative stem from each set against the frozen candidate player and records the scoped direct-load rejection. That boundary says nothing about the candidate's internal MIDI event or plugin support.

Original Psycle boundary

Pinned Psycle 1.12.0 x86 is not observed or classified in this phase.

This is donor-first real-world robustness evidence. Any later original-reference MIDI claim must be a separate version-pinned observation.

All corpus outputs retain parity_status: UNKNOWN, and no compatibility-matrix row is added or promoted.

Private real-corpus workflow

Adds:

.github/workflows/phase6c-midi-corpus-private.yml

Manual trigger: workflow_dispatch

Required masked repository secret:

PSYCLE_PHASE6C_MIDI_CORPUS_URL

The secret points to an outer transport ZIP containing the six exact archive files. The outer ZIP is not authoritative; each inner archive must match its frozen filename and SHA-256.

Each real stem is processed privately. Raw MIDI, ZIP and transient WAV bytes are deleted before artifact upload.

Uploaded artifacts contain only:

  • sanitized per-stem JSON observations;
  • donor corpus summary;
  • exact donor probe executable;
  • exact retained midiloader.c;
  • frozen candidate player and scoped boundary receipt;
  • public-safe combined corpus summary.

Continuous CI

Ordinary PR CI requires no private corpus.

It creates a project-owned SMF1/480 fixture and runs the same C probe end-to-end through:

SongReader / MidiLoader
  -> untouched imported event digest
  -> deterministic classic Sampler projection
  -> Player
  -> FileOutDriver
  -> non-silent WAV validation

The Python contract tests also exercise:

  • malformed key-signature preservation;
  • cross-track polyphony;
  • balanced note handling;
  • renamed-MIDI / renamed-ZIP privacy rejection;
  • frozen corpus archive identities;
  • candidate source boundary;
  • workflow trigger coverage;
  • summary/component receipt validation.

Temporary roadmap

  • import/translation baseline
  • deterministic sample-mode playback witness
  • historical SickMaate three-way observation — private dispatch still pending
  • MIDI real-world playback corpus — current phase
  • legacy-lane closeout

The MIDI phase remains observationally pending until the private workflow is dispatched with PSYCLE_PHASE6C_MIDI_CORPUS_URL, but the implementation and continuously testable execution path are introduced by this PR.

Summary by Sourcery

Introduce a private, identity-bound MIDI corpus lane that validates C-Psycle import robustness and deterministic engine execution without promoting compatibility parity.

New Features:

  • Add a private, manifest-bound real-world MIDI corpus workflow covering donor playback and frozen candidate load-boundary observations.
  • Add continuous CI coverage for synthetic SMF import through deterministic audio projection and non-silent rendering.

Bug Fixes:

  • Restore C-Psycle MIDI-file loading and ensure imported notes receive terminal release events when needed.
  • Prevent sampler period updates for voices that are not currently playing.

Enhancements:

  • Upgrade the MIDI reference corpus manifest to an executable schema-v2 contract with frozen identities, source observations, stress progression, and privacy boundaries.
  • Separate untouched native MIDI import evidence from deterministic classic-Sampler execution projection while retaining parity status as UNKNOWN.

Build:

  • Enable the C-Psycle MIDI-file feature and extend CI dependencies and build steps for the MIDI corpus probe.

CI:

  • Add manual private corpus observation, sanitized evidence auditing, candidate boundary checks, and diagnostic handling to GitHub Actions.

Documentation:

  • Document the real-world MIDI corpus procedure, evidence boundaries, stress progression, and pending original-reference observations.

Tests:

  • Add Python contract tests and a native C probe covering SMF parsing, imported graph digests, MIDI projection, rendering, privacy enforcement, manifest binding, and candidate boundaries.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @EmergentMonk, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 23 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T00:40:00.631398Z 80ecfb6 Manual request
🔒 Security Review ✅ Completed 2026-10-01T21:53:54.265449Z 88c105a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA 88c105a against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

This PR implements the current MIDI real-world corpus roadmap item. Review especially: manifest-pinned private corpus identity, standard-library SMF analysis, cross-track polyphony/overlap accounting, the boundary between untouched native MidiLoader import and the deterministic Sampulse audibility projection, raw MIDI/ZIP privacy exclusion, frozen-candidate representative direct-load evidence, and self-contained public component summaries. Original Psycle remains explicitly unobserved/unclassified in this donor-first phase.

@sourcery-ai

sourcery-ai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR introduces a private, manifest-bound real-world MIDI corpus lane with standard-library source analysis, native C-Psycle import evidence, a clearly separated deterministic Sampulse execution projection, frozen candidate direct-load observations, privacy-safe artifacts, and a continuously exercised synthetic CI path; all results remain observational with parity_status UNKNOWN.

Sequence diagram for MIDI corpus donor observation and playback projection

sequenceDiagram
    participant Workflow as PrivateWorkflow
    participant Analyzer as phase6c-midi-corpus.py
    participant Probe as MidiCorpusProbe
    participant Loader as SongReader_MidiLoader
    participant Player as Player
    participant FileOut as FileOutDriver

    Workflow->>Analyzer: prepare-bundle
    Analyzer->>Analyzer: parse_smf
    Analyzer-->>Workflow: manifest-bound private stems
    Workflow->>Probe: process stem
    Probe->>Loader: load MThd SMF
    Loader-->>Probe: untouched imported tracker graph
    Probe->>Probe: digest imported events
    Probe->>Probe: attach deterministic Sampulse substrate
    Probe->>Player: render 16-beat projection
    Player->>FileOut: write transient WAV
    FileOut-->>Probe: non-silent render
    Probe-->>Workflow: sanitized observation and hashes
    Workflow->>Workflow: delete MIDI, ZIP, and WAV bytes
Loading

Flow diagram for the MIDI corpus stress progression

flowchart LR
    A[FM Doom<br/>gentle baseline] --> B[Celestial Mechanics<br/>older export behavior]
    B --> C[Deterministic Pattern<br/>controlled follow-tempo]
    C --> D[Blue Glare<br/>dense tempo maps]
    D --> E[Polyrhythmic Patterns<br/>overlap and polyphony]
    E --> F[NGC3603 Quantum Demoscene<br/>16-channel routing stress]
Loading

Flow diagram for continuous synthetic MIDI CI validation

flowchart LR
    Fixture[Generate SMF1/480 fixture] --> Import[SongReader / MidiLoader]
    Import --> Digest[Digest untouched event graph]
    Digest --> Project[Project notes to deterministic Sampulse]
    Project --> Render[Player -> FileOutDriver]
    Render --> Validate[Validate non-silent WAV and contract fields]
    Validate --> Delete[Delete transient MIDI and WAV]
Loading

File-Level Changes

Change Details Files
Adds a schema-v2 private MIDI corpus contract with frozen identities, source-analysis expectations, stress progression, and explicit evidence/parity boundaries.
  • Freezes six archive hashes, stem aggregates, MIDI edge cases, and progression order.
  • Documents private-input handling, donor projection semantics, candidate scope, and non-observation of original Psycle.
phase6c/reference-corpus/manifest.json
phase6c/LEGACY_PLAYBACK_IMPORT.md
Implements a standard-library corpus analyzer and evidence validation pipeline for private MIDI inputs.
  • Parses SMF1/480 files, preserving malformed key signatures and measuring notes, overlaps, polyphony, tempo, duration, channels, and event-family observations.
  • Verifies nested archive identities and manifest aggregates while preventing raw MIDI/ZIP bytes from public evidence.
  • Builds donor, candidate-boundary, and public-safe summary receipts with parity fixed to UNKNOWN.
scripts/phase6c-midi-corpus.py
Adds a native C-Psycle MIDI import probe that separates untouched import evidence from deterministic playback execution.
  • Digests imported tracker events and records counts, routing, tempo commands, and machine state before projection.
  • Attaches a project-owned Sampulse sample/instrument substrate, routes imported events, renders through Player/FileOutDriver, and validates non-silent WAV output.
tests/phase6c_midi_corpus_probe.c
Adds manual private corpus observation for donor playback and frozen C++ candidate direct-load boundaries.
  • Downloads and verifies the masked outer bundle's six inner archives, processes all stems in the frozen order, and deletes private inputs and transient renders before upload.
  • Publishes sanitized donor evidence, exact support binaries/source, representative candidate rejection receipts, and a combined summary without promoting compatibility claims.
.github/workflows/phase6c-midi-corpus-private.yml
Integrates the MIDI lane into continuous PR CI and adds contract coverage.
  • Generates a synthetic SMF fixture and runs the same import-to-render C probe end to end.
  • Tests parser behavior, privacy audits, manifest identities, candidate source boundaries, workflow coverage, and receipt validation.
.github/workflows/phase6c-legacy-playback-import.yml
tests/phase6c_midi_corpus.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 88c105ac4f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/phase6c-midi-corpus.py
Comment thread scripts/phase6c-midi-corpus.py Outdated
Comment thread scripts/phase6c-midi-corpus.py Outdated
Comment thread scripts/phase6c-midi-corpus.py Outdated

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA a76d155 against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

This head addresses the four latest corpus findings: representative and donor stem bytes are re-bound by re-opening the manifest-pinned private archives; equal-tick MIDI metrics preserve same-track ordering while remaining cross-track-order independent; candidate observations require the canonical Phase 6B build-tree ELF and frozen baseline identity rather than arbitrary supplied executables; and donor public evidence retains/validates distinct per-stem source/event/render records. The always-on fixture-contract job is green on this SHA.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a76d1558cc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/phase6c-midi-corpus.py
Comment thread cpsycle/detail/psyconf.h

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA 4dfadff against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

This head includes the four latest evidence fixes (archive-member rebinding, same-track/equal-tick ordering, canonical Phase 6B candidate-player provenance, distinct per-stem donor records) plus the native Sampulse crash fix exposed by the synthetic MIDI projection: xmsamplerchannel_setnote now recalculates period only for a still-playing foreground voice, avoiding dereference of an ended voice whose wave controller has no sample. Failure-only GDB diagnostics are also preserved as an artifact.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4dfadffdf7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/phase6c-midi-corpus.py

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA 460f04f against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

This head addresses the two latest P1 findings as well: candidate-player identity now includes an immediate clean-rebuild attestation (initial canonical build hash must equal the clean rebuild hash, and this attestation runs in ordinary CI); MidiLoader now flushes pending end-of-track note-offs, and the synthetic SMF runtime contract requires exactly two imported releases before the non-silent projection render.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 460f04f946

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/phase6c-midi-corpus.py
Comment thread cpsycle/detail/psyconf.h
Comment thread scripts/phase6c-midi-corpus.py Outdated

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA 5603de2 against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5603de2b31

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/phase6c_midi_corpus_probe.c Outdated
Comment thread cpsycle/audio/src/midiloader.c Outdated
Comment thread cpsycle/detail/psyconf.h
Comment thread tests/phase6c_midi_corpus_probe.c
Comment thread scripts/phase6c-midi-corpus.py Outdated

Copy link
Copy Markdown
Member Author

@codex Please Review this exact SHA 80ecfb6 against the existing contract. Report only actionable correctness defects, with a minimal reproduction, expected versus actual behavior, and affected lines. State whether each reproduction was executed or statically inferred. Don’t repeat fixed findings without a new failing case. Keep architectural suggestions separate and non-blocking.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 80ecfb6ef3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cpsycle/detail/psyconf.h
#define PSYCLE_USE_PSY2
#define PSYCLE_USE_XM
/* #define PSYCLE_USE_MIDI_FILE */
#define PSYCLE_USE_MIDI_FILE

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Flush equal-tick releases before reusing their voice

Statically inferred fresh case beyond the fixed end-of-track case: import Note On C4 at tick 0, Note Off C4 at tick 10, then Note On D4 at the same tick 10. In midiloader_writepatternevent() the pending release fails the strict time < position test at midiloader.c:957, but lines 966-967 still select that voice and clear noteoff; the D4 event then overwrites the voice, so the expected two releases become only D4's later release and C4 remains sustained. Enabling the loader here exposes this path; either emit equal-tick releases before voice reuse or retain the pending state, and add this boundary fixture.

AGENTS.md reference: AGENTS.md:L330-L330

Useful? React with 👍 / 👎.

Comment on lines +1169 to +1172
unexpected = [
value for value in untracked_after.stdout.splitlines()
if value != allowed_plugin and not value.startswith(allowed_diversalis)
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Verify allowlisted candidate dependencies before rebuilding

Statically inferred fresh bypass beyond the fixed generated-Makefile case: after staging the candidate dependencies, modify any compiled file under psycle-cpp-r12005-sanitized/diversalis/ and invoke attest-candidate-player. The expected result is rejection because the build no longer uses the pinned r12005 dependency, but this prefix exemption removes every such file from unexpected; git diff also ignores the untracked tree, so qmake rebuilds it and the receipt still identifies the output as the frozen candidate. Validate the staged dependency against a frozen manifest or SVN identity before allowing it.

AGENTS.md reference: AGENTS.md:L303-L303

Useful? React with 👍 / 👎.

Comment on lines +959 to +960
midiloader_insertnoteoff(
self, voice, &self->currtrack.channels[voice]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reclaim every voice whose release was emitted

Statically inferred minimal reproduction: import 63 successive two-note chords, using channel 0/note N and channel 1/note N for each chord and releasing both before advancing to the next chord. The expected graph contains all 126 note-ons, but each first attack flushes every pending release while channelvoice retains only the last released voice; the other released voice keeps a non-empty tracknote, so the free-voice scan at lines 971-976 never reclaims it and the second note of chord 63 is dropped after all 63 usable tracker voices appear occupied. Clear every released voice's stored note (while separately retaining the one selected for immediate reuse), and regress repeated chords.

AGENTS.md reference: AGENTS.md:L330-L330

Useful? React with 👍 / 👎.

Comment on lines +245 to +247
for (slot = 0; slot < 16u; ++slot) {
if (psy_audio_machines_at(machines, slot))
++stats->machines_before_projection;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Inspect every machine slot before claiming an empty import

Statically inferred minimal reproduction: have the loader place a machine in slot 16 and run this probe. The expected result is rejection because the native-import contract requires zero sound-generating machines before projection, but this loop inspects only slots 0-15 even though C-Psycle exposes ordinary machine slots through 127; the actual result leaves machines_before_projection at zero and publishes the false empty-import observation. Iterate all non-Master machine slots rather than the MIDI channel range.

AGENTS.md reference: AGENTS.md:L325-L325

Useful? React with 👍 / 👎.

Comment on lines +1376 to +1379
if obs.get("non_silent_projection") is not True:
die(f"{stem_id}: execution projection is silent")
if obs.get("projection_kind") != "deterministic-sampler":
die(f"{stem_id}: execution projection kind changed")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Validate the imported tempo map before accepting a stem

Executed reproduction: I called validate_donor_execution_observation() with a source analysis reporting 539 tempo events and an otherwise valid donor observation reporting tempo_commands: 0; it returned successfully. The expected behavior is to reject an import that lost the corpus's repeated tempo map (accounting separately for any tick-zero event normalized into song BPM), but the actual validator skips directly from note/release coverage to audibility and the public stem record drops tempo_commands, so every tempo change can disappear while the set is still reported fully imported and non-silent.

AGENTS.md reference: AGENTS.md:L320-L320

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant