Skip to content

[S3] upstream 동기 — 컷 822504b (오류 분류 축, 충돌 11) - #16

Merged
Jun025 merged 15 commits into
mainfrom
feat/rustjava-upstream-sync-s3
Aug 26, 2026
Merged

[S3] upstream 동기 — 컷 822504b (오류 분류 축, 충돌 11)#16
Jun025 merged 15 commits into
mainfrom
feat/rustjava-upstream-sync-s3

Conversation

@Jun025

@Jun025 Jun025 commented Aug 26, 2026

Copy link
Copy Markdown
Owner

티켓 rustjava-upstream-sync-s3 · 정본 docs/upstream-sync-approach.md §5(한 티켓 = 한 컷).

base 가 main 이 아니라 feat/rustjava-upstream-sync-s2 다. S2(PR #13)가 아직 열려 있어
main 을 base 로 잡으면 S2 의 충돌 5건을 다시 만난다. #13 이 착지하면 이 PR 은 자동으로 main 으로 리타깃된다.

무엇을

upstream 822504b(dlunch#180 Harden JVM runtime correctness) 1커밋 머지 · 충돌 11 해소.

파일 처분
classfile/src/{class,constant_pool,error,lib}.rs · jvm_rust/class_definition.rs · src/runtime.rs · test_utils/src/lib.rs upstream 채택 우리 ParseError(Java 예외 1종) → upstream ClassFileError+ClassDefinitionError(4종: ClassFormatError·UnsupportedClassVersionError·VerifyError·UnsupportedOperationException). 계획서 §3-B 판정 그대로
java/lang/string.rs 양쪽 병합 upstream 골격 + 우리 charset::Charset 라우팅. upstream 의 decode_str/encode_str 중복 표 삭제
tests/.../test_string.rs 합집합 양쪽이 같은 자리에 다른 테스트를 넣었다
java/lang/thread.rs 양쪽 병합 upstream 재작성 본문 + PR #4 의 수동 span. #[tracing::instrument] 재유입 0
AGENTS.md 합집합 우리 「Round Worklog」 절 ↔ upstream 「Testing Boundaries」 절

★계획서 §4-A 가 예고한 «충돌 0 파손»이 실제로 났다

tests/test_class_format.rs 는 우리 전용이라 충돌 마커가 한 줄도 안 뜨는데, upstream 이 원인별
문구를 "Invalid class file" 로 평탄화해 3건이 깨진다. ⇒ 문구 단정만 삭제("Truncated"·"tag 18"·"magic"),
ClassFormatError 종류 단정은 유지. 4/4 통과.

검증 (CI rust.yml 4종 · 전건 로컬 rc=0)

  • cargo fmt --all -- --check · cargo clippy --all -- -D warnings
  • cargo clippy --workspace --exclude test_utils --target wasm32-unknown-unknown -- -D warnings
  • cargo test --all216 passed / 0 failed / 1 ignored (S1 169 → S2 191 → S3 216)
  • tests/test_class_format.rs 4/4 · git grep 'tracing::instrument\|tracing-attributes' 0건
  • 우리 고유 줄 생존 대조: base af4f6f8 이후 우리가 추가한 .rs 321줄 중 부재 81줄, 전건 의도한 해소

★충돌은 계획서 예측(+9)보다 2건 많았다

AGENTS.md — 계획서 작성 이후 PR #15 가 만든 파일이라 표에 있을 수 없었다.
⑵★thread.rsS1 이 이미 닫은 파일이 다시 충돌했다(822504b 가 같은 함수를 재작성).
⇒ 「새 충돌 = 그 컷에서 «처음» 충돌하는 파일 수」라는 계획서 정의는 한 번 닫히면 다시 안 열린다
암묵 전제하는데, 그 전제가 깨졌다. 예측은 하한으로 읽어라.

조상

git merge-base HEAD upstream/main = af4f6f8 ⇒ S2 가 했던 -s ours 복원은 불필요했고 하지 않았다.
★단 #13 이 스쿼시로 착지하면 다시 끊긴다 — 이 PR 이 main 으로 리타깃된 뒤 merge-base 를 다시 재라.

머지 0 · force-push 0 · 리베이스 0 · upstream 발신 0.

dependabot Bot and others added 13 commits July 13, 2026 19:56
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.25.0 to 1.25.1.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](Lokathor/bytemuck@v1.25.0...v1.25.1)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-version: 1.25.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Replace runtime panics with the matching Java exceptions

An unwrap audit found panics reachable from ordinary Java code:

- File.length() returns 0 for a missing file; isDirectory/isFile lose
  their guard-then-unwrap shape
- FileImpl (native runtime) maps open/read/write/seek failures to
  IOError instead of panicking, so FileInputStream and RandomAccessFile
  guards actually produce FileNotFoundException; FileOutputStream gains
  the same guard
- File I/O operations (read/write/seek/available/length/setLength)
  throw java.io.IOException on failure via a shared helper
- Class.forName resolves the class and throws ClassNotFoundException
  (new runtime class) instead of panicking on any not-yet-loaded name
- StringBuffer.append(char)/append(char[]) keep exact UTF-16 units so
  unpaired surrogates no longer panic and pairs built char by char
  survive; String.valueOf(char) builds through [C for the same reason
- PrintStream.println(char) replaces an unpaired surrogate with '?'
  like the JDK charset encoder
- ZipFile validates the archive in its constructor and throws
  java.util.zip.ZipException (new runtime class) for a malformed
  archive; getInputStream returns null for a missing entry

Expected outputs for the new fixtures are generated by a real JVM.
Remaining unwraps are invariants (interpreter stack discipline, thread
attach), guarded lookups, or documented gaps (lenient calendar
normalization, ClassFormatError plumbing).

* Inline the IOException conversion at each I/O call site
Every attached thread now owns its java/lang/Thread instance: attach
takes the instance for threads started via Thread.start (so
currentThread() inside run() is the started Thread object) and creates
one otherwise (bootstrap, external attachers). currentThread() returns
the stored instance, and the GC roots it per thread.

Also parse unrecognized classfile attributes as an opaque Unknown
variant instead of failing — JVMS 4.7.1 requires silently ignoring
them, and the anonymous-class fixture carries EnclosingMethod and
Signature attributes the parser rejected.

Expected output for the fixture is generated by a real JVM.
* Add Java primitive wrapper classes

* Use Character digit semantics for numeric parsing
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.52.3 to 1.52.4.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](tokio-rs/tokio@tokio-1.52.3...tokio-1.52.4)

---
updated-dependencies:
- dependency-name: tokio
  dependency-version: 1.52.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Add CLDC 1.1 core API compatibility

* Fix CI lint and improve CLDC coverage

* Fix array assignability and reader progress
* Harden JVM runtime correctness

* Address classfile review findings

* Move class initialization tests to Java fixture

* Separate classfile validation from JVM verification

* Remove ClassFileError re-export
PR #11 was squash-merged, so upstream ancestry was lost: origin/main
carries 1f356ae's content byte-for-byte (git diff 0bd4f80 origin/main
-- '*.rs' '*.toml' '*.lock' is empty) but git still resolved the merge
base to 62cf0c6, replaying all six upstream commits and re-conflicting
15 files instead of the predicted 5.

This -s ours merge changes no tree bytes; it only records the parent so
that S2..S7 merge against 1f356ae as base.
… API, PR dlunch#177)

Conflicts (5, exactly as S1 predicted):
- java/io.rs, java/io/unsupported_encoding_exception.rs, loader.rs:
  upstream side is a superset; took it, then restored our
  ClassFormatError registration that --theirs had dropped from loader.rs.
- java/io/input_stream_reader.rs: kept our Charset abstraction (4 charsets
  vs upstream's inline 2) and adopted upstream's decode_length/end_of_input
  multibyte-boundary handling on top of it.
- tests/.../test_input_stream_reader.rs: union of both sides' tests.

Also fixed a silent auto-merge duplicate: both sides added a byte-identical
Throwable::getMessage at different positions, so git merged both and the
build failed with E0592. Kept upstream's placement.

InputStreamReader's single-argument ctor stays lazy about the default
charset (JDK does not declare it to throw UnsupportedEncodingException);
only the (InputStream, String) ctor validates eagerly, as upstream added.

cargo fmt/clippy/clippy-wasm32/test all rc=0; 191 passed / 0 failed.
…m-sync-s3

# Conflicts:
#	REPORT.md
#	STATE.md
…ication, PR dlunch#180)

conflicts 11 resolved: classfile/{class,constant_pool,error,lib}.rs + jvm_rust/class_definition.rs
+ src/runtime.rs + test_utils/lib.rs -> upstream (ClassFileError/ClassDefinitionError, 4 Java
exception kinds vs our 1); java/lang/string.rs -> upstream structure routed through our
charset::Charset (default path falls back, explicit path throws, duplicate table dropped);
test_string.rs -> union of both test sets; thread.rs -> upstream body under PR #4's manual span;
AGENTS.md -> union.

tests/test_class_format.rs: message assertions relaxed, ClassFormatError kind assertions kept
(upstream flattens parse causes into "Invalid class file").
…flicts 11) + refresh STATE 「다음」

STATE.md ③-0 pointed at rustjava-pr8-claude-md-prune-disposition as top priority on the grounds
that its review.md was missing and gate 2 had stalled. Both are false now: PR #8 is MERGED
(2026-08-18T19:26:08Z -> 00bddf3) and the review reports exist. Item closed, list renumbered,
⑤ operating notes re-measured (open PRs 2 -> 1, dead branch row dropped).
@Jun025
Jun025 changed the base branch from feat/rustjava-upstream-sync-s2 to main August 26, 2026 21:51
@Jun025
Jun025 merged commit 4bb796d into main Aug 26, 2026
9 checks passed
@Jun025
Jun025 deleted the feat/rustjava-upstream-sync-s3 branch August 26, 2026 22:08
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