Skip to content

Commit d42d9ef

Browse files
Harvi654claude
andcommitted
Patches are AI-written and stay out of Wine; LGPL; validation rules
Wine's clean room guidelines (October 2026) do not accept LLM-generated code and require a real name, so the patches here are not meant for upstream Wine. Say so in the README, AGENTS.md and patches/README.md, and turn the "for upstream" notes in the docs into notes for Wine bug reports. The README called the patches LGPL only "when sent upstream". They change LGPL code, so they are LGPL 2.1 or later regardless; patches/README.md now states license and origin. AGENTS.md gets the working rules used since then: validation levels L0-L5 with Wine tests checked on real Windows 10, the clean room limits and the rules for working with AI (test first, three rounds, cross review). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NS6r8jDvZcYmNex7tD6mUE
1 parent b56b0fa commit d42d9ef

5 files changed

Lines changed: 103 additions & 19 deletions

File tree

‎AGENTS.md‎

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,70 @@ explain why things are the way they are.
5050
`wine/version.env`, with a test in Wine's test suite where possible.
5151
- Raise `WINE_BUILD` when patches change; the workflow publishes the release;
5252
then add its SHA-256 to `wine/SHA256SUMS` (`[skip ci]`).
53-
- Patches are meant for upstream Wine eventually - keep them clean and minimal.
53+
- Patches are written with AI help and are **not** sent to Wine: Wine does not
54+
accept LLM-generated code and requires the author's real name. Never submit
55+
them or hide their origin. What goes to Wine is a bug report on
56+
bugs.winehq.org in words: what the application calls, what Wine returns,
57+
what Windows returns, the steps and a public synthetic test.
58+
- Write them as Wine would anyway: one DLL, small, in the style of the
59+
surrounding code, with the `/*** name (DLL.@) */` headers kept, and a test in
60+
`dlls/<dll>/tests/` that uses `ok()` / `todo_wine` (fails on unpatched Wine,
61+
passes with the patch). The test describes Windows, so it has to pass on
62+
Windows (below).
63+
- Patches modify LGPL code, so they are LGPL 2.1 or later (see
64+
`patches/README.md`), whatever the license of the rest of the repository.
65+
66+
### Validation levels
67+
A patch is recorded with the level it reached:
68+
- **L0** builds from the official Wine source with the full patch set, both
69+
architectures, no fuzz.
70+
- **L1** its Wine test passes on real Windows 10 (x86_64 and i686 executables
71+
built with MinGW, run in the maintainer's Windows VM, which has no network;
72+
only text results come back, never DLLs). Expected values come from what
73+
Windows returned, not from documentation or guesses; where a value is
74+
unknown, add a trace and measure it first. If a test fails on Windows, the
75+
test is wrong - fix the test, then the patch.
76+
- **L2** the existing tests of the touched DLL show no new failures (for
77+
server, user32, win32u, winex11 also run the neighbouring suites).
78+
- **L3** reproducers or fuzzing for complex cases (`docs/wine-repro/`).
79+
- **L4** the maintainer's smoke test in Inventor (and SOLIDWORKS when the DLL
80+
is shared): the feature itself plus start, part, assembly, save/reopen,
81+
restart.
82+
- **L5** a week of normal use.
83+
Diagnostic or trace patches stay in `patches/debug/` and never go into a
84+
normal build. A patch that passes its tests but does not fix the user's
85+
problem is not added.
86+
87+
### Clean room
88+
- Allowed: observing behaviour from outside - Wine debug channels (`+relay`,
89+
`+seh`, `+ole`, ...), also with native Microsoft components (.NET 4.8,
90+
WebView2), and stack addresses at a crash. When a native Microsoft component
91+
was traced, say so in the docs.
92+
- Not allowed: disassembly, debug symbols or source of Microsoft code, copying
93+
Microsoft files out of Windows or the VM, and looking inside Autodesk (or
94+
other vendors') binaries beyond crash addresses.
95+
- Bug reports for Wine contain only the application's side and our own tests,
96+
never internals of Microsoft DLLs.
97+
- AI may have seen other projects' code (Mesa, ReactOS, ...): ask for original
98+
code and say so in the patch; for a larger patch ask a second model whether
99+
it resembles a known project.
100+
101+
### Working with AI
102+
- Test first, then the fix; one task at a time.
103+
- Three rounds: if three fix attempts do not bring the result closer, stop,
104+
write down the state and the best hypothesis, and move to something else.
105+
- Cross review: a patch written by one assistant is read in full by another
106+
before it goes into a normal build.
107+
- Every patch gets a short plain-language explanation in the docs that the
108+
maintainer can follow without reading the code.
54109

55110
## Documentation
56111
- Every fix or finding gets written up in `docs/arch-hyprland.md`, in the
57112
same style as the sections there: a section for the problem (symptom as the
58113
user saw it, cause down to the Wine function, the fix, how it was found -
59114
with the commands, so others and Wine developers can repeat it - what is
60-
still open, notes for upstream) and a dated entry in its "Result log".
115+
still open, notes for a Wine bug report, the validation level reached) and
116+
a dated entry in its "Result log".
61117
Reproducers and test programs go to `docs/wine-repro/<dll>-<topic>/` with a
62118
README. Also update `README.md` (status table) and `notes/` where they
63119
mention the topic.

‎README.md‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,9 @@ Inventor itself is not modified. The work is in three places:
326326
and built into this project's Wine by a public GitHub workflow
327327
(`scripts/build-wine.sh`); the result is installed in your home folder, next
328328
to - not over - the system's Wine.
329-
They are meant to go to Wine upstream.
329+
They were written with AI help, so they are not sent to Wine itself (Wine
330+
does not accept AI-generated code); Wine gets bug reports with test cases
331+
instead. New patches come with a test that is checked on real Windows.
330332
- **Installation** (`scripts/install-from-image.py`, `scripts/lib/odis.py`):
331333
reads Autodesk's install image and runs its packages in the right order
332334
under Wine, in place of Autodesk's Windows installer front end.
@@ -411,10 +413,10 @@ of AI (Claude, by Anthropic) and tested by people on real machines.
411413

412414
## License
413415

414-
[MIT](LICENSE), like the original project. The top-level Wine patches in
415-
`patches/` are offered under Wine's license (LGPL 2.1 or later) when sent
416-
upstream. See [the patch layout](patches/README.md) for patches targeting other
417-
components and optional runtimes.
416+
[MIT](LICENSE), like the original project - except the Wine patches in
417+
`patches/`: they change Wine's code and are therefore under Wine's license,
418+
the LGPL 2.1 or later. The Wine this project builds and publishes is LGPL 2.1
419+
or later too. See [the patch layout](patches/README.md).
418420

419421
Autodesk Inventor and Microsoft WebView2 remain proprietary. The Nix packages
420422
and installer sources are marked unfree; this repository's license does not

‎docs/arch-hyprland.md‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ selection, and Wine's `IFolderView2::GetSelection`/`GetSelectedItem`/
410410
`SVGIO_SELECTION`. `patches/shell32-folderview-selection.patch` implements them;
411411
`build-wine-dll.sh shell32 --install` applies it together with the GetImage
412412
patch. Confirmed: click fills the name, double-click opens files and folders.
413-
(Upstream still needs tests for it.)
413+
(Still needs a Wine test checked on Windows - level L1 in `AGENTS.md`.)
414414

415415
### Open: big icons in the New dialog
416416

@@ -555,8 +555,8 @@ a visible window moved. `patches/server-mousemove-on-show-hide.patch`
555555
(wineserver, `build-wine-dll.sh server --install`, close all Wine programs
556556
first) sends one 100 ms after a window is shown/hidden, one per burst
557557
(`WINE_SHOWHIDE_MOUSEMOVE_MS`, 0 = off). Sent at once it came too early.
558-
Confirmed working. The delay is empirical - before proposing it upstream,
559-
measure when Windows delivers that mouse move.
558+
Confirmed working. The delay is empirical - for level L1 (and a Wine bug
559+
report), measure when Windows delivers that mouse move.
560560

561561
## Sketch: black rectangles around the sketch input boxes (fixed)
562562

@@ -815,14 +815,16 @@ again, note the exact steps and take a `+win,+msg` trace.
815815
- The fuzzer runs keep the substorages closed around a root `Revert` because
816816
of that.
817817

818-
### For upstream Wine
818+
### For a Wine bug report
819819

820-
The two patches are independent and apply in either order. The lock patch is
821-
large only because of the wrappers (generated, one per vtable method); the
822-
logic is "enter `storage_cs` / call the original method / leave". Before
823-
sending it, consider a per-file lock and check with a Windows test whether
824-
native ole32 really serialises (the `test_threads` test should pass on
825-
Windows - `rkernel.exe` suggests it does).
820+
The patches are not sent to Wine (AI-generated, see `patches/README.md`); the
821+
bugs are reported in words with the public tests. The two patches are
822+
independent and apply in either order. The lock patch is large only because of
823+
the wrappers (generated, one per vtable method); the logic is "enter
824+
`storage_cs` / call the original method / leave". Still to check (level L1 in
825+
`AGENTS.md`): whether native ole32 really serialises - the `test_threads` test
826+
should pass on Windows 10 (`rkernel.exe` suggests it does) - and whether a
827+
per-file lock would be closer to Windows.
826828

827829
## GPU ray tracing (Inventor 2027, not working yet)
828830

‎patches/README.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@
44
Wine build discover these automatically.
55
- `libgsf/` contains the empty OLE stream fix used by the flake's libgsf overlay.
66
- `debug/` contains optional diagnostic patches, excluded from normal builds.
7+
- `drafts/` contains unfinished patches that are not applied.
78

89
Keep patches for other projects and optional runtime variants in subdirectories
910
so Wine's automatic top-level patch discovery cannot apply them accidentally.
11+
12+
## License
13+
14+
The patches change LGPL-licensed code, so they are licensed like that code:
15+
the Wine patches under the GNU Lesser General Public License 2.1 or later
16+
(Wine's `COPYING.LIB`), the libgsf patch under libgsf's license (also
17+
LGPL 2.1 or later). The MIT license of the rest of this repository does not
18+
apply to them.
19+
20+
## Origin
21+
22+
The patches were written with AI help (Claude by Anthropic) and tested by
23+
people on real machines; patches from other contributors say which tool they
24+
used. `wbemprox-timezone.patch` comes from the original project
25+
([cakelesscoder/inventor-on-linux](https://github.com/cakelesscoder/inventor-on-linux)).
26+
No Microsoft code, disassembly or debug symbols were used.
27+
28+
Because Wine does not accept AI-generated code, these patches are **not** sent
29+
to Wine. Problems they fix are reported to Wine as bug reports (what the
30+
application calls, what Wine returns, what Windows returns, a public test).
31+
32+
How a patch is validated (tests on real Windows, levels L0-L5) is described in
33+
`AGENTS.md`.

‎patches/drafts/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ It did **not** make GPU ray tracing available (see the README and
1717
docs/arch-hyprland.md) - so it is a cosmetic/diagnostic fix.
1818

1919
State: applies to Wine 11.20 and current upstream; not built or tested as a
20-
Wine build yet. For upstream it needs a test (dlls/win32u or the
21-
display-device tests) and a check what real Windows drivers write for each
20+
Wine build yet. Before it can move to `patches/` it needs a test (dlls/win32u
21+
or the display-device tests) and a check what real Windows drivers write for each
2222
vendor (the names above come from AMD/NVIDIA/Intel driver INF files and a
2323
Windows install).

0 commit comments

Comments
 (0)