
    Jj3                        d Z ddlmZ ddlZddlmZ ddlmZ  ee      j                         j                  d   Zedz  ZddZdd	dd
ZddZddZedk(  r e e             y)zPSummarize non-palette motion producer evidence for map tiles and battle effects.    )annotationsN)Path)Any   outc                    t         | z  }	 t        j                  |j                  d            }t        |t              r|S i S # t        $ r i cY S w xY w)Nutf-8encoding)OUTjsonloads	read_textFileNotFoundError
isinstancedict)namepathdatas      1tools/build_non_palette_motion_producer_review.py	read_jsonr      sU    :Dzz$..'.:; dD)41r1  	s   %A AAdefaultc               j    | }|D ]'  }t        |t              s|c S |j                  |      }) ||S |S )N)r   r   get)r   r   keysnodekeys        r   pickr      sC    D $%Nxx} l7,,    c                    t        d      } t        d      }t        d      }t        d      }t        d      }t        d      }t        d      }t        d      }t        d	      }t        d
      }	t        d      }
t        d      }t        d      }dd| j                  d      t        | dd      ddddd|j                  d      t        |dd      ddddd|j                  d      t        |dd      ddddd|j                  d      t        |dd      ddddd|j                  d      t        |dd      d d!dd"d|j                  d      t        |dd      d d#dd$d|j                  d      t        |dd      d%d&dd'd	|j                  d      t        |dd      d d(dg}d)d
|	j                  d      t        |	dd*d+,       d-t        |	dd.d+,       d/d0d1dd2d|
j                  d      t        |
dd3d+,       d4t        |
dd5d+,       d6d7d8dd9d|j                  d      t        |dd:d+,       d;t        |dd<       d=d>d?dd@d|j                  d      t        |ddAd+,       dBt        |ddCg ,       d=dDdEdg}t        |ddFd+,      t        |ddGd+,      t        |ddHd+,      t        |ddId+,      t        |ddJdK,      t        |ddLd+,      t        |ddMd+,      t        |ddNdK,      dO}t        |	dd*d+,      t        |	dd.d+,      t        |
dd3d+,      t        |
ddPd+,      t        |
dd5d+,      t        |ddQd+,      t        |dd<      dR}dSdTg dUdVdW||dXdY||dZd[d\d]d^d_d`d]dadbdcd]gg dddeS )fNzpalette_pipeline_review.jsonz,map_animation_execution_boundary_review.jsonz,map_animation_live_buffer_writer_review.jsonz1map_animation_frame_script_tile_write_review.jsonz9map_animation_active_object_script_tile_write_review.jsonz4map_animation_non_object_tile_write_root_review.jsonz-map_animation_draw_tile_transform_review.jsonz$map_animation_tick_route_review.jsonz3map_animation_specialized_loop_boundary_review.jsonz)battle_helper_position_motion_review.jsonz+battle_effect_animation_pattern_review.jsonz*battle_effect_visual_assertion_review.jsonz'battle_motion_boundary_loop_review.jsonzpalette ramp/copystatussummarycoreConclusionzpromoted-color-onlyuT   색상/fade/ramp 근거이며 타일 위치/source-index motion 근거는 아니다.)areasourcer"   finding	promotionboundaryz!live layer0/layer1 buffer writersdecisionzhandlers-grounded-root-unbounduk   opcode 0x58/0x6b/0x76 live tile writer는 확인됐지만 animated map root/tick와 연결되지 않았다.zdraw-time tile transformznegative-for-visible-motionu`   현재 draw path는 live layer0 tile id를 고정 grid 공식으로 source rect에 매핑한다.zfield tick routez%tick-route-grounded-producer-indirectuT   per-frame route는 확인됐지만 직접 live map buffer를 mutate하지 않는다.z"strict active-object +0xec scriptsnegativeuV   strict object script command boundary에서는 live tile write가 나오지 않는다.z,runtime-installed object +0x64 frame scriptsua   opcode 0x20 attach target과 0x18 state-table entry 모두 command-boundary tile write가 없다.z#non-object aligned tile-write rootszroots-exist-no-animated-bindinguz   aligned tile-write commands는 있지만 animated map/root + animated coordinate/tile을 동시에 만족하지 않는다.zspecialized loop scanuj   tick/redraw/draw 주변 direct callee에서도 별도 live-buffer/tile-shift producer를 찾지 못했다.zhelper position/motion fieldshelpersWithPositionOrMotionr   r   z  helpers carry position/motion; helpersWithMotionStepz carry motion step.z promoted-helper-motion-semanticsut   전투 helper/object motion은 팔레트가 아니라 object position/motion field 기반으로 해석 가능하다.zeffect pattern joinskillsWithHelpersz skill rows have helpers; skillsWithExecutionRequirementsz% rows require spawn/motion execution.zjoined-by-skillua   스킬별 helper/effect frame 결합은 됐지만 원작 픽셀 오라클은 별도 검증이다.zvisual execution assertions!requirementRowsWithColoredPreviewz@ requirement rows have colored previews; pixel oracle status is pixelOracleStatus.z'web-runner-asserted-not-original-oracleug   웹 runner 표현은 검증됐지만 원작 런타임 캡처와 동일하다고 주장하지 않는다.zmotion boundary loopsmotionBoundaryRowsz boundary rows, helpers helperszpromoted-loop-semanticsuR   일부 화면 경계/loop형 motion은 정적 분석으로 의미가 확정됐다.animatedMapCountanimatedCellCount&liveBufferCandidateVmTileWriteRefCount"liveBufferAnimatedRootBindingCount!frameScriptTileWriteProducerFoundF-nonObjectPromotedAnimatedProducerCommandCount#specializedLoopStrongCandidateCount#drawTimeVisibleMotionTransformFound)r5   r6   r7   r8   r9   r:   r;   r<   skillsWithEffectFramesmotionModelClassifiedRows)r,   r-   r.   r=   r/   r>   r1   z)hwanse-non-palette-motion-producer-reviewz7battle-motion-grounded-map-tile-motion-producer-unbound)z out/palette_pipeline_review.jsonz0out/map_animation_execution_boundary_review.jsonz0out/map_animation_live_buffer_writer_review.jsonz5out/map_animation_frame_script_tile_write_review.jsonz8out/map_animation_non_object_tile_write_root_review.jsonz-out/battle_helper_position_motion_review.jsonz/out/battle_effect_animation_pattern_review.jsonz.out/battle_effect_visual_assertion_review.jsonzMap-side non-palette visible tile motion is still unbound: live tile writer handlers exist, but no static path currently ties them to animated map roots/cells or the field tick route.zBattle-side non-palette effect motion is substantially grounded through helper position/motion fields, spawn streams, and visual runner assertions, with the explicit boundary that it is not yet an original runtime pixel oracle.zFor map motion, inspect the animated-map load/update dispatcher or any caller that materializes opcode 0x58/0x6b/0x76 streams after resource load; do not continue from palette handlers or strict object frame scripts unless new refs appear.)mapConclusionbattleConclusion
mapSummarybattleSummaryrecommendedNextStaticStepzfield map palette effectszpromote as color/ramp onlyzjpalette buffer/copy/SetEntries path is grounded, but it cannot by itself move waterfall/fire source tiles.)r%   r*   reasonzfield map visible tile motionzkeep unpromotedzfno static producer writes animated-map live layer0 source ids under a proven per-map/per-tick binding.zbattle effect helper motionzpromote for runner usezhelper position/motion opcode fields and spawn/motion execution requirements are joined by skill and checked by visual assertions.)zwSearch upstream materializers for tile-write command streams instead of re-scanning decoded +0xec/+0x64 object scripts.zdSeparate map tile source-index motion from palette-only effects in every future map animation claim.zIf static search remains saturated, use a narrow runtime watchpoint on 0x00595af0 live layer0 entries for map1_01a/map1_02b animated cells.zFor battle effects, future work should target original-runtime pixel/oracle comparison rather than reclassifying already joined helper motion rows.)kindr"   r&   r#   mapSurfacesbattleSurfacespromotionDecisionsnextFrontier)r   r   r   )palettemap_boundarylive_bufferframe_scriptactive_script
non_objectdraw_transform
tick_routespecialized_loophelper_motioneffect_patternvisual_assertionmotion_boundarymap_surfacesbattle_surfacesmap_summarybattle_summarys                    r   build_reportr[       s   67GKLLJKKPQLYZMQRJNONABJ !VWIJMLMN !MN IJO (4kk(+GY0@A.n	
 8D!ooh/KJ?9 F	
 /E$((2NIzB6z	
 '< nnX.J	:>@n	
 9Q#''1M9jA#p	
 CI"&&x0L)Z@#{	
 :L nnX.J	:>: U	
 ,K&**84,iD# E	
sALJ 4A#''1y2OYZ[\\|y2ISTUVVik < O
	
 *C$((2	3FPQRSSm	3T^_`a  bGH +{
	
 2B&**84()5Xbcde f**./?L_*`)aabd C B
	
 ,?%))(34HRSTU VIrRSSTV 3l
	
E-O` !y:LVWX!,	;NXYZ26|YPx  CD  3E.2<Lpz{.|-1,	Knx}-~9=lI  XG  QR  :S/3L)Mr|}/~/3L)Mr  }B  0C	K (,M9Fcmn'o!%mY@Wab!c!.)=PZ[\"&~yBZde"f+/	Klvw+x%)*:IGblm%n!"2I?RSN <K	
nO &+D
  $) 48 G 8- C 64 _
"
a6 6r    c                     t               } t        j                  d       t        dz  j                  t	        j
                  | dd      dz   d	       y
)NT)exist_okz'non_palette_motion_producer_review.jsonF   )ensure_asciiindent
r	   r
   r   )r[   r   mkdir
write_textr   dumps)reports    r   mainrf      sN    ^FIItI44@@

6a84? A  r    __main__)r   strreturndict[str, Any])r   rj   r   rh   r   r   ri   r   )ri   rj   )ri   int)__doc__
__future__r   r   pathlibr   typingr   __file__resolveparentsROOTr   r   r   r[   rf   __name__
SystemExit r    r   <module>rw      ss    V "    H~''*
Ul2 ;? -K\ z
TV
 r    