Commit Graph

21 Commits

Author SHA1 Message Date
gamer147
5a23f93152 docs(engine-ambient): explain why _components GetOrAdd factory is contention-safe
Reviewer noted the factory may be invoked more than once under contention.
Document the analysis inline so a future reader doesn't have to redo it:
the discarded instance's mutations land on private fields of a soon-unreachable
object, and the only shared sentinel (_noopViewMaterial) is read-only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-06-08 08:25:34 -04:00
gamer147
fbac66fd0b chore(engine-ambient): harden shim + LocalLog statics for fixture parallelism
Follow-up to the multi-instancing migration. Wraps the process-shared engine
statics that aren't ambient-fronted but race between concurrent battles:

- UnityEngine.Resources._loaded: Dictionary -> ConcurrentDictionary.GetOrAdd
  (the shared prefab cache keyed by path; concurrent first-misses produced
  duplicate GameObjects + Dictionary corruption)
- UnityEngine.GameObject._components: Dictionary -> ConcurrentDictionary with
  Interlocked.CompareExchange init (Resources.Load returns SHARED prefab
  GameObjects, so two engines' Setup() can race on the same _components map
  — surfaced as "Operations that change non-concurrent collections" crashes
  during BattleManagerBase ctor's GetComponent<T>() chain)
- Wizard.LocalLog: single static lock around all mutating entry points
  (StringBuilder _lastTraceLogStringBuilder + ~12 mutable string/bool/int
  scratch fields; serializing the trace-log surface is cheap since logging
  is not the hot path)

Flips SVSim.BattleEngine.Tests assembly Parallelizable scope from Self to
Fixtures and restructures MultiInstanceEngineTests.StressN_BaselineMatches so
Setup runs INSIDE Task.Run (was previously serialized as a workaround for the
LocalLog races). The fixture is also lifted to ParallelScope.All so the
two-engines and stress tests can run alongside each other.

Suite fully green under fixture parallelism (59/0/2 across 3 consecutive runs);
SVSim.UnitTests still 1054/0/0 — true multi-instance correctness is now proved
end-to-end in tests rather than gated behind a serial workaround.

Manifest sha refresh + new patch artifact for the LocalLog edit (decomp-origin);
the two shim files are authored, so no metadata update is needed for them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-06-08 08:02:49 -04:00
gamer147
62a28fe2d4 feat(battle-engine-port): M5 COMPLETE — summon_token spell resolves headless (board-count delta oracle)
Card 800134010 (clan-1 cost-1 ungated spell, summon_token=100011020): a when_play
summon places one new neutral 2/2 follower token on the caster board. New oracle
dimension = board-count + token-identity delta from a SKILL-CREATED card. 5/5 green;
engine 0 errors; check_drift clean; zero new Engine copies.

This is the first headless run of the PUBLIC prefab card-creation path
(CardCreatorBase.CreateCard, createNullView:false) — engine-internal card creation
(summon/draw/token) has no null-view path in solo mode, unlike the M2-M4 hand-card
seam. Built that path headless:
- Self-consistent no-op Unity object graph (UnityShim.cs): Component.gameObject/
  transform, GameObject.transform, Transform.parent/Find now lazily non-null +
  cached; GetComponent routed through the GameObject component model.
- Targeted NGUI material backing-field wiring (UIFont.mMat / UILabel.mMaterial) so
  the copied material getters return non-null via their simple branch (blanket/deep
  wiring would make them delegate down a re-nulling chain).
- getUIBase_CardManager() default! -> field-wired no-op via new ShimView.Create<T>().
- Test-side seeds: SBattleLoad card templates + 3D scene GameObjects (InitCardTemplates).

Load-bearing proof: swapping to the M3 non-summoning spell fails the board-count
(Expected 2, was 1) + token-not-found assertions; reverted to green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 03:19:47 -04:00
gamer147
2b506574e7 feat(battle-engine-port): M2 step 1 — SingleBattleMgr constructs headless
First green of the M2 go/no-go probe: `new SingleBattleMgr(StandardBattleMgr-
ContentsCreator)` now builds the two-player pair fully headless against the shim,
no Unity runtime. Verdict: headless construction is feasible; every blocker was a
mechanical no-op shim fill or data seam, not a Unity/logic wall.

Shim fills (authored):
- GameMgr: lazy non-null DataMgr/PrefabMgr/InputMgr/SoundMgr/BattleControl.
- GameObject: lazy cached component model so GetComponent<T>/AddComponent<T> return
  non-null no-op instances for Component-derived T (F1: unguarded view touches).
- Resources.Load(string): cached non-null GameObject so the prefab->Instantiate->
  GetComponent chain (UnityEventAgent) yields a real object.
- ClassBattleCardViewBase: re-attach dropped IClassBattleCardView (no-op members);
  ClassBattleCardBase.Setup casts the created view to it.

Engine copy (DP1/DP3 mis-cut fix):
- CardIconControl.cs copied verbatim (manifested) + generated null-stub deleted.
  SplitAndCompleteIconStr is pure string logic on the resolution path that M1 had
  wrongly stubbed as "View" -> null deref in SkillCreator.CreateBuildInfo.

Test harness (SVSim.BattleEngine.Tests, authored fixture):
- HeadlessContentsCreator/HeadlessPhaseCreator: deterministic replica of the solo
  practice init (StandardBattleMgrContentsCreator + SingleBattlePhaseCreator) with
  no-op recovery/replay managers.
- HeadlessCardMaster: reflects the loader cards.json dump into CardMaster.
- HeadlessMasterData: minimal Data.Master (class-character list, empty collections)
  + Data.Load + player/enemy chara ids.
- ConstructionProbeTests.SingleBattleMgr_constructs_headless — GREEN.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 01:36:22 -04:00
gamer147
f63d1cc2e2 port(m1): wave 7j — Material/Plane/Socket overloads + IDictionary extension (24->12)
- Material.SetVector(int nameID, Vector4); Plane(Vector3, float d) ctor; Socket.On
  (SocketIOEventTypes, callback) overload.
- Global GetValueOrDefault(this IDictionary<,>) extension — the BCL form only binds to
  IReadOnlyDictionary, so the IDictionary call mis-resolved to JsonDataExtension.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 01:00:12 -04:00
gamer147
59cb089c97 port(m1): wave 7h — Unity overloads + SDK return types + RoomRoot:UIBase (56->40)
- Resources.LoadAsync(string) non-generic, LayerMask implicit-from-int, Animation
  string indexer.
- SDK return-type fixes: RedShellSDK.MarkConversion/LogEvent return IEnumerator
  (StartCoroutine arg), Packsize.Test() returns bool (!Test()).
- RoomRoot : UIBase (decomp base) so TopBar/Footer's (RoomRoot) casts succeed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 00:54:47 -04:00
gamer147
3a88b27752 port(m1): wave 7g — Unity coroutine/overload + app-member tail (88->56)
- MonoBehaviour.StopCoroutine(string) (iTween/NGUI StopCoroutine("name")),
  Object.DestroyImmediate(o, bool), GetComponentInParent<T>(bool includeInactive).
- App members: TitlePanelBase (:MonoBehaviour + IsFinishInit), PlayerController.Target,
  DialogManager.CreateDialogBaseOpenCardDetail, BattleLogWindow.HideCardListPanel,
  DetailPanelTouchProcessor.StopAttackTarget, StoryRecoveryData.ChapterCharaId +
  (SelectedStoryInfo) ctor overload.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 00:52:18 -04:00
gamer147
981f903504 port(m1): wave 7e — Unity/NGUI/Spine member tail (142->112)
- isActiveAndEnabled onto Behaviour (real Unity location) — clears it on all 5
  MonoBehaviour-derived NGUI types (MyPageCardPanel/WizardUIButton/UITweenAlpha/
  UIScrollView/UICardList) in one edit.
- Touch.tapCount, Rigidbody2D.isKinematic, AnimatorStateInfo.fullPathHash,
  AnimationClip.frameRate.
- Spine: SkeletonData.Skins (List<Skin>) + Skin.Name, for SpineObject's
  Data.Skins.Any(s => s.Name == ...).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 00:44:04 -04:00
gamer147
8bb392dcd6 port(m1): wave 6h — CS0246 app types + Unity members/enums (236->210)
- Generated app types: ChapterCharaDecider, DownloadInfoGetter, DeckSelection(Confirm)DialogDisplay,
  SubChapterStorySectionBtn, EvolutionHideMessageVfx; nested OpeningShowCharacterPanelVfx on OpeningVfx.
- EffectMgr.MoveType: full 47-value decomp enum (was 4).
- MonoBehaviour.print, Debug.isDebugBuild, LayerMask.LayerToName,
  SystemLanguage.Chinese, RuntimePlatform.XBOX360/BlackBerryPlayer/+console values.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 00:15:46 -04:00
gamer147
e5e05deadb port(m1): wave 6f — Unity primitive operators (362->304)
CS0019 operator gaps on value-type shims:
- Vector2: ==/!=, Vector2*Vector2, Equals/GetHashCode.
- Vector4: *float, +/-, ==/!=, Equals/GetHashCode.
- Color: ==/!= (Color==Color32 via existing implicit conv), Equals/GetHashCode.
- Rect: ==/!=; Matrix4x4: *, GetColumn/GetRow/indexer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 00:08:11 -04:00
gamer147
8c9fe7a1b9 port(m1): wave 6e — Unity ctors + Unity/ZXing/SFB type stubs (444->362)
CS1729 Unity ctors: Plane(3pt), Texture2D(w,h,fmt,mip), Keyframe(4),
  AnimationCurve(params Keyframe[]), WebCamTexture(name,w,h,fps), UnityWebRequest(url,method).
CS0246 Unity: AnimationState, GUIContent, TextEditor, WebCamDevice, Display,
  WaitForSecondsRealtime, AnimationBlendMode + WebCamTexture.devices.
CS0246 SDK: SFB ExtensionFilter/StandaloneFileBrowser; ZXing BarcodeFormat/Result/
  BarcodeWriter/BarcodeReader/QrCodeEncodingOptions/ErrorCorrectionLevel.
NullBattleCardView parameterless ctor (CS7036).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 00:06:03 -04:00
gamer147
629ae6bf98 port(m1): wave 6d — Unity method/ctor overloads (572->444)
CS1501 overload gaps (Unity):
- Transform.TransformPoint/InverseTransformPoint(float,float,float); LookAt(.,worldUp) x2.
- Object.FindObjectsOfType(Type)/(bool); Instantiate<T>(.,pos,rot,parent).
- Component/GameObject.BroadcastMessage(string,object[,opts]).
- Animator.Play(string/int, layer[, normalizedTime]).
- Mathf.Min/Max(params float[]/int[]).
- MonoBehaviour.CancelInvoke(string).
CS1729: NullBattleCardView(BuildInfo) ctor.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 00:00:11 -04:00
gamer147
9376b35db2 port(m1): wave 6c — Unity + Steam/FB/Adjust static-class shims (696->572)
Off-battle-path static surfaces (CS0103 cluster):
- UnityStatics: Gizmos, Physics2D, Caching, GUIUtility, Cursor, ColorUtility,
  ScreenCapture, RenderSettings, JsonUtility, Social + CursorLockMode enum.
- RaycastHit2D implicit-bool operator; ILocalUser in SocialPlatforms.
- Steamworks: Callback<T>.Create, AppId_t/CSteamID/HAuthTicket/SteamNetworkingIdentity,
  MicroTxn/GetAuthSessionTicket response structs, SteamAPI/User/Utils/Client statics.
  Removed empty dup GetAuthSessionTicketResponse_t from ThirdParty.cs.
- Facebook.Unity: FB + ILoginResult + FacebookDelegate<T>; com.adjust.sdk.Adjust;
  global TimeNativePlugin/Packsize native-plugin stubs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 23:56:52 -04:00
gamer147
7e5ff0a58f feat(battle-engine): ParticleSystem/Collider2D/Quaternion + SocketOptions members (1462->1386)
ParticleSystem.MainModule (playOnAwake/simulationSpeed/startColor + MinMaxGradient),
ParticleSystemRenderer (maskInteraction/trailMaterial + SpriteMaskInteraction), BoxCollider2D
(isTrigger/offset/size), Quaternion.FromToRotation/Inverse. SocketOptions (AutoConnect/
ConnectWith/AdditionalQueryParams) + PlatformSupport ObservableDictionary.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 22:43:39 -04:00
gamer147
d01e3da869 feat(battle-engine): UnityEngine member + static-class shims (3526->2706)
Extend the UnityEngine value/component shims with no-op members surfaced by the compile
loop (UnityWebRequest/Font/Mesh/LODGroup/AudioSource/Rigidbody/Camera/Sprite/Animation/
Transform/Material/Texture2D/Light/Input/Resources + CharacterInfo/Vector4), via partial
declarations + UnityShimExt.cs. Add the missing UnityEngine static classes (PlayerPrefs/
Physics/GUI/SystemInfo/Graphics/QualitySettings/StackTraceUtility) + enums (TextureFormat/
ColorSpace/EventModifiers/RenderTextureReadWrite) + Experimental.Rendering.GraphicsFormat*
in UnityStatics.cs. All cosmetic, off the battle path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 22:14:23 -04:00
gamer147
a28e3ba334 feat(battle-engine): Unity shim members — BoxCollider/RenderTexture/AnimationCurve/Animator (4572->4254)
Add no-op members + supporting types (FilterMode/TextureWrapMode/WrapMode/Keyframe/
AnimatorStateInfo/AnimatorClipInfo) to the UnityEngine shim. Standard Unity API surface,
inferred from frontier member names — Unity types aren't in the decomp so they're
hand-extended, not generated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 21:40:37 -04:00
gamer147
3dcd53933a feat(battle-engine): AOT/SFB/Steam/DisallowMultiple + FriendDataBase.SetPlayerData
Clears the last type+header frontier (RoomInviteFriendColum override). Per F3 this
unmasks the remaining View/UI/god-object member bodies (~8k) -- the next grind is
pure member-surface growth, closure (~3242 files) now essentially complete.
2026-06-05 20:40:33 -04:00
gamer147
0455ff649e feat(battle-engine): EffectType full enum + collection/card/vfx extension copies
Replaces partial EffectMgr.EffectType with all 226 decomp values; copies the
IsNotNullOrEmpty/EquelsID/FindFromCardId/GetAllFuncVfxResults extension files +
UI extensions; adds Renderer/MeshFilter shared-material/mesh/sortingOrder. Compile
loop then closed the revealed deps (3242 files). 9.1k -> 18 errors.
2026-06-05 20:38:56 -04:00
gamer147
c3bd39f2cb feat(battle-engine): final type-frontier residual (Story/Title/Friend stubs, SDK anchors, Unity AndroidJavaObject/WebCamTexture)
Clears the last CS0246/CS0234 type frontier; per F3 this unmasks the AI-subsystem
member bodies (~9k member-level errors) -- next grind is extension copies + god-object
member growth.
2026-06-05 20:34:49 -04:00
gamer147
4491c6c7f3 feat(battle-engine): full Unity primitive/runtime surface + game extension copies
Grows Vector2/3, Mathf, Color, Quaternion, GameObject, Transform, Camera, Material,
ParticleSystem, Rect, Bounds, Time to the surface the engine references; adds Input/
Random/Resources statics + full KeyCode enum. Copies the verbatim extension files that
collapse thousands of CS1061s at once (ContentKeywordExt, JsonData/LitJson extensions,
EventExtension.Call, GameObjectExtension(s)). 26.5k -> 15.9k errors; residual now
dominated by god-object member surface (GameMgr/UIManager/EffectMgr/Vfx*).
2026-06-05 20:22:43 -04:00
gamer147
957af3d1ec feat(battle-engine): full Unity/VFX/god-object shims + expanded copy closure (2570 files)
Authored Unity primitive/object-model shim, VFX layer (control-flow-preserving, InstantVfx never invokes its action -- headless suppression), god-object stubs (GameMgr/EffectMgr/UIManager with faithfully-extracted nested enums), View/UI/Touch tree, LitJson+BetterList+Tuple copied, third-party stubs. Discovered Roslyn header-error masking: fixing class-header type errors unmasks body references, so the true copy closure is ~2570 files (was 782 under masking). Errors: masked-25720 -> 268; our shim files compile clean. Remaining: ~50 residual shim/external types, 24 NGUI UI-base overrides, static-type fixes, plus likely 1-2 more unmask waves.
2026-06-05 17:22:20 -04:00