Skip to content

main: the two reds a push left behind, together so either can be merged - #2829

Closed
fiestorra wants to merge 1 commit into
ProjectLeonida:mainfrom
fiestorra:fix-main-reds
Closed

fiestorra wants to merge 1 commit into
ProjectLeonida:mainfrom
fiestorra:fix-main-reds

Conversation

@fiestorra

Copy link
Copy Markdown
Contributor

main 9d231d373 has two reds that a push left behind, and they are each other's reason for not going green on their own. This fixes both, so either can be merged and the pipeline can say so.

The two, measured on main with nothing applied:

python -m pytest tests/test_tool_stdout_encoding.py -q
  1 failed, 3 passed, 2 subtests passed
  AssertionError: Lists differ: ['tools/make_amplify_dxil.py'] != []

cargo test --workspace --no-run
  error[E0583]: file not found for module `asbench`
  --> crates\leonida-gpu\src\indirect.rs:4036:1
  exit 101

The changes, two and four lines:

-    #[cfg(test)]
-    mod asbench;
  if __name__ == "__main__":
+     try:  # a redirected stdout is strict ANSI code page under -I; write '?' for what it cannot encode
+         sys.stdout.reconfigure(errors="replace")
+     except (AttributeError, ValueError, OSError):
+         pass
      main()

The Python block is copied from ab_control_flow.py, address_guard.py and amd_swizzle.py, which all have it with the same comment. indirect/asbench.rs has never been in the repository (git log --all -- '*asbench*' is empty); indirect/bench.rs is there and stays.

After, measured:

python -m pytest tests/test_tool_stdout_encoding.py -q     4 passed, 2 subtests passed
cargo test --workspace --no-run                             exit 0
cargo test --workspace                                      exit 101, 6.5 min
  one failure: policy::tests::repository_passes_policy      <- #2815 fixes that

Why together: #2825 removes the module and its checks came back red on test_tool_stdout_encoding; #2827 fixes the tool and its checks would come back red on E0583. Each inherits the other's red from main, so neither can be the one that turns the board green. This is the same two changes and nothing else - if the maintainers prefer two pull requests in sequence, #2825 and #2827 are still there and this supersedes them.

AI-assisted: yes - DeepSeek v4.1 (flash), which found both by chasing a red that was not its own.

Written with an AI assistant.

949 - indirect.rs declares 'mod asbench' under #[cfg(test)] and the file was never
committed: cargo test --workspace fails with E0583 before running anything.

- make_amplify_dxil.py's __main__ does not set errors='replace' on stdout, which
  test_tool_stdout_encoding.py requires of every tool: main fails it on Linux and
  Windows.

Separately neither pull request can show green, because each inherits the other's
red from main. Together: the python test passes 4 of 4, cargo test --no-run
compiles, and cargo test --workspace has only the asset policy failure that ProjectLeonida#2815
fixes.
@OreoFR

OreoFR commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Thanks: both halves of this are already in main. #2825 was merged as 957fa9fe7 and #2827 as 86c30fcea, on OreoFR's (maintainer) written agreement, as fixes of a red on main. Merging this head into the current main 86c30fcea gives exactly main's tree (git merge-tree → b2cdde811, the same tree as main), so it changes nothing any more and can be closed as already in main. AI-assisted (Claude Code agent oreofr-agent, for OreoFR).

@OreoFR OreoFR closed this Dec 1, 2026
@fiestorra

Copy link
Copy Markdown
Contributor Author

Closing this: #2825 and #2827 were both merged (957fa9fe7, 86c30fcea), so its two changes are already in main. Nothing to merge here.

Verified on main 86c30fcea, with nothing applied:

python -m pytest tests/test_tool_stdout_encoding.py -q     4 passed, 2 subtests passed
cargo test --workspace --no-run                             exit 0

So both reds this pull request was made to fix are gone from the tree, each through its own pull request. The combined one was the fallback for the case where neither could show green on its own; the maintainers merged them in sequence instead, which is the cleaner outcome and makes this redundant.

What is still worth having from it: the local measurement that both reds were the same morning's, and that cargo test --no-run - not any workflow - is what proves the E0583 half. That is in #2570.

AI-assisted: yes - DeepSeek v4.1 (flash).

Written with an AI assistant.

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.

2 participants