Skip to content

Systems 8a: every task names its worker; the pipeline owns the write queue - #119

Open
Pelotrio wants to merge 3 commits into
claude/systems-pagesfrom
claude/systems-workers
Open

Pelotrio wants to merge 3 commits into
claude/systems-pagesfrom
claude/systems-workers

Conversation

@Pelotrio

@Pelotrio Pelotrio commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Eighth PR of docs/SYSTEMS.md (8a), stacked on #118: every piece of work off the Swing thread names its worker, and the project's write queue belongs to the change pipeline.

Finish line

Behavior Test
Closing the project finishes the writes already taken and refuses later ones WriteQueueTest.closingFinishesTheWritesAlreadyTakenAndRefusesLaterOnes
Closing waits through an interruption and keeps it for the caller WriteQueueTest.closingWaitsThroughAnInterruptionAndKeepsItForTheCaller
A key change taken before closing is written and recorded WriteQueueTest.anOfflineKeyChangeTakenBeforeClosingIsWrittenAndRecorded
No class runs work on the JVM's shared pool, and no own executor is left but the allowed services' SystemsRulesTest (the shared-pool list is empty; the executors of ConfigChanges, JsonStateWriter, TextureThumbnails, ModLogoIcons and ResourceViewPanel are gone from the thread list)

What changes

  • WriteQueue is the project's write queue: a dedicated serial worker from Workers.projectWrites() that refuses writes once closed and waits, when closing, for those already taken. The project makes one for its pipeline and closes it before its change record, where it closed ConfigChanges before. ChangePipeline.write and writes() give it to configuration settings and ResourceEdits; ConfigChanges keeps no thread. The queue's three tests moved from ConfigChangesTest; a regression also verifies writes and closing while all shared file workers are occupied.
  • 27 async calls in 19 classes that ran on the JVM's shared pool, one-argument supplyAsync and the like and ForkJoinPool.commonPool(), run on Workers.files().
  • TextureThumbnails and ModLogoIcons read on a Workers.fileStrand(), one at a time, as their archives stay on one thread; ResourceViewPanel reads on the file work; JsonStateWriter's delayed flush runs on the timer.
  • Script file commands compose after pending editor saves rather than joining them on a file worker. ScriptFileActionsTest.movingWaitsForPendingSavesWithoutHoldingTheirWorker verifies rename with three occupied workers and a pending save requiring the fourth.
  • docs/SYSTEMS.md names the workers as built, and splits the last step into 8a (this), 8b (the current project as state) and 8c (owners noticing values put back, connection numbers).

Left as it is

The debugger windows' reads now share the file work's four threads, where they shared the JVM's pool before; a debugger request that hangs holds one of them.

Focused :companion:test checks pass locally. CI runs the full build for the updated head.

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 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-09-30T17:19:20.460704Z e5e3da3 New commits
ℹ️ 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.

@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: 731197c294

ℹ️ 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".

CompletableFuture<Void> drained = new CompletableFuture<>();
synchronized (this) {
this.closed = true;
this.strand.execute(() -> drained.complete(null));

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 Keep queue shutdown independent of the shared file pool

When all four Workers.files() threads are occupied by stalled reads or debugger-analysis tasks, this drain marker remains queued on that same pool while close() blocks in drained.get(). A project switch or application shutdown can therefore hang indefinitely even when this project's write queue is empty; the former dedicated write executor did not depend on unrelated file work making progress. The close path needs a way to drain independently of shared-pool availability.

Useful? React with 👍 / 👎.

@Pelotrio
Pelotrio force-pushed the claude/systems-pages branch from d5e7629 to 295b846 Compare September 30, 2026 16:35
@Pelotrio
Pelotrio force-pushed the claude/systems-workers branch from 731197c to c7926a4 Compare September 30, 2026 16:38

@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: c7926a4e4d

ℹ️ 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".

}
}
}).whenComplete((ignored, failure) -> SwingUtilities.invokeLater(() -> {
}, Workers.files()).whenComplete((ignored, failure) -> SwingUtilities.invokeLater(() -> {

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 Avoid joining script saves on their own bounded pool

When three file workers are stalled and an affected script has another autosave chained behind an in-flight save, this command can take the fourth worker before that chained save is submitted, then block at pendingSave().join() while the save is queued back to Workers.files(). With every worker occupied, rename, move, or delete never completes even after the preceding save finishes; compose the operation after the pending saves instead of blocking a worker from the same bounded pool.

AGENTS.md reference: AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

@Pelotrio
Pelotrio force-pushed the claude/systems-pages branch from 295b846 to c827f12 Compare September 30, 2026 16:56
@Pelotrio
Pelotrio force-pushed the claude/systems-workers branch from c7926a4 to 9c9c5db Compare September 30, 2026 17:01
@Pelotrio
Pelotrio force-pushed the claude/systems-pages branch from c827f12 to d4e9891 Compare September 30, 2026 17:11
Pelotrio and others added 3 commits September 30, 2026 19:11
…he write queue

WriteQueue, a serial path over the file work, is the project's write queue: the
project makes it for its pipeline and closes it before the change record, and
ConfigChanges keeps no thread. The async calls that ran on the JVM's shared pool
run on Workers.files(); the thumbnail and logo readers use file strands, the
resource viewer the file work, and the state writer's flush the timer.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Pelotrio
Pelotrio force-pushed the claude/systems-workers branch from 9c9c5db to e5e3da3 Compare September 30, 2026 17:11
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