upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorVonsek <45567075+Vonsek@users.noreply.github.com>2026-11-22 19:08:54 +0100
committerVonsek <45567075+Vonsek@users.noreply.github.com>2026-11-22 19:08:54 +0100
commit3af42c619253941610d9809e8a28a07e8dfdfdf2 (patch)
treea675793195f8bc69c3caebb0e9614ecfb65e1c4c /runtime
parente6af0a0931639ff33cdd4a28289da984f194c87e (diff)
parentec8ec4c9a46c6623f1a9c125afd3566da97f1e0c (diff)
merge: preserve upstream changes alongside the asset fix
Diffstat (limited to 'runtime')
-rw-r--r--runtime/CMakeLists.txt75
-rw-r--r--runtime/shims/d3d12_com.cpp177
-rw-r--r--runtime/shims/d3d12_com.h30
-rw-r--r--runtime/shims/d3d12_vulkan_device.cpp790
-rw-r--r--runtime/shims/file_system.cpp513
-rw-r--r--runtime/shims/file_system.h3
-rw-r--r--runtime/shims/gameinput.cpp129
-rw-r--r--runtime/shims/gameinput.h1
-rw-r--r--runtime/shims/library_loader.cpp13
-rw-r--r--runtime/shims/process.cpp31
-rw-r--r--runtime/shims/registry.cpp4
-rw-r--r--runtime/shims/shims.h4
-rw-r--r--runtime/shims/xgameruntime.cpp120
-rw-r--r--runtime/shims/xmem.cpp98
-rw-r--r--runtime/src/cached_pso.h110
-rw-r--r--runtime/src/command_list.h19
-rw-r--r--runtime/src/frame_pacer.h13
-rw-r--r--runtime/src/gfx10_descriptors.h23
-rw-r--r--runtime/src/pe_loader.cpp308
-rw-r--r--runtime/src/pe_loader.h12
-rw-r--r--runtime/src/vulkan_backend.h10
-rw-r--r--runtime/src/vulkan_bindless.h8
-rw-r--r--runtime/src/vulkan_present.h5
-rw-r--r--runtime/src/vulkan_replay.h93
-rw-r--r--runtime/src/xdxr_build.comp11
-rw-r--r--runtime/src/xdxr_build.inc7884
-rw-r--r--runtime/test/bindless_sizing_test.cpp16
-rw-r--r--runtime/test/command_list_test.cpp18
-rw-r--r--runtime/test/d3d12_bundle_test.cpp840
-rw-r--r--runtime/test/d3d12_com_test.cpp15
-rw-r--r--runtime/test/d3d12_compute_test.cpp158
-rw-r--r--runtime/test/d3d12_descriptor_test.cpp360
-rw-r--r--runtime/test/d3d12_draw_test.cpp34
-rw-r--r--runtime/test/d3d12_first_light_test.cpp395
-rw-r--r--runtime/test/d3d12_shader_cache_test.cpp322
-rw-r--r--runtime/test/d3d12_texture1d_test.cpp272
-rw-r--r--runtime/test/d3d12_typeless_families_test.cpp416
-rw-r--r--runtime/test/d3d12_uav_clear_test.cpp42
-rw-r--r--runtime/test/d3d12_vulkan_device_test.cpp201
-rw-r--r--runtime/test/d3d12_xdxr_rt_test.cpp2
-rw-r--r--runtime/test/file_system_test.cpp323
-rw-r--r--runtime/test/fixtures/tiny_bundled_load.cpp9
-rw-r--r--runtime/test/fixtures/tiny_gdk_load.cpp26
-rw-r--r--runtime/test/fixtures/tiny_tls_cb_only.cpp42
-rw-r--r--runtime/test/frame_pacer_test.cpp25
-rw-r--r--runtime/test/gameinput_test.cpp56
-rw-r--r--runtime/test/gfx10_descriptors_test.cpp49
-rw-r--r--runtime/test/glsl/ps_typeless_float.frag8
-rw-r--r--runtime/test/glsl/ps_typeless_uint.frag9
-rw-r--r--runtime/test/loader_tls_test.cpp149
-rw-r--r--runtime/test/process_cmdline_test.cpp61
-rw-r--r--runtime/test/replay_uav_clear_offset_test.cpp165
-rw-r--r--runtime/test/shaders/build.py18
-rw-r--r--runtime/test/shaders/check.py80
-rw-r--r--runtime/test/shaders/cs_buf_swizzle.asm19
-rw-r--r--runtime/test/shaders/cs_fmt_int_narrow.asm126
-rw-r--r--runtime/test/shaders/cs_fmt_sint32.asm6
-rw-r--r--runtime/test/shaders/cs_mask_vgpr_exec.asm15
-rw-r--r--runtime/test/shaders/cs_signed_zero_nan.asm63
-rw-r--r--runtime/test/shaders/gs_w64_a_ring.asm40
-rw-r--r--runtime/test/shaders/gs_w64_c_lane_id.asm36
-rw-r--r--runtime/test/shaders/ps_sdwa_f16_const.asm32
-rw-r--r--runtime/test/shaders/ps_w64_a_bpermute.asm44
-rw-r--r--runtime/test/shaders/ps_w64_a_permlane.asm42
-rw-r--r--runtime/test/shaders/ps_w64_a_swizzle.asm35
-rw-r--r--runtime/test/shaders/w64_graphics.py76
-rw-r--r--runtime/test/typeless_rtv_test.cpp6
-rw-r--r--runtime/test/vk_bindless_test.cpp5
-rw-r--r--runtime/test/vk_harness.cpp5
-rw-r--r--runtime/test/vk_pipeline_check.cpp149
-rw-r--r--runtime/test/vk_presenter_sync_test.cpp22
-rw-r--r--runtime/test/xgameruntime_test.cpp60
72 files changed, 11018 insertions, 4358 deletions
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
index d9dad1919..7104d50cd 100644
--- a/runtime/CMakeLists.txt
+++ b/runtime/CMakeLists.txt
@@ -471,6 +471,18 @@ if(BUILD_TESTING)
471 ARCHIVE_OUTPUT_DIRECTORY "${TINY_FIXTURE_DIR}" 471 ARCHIVE_OUTPUT_DIRECTORY "${TINY_FIXTURE_DIR}"
472 ) 472 )
473 473
474 add_library(tiny_tls_cb_only SHARED test/fixtures/tiny_tls_cb_only.cpp)
475 target_compile_definitions(tiny_tls_cb_only PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
476 target_compile_options(tiny_tls_cb_only PRIVATE /W4 /permissive- /utf-8 /GS-)
477 target_link_options(tiny_tls_cb_only PRIVATE /NODEFAULTLIB /ENTRY:DllMainCRTStartup)
478 target_link_libraries(tiny_tls_cb_only PRIVATE kernel32)
479 set_target_properties(tiny_tls_cb_only PROPERTIES
480 OUTPUT_NAME tiny_tls_cb_only
481 PREFIX ""
482 RUNTIME_OUTPUT_DIRECTORY "${TINY_FIXTURE_DIR}"
483 ARCHIVE_OUTPUT_DIRECTORY "${TINY_FIXTURE_DIR}"
484 )
485
474 # pe_loader.cpp needs the shim registry for shims::find/make_unimplemented_thunk. The fixtures import only host 486 # pe_loader.cpp needs the shim registry for shims::find/make_unimplemented_thunk. The fixtures import only host
475 # DLLs, so no shim tables are linked. 487 # DLLs, so no shim tables are linked.
476 add_executable(loader_tls_test 488 add_executable(loader_tls_test
@@ -483,7 +495,7 @@ if(BUILD_TESTING)
483 ) 495 )
484 target_compile_definitions(loader_tls_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX) 496 target_compile_definitions(loader_tls_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
485 target_compile_options(loader_tls_test PRIVATE /W4 /permissive- /utf-8 /EHsc) 497 target_compile_options(loader_tls_test PRIVATE /W4 /permissive- /utf-8 /EHsc)
486 add_dependencies(loader_tls_test tiny_tls gta6rt_tls_host) 498 add_dependencies(loader_tls_test tiny_tls tiny_tls_cb_only gta6rt_tls_host)
487 add_test(NAME loader_tls 499 add_test(NAME loader_tls
488 COMMAND loader_tls_test "$<TARGET_FILE:tiny_tls>" 500 COMMAND loader_tls_test "$<TARGET_FILE:tiny_tls>"
489 ) 501 )
@@ -917,7 +929,7 @@ if(TARGET Vulkan::Headers)
917 ${_stubs_header} 929 ${_stubs_header}
918 ID3D12GraphicsCommandList8 ID3D12CommandQueue ID3D12CommandAllocator ID3D12Fence1 930 ID3D12GraphicsCommandList8 ID3D12CommandQueue ID3D12CommandAllocator ID3D12Fence1
919 ID3D12Device11 ID3D12DescriptorHeap ID3D12Heap ID3D12Resource ID3D12QueryHeap ID3D12RootSignature 931 ID3D12Device11 ID3D12DescriptorHeap ID3D12Heap ID3D12Resource ID3D12QueryHeap ID3D12RootSignature
920 ID3D12PipelineState ID3D12CommandSignature ID3D12PipelineLibrary1 932 ID3D12PipelineState ID3D12CommandSignature ID3D12PipelineLibrary1 ID3D12ShaderCacheSession
921 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../tools/gen_d3d12_stubs.py ${LEONIDA_D3D12_HEADER} 933 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../tools/gen_d3d12_stubs.py ${LEONIDA_D3D12_HEADER}
922 COMMENT "Generating D3D12 COM stubs" 934 COMMENT "Generating D3D12 COM stubs"
923 VERBATIM) 935 VERBATIM)
@@ -1000,6 +1012,13 @@ if(TARGET Vulkan::Headers)
1000 FAIL_REGULAR_EXPRESSION "Validation Error;VUID-") 1012 FAIL_REGULAR_EXPRESSION "Validation Error;VUID-")
1001 set_tests_properties(d3d12_vulkan_device PROPERTIES SKIP_RETURN_CODE 77) 1013 set_tests_properties(d3d12_vulkan_device PROPERTIES SKIP_RETURN_CODE 77)
1002 1014
1015 add_executable(d3d12_texture1d_test test/d3d12_texture1d_test.cpp)
1016 target_link_libraries(d3d12_texture1d_test PRIVATE gta6rt_d3d12_com dxguid)
1017 target_compile_definitions(d3d12_texture1d_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
1018 target_compile_options(d3d12_texture1d_test PRIVATE /W4 /permissive- /utf-8)
1019 add_test(NAME d3d12_texture1d COMMAND d3d12_texture1d_test)
1020 set_tests_properties(d3d12_texture1d PROPERTIES SKIP_RETURN_CODE 77)
1021
1003 # ClearUnorderedAccessViewUint/Float on buffers and textures, read back through D3D12. 1022 # ClearUnorderedAccessViewUint/Float on buffers and textures, read back through D3D12.
1004 add_executable(d3d12_uav_clear_test test/d3d12_uav_clear_test.cpp) 1023 add_executable(d3d12_uav_clear_test test/d3d12_uav_clear_test.cpp)
1005 target_link_libraries(d3d12_uav_clear_test PRIVATE gta6rt_d3d12_com) 1024 target_link_libraries(d3d12_uav_clear_test PRIVATE gta6rt_d3d12_com)
@@ -1086,6 +1105,13 @@ if(TARGET Vulkan::Headers)
1086 target_compile_definitions(d3d12_method_variants_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX) 1105 target_compile_definitions(d3d12_method_variants_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
1087 target_compile_options(d3d12_method_variants_test PRIVATE /W4 /permissive- /utf-8) 1106 target_compile_options(d3d12_method_variants_test PRIVATE /W4 /permissive- /utf-8)
1088 add_test(NAME d3d12_method_variants COMMAND d3d12_method_variants_test) 1107 add_test(NAME d3d12_method_variants COMMAND d3d12_method_variants_test)
1108 # ID3D12Device9::CreateShaderCacheSession, ID3D12ShaderCacheSession and ShaderCacheControl (D3D-34).
1109 add_executable(d3d12_shader_cache_test test/d3d12_shader_cache_test.cpp)
1110 target_link_libraries(d3d12_shader_cache_test PRIVATE gta6rt_d3d12_com)
1111 target_compile_definitions(d3d12_shader_cache_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
1112 target_compile_options(d3d12_shader_cache_test PRIVATE /W4 /permissive- /utf-8)
1113 add_test(NAME d3d12_shader_cache COMMAND d3d12_shader_cache_test)
1114 set_tests_properties(d3d12_shader_cache PROPERTIES SKIP_RETURN_CODE 77)
1089 set_tests_properties(d3d12_method_variants PROPERTIES SKIP_RETURN_CODE 77) 1115 set_tests_properties(d3d12_method_variants PROPERTIES SKIP_RETURN_CODE 77)
1090 1116
1091 # CreateSampler2 (D3D-28) against CreateSampler, and its refusals against the host's PC runtime. 1117 # CreateSampler2 (D3D-28) against CreateSampler, and its refusals against the host's PC runtime.
@@ -1148,6 +1174,34 @@ if(TARGET Vulkan::Headers)
1148 target_compile_options(d3d12_typeless_rtv_test PRIVATE /W4 /permissive- /utf-8) 1174 target_compile_options(d3d12_typeless_rtv_test PRIVATE /W4 /permissive- /utf-8)
1149 add_test(NAME d3d12_typeless_rtv COMMAND d3d12_typeless_rtv_test) 1175 add_test(NAME d3d12_typeless_rtv COMMAND d3d12_typeless_rtv_test)
1150 1176
1177 # Typed RTV clears and draws of every TYPELESS color family against the host on the same adapter and WARP
1178 # (D3D-275). The draws need glslangValidator for their GLSL stand-ins of translated shaders.
1179 add_executable(d3d12_typeless_families_test test/d3d12_typeless_families_test.cpp)
1180 target_link_libraries(d3d12_typeless_families_test PRIVATE gta6rt_d3d12_com d3d12 dxgi)
1181 target_compile_definitions(d3d12_typeless_families_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
1182 target_compile_options(d3d12_typeless_families_test PRIVATE /W4 /permissive- /utf-8)
1183 add_test(NAME d3d12_typeless_families COMMAND d3d12_typeless_families_test)
1184 set_tests_properties(d3d12_typeless_families PROPERTIES SKIP_RETURN_CODE 77)
1185 if(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE)
1186 foreach(pair "vs_fullscreen.vert;LEONIDA_TYPELESS_VS_SPV;typeless_vs.spv"
1187 "ps_typeless_float.frag;LEONIDA_TYPELESS_PS_FLOAT_SPV;typeless_ps_float.spv"
1188 "ps_typeless_uint.frag;LEONIDA_TYPELESS_PS_UINT_SPV;typeless_ps_uint.spv")
1189 list(GET pair 0 shader)
1190 list(GET pair 1 definition)
1191 list(GET pair 2 name)
1192 set(binary ${CMAKE_CURRENT_BINARY_DIR}/generated/${name})
1193 add_custom_command(OUTPUT ${binary}
1194 COMMAND ${Vulkan_GLSLANG_VALIDATOR_EXECUTABLE} -V --target-env vulkan1.3 -o ${binary}
1195 ${CMAKE_CURRENT_SOURCE_DIR}/test/glsl/${shader}
1196 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/test/glsl/${shader}
1197 COMMENT "Compiling the typeless draw test shader ${shader}" VERBATIM)
1198 target_sources(d3d12_typeless_families_test PRIVATE ${binary})
1199 target_compile_definitions(d3d12_typeless_families_test PRIVATE ${definition}="${binary}")
1200 endforeach()
1201 else()
1202 message(STATUS "glslangValidator not found: d3d12_typeless_families_test runs its clears only")
1203 endif()
1204
1151 # 96-bit R32G32B32 textures (D3D-62): footprints and every copy path against Windows WARP. 1205 # 96-bit R32G32B32 textures (D3D-62): footprints and every copy path against Windows WARP.
1152 add_executable(d3d12_rgb96_test test/d3d12_rgb96_test.cpp) 1206 add_executable(d3d12_rgb96_test test/d3d12_rgb96_test.cpp)
1153 target_link_libraries(d3d12_rgb96_test PRIVATE gta6rt_d3d12_com d3d12 dxgi) 1207 target_link_libraries(d3d12_rgb96_test PRIVATE gta6rt_d3d12_com d3d12 dxgi)
@@ -1190,6 +1244,15 @@ if(TARGET Vulkan::Headers)
1190 add_test(NAME xbox_present COMMAND xbox_present_test) 1244 add_test(NAME xbox_present COMMAND xbox_present_test)
1191 set_tests_properties(xbox_present PROPERTIES SKIP_RETURN_CODE 77) 1245 set_tests_properties(xbox_present PROPERTIES SKIP_RETURN_CODE 77)
1192 1246
1247 # First light through D3D12 (docs/first_light.md): the real model and translated VS/PS that tools/first_light.py
1248 # wrote to LEONIDA_FIRST_LIGHT_DIR, drawn through the device proxy. Skips (77) unless that variable is set.
1249 add_executable(d3d12_first_light_test test/d3d12_first_light_test.cpp shims/d3d12_xs_device.cpp)
1250 target_link_libraries(d3d12_first_light_test PRIVATE gta6rt_d3d12_com)
1251 target_compile_definitions(d3d12_first_light_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX)
1252 target_compile_options(d3d12_first_light_test PRIVATE /W4 /permissive- /utf-8)
1253 add_test(NAME d3d12_first_light COMMAND d3d12_first_light_test)
1254 set_tests_properties(d3d12_first_light PROPERTIES SKIP_RETURN_CODE 77)
1255
1193 # M1.5 (D3D-53): a draw whose VS and PS are translator output. test/shaders/vs_m15.asm and ps_m15.asm are assembled 1256 # M1.5 (D3D-53): a draw whose VS and PS are translator output. test/shaders/vs_m15.asm and ps_m15.asm are assembled
1194 # with llvm-mc and translated by tools/rdna2spirv.py through test/shaders/build.py, which also writes the FSSM 1257 # with llvm-mc and translated by tools/rdna2spirv.py through test/shaders/build.py, which also writes the FSSM
1195 # programs their index entries are keyed by. Needs llvm-mc with the AMDGPU target (LLVM_MC in the environment, as 1258 # programs their index entries are keyed by. Needs llvm-mc with the AMDGPU target (LLVM_MC in the environment, as
@@ -1562,6 +1625,14 @@ if(TARGET Vulkan::Headers)
1562 target_compile_options(d3d12_pipeline_library_test PRIVATE /W4 /permissive- /utf-8) 1625 target_compile_options(d3d12_pipeline_library_test PRIVATE /W4 /permissive- /utf-8)
1563 add_test(NAME d3d12_pipeline_library COMMAND d3d12_pipeline_library_test) 1626 add_test(NAME d3d12_pipeline_library COMMAND d3d12_pipeline_library_test)
1564 set_tests_properties(d3d12_pipeline_library PROPERTIES SKIP_RETURN_CODE 77) 1627 set_tests_properties(d3d12_pipeline_library PROPERTIES SKIP_RETURN_CODE 77)
1628 # ExecuteBundle: what a bundle's draws inherit and hand back, against the host runtime and WARP.
1629 add_executable(d3d12_bundle_test test/d3d12_bundle_test.cpp ${LEONIDA_TEST_VS} ${LEONIDA_TEST_PS})
1630 target_link_libraries(d3d12_bundle_test PRIVATE gta6rt_d3d12_com d3d12 dxgi)
1631 target_compile_definitions(d3d12_bundle_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX
1632 LEONIDA_TEST_VS_SPV="${LEONIDA_TEST_VS}" LEONIDA_TEST_PS_SPV="${LEONIDA_TEST_PS}")
1633 target_compile_options(d3d12_bundle_test PRIVATE /W4 /permissive- /utf-8)
1634 add_test(NAME d3d12_bundle COMMAND d3d12_bundle_test)
1635 set_tests_properties(d3d12_bundle PROPERTIES SKIP_RETURN_CODE 77)
1565 else() 1636 else()
1566 message(STATUS "glslangValidator not found: d3d12_compute_test, d3d12_draw_test and d3d12_set0_compute_test are not built") 1637 message(STATUS "glslangValidator not found: d3d12_compute_test, d3d12_draw_test and d3d12_set0_compute_test are not built")
1567 endif() 1638 endif()
diff --git a/runtime/shims/d3d12_com.cpp b/runtime/shims/d3d12_com.cpp
index 663f5f3a5..e1c8deca1 100644
--- a/runtime/shims/d3d12_com.cpp
+++ b/runtime/shims/d3d12_com.cpp
@@ -12,7 +12,9 @@
12#include <atomic> 12#include <atomic>
13#include <bit> 13#include <bit>
14#include <condition_variable> 14#include <condition_variable>
15#include <functional>
15#include <memory> 16#include <memory>
17#include <optional>
16#include <cstdio> 18#include <cstdio>
17#include <cstring> 19#include <cstring>
18#include <mutex> 20#include <mutex>
@@ -206,12 +208,22 @@ public:
206 if (!list_.reset()) return d3d12_trace::result(method, E_FAIL); // D3D12 resets only closed lists 208 if (!list_.reset()) return d3d12_trace::result(method, E_FAIL); // D3D12 resets only closed lists
207 record_into(command_allocator); 209 record_into(command_allocator);
208 invalid_ = false; 210 invalid_ = false;
211 calls_.clear();
209 release_held(); // what the old recording used: it was replayed at ExecuteCommandLists 212 release_held(); // what the old recording used: it was replayed at ExecuteCommandLists
210 reset_state(state); // Reset returns every list state to its default 213 reset_state(state); // Reset returns every list state to its default
211 stencil_ref_set_ = false; 214 if (type_ == D3D12_COMMAND_LIST_TYPE_BUNDLE) set_initial_pipeline(state); // reset_state holds it
212 return d3d12_trace::result(method, S_OK); 215 return d3d12_trace::result(method, S_OK);
213 } 216 }
214 217
218 // CreateCommandList's pipeline state. As SetPipelineState on a direct list; on a bundle it is the first deferred
219 // call, which the application did not make, so it is not traced.
220 void set_initial_pipeline(ID3D12PipelineState* state) {
221 if (!state) return;
222 if (type_ != D3D12_COMMAND_LIST_TYPE_BUNDLE) return SetPipelineState(state);
223 defer([=](GraphicsCommandList& l) { l.set_pipeline(state); });
224 hold(state);
225 }
226
215 void STDMETHODCALLTYPE ExecuteBundle(ID3D12GraphicsCommandList* command_list) override { 227 void STDMETHODCALLTYPE ExecuteBundle(ID3D12GraphicsCommandList* command_list) override {
216 d3d12_trace::record("ID3D12GraphicsCommandList::ExecuteBundle"); 228 d3d12_trace::record("ID3D12GraphicsCommandList::ExecuteBundle");
217 if (type_ != D3D12_COMMAND_LIST_TYPE_DIRECT) return check(false); 229 if (type_ != D3D12_COMMAND_LIST_TYPE_DIRECT) return check(false);
@@ -219,15 +231,17 @@ public:
219 if (!bundle || bundle->type_ != D3D12_COMMAND_LIST_TYPE_BUNDLE || bundle->invalid_ || 231 if (!bundle || bundle->type_ != D3D12_COMMAND_LIST_TYPE_BUNDLE || bundle->invalid_ ||
220 !bundle->list_.closed()) 232 !bundle->list_.closed())
221 return check(false); 233 return check(false);
222 if (!list_.execute_bundle(bundle->list_)) return check(false); 234 // The bundle's state calls and draws play on this list through the members the application would have
223 235 // called, so a draw sees this list's state plus what the bundle set, and what the bundle set stays here
224 // Only the sticky state currently recorded by this COM layer is carried back from the bundle. 236 // afterwards (measured on the PC runtime, docs/d3d12_vulkan.md section 3.2). Commands that need no state
225 if (bundle->blend_factor_set_) blend_factor_ = bundle->blend_factor_; 237 // were recorded in the bundle's own list and are copied between them, in order.
226 if (bundle->stencil_ref_set_) { 238 std::size_t copied = 0;
227 front_stencil_ref_ = bundle->front_stencil_ref_; 239 for (const BundleCall& call : bundle->calls_) {
228 back_stencil_ref_ = bundle->back_stencil_ref_; 240 if (!list_.execute_bundle(bundle->list_, copied, call.commands)) return check(false);
229 stencil_ref_set_ = true; 241 copied = call.commands;
242 call.run(*this);
230 } 243 }
244 check(list_.execute_bundle(bundle->list_, copied));
231 } 245 }
232 246
233 // Root signatures, pipeline state and root arguments. The arguments are packed into the 32 user-data dwords 247 // Root signatures, pipeline state and root arguments. The arguments are packed into the 32 user-data dwords
@@ -242,6 +256,7 @@ public:
242 256
243 void STDMETHODCALLTYPE SetPipelineState(ID3D12PipelineState* state) override { 257 void STDMETHODCALLTYPE SetPipelineState(ID3D12PipelineState* state) override {
244 d3d12_trace::record("ID3D12GraphicsCommandList::SetPipelineState"); 258 d3d12_trace::record("ID3D12GraphicsCommandList::SetPipelineState");
259 if (defer([=](GraphicsCommandList& l) { l.set_pipeline(state); })) return hold(state);
245 set_pipeline(state); 260 set_pipeline(state);
246 } 261 }
247 262
@@ -289,8 +304,8 @@ public:
289 } 304 }
290 305
291 void STDMETHODCALLTYPE Dispatch(UINT x, UINT y, UINT z) override { 306 void STDMETHODCALLTYPE Dispatch(UINT x, UINT y, UINT z) override {
292 if (!compute_pipeline_ || !compute_.layout) return check(false); 307 if (defer([=](GraphicsCommandList& l) { l.record_dispatch(x, y, z); }, true)) return;
293 check(list_.dispatch({compute_pipeline_, compute_.data, x, y, z})); 308 record_dispatch(x, y, z);
294 } 309 }
295 310
296 // ClearState returns every piece of list state to its default, as Reset does (stencil references included). 311 // ClearState returns every piece of list state to its default, as Reset does (stencil references included).
@@ -298,20 +313,27 @@ public:
298 313
299 // Graphics state. Draws record a copy of it (command_list.h, Draw). 314 // Graphics state. Draws record a copy of it (command_list.h, Draw).
300 void STDMETHODCALLTYPE IASetPrimitiveTopology(D3D12_PRIMITIVE_TOPOLOGY topology) override { 315 void STDMETHODCALLTYPE IASetPrimitiveTopology(D3D12_PRIMITIVE_TOPOLOGY topology) override {
316 if (defer([=](GraphicsCommandList& l) { l.topology_ = u(topology); })) return;
301 topology_ = u(topology); 317 topology_ = u(topology);
302 } 318 }
303 319
304 void STDMETHODCALLTYPE IASetVertexBuffers(UINT start, UINT count, const D3D12_VERTEX_BUFFER_VIEW* views) override { 320 void STDMETHODCALLTYPE IASetVertexBuffers(UINT start, UINT count, const D3D12_VERTEX_BUFFER_VIEW* views) override {
305 if (std::uint64_t(start) + count > vertex_buffers_.size()) return check(false); 321 if (std::uint64_t(start) + count > vertex_buffers_.size()) return check(false);
306 for (UINT i = 0; i < count; ++i) 322 if (type_ == D3D12_COMMAND_LIST_TYPE_BUNDLE) {
307 vertex_buffers_[start + i] = views ? leonida::VertexBufferView{views[i].BufferLocation, views[i].SizeInBytes, 323 std::vector<D3D12_VERTEX_BUFFER_VIEW> copy;
308 views[i].StrideInBytes} 324 if (views) copy.assign(views, views + count);
309 : leonida::VertexBufferView{}; 325 defer([=, copy = std::move(copy), bound = views != nullptr](GraphicsCommandList& l) {
326 l.set_vertex_buffers(start, count, bound ? copy.data() : nullptr);
327 });
328 return;
329 }
330 set_vertex_buffers(start, count, views);
310 } 331 }
311 332
312 void STDMETHODCALLTYPE IASetIndexBuffer(const D3D12_INDEX_BUFFER_VIEW* view) override { 333 void STDMETHODCALLTYPE IASetIndexBuffer(const D3D12_INDEX_BUFFER_VIEW* view) override {
313 index_ = view ? leonida::IndexBufferView{view->BufferLocation, view->SizeInBytes, u(view->Format)} 334 const std::optional<D3D12_INDEX_BUFFER_VIEW> copy = view ? std::optional(*view) : std::nullopt;
314 : leonida::IndexBufferView{}; 335 if (defer([=](GraphicsCommandList& l) { l.set_index_buffer(copy ? &*copy : nullptr); })) return;
336 set_index_buffer(view);
315 } 337 }
316 338
317 // A count of 0 unbinds the viewports; draws then rasterize nothing (record_draw). 339 // A count of 0 unbinds the viewports; draws then rasterize nothing (record_draw).
@@ -345,24 +367,32 @@ public:
345 } 367 }
346 368
347 void STDMETHODCALLTYPE OMSetBlendFactor(const FLOAT factor[4]) override { 369 void STDMETHODCALLTYPE OMSetBlendFactor(const FLOAT factor[4]) override {
348 blend_factor_set_ = true; 370 const std::array<float, 4> value = factor ? std::array<float, 4>{factor[0], factor[1], factor[2], factor[3]}
349 blend_factor_ = factor ? std::array<float, 4>{factor[0], factor[1], factor[2], factor[3]} 371 : std::array<float, 4>{1, 1, 1, 1}; // null means { 1, 1, 1, 1 }
350 : std::array<float, 4>{1, 1, 1, 1}; // null means { 1, 1, 1, 1 } 372 if (defer([=](GraphicsCommandList& l) { l.blend_factor_ = value; })) return;
373 blend_factor_ = value;
351 } 374 }
352 375
353 void STDMETHODCALLTYPE OMSetStencilRef(UINT reference) override { 376 void STDMETHODCALLTYPE OMSetStencilRef(UINT reference) override {
377 if (defer([=](GraphicsCommandList& l) { l.front_stencil_ref_ = l.back_stencil_ref_ = reference; })) return;
354 front_stencil_ref_ = back_stencil_ref_ = reference; 378 front_stencil_ref_ = back_stencil_ref_ = reference;
355 stencil_ref_set_ = true; // the bundle carry-back in ExecuteBundle needs to see this
356 } 379 }
357 380
358 void STDMETHODCALLTYPE DrawInstanced(UINT vertices, UINT instances, UINT first_vertex, UINT first_instance) override { 381 void STDMETHODCALLTYPE DrawInstanced(UINT vertices, UINT instances, UINT first_vertex, UINT first_instance) override {
359 d3d12_trace::record("ID3D12GraphicsCommandList::DrawInstanced"); 382 d3d12_trace::record("ID3D12GraphicsCommandList::DrawInstanced");
383 if (defer([=](GraphicsCommandList& l) { l.record_draw(false, vertices, instances, first_vertex, 0, first_instance); },
384 true))
385 return;
360 record_draw(false, vertices, instances, first_vertex, 0, first_instance); 386 record_draw(false, vertices, instances, first_vertex, 0, first_instance);
361 } 387 }
362 388
363 void STDMETHODCALLTYPE DrawIndexedInstanced(UINT indices, UINT instances, UINT first_index, INT base_vertex, 389 void STDMETHODCALLTYPE DrawIndexedInstanced(UINT indices, UINT instances, UINT first_index, INT base_vertex,
364 UINT first_instance) override { 390 UINT first_instance) override {
365 d3d12_trace::record("ID3D12GraphicsCommandList::DrawIndexedInstanced"); 391 d3d12_trace::record("ID3D12GraphicsCommandList::DrawIndexedInstanced");
392 if (defer([=](GraphicsCommandList& l) {
393 l.record_draw(true, indices, instances, first_index, base_vertex, first_instance);
394 }, true))
395 return;
366 record_draw(true, indices, instances, first_index, base_vertex, first_instance); 396 record_draw(true, indices, instances, first_index, base_vertex, first_instance);
367 } 397 }
368 398
@@ -471,9 +501,19 @@ public:
471 501
472 // The format picks the member of a typeless family to resolve as; the textures' own format is used. 502 // The format picks the member of a typeless family to resolve as; the textures' own format is used.
473 void STDMETHODCALLTYPE ResolveSubresource(ID3D12Resource* dst, UINT dst_subresource, ID3D12Resource* src, 503 void STDMETHODCALLTYPE ResolveSubresource(ID3D12Resource* dst, UINT dst_subresource, ID3D12Resource* src,
474 UINT src_subresource, DXGI_FORMAT) override { 504 UINT src_subresource, DXGI_FORMAT format) override {
475 d3d12_trace::record("ID3D12GraphicsCommandList::ResolveSubresource"); 505 d3d12_trace::record("ID3D12GraphicsCommandList::ResolveSubresource");
476 if (type_ == D3D12_COMMAND_LIST_TYPE_BUNDLE) return check(false); 506 if (type_ == D3D12_COMMAND_LIST_TYPE_BUNDLE) return check(false);
507 const auto integer_color = [](ID3D12Resource* resource) {
508 if (!resource) return false;
509 const auto desc = resource->GetDesc();
510 return !(desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL) &&
511 color_resolve_format_is_integer(desc.Format);
512 };
513 if (color_resolve_format_is_integer(format) || integer_color(dst) || integer_color(src)) {
514 note_once("ResolveSubresource refused: integer colour formats cannot be resolved");
515 return check(false);
516 }
477 check(list_.resolve_subresource({resource_id(dst), dst_subresource, resource_id(src), src_subresource})); 517 check(list_.resolve_subresource({resource_id(dst), dst_subresource, resource_id(src), src_subresource}));
478 } 518 }
479 519
@@ -603,9 +643,13 @@ public:
603 void STDMETHODCALLTYPE OMSetFrontAndBackStencilRef(UINT front, UINT back) override { 643 void STDMETHODCALLTYPE OMSetFrontAndBackStencilRef(UINT front, UINT back) override {
604 d3d12_trace::record("ID3D12GraphicsCommandList8::OMSetFrontAndBackStencilRef"); 644 d3d12_trace::record("ID3D12GraphicsCommandList8::OMSetFrontAndBackStencilRef");
605 if (list_.closed()) return check(false); 645 if (list_.closed()) return check(false);
646 if (defer([=](GraphicsCommandList& l) {
647 l.front_stencil_ref_ = front;
648 l.back_stencil_ref_ = back;
649 }))
650 return;
606 front_stencil_ref_ = front; 651 front_stencil_ref_ = front;
607 back_stencil_ref_ = back; 652 back_stencil_ref_ = back;
608 stencil_ref_set_ = true;
609 } 653 }
610 654
611 // Debug markers, recorded in order with the other commands and replayed as VK_EXT_debug_utils labels. The trace 655 // Debug markers, recorded in order with the other commands and replayed as VK_EXT_debug_utils labels. The trace
@@ -785,6 +829,7 @@ private:
785 829
786 void clear_unordered_access(D3D12_CPU_DESCRIPTOR_HANDLE view, ID3D12Resource* resource, bool is_float, 830 void clear_unordered_access(D3D12_CPU_DESCRIPTOR_HANDLE view, ID3D12Resource* resource, bool is_float,
787 const std::array<std::uint32_t, 4>& values, UINT count, const D3D12_RECT* rects) { 831 const std::array<std::uint32_t, 4>& values, UINT count, const D3D12_RECT* rects) {
832 if (type_ == D3D12_COMMAND_LIST_TYPE_BUNDLE) return check(false); // no clear is allowed in a bundle
788 leonida::UavView target{}; 833 leonida::UavView target{};
789 if (!view.ptr || !resource || !unordered_access_view(view, resource, target)) return check(false); 834 if (!view.ptr || !resource || !unordered_access_view(view, resource, target)) return check(false);
790 check(list_.clear_unordered_access(target, is_float, values, to_rects(count, rects))); 835 check(list_.clear_unordered_access(target, is_float, values, to_rects(count, rects)));
@@ -853,6 +898,10 @@ private:
853 // signature that is already bound changes nothing: "existing root signature bindings do not become stale" 898 // signature that is already bound changes nothing: "existing root signature bindings do not become stale"
854 // (D3D12, "Using a Root Signature"), and engines rebind routinely. 899 // (D3D12, "Using a Root Signature"), and engines rebind routinely.
855 void bind_root(RootState& state, ID3D12RootSignature* signature) { 900 void bind_root(RootState& state, ID3D12RootSignature* signature) {
901 if (defer([=, compute = &state == &compute_](GraphicsCommandList& l) {
902 l.bind_root(compute ? l.compute_ : l.graphics_, signature);
903 }))
904 return hold(signature); // the bundle keeps it for as long as it can be executed
856 const RootArgumentLayout* layout = root_signature_layout(signature); 905 const RootArgumentLayout* layout = root_signature_layout(signature);
857 if (layout && layout == state.layout) return; 906 if (layout && layout == state.layout) return;
858 hold(signature); // state.layout points into it 907 hold(signature); // state.layout points into it
@@ -880,6 +929,22 @@ private:
880 } 929 }
881 930
882 void constants(RootState& state, UINT index, UINT count, const void* data, UINT offset) { 931 void constants(RootState& state, UINT index, UINT count, const void* data, UINT offset) {
932 if (type_ == D3D12_COMMAND_LIST_TYPE_BUNDLE) {
933 // The layout is the executing list's, so the range is checked when it runs; no signature takes more
934 // than D3D12_MAX_ROOT_COST dwords, which bounds what is copied from the caller's memory.
935 if (count > D3D12_MAX_ROOT_COST) return check(false);
936 const auto* words = static_cast<const std::uint32_t*>(data);
937 std::vector<std::uint32_t> copy;
938 if (data) copy.assign(words, words + count);
939 // A count of 0 with a non-null pointer is a valid call; an empty vector's data() may be null.
940 static constexpr std::uint32_t none = 0;
941 defer([=, compute = &state == &compute_, copy = std::move(copy),
942 given = data != nullptr](GraphicsCommandList& l) {
943 l.constants(compute ? l.compute_ : l.graphics_, index, count,
944 !given ? nullptr : copy.empty() ? &none : copy.data(), offset);
945 });
946 return;
947 }
883 const RootArgumentLayout::Parameter* p = parameter(state, index, rt::rootsig::ParamType::Constants); 948 const RootArgumentLayout::Parameter* p = parameter(state, index, rt::rootsig::ParamType::Constants);
884 if (!p) return; 949 if (!p) return;
885 if (!data || std::uint64_t(offset) + count > p->constant_count) return check(false); 950 if (!data || std::uint64_t(offset) + count > p->constant_count) return check(false);
@@ -888,6 +953,10 @@ private:
888 } 953 }
889 954
890 void address(RootState& state, UINT index, std::uint64_t va, rt::rootsig::ParamType type) { 955 void address(RootState& state, UINT index, std::uint64_t va, rt::rootsig::ParamType type) {
956 if (defer([=, compute = &state == &compute_](GraphicsCommandList& l) {
957 l.address(compute ? l.compute_ : l.graphics_, index, va, type);
958 }))
959 return;
891 const RootArgumentLayout::Parameter* p = parameter(state, index, type); 960 const RootArgumentLayout::Parameter* p = parameter(state, index, type);
892 if (!p) return; 961 if (!p) return;
893 write(state, p->user_offset, std::uint32_t(va)); 962 write(state, p->user_offset, std::uint32_t(va));
@@ -900,7 +969,6 @@ private:
900 bool invalid_ = false; 969 bool invalid_ = false;
901 UINT front_stencil_ref_ = 0; 970 UINT front_stencil_ref_ = 0;
902 UINT back_stencil_ref_ = 0; 971 UINT back_stencil_ref_ = 0;
903 bool stencil_ref_set_ = false;
904 RootState compute_; 972 RootState compute_;
905 RootState graphics_; 973 RootState graphics_;
906 std::uintptr_t compute_pipeline_ = 0; 974 std::uintptr_t compute_pipeline_ = 0;
@@ -913,7 +981,6 @@ private:
913 std::vector<leonida::TargetView> render_targets_; 981 std::vector<leonida::TargetView> render_targets_;
914 leonida::TargetView depth_{}; 982 leonida::TargetView depth_{};
915 std::array<float, 4> blend_factor_{1, 1, 1, 1}; 983 std::array<float, 4> blend_factor_{1, 1, 1, 1};
916 bool blend_factor_set_ = false;
917 984
918 // The root signatures and pipeline states this recording uses. D3D12 lets an application release them right 985 // The root signatures and pipeline states this recording uses. D3D12 lets an application release them right
919 // after Set*RootSignature / SetPipelineState; the list keeps them until Reset or its own release, so the root 986 // after Set*RootSignature / SetPipelineState; the list keeps them until Reset or its own release, so the root
@@ -921,6 +988,31 @@ private:
921 // runs the submission stays the application's job, as in D3D12.) 988 // runs the submission stays the application's job, as in D3D12.)
922 std::vector<IUnknown*> held_; 989 std::vector<IUnknown*> held_;
923 990
991 // A bundle keeps its state calls and draws instead of applying them: it has no render targets, viewport or root
992 // signature of its own to resolve them against, and what it sets belongs to the list that executes it.
993 // `commands` is how much of the bundle's own list was recorded before the call, so ExecuteBundle can replay the
994 // calls and copy the state-free commands (markers, immediate writes) in their original order. Returns whether the
995 // call was kept; on any other list it is false and the caller does the work.
996 struct BundleCall {
997 std::size_t commands;
998 std::function<void(GraphicsCommandList&)> run;
999 };
1000 std::vector<BundleCall> calls_;
1001
1002 // Every deferred call replays through a private member that does not trace: the trace line is written once, when
1003 // the application makes the call, and not again at each ExecuteBundle. After Close nothing is appended, since
1004 // another list may be executing the bundle: a state call is ignored, and a draw or dispatch (`command`) makes
1005 // the list invalid.
1006 bool defer(std::function<void(GraphicsCommandList&)> run, bool command = false) {
1007 if (type_ != D3D12_COMMAND_LIST_TYPE_BUNDLE) return false;
1008 if (list_.closed()) {
1009 if (command) check(false);
1010 return true;
1011 }
1012 calls_.push_back({list_.commands().size(), std::move(run)});
1013 return true;
1014 }
1015
924 void hold(IUnknown* object) { 1016 void hold(IUnknown* object) {
925 if (!object || std::find(held_.begin(), held_.end(), object) != held_.end()) return; 1017 if (!object || std::find(held_.begin(), held_.end(), object) != held_.end()) return;
926 object->AddRef(); 1018 object->AddRef();
@@ -952,10 +1044,26 @@ private:
952 render_targets_.clear(); 1044 render_targets_.clear();
953 depth_ = {}; 1045 depth_ = {};
954 blend_factor_ = {1, 1, 1, 1}; 1046 blend_factor_ = {1, 1, 1, 1};
955 blend_factor_set_ = false;
956 set_pipeline(state); 1047 set_pipeline(state);
957 } 1048 }
958 1049
1050 void set_vertex_buffers(UINT start, UINT count, const D3D12_VERTEX_BUFFER_VIEW* views) {
1051 for (UINT i = 0; i < count; ++i)
1052 vertex_buffers_[start + i] = views ? leonida::VertexBufferView{views[i].BufferLocation, views[i].SizeInBytes,
1053 views[i].StrideInBytes}
1054 : leonida::VertexBufferView{};
1055 }
1056
1057 void set_index_buffer(const D3D12_INDEX_BUFFER_VIEW* view) {
1058 index_ = view ? leonida::IndexBufferView{view->BufferLocation, view->SizeInBytes, u(view->Format)}
1059 : leonida::IndexBufferView{};
1060 }
1061
1062 void record_dispatch(UINT x, UINT y, UINT z) {
1063 if (!compute_pipeline_ || !compute_.layout) return check(false);
1064 check(list_.dispatch({compute_pipeline_, compute_.data, x, y, z}));
1065 }
1066
959 // A draw needs a graphics pipeline, a graphics root signature and a topology. 1067 // A draw needs a graphics pipeline, a graphics root signature and a topology.
960 void record_draw(bool indexed, UINT count, UINT instances, UINT first, INT base_vertex, UINT first_instance) { 1068 void record_draw(bool indexed, UINT count, UINT instances, UINT first, INT base_vertex, UINT first_instance) {
961 if (!graphics_pipeline_ || !graphics_.layout || !topology_) return check(false); 1069 if (!graphics_pipeline_ || !graphics_.layout || !topology_) return check(false);
@@ -1396,7 +1504,7 @@ HRESULT create_command_allocator(D3D12_COMMAND_LIST_TYPE type, REFIID riid, void
1396} 1504}
1397 1505
1398HRESULT create_command_list(D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator* allocator, REFIID riid, 1506HRESULT create_command_list(D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator* allocator, REFIID riid,
1399 void** out, IUnknown* device) { 1507 void** out, IUnknown* device, ID3D12PipelineState* initial_state) {
1400 if (!out) return E_POINTER; 1508 if (!out) return E_POINTER;
1401 *out = nullptr; 1509 *out = nullptr;
1402 CommandAllocator* command_allocator = CommandAllocator::from(allocator); 1510 CommandAllocator* command_allocator = CommandAllocator::from(allocator);
@@ -1409,7 +1517,12 @@ HRESULT create_command_list(D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator
1409 auto* object = new GraphicsCommandList(type); // created open, as D3D12 does 1517 auto* object = new GraphicsCommandList(type); // created open, as D3D12 does
1410 object->record_into(command_allocator); 1518 object->record_into(command_allocator);
1411 object->attach_device(device); 1519 object->attach_device(device);
1412 return hand_out(object, riid, out); 1520 const HRESULT hr = hand_out(object, riid, out); // releases the creation reference, so a failure frees the list
1521 // The initial pipeline state only once the list exists for the caller, as SetPipelineState on it would be.
1522 if (SUCCEEDED(hr) && initial_state)
1523 if (GraphicsCommandList* list = GraphicsCommandList::from(static_cast<IUnknown*>(*out)))
1524 list->set_initial_pipeline(initial_state);
1525 return hr;
1413} 1526}
1414 1527
1415HRESULT create_fence(leonida::VulkanContext& context, UINT64 initial_value, D3D12_FENCE_FLAGS flags, REFIID riid, 1528HRESULT create_fence(leonida::VulkanContext& context, UINT64 initial_value, D3D12_FENCE_FLAGS flags, REFIID riid,
@@ -1490,4 +1603,12 @@ bool front_back_stencil_ref(ID3D12GraphicsCommandList8* list, UINT& front, UINT&
1490 return true; 1603 return true;
1491} 1604}
1492 1605
1606bool recorded_commands(ID3D12GraphicsCommandList* list, std::vector<leonida::Command>& commands) {
1607 const GraphicsCommandList* l = GraphicsCommandList::from(list);
1608 if (!l) return false;
1609 const auto recorded = l->commands().commands();
1610 commands.assign(recorded.begin(), recorded.end());
1611 return true;
1612}
1613
1493} // namespace rt::d3d12 1614} // namespace rt::d3d12
diff --git a/runtime/shims/d3d12_com.h b/runtime/shims/d3d12_com.h
index 9ce714c13..f0bb0d859 100644
--- a/runtime/shims/d3d12_com.h
+++ b/runtime/shims/d3d12_com.h
@@ -50,7 +50,7 @@ HRESULT create_command_queue(leonida::VulkanContext& context, VkQueue queue, std
50 std::shared_ptr<void> queue_lease = {}); 50 std::shared_ptr<void> queue_lease = {});
51HRESULT create_command_allocator(D3D12_COMMAND_LIST_TYPE type, REFIID riid, void** out, IUnknown* device = nullptr); 51HRESULT create_command_allocator(D3D12_COMMAND_LIST_TYPE type, REFIID riid, void** out, IUnknown* device = nullptr);
52HRESULT create_command_list(D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator* allocator, REFIID riid, 52HRESULT create_command_list(D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator* allocator, REFIID riid,
53 void** out, IUnknown* device = nullptr); 53 void** out, IUnknown* device = nullptr, ID3D12PipelineState* initial_state = nullptr);
54HRESULT create_fence(leonida::VulkanContext& context, UINT64 initial_value, D3D12_FENCE_FLAGS flags, REFIID riid, 54HRESULT create_fence(leonida::VulkanContext& context, UINT64 initial_value, D3D12_FENCE_FLAGS flags, REFIID riid,
55 void** out, IUnknown* device = nullptr); 55 void** out, IUnknown* device = nullptr);
56HRESULT create_command_signature(leonida::IndirectKind kind, UINT byte_stride, REFIID riid, void** out, 56HRESULT create_command_signature(leonida::IndirectKind kind, UINT byte_stride, REFIID riid, void** out,
@@ -122,6 +122,13 @@ struct VulkanDeviceInfo {
122 bool swapchain_maintenance1 = false; 122 bool swapchain_maintenance1 = false;
123 // VK_EXT_image_view_min_lod and its minLod feature are enabled on the logical device. 123 // VK_EXT_image_view_min_lod and its minLod feature are enabled on the logical device.
124 bool image_view_min_lod = false; 124 bool image_view_min_lod = false;
125 // Pixel-shader extensions translated shaders can declare, each enabled with its feature where the GPU has it:
126 // VK_KHR_fragment_shader_barycentric (BaryCoordKHR / PerVertexKHR reads), VK_EXT_fragment_shader_interlock
127 // (fragmentShaderPixelInterlock: POPS shaders run in PixelInterlockOrderedEXT) and VK_KHR_maintenance8 (texel
128 // offsets outside gathers: the index's needs_maintenance8).
129 bool fragment_shader_barycentric = false;
130 bool fragment_shader_interlock = false;
131 bool maintenance8 = false;
125 // The instance enabled VK_EXT_debug_utils: SetMarker/BeginEvent/EndEvent become debug labels. Otherwise they 132 // The instance enabled VK_EXT_debug_utils: SetMarker/BeginEvent/EndEvent become debug labels. Otherwise they
126 // do nothing. 133 // do nothing.
127 bool debug_utils = false; 134 bool debug_utils = false;
@@ -140,6 +147,10 @@ struct VulkanDeviceInfo {
140 // The core features enabled on `device`. Graphics PSOs that need independentBlend, fillModeNonSolid, 147 // The core features enabled on `device`. Graphics PSOs that need independentBlend, fillModeNonSolid,
141 // depthBiasClamp or dualSrcBlend are refused unless it is set here. 148 // depthBiasClamp or dualSrcBlend are refused unless it is set here.
142 VkPhysicalDeviceFeatures features{}; 149 VkPhysicalDeviceFeatures features{};
150 // Vulkan 1.2 shaderOutputLayer / shaderOutputViewportIndex enabled on `device`: a translated vertex shader that
151 // writes the layer or viewport declares ShaderLayer / ShaderViewportIndex (the index's `features`).
152 bool shader_output_layer = false;
153 bool shader_output_viewport_index = false;
143 // The translator's output folder (spirv/index.json + <name>.spv) for pipeline creation; empty: the 154 // The translator's output folder (spirv/index.json + <name>.spv) for pipeline creation; empty: the
144 // LEONIDA_SHADERS environment variable. 155 // LEONIDA_SHADERS environment variable.
145 std::string shader_dir; 156 std::string shader_dir;
@@ -166,6 +177,8 @@ void set_device_outer(ID3D12Device* device, IUnknown* outer);
166VkImage vulkan_image(ID3D12Resource* resource); 177VkImage vulkan_image(ID3D12Resource* resource);
167// The VkBuffer behind a buffer created by such a device, or VK_NULL_HANDLE. For tests. 178// The VkBuffer behind a buffer created by such a device, or VK_NULL_HANDLE. For tests.
168VkBuffer vulkan_buffer(ID3D12Resource* resource); 179VkBuffer vulkan_buffer(ID3D12Resource* resource);
180// What a device from create_vulkan_device* was created with (enabled features included), or null. For tests.
181const VulkanDeviceInfo* vulkan_device_info(ID3D12Device* device);
169// True when `device` has VK_KHR_acceleration_structure + VK_KHR_ray_query enabled. 182// True when `device` has VK_KHR_acceleration_structure + VK_KHR_ray_query enabled.
170bool device_supports_ray_tracing(ID3D12Device* device); 183bool device_supports_ray_tracing(ID3D12Device* device);
171// The VkAccelerationStructureKHR registered for `va` on `device`, or VK_NULL_HANDLE. For tests. 184// The VkAccelerationStructureKHR registered for `va` on `device`, or VK_NULL_HANDLE. For tests.
@@ -174,6 +187,9 @@ VkAccelerationStructureKHR vulkan_acceleration_structure(ID3D12Device* device, D
174// The property flags of the Vulkan memory type behind a resource created by such a device, or 0. For tests. 187// The property flags of the Vulkan memory type behind a resource created by such a device, or 0. For tests.
175VkMemoryPropertyFlags vulkan_memory_flags(ID3D12Resource* resource); 188VkMemoryPropertyFlags vulkan_memory_flags(ID3D12Resource* resource);
176 189
190// Whether the requested colour format has an integer numeric class.
191bool color_resolve_format_is_integer(DXGI_FORMAT format);
192
177// Whether both resources use the requested typed, non-integer colour format for a regional average resolve. 193// Whether both resources use the requested typed, non-integer colour format for a regional average resolve.
178bool color_resolve_format_matches(DXGI_FORMAT format, ID3D12Resource* dst, ID3D12Resource* src); 194bool color_resolve_format_matches(DXGI_FORMAT format, ID3D12Resource* dst, ID3D12Resource* src);
179 195
@@ -208,6 +224,14 @@ VkDescriptorSetLayout bindless_set_layout(ID3D12Device* device);
208// The bindless index the descriptor hash table holds for the 8 key dwords of a T# (or the 4 of an S# followed by 224// The bindless index the descriptor hash table holds for the 8 key dwords of a T# (or the 4 of an S# followed by
209// 0xFFFFFFFF x4), 0 (the fallback) when it has none or `device` has no such set. For tests. 225// 0xFFFFFFFF x4), 0 (the fallback) when it has none or `device` has no such set. For tests.
210std::uint32_t bindless_hash_lookup(ID3D12Device* device, const std::uint32_t (&key)[8]); 226std::uint32_t bindless_hash_lookup(ID3D12Device* device, const std::uint32_t (&key)[8]);
227// The free indices of that set's 2D image and sampler arrays: how many more distinct 2D T#s and S#s
228// CreateShaderResourceView and CreateSampler can register before they log that the array is full. Zeros when
229// `device` has no such set. For tests.
230struct BindlessRoom {
231 std::uint32_t images_2d = 0;
232 std::uint32_t samplers = 0;
233};
234BindlessRoom bindless_room(ID3D12Device* device);
211// Gives each S# a sampler in that set and a key in its hash table, as CreateSampler does, without a heap slot: for 235// Gives each S# a sampler in that set and a key in its hash table, as CreateSampler does, without a heap slot: for
212// the literal S#s a shader builds from immediates (`literal_samplers` in the shader index). An S# that has them 236// the literal S#s a shader builds from immediates (`literal_samplers` in the shader index). An S# that has them
213// already is left as it is. E_INVALIDARG when `device` is not such a device; E_FAIL when one of them could not be 237// already is left as it is. E_INVALIDARG when `device` is not such a device; E_FAIL when one of them could not be
@@ -294,6 +318,10 @@ void set_global_realtime_privilege_override_for_test(int state);
294// not one of this module's command lists. 318// not one of this module's command lists.
295bool front_back_stencil_ref(ID3D12GraphicsCommandList8* list, UINT& front, UINT& back); 319bool front_back_stencil_ref(ID3D12GraphicsCommandList8* list, UINT& front, UINT& back);
296 320
321// A copy of the commands `list` has recorded so far, for tests of what a bundle puts into its parent. False when
322// `list` is not one of this module's command lists.
323bool recorded_commands(ID3D12GraphicsCommandList* list, std::vector<leonida::Command>& commands);
324
297inline leonida::ResourceId resource_id(const ID3D12Resource* resource) { 325inline leonida::ResourceId resource_id(const ID3D12Resource* resource) {
298 return reinterpret_cast<leonida::ResourceId>(resource); 326 return reinterpret_cast<leonida::ResourceId>(resource);
299} 327}
diff --git a/runtime/shims/d3d12_vulkan_device.cpp b/runtime/shims/d3d12_vulkan_device.cpp
index 025e3696c..adacb4bf8 100644
--- a/runtime/shims/d3d12_vulkan_device.cpp
+++ b/runtime/shims/d3d12_vulkan_device.cpp
@@ -19,6 +19,7 @@
19#include "../src/vulkan_bindless.h" 19#include "../src/vulkan_bindless.h"
20#include "../src/vulkan_memory.h" 20#include "../src/vulkan_memory.h"
21#include "../src/resource_tiling.h" 21#include "../src/resource_tiling.h"
22#include "../src/cached_pso.h"
22#include "../src/shader_library.h" 23#include "../src/shader_library.h"
23#include "../src/vulkan_present.h" 24#include "../src/vulkan_present.h"
24#include "../src/vulkan_device_filter.h" 25#include "../src/vulkan_device_filter.h"
@@ -34,6 +35,8 @@
34#include <cctype> 35#include <cctype>
35#include <climits> 36#include <climits>
36#include <cstdlib> 37#include <cstdlib>
38#include <filesystem>
39#include <fstream>
37#include <iterator> 40#include <iterator>
38#include <map> 41#include <map>
39#include <cstring> 42#include <cstring>
@@ -325,6 +328,17 @@ leonida::TargetView volume_rtv(leonida::ResourceId id, const D3D12_RESOURCE_DESC
325 return {id, slices.MipSlice, slices.FirstWSlice, count}; 328 return {id, slices.MipSlice, slices.FirstWSlice, count};
326} 329}
327 330
331leonida::TargetView line_target_view(leonida::ResourceId id, const D3D12_RESOURCE_DESC& resource,
332 UINT mip, UINT first_layer, UINT layer_count) {
333 if (resource.Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE1D || mip >= resource.MipLevels ||
334 first_layer >= resource.DepthOrArraySize)
335 return {};
336 const UINT remaining = UINT(resource.DepthOrArraySize) - first_layer;
337 const UINT count = layer_count == UINT_MAX ? remaining : layer_count;
338 if (!count || count > remaining) return {};
339 return {id, mip, first_layer, count};
340}
341
328// The VkImage a texture description becomes, with its mip count already resolved (MipLevels != 0). Shared by 342// The VkImage a texture description becomes, with its mip count already resolved (MipLevels != 0). Shared by
329// texture creation and GetResourceAllocationInfo, so the sizes reported are the sizes later allocated. 343// texture creation and GetResourceAllocationInfo, so the sizes reported are the sizes later allocated.
330// Keeps the optional VkImageFormatListCreateInfo alongside VkImageCreateInfo so info.pNext stays valid. 344// Keeps the optional VkImageFormatListCreateInfo alongside VkImageCreateInfo so info.pNext stays valid.
@@ -394,6 +408,7 @@ struct DeviceState {
394 PFN_vkGetPhysicalDeviceImageFormatProperties2 image_format_properties2 = nullptr; 408 PFN_vkGetPhysicalDeviceImageFormatProperties2 image_format_properties2 = nullptr;
395 PFN_vkGetDeviceImageMemoryRequirements image_requirements = nullptr; // Vulkan 1.3 or VK_KHR_maintenance4 409 PFN_vkGetDeviceImageMemoryRequirements image_requirements = nullptr; // Vulkan 1.3 or VK_KHR_maintenance4
396 LUID luid{}; // VkPhysicalDeviceIDProperties::deviceLUID; zero when the driver reports none 410 LUID luid{}; // VkPhysicalDeviceIDProperties::deviceLUID; zero when the driver reports none
411 leonida::cached_pso::Identity pso_identity; // what GetCachedBlob records and CachedPSO is checked against
397 QueueClock clock; // what every queue's GetClockCalibration uses 412 QueueClock clock; // what every queue's GetClockCalibration uses
398 PFN_vkGetPhysicalDeviceFormatProperties2 format_properties2 = nullptr; 413 PFN_vkGetPhysicalDeviceFormatProperties2 format_properties2 = nullptr;
399 // True when VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 lacks native STORAGE_IMAGE but mutable R32_UINT+{R32_UINT,E5B9G9R9} 414 // True when VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 lacks native STORAGE_IMAGE but mutable R32_UINT+{R32_UINT,E5B9G9R9}
@@ -608,13 +623,22 @@ struct DeviceState {
608 subgroups.lane_min = size_control.minSubgroupSize ? size_control.minSubgroupSize : subgroup.subgroupSize; 623 subgroups.lane_min = size_control.minSubgroupSize ? size_control.minSubgroupSize : subgroup.subgroupSize;
609 subgroups.lane_max = size_control.maxSubgroupSize ? size_control.maxSubgroupSize : subgroups.lane_min; 624 subgroups.lane_max = size_control.maxSubgroupSize ? size_control.maxSubgroupSize : subgroups.lane_min;
610 if (subgroups.lane_max < subgroups.lane_min) subgroups.lane_max = subgroups.lane_min; 625 if (subgroups.lane_max < subgroups.lane_min) subgroups.lane_max = subgroups.lane_min;
611 // D3D-121: Intel's D3D12 driver answers a fixed 16..16 on its integrated GPUs, where Vulkan reports the 626 // D3D-121: Intel's D3D12 driver answers a fixed 16..16 on its older integrated GPUs, where Vulkan reports
612 // compiler's whole 8..32 choice. Measured on Xe-LP: UHD 770 (32.0.101.6129) and Raptor Lake-S Mobile 627 // the compiler's whole 8..32 choice. Measured on Xe-LP: UHD 770 (32.0.101.6129), Raptor Lake-S Mobile
613 // (101.7092). Discrete Arc is not measured yet (TEST-57), so it keeps the Vulkan range. 628 // (101.7092) and Tiger Lake 0x9a78 (101.7088). Discrete Arc is not measured yet (TEST-57), so it keeps the
629 // Vulkan range. D3D-280: from Xe-LPG on the driver answers what Vulkan reports (Meteor Lake 0x7d55,
630 // 32.0.101.6127: 8..32 on both sides), so there is no fixed answer to mirror and those lines keep the
631 // Vulkan range too.
614 constexpr uint32_t kIntelVendorId = 0x8086; 632 constexpr uint32_t kIntelVendorId = 0x8086;
615 constexpr UINT kIntelD3D12Lanes = 16; 633 constexpr UINT kIntelD3D12Lanes = 16;
634 const uint32_t intel_device_id = properties.properties.deviceID;
635 // The Xe-core integrated lines from Xe-LPG on. Device IDs are not generation-ordered (Tiger Lake's 0x9a78
636 // sorts above Meteor Lake's), so the ranges are listed out, not compared as a cutoff.
637 const bool intel_xe_lpg_or_later =
638 (intel_device_id >= 0x7d40 && intel_device_id <= 0x7dc5) || // Meteor Lake, Arrow Lake
639 (intel_device_id >= 0x64a0 && intel_device_id <= 0x64b6); // Lunar Lake
616 if (properties.properties.vendorID == kIntelVendorId && 640 if (properties.properties.vendorID == kIntelVendorId &&
617 properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU && 641 properties.properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU && !intel_xe_lpg_or_later &&
618 subgroups.lane_min <= kIntelD3D12Lanes && kIntelD3D12Lanes <= subgroups.lane_max) 642 subgroups.lane_min <= kIntelD3D12Lanes && kIntelD3D12Lanes <= subgroups.lane_max)
619 subgroups.lane_min = subgroups.lane_max = kIntelD3D12Lanes; 643 subgroups.lane_min = subgroups.lane_max = kIntelD3D12Lanes;
620 return subgroups; 644 return subgroups;
@@ -804,6 +828,11 @@ struct DeviceState {
804 log_once("set 0 has no array for this image type:", int(image.type)); 828 log_once("set 0 has no array for this image type:", int(image.type));
805 return false; 829 return false;
806 } 830 }
831 const bool depth_or_stencil = (aspects & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) != 0;
832 if (storage && depth_or_stencil) {
833 log_once("storage view not supported for depth-stencil image format:", int(image_format));
834 return false;
835 }
807 // A T# of 8_UINT on a depth-stencil image is a view of its stencil plane (image_descriptor, D3D-75). Vulkan 836 // A T# of 8_UINT on a depth-stencil image is a view of its stencil plane (image_descriptor, D3D-75). Vulkan
808 // views it in the image's own format with the stencil aspect, and returns the value in R, as a T# whose 837 // views it in the image's own format with the stencil aspect, and returns the value in R, as a T# whose
809 // format is 8_UINT reads it from X. 838 // format is 8_UINT reads it from X.
@@ -816,7 +845,8 @@ struct DeviceState {
816 view_format = rgb96_view_format(image_format, image.format); 845 view_format = rgb96_view_format(image_format, image.format);
817 channels_format = rgb96_named_format(view_format); 846 channels_format = rgb96_named_format(view_format);
818 } 847 }
819 if (view_format == VK_FORMAT_UNDEFINED) { 848 if (view_format == VK_FORMAT_UNDEFINED ||
849 (depth_or_stencil && !g::is_depth_stencil_format(view_format))) {
820 log_once("no Vulkan view format for the GFX10 format of a view:", int(image.format)); 850 log_once("no Vulkan view format for the GFX10 format of a view:", int(image.format));
821 return false; 851 return false;
822 } 852 }
@@ -1551,7 +1581,7 @@ public:
1551 1581
1552 leonida::ResourceBinding binding{}; 1582 leonida::ResourceBinding binding{};
1553 binding.image = image_; 1583 binding.image = image_;
1554 binding.rgba8_typeless = desc_.Format == DXGI_FORMAT_R8G8B8A8_TYPELESS; 1584 binding.typeless = format.typeless && format.aspects == VK_IMAGE_ASPECT_COLOR_BIT; // views name their format
1555 binding.castable_view_formats = !view_formats_.empty(); // a castable list made the image mutable 1585 binding.castable_view_formats = !view_formats_.empty(); // a castable list made the image mutable
1556 binding.rgb96 = format.rgb96; 1586 binding.rgb96 = format.rgb96;
1557 binding.depth24_as_float = format.d24_as_float; 1587 binding.depth24_as_float = format.d24_as_float;
@@ -2163,13 +2193,139 @@ class RootSignature final
2163public: 2193public:
2164 // {3e9b4a61-2d7c-4f18-b5a0-c71e8d92f036} 2194 // {3e9b4a61-2d7c-4f18-b5a0-c71e8d92f036}
2165 static constexpr GUID kTag{0x3e9b4a61, 0x2d7c, 0x4f18, {0xb5, 0xa0, 0xc7, 0x1e, 0x8d, 0x92, 0xf0, 0x36}}; 2195 static constexpr GUID kTag{0x3e9b4a61, 0x2d7c, 0x4f18, {0xb5, 0xa0, 0xc7, 0x1e, 0x8d, 0x92, 0xf0, 0x36}};
2166 explicit RootSignature(RootArgumentLayout layout) : layout_(std::move(layout)) {} 2196 RootSignature(RootArgumentLayout layout, std::string content)
2197 : layout_(std::move(layout)), content_(std::move(content)) {}
2167 const RootArgumentLayout& layout() const { return layout_; } 2198 const RootArgumentLayout& layout() const { return layout_; }
2199 // SHA-256 of the serialized root signature: a cached PSO matches root signatures with the same content.
2200 const std::string& content() const { return content_; }
2168 2201
2169private: 2202private:
2170 RootArgumentLayout layout_; 2203 RootArgumentLayout layout_;
2204 std::string content_;
2171}; 2205};
2172 2206
2207// The ID3DBlob GetCachedBlob returns.
2208class CachedBlob final : public ID3DBlob {
2209public:
2210 explicit CachedBlob(std::vector<std::uint8_t> bytes) : bytes_(std::move(bytes)) {}
2211 HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** out) override {
2212 if (!out) return E_POINTER;
2213 if (riid == __uuidof(IUnknown) || riid == __uuidof(ID3D10Blob)) {
2214 AddRef();
2215 *out = static_cast<ID3DBlob*>(this);
2216 return S_OK;
2217 }
2218 *out = nullptr;
2219 return E_NOINTERFACE;
2220 }
2221 ULONG STDMETHODCALLTYPE AddRef() override { return ++refs_; }
2222 ULONG STDMETHODCALLTYPE Release() override {
2223 const ULONG left = --refs_;
2224 if (!left) delete this;
2225 return left;
2226 }
2227 LPVOID STDMETHODCALLTYPE GetBufferPointer() override { return bytes_.data(); }
2228 SIZE_T STDMETHODCALLTYPE GetBufferSize() override { return bytes_.size(); }
2229
2230private:
2231 std::vector<std::uint8_t> bytes_;
2232 std::atomic<ULONG> refs_{1};
2233};
2234
2235// A shader as the key sees it, without reading the whole program on every PSO: a DXBC container already carries a
2236// checksum of its contents (bytes 4..19), so that and the size stand for it. A container without one (all zero, as
2237// hand-built test containers have) or other bytecode is hashed with FNV-1a.
2238void key_shader(leonida::cached_pso::KeyBuilder& key, const char* stage, const D3D12_SHADER_BYTECODE& code) {
2239 const auto* bytes = static_cast<const std::uint8_t*>(code.pShaderBytecode);
2240 const std::size_t size = bytes ? code.BytecodeLength : 0;
2241 key.tag(stage).u32(std::uint32_t(size)).u32(std::uint32_t(std::uint64_t(size) >> 32));
2242 if (size >= 20 && std::memcmp(bytes, "DXBC", 4) == 0 &&
2243 std::any_of(bytes + 4, bytes + 20, [](std::uint8_t b) { return b != 0; })) {
2244 key.bytes(bytes + 4, 16);
2245 return;
2246 }
2247 std::uint64_t h = 0xcbf29ce484222325ull;
2248 for (std::size_t i = 0; i < size; ++i) h = (h ^ bytes[i]) * 0x100000001b3ull;
2249 key.u32(std::uint32_t(h)).u32(std::uint32_t(h >> 32));
2250}
2251
2252void key_root_signature(leonida::cached_pso::KeyBuilder& key, ID3D12RootSignature* signature);
2253
2254// The parts of a compute description the PC runtime matches a cached PSO against (not Flags, measured).
2255leonida::cached_pso::Key pipeline_key(const D3D12_COMPUTE_PIPELINE_STATE_DESC& desc) {
2256 leonida::cached_pso::KeyBuilder key;
2257 key.tag("compute");
2258 key_root_signature(key, desc.pRootSignature);
2259 key_shader(key, "cs", desc.CS);
2260 key.u32(desc.NodeMask);
2261 return leonida::sha256_hex(key.data());
2262}
2263
2264leonida::cached_pso::Key pipeline_key(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& desc) {
2265 leonida::cached_pso::KeyBuilder key;
2266 key.tag("graphics");
2267 key_root_signature(key, desc.pRootSignature);
2268 key_shader(key, "vs", desc.VS);
2269 key_shader(key, "ps", desc.PS);
2270 key_shader(key, "ds", desc.DS);
2271 key_shader(key, "hs", desc.HS);
2272 key_shader(key, "gs", desc.GS);
2273 const D3D12_STREAM_OUTPUT_DESC& so = desc.StreamOutput;
2274 key.u32(so.pSODeclaration ? so.NumEntries : 0);
2275 for (UINT i = 0; so.pSODeclaration && i < so.NumEntries; ++i) {
2276 const D3D12_SO_DECLARATION_ENTRY& e = so.pSODeclaration[i];
2277 key.u32(e.Stream).text(e.SemanticName).u32(e.SemanticIndex).u32(e.StartComponent).u32(e.ComponentCount);
2278 key.u32(e.OutputSlot);
2279 }
2280 key.u32(so.pBufferStrides ? so.NumStrides : 0);
2281 for (UINT i = 0; so.pBufferStrides && i < so.NumStrides; ++i) key.u32(so.pBufferStrides[i]);
2282 key.u32(so.RasterizedStream);
2283 const D3D12_BLEND_DESC& blend = desc.BlendState;
2284 key.u32(blend.AlphaToCoverageEnable).u32(blend.IndependentBlendEnable);
2285 for (const D3D12_RENDER_TARGET_BLEND_DESC& t : blend.RenderTarget)
2286 key.u32(t.BlendEnable).u32(t.LogicOpEnable).u32(t.SrcBlend).u32(t.DestBlend).u32(t.BlendOp).u32(t.SrcBlendAlpha)
2287 .u32(t.DestBlendAlpha).u32(t.BlendOpAlpha).u32(t.LogicOp).u32(t.RenderTargetWriteMask);
2288 key.u32(desc.SampleMask);
2289 const D3D12_RASTERIZER_DESC& r = desc.RasterizerState;
2290 std::uint32_t bias_clamp = 0, slope = 0;
2291 std::memcpy(&bias_clamp, &r.DepthBiasClamp, 4);
2292 std::memcpy(&slope, &r.SlopeScaledDepthBias, 4);
2293 key.u32(r.FillMode).u32(r.CullMode).u32(r.FrontCounterClockwise).u32(std::uint32_t(r.DepthBias)).u32(bias_clamp);
2294 key.u32(slope).u32(r.DepthClipEnable).u32(r.MultisampleEnable).u32(r.AntialiasedLineEnable);
2295 key.u32(r.ForcedSampleCount).u32(r.ConservativeRaster);
2296 const D3D12_DEPTH_STENCIL_DESC& d = desc.DepthStencilState;
2297 key.u32(d.DepthEnable).u32(d.DepthWriteMask).u32(d.DepthFunc).u32(d.StencilEnable).u32(d.StencilReadMask);
2298 key.u32(d.StencilWriteMask);
2299 for (const D3D12_DEPTH_STENCILOP_DESC& face : {d.FrontFace, d.BackFace})
2300 key.u32(face.StencilFailOp).u32(face.StencilDepthFailOp).u32(face.StencilPassOp).u32(face.StencilFunc);
2301 const D3D12_INPUT_LAYOUT_DESC& input = desc.InputLayout;
2302 key.u32(input.pInputElementDescs ? input.NumElements : 0);
2303 for (UINT i = 0; input.pInputElementDescs && i < input.NumElements; ++i) {
2304 const D3D12_INPUT_ELEMENT_DESC& e = input.pInputElementDescs[i];
2305 key.text(e.SemanticName).u32(e.SemanticIndex).u32(e.Format).u32(e.InputSlot).u32(e.AlignedByteOffset);
2306 key.u32(e.InputSlotClass).u32(e.InstanceDataStepRate);
2307 }
2308 key.u32(desc.IBStripCutValue).u32(desc.PrimitiveTopologyType).u32(desc.NumRenderTargets);
2309 for (const DXGI_FORMAT format : desc.RTVFormats) key.u32(format);
2310 key.u32(desc.DSVFormat).u32(desc.SampleDesc.Count).u32(desc.SampleDesc.Quality).u32(desc.NodeMask);
2311 return leonida::sha256_hex(key.data());
2312}
2313
2314// CachedPSO as the PC runtime checks it before creating the PSO (src/cached_pso.h has the measured answers).
2315HRESULT check_cached_pso(const leonida::cached_pso::Identity& identity, const leonida::cached_pso::Key& key,
2316 const D3D12_CACHED_PIPELINE_STATE& cached) {
2317 if (!cached.pCachedBlob) return S_OK;
2318 if (!cached.CachedBlobSizeInBytes) return E_INVALIDARG;
2319 using leonida::cached_pso::Check;
2320 switch (leonida::cached_pso::check(identity, key,
2321 {static_cast<const std::uint8_t*>(cached.pCachedBlob), cached.CachedBlobSizeInBytes})) {
2322 case Check::accepted: return S_OK;
2323 case Check::other_adapter: return D3D12_ERROR_ADAPTER_NOT_FOUND;
2324 case Check::other_driver: return D3D12_ERROR_DRIVER_VERSION_MISMATCH;
2325 default: return E_INVALIDARG;
2326 }
2327}
2328
2173// A pipeline state. Compute only for now: the shader is found by the SHA-256 of its FSSM program in the 2329// A pipeline state. Compute only for now: the shader is found by the SHA-256 of its FSSM program in the
2174// translator's index, and the FSSM blob is copied into the arena as the shader's code base. 2330// translator's index, and the FSSM blob is copied into the arena as the shader's code base.
2175class PipelineState final 2331class PipelineState final
@@ -2220,6 +2376,15 @@ public:
2220 } 2376 }
2221 2377
2222 std::uintptr_t id() const { return reinterpret_cast<std::uintptr_t>(static_cast<const ID3D12PipelineState*>(this)); } 2378 std::uintptr_t id() const { return reinterpret_cast<std::uintptr_t>(static_cast<const ID3D12PipelineState*>(this)); }
2379 void set_cache_key(leonida::cached_pso::Key key) { cache_key_ = std::move(key); }
2380
2381 // A null pointer is accepted with S_OK, as by the PC runtime (measured on an RTX 3060 and WARP).
2382 HRESULT STDMETHODCALLTYPE GetCachedBlob(ID3DBlob** blob) override {
2383 if (!blob) return S_OK;
2384 *blob = new CachedBlob(leonida::cached_pso::encode(device_.pso_identity, cache_key_));
2385 return S_OK;
2386 }
2387
2223 bool compute() const { return registered_ && !is_graphics_; } 2388 bool compute() const { return registered_ && !is_graphics_; }
2224 bool graphics() const { return registered_ && is_graphics_; } 2389 bool graphics() const { return registered_ && is_graphics_; }
2225 const std::vector<leonida::SubgroupRequest>& subgroup_requests() const { return subgroup_requests_; } 2390 const std::vector<leonida::SubgroupRequest>& subgroup_requests() const { return subgroup_requests_; }
@@ -2819,8 +2984,20 @@ private:
2819 bool registered_ = false; 2984 bool registered_ = false;
2820 bool is_graphics_ = false; 2985 bool is_graphics_ = false;
2821 std::vector<leonida::SubgroupRequest> subgroup_requests_; // one per stage, in creation order 2986 std::vector<leonida::SubgroupRequest> subgroup_requests_; // one per stage, in creation order
2987 leonida::cached_pso::Key cache_key_;
2822}; 2988};
2823 2989
2990void key_root_signature(leonida::cached_pso::KeyBuilder& key, ID3D12RootSignature* signature) {
2991 if (!signature) {
2992 key.tag("no root signature");
2993 } else if (const RootSignature* own = RootSignature::from<RootSignature>(signature)) {
2994 key.tag("root signature").text(own->content().c_str());
2995 } else {
2996 const auto address = reinterpret_cast<std::uintptr_t>(signature);
2997 key.tag("foreign root signature").bytes(&address, sizeof(address));
2998 }
2999}
3000
2824// A view of a texture as Create*View describes it, before the resource's own shape is applied. 3001// A view of a texture as Create*View describes it, before the resource's own shape is applied.
2825struct TextureView { 3002struct TextureView {
2826 DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN; // UNKNOWN: the resource's 3003 DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN; // UNKNOWN: the resource's
@@ -2927,6 +3104,267 @@ private:
2927 std::unordered_map<std::wstring, ID3D12PipelineState*> entries_; 3104 std::unordered_map<std::wstring, ID3D12PipelineState*> entries_;
2928}; 3105};
2929 3106
3107// Process-wide backing for ID3D12Device9::CreateShaderCacheSession and ID3D12ShaderCacheSession (D3D-34).
3108// Sessions in the same process sharing (Identifier, Mode, Version, disk_path) share their entries; MODE_DISK
3109// persists entries to a versioned binary file so data survives device/process teardown; SetDeleteOnDestroy
3110// removes the backing store (and disk file, if any) once the last live session referencing it is released.
3111struct ShaderCacheKey {
3112 GUID identifier{};
3113 D3D12_SHADER_CACHE_MODE mode = D3D12_SHADER_CACHE_MODE_MEMORY;
3114 UINT64 version = 0;
3115 std::wstring disk_path; // empty for MODE_MEMORY
3116
3117 bool operator<(const ShaderCacheKey& other) const {
3118 const int cmp = std::memcmp(&identifier, &other.identifier, sizeof(GUID));
3119 if (cmp != 0) return cmp < 0;
3120 if (mode != other.mode) return mode < other.mode;
3121 if (version != other.version) return version < other.version;
3122 return disk_path < other.disk_path;
3123 }
3124};
3125
3126struct ShaderCacheStore {
3127 static constexpr std::uint32_t kDiskMagic = 0x3143534Cu; // "LSC1"
3128 static constexpr std::uint32_t kDiskVersion = 1;
3129
3130 std::mutex mutex;
3131 std::map<std::string, std::vector<std::uint8_t>> entries;
3132 std::size_t total_bytes = 0;
3133 std::uint32_t live_sessions = 0;
3134 bool delete_on_destroy = false;
3135 std::filesystem::path disk_path;
3136
3137 void load_from_disk_locked() {
3138 if (disk_path.empty()) return;
3139 std::ifstream in(disk_path, std::ios::binary);
3140 if (!in) return;
3141 std::uint32_t header[3]{};
3142 if (!in.read(reinterpret_cast<char*>(header), sizeof(header))) return;
3143 if (header[0] != kDiskMagic || header[1] != kDiskVersion) return;
3144 const std::uint32_t count = header[2];
3145 std::map<std::string, std::vector<std::uint8_t>> loaded;
3146 std::size_t bytes = 0;
3147 for (std::uint32_t i = 0; i < count; ++i) {
3148 std::uint32_t lens[2]{};
3149 if (!in.read(reinterpret_cast<char*>(lens), sizeof(lens))) return;
3150 if (!lens[0] || !lens[1]) return;
3151 std::string k(lens[0], '\0');
3152 std::vector<std::uint8_t> v(lens[1]);
3153 if (!in.read(k.data(), lens[0]) || !in.read(reinterpret_cast<char*>(v.data()), lens[1])) return;
3154 loaded.emplace(std::move(k), std::move(v));
3155 bytes += lens[1];
3156 }
3157 entries = std::move(loaded);
3158 total_bytes = bytes;
3159 }
3160
3161 bool save_to_disk_locked() const {
3162 if (disk_path.empty()) return true;
3163 std::error_code ec;
3164 std::filesystem::create_directories(disk_path.parent_path(), ec);
3165 std::filesystem::path tmp = disk_path;
3166 tmp += L".tmp";
3167 {
3168 std::ofstream out(tmp, std::ios::binary | std::ios::trunc);
3169 if (!out) return false;
3170 const std::uint32_t header[3] = {kDiskMagic, kDiskVersion, static_cast<std::uint32_t>(entries.size())};
3171 out.write(reinterpret_cast<const char*>(header), sizeof(header));
3172 for (const auto& [k, v] : entries) {
3173 const std::uint32_t lens[2] = {static_cast<std::uint32_t>(k.size()),
3174 static_cast<std::uint32_t>(v.size())};
3175 out.write(reinterpret_cast<const char*>(lens), sizeof(lens));
3176 out.write(k.data(), static_cast<std::streamsize>(k.size()));
3177 out.write(reinterpret_cast<const char*>(v.data()), static_cast<std::streamsize>(v.size()));
3178 }
3179 if (!out.good()) return false;
3180 }
3181 if (!MoveFileExW(tmp.c_str(), disk_path.c_str(), MOVEFILE_REPLACE_EXISTING)) {
3182 std::filesystem::remove(tmp, ec);
3183 return false;
3184 }
3185 return true;
3186 }
3187
3188 void clear() {
3189 std::lock_guard lock(mutex);
3190 entries.clear();
3191 total_bytes = 0;
3192 if (!disk_path.empty()) {
3193 std::error_code ec;
3194 std::filesystem::remove(disk_path, ec);
3195 }
3196 }
3197};
3198
3199struct ShaderCacheRegistry {
3200 std::mutex mutex;
3201 std::map<ShaderCacheKey, std::shared_ptr<ShaderCacheStore>> stores;
3202 std::atomic<bool> disabled{false};
3203
3204 std::shared_ptr<ShaderCacheStore> acquire(const ShaderCacheKey& key) {
3205 std::lock_guard lock(mutex);
3206 auto& slot = stores[key];
3207 if (!slot) {
3208 slot = std::make_shared<ShaderCacheStore>();
3209 if (key.mode == D3D12_SHADER_CACHE_MODE_DISK && !key.disk_path.empty()) {
3210 slot->disk_path = key.disk_path;
3211 std::lock_guard store_lock(slot->mutex);
3212 slot->load_from_disk_locked();
3213 }
3214 }
3215 ++slot->live_sessions;
3216 return slot;
3217 }
3218
3219 void mark_delete_on_destroy(const std::shared_ptr<ShaderCacheStore>& store) {
3220 std::lock_guard lock(mutex);
3221 if (store) store->delete_on_destroy = true;
3222 }
3223
3224 void release(const ShaderCacheKey& key, const std::shared_ptr<ShaderCacheStore>& store) {
3225 std::lock_guard lock(mutex);
3226 if (!store) return;
3227 if (store->live_sessions > 0) --store->live_sessions;
3228 if (store->live_sessions == 0) {
3229 if (store->delete_on_destroy) {
3230 if (!store->disk_path.empty()) {
3231 std::error_code ec;
3232 std::filesystem::remove(store->disk_path, ec);
3233 }
3234 const auto it = stores.find(key);
3235 if (it != stores.end() && it->second == store) stores.erase(it);
3236 } else if (key.mode == D3D12_SHADER_CACHE_MODE_DISK) {
3237 // Evict idle disk stores from memory so reopening reloads from disk.
3238 const auto it = stores.find(key);
3239 if (it != stores.end() && it->second == store) stores.erase(it);
3240 }
3241 }
3242 }
3243
3244 void clear_all() {
3245 std::vector<std::shared_ptr<ShaderCacheStore>> snapshot;
3246 {
3247 std::lock_guard lock(mutex);
3248 snapshot.reserve(stores.size());
3249 for (const auto& [k, v] : stores) snapshot.push_back(v);
3250 }
3251 for (const auto& store : snapshot) store->clear();
3252 }
3253};
3254
3255ShaderCacheRegistry& process_shader_cache_registry() {
3256 static auto* registry = new ShaderCacheRegistry();
3257 return *registry;
3258}
3259
3260std::filesystem::path shader_cache_disk_path(const D3D12_SHADER_CACHE_SESSION_DESC& desc,
3261 const VkPhysicalDeviceProperties& gpu_props) {
3262 std::error_code ec;
3263 std::filesystem::path dir = (desc.Flags & D3D12_SHADER_CACHE_FLAG_USE_WORKING_DIR)
3264 ? std::filesystem::current_path(ec)
3265 : (std::filesystem::temp_directory_path(ec) / L"leonida_shader_cache");
3266 if (ec || dir.empty()) return {};
3267 wchar_t name[160]{};
3268 const auto& g = desc.Identifier;
3269 if (desc.Flags & D3D12_SHADER_CACHE_FLAG_DRIVER_VERSIONED) {
3270 std::swprintf(name, std::size(name),
3271 L"leonida_sc_%08lx%04x%04x%02x%02x%02x%02x%02x%02x%02x%02x_v%llu_d%04x_%04x_%08x.bin",
3272 static_cast<unsigned long>(g.Data1), g.Data2, g.Data3, g.Data4[0], g.Data4[1], g.Data4[2],
3273 g.Data4[3], g.Data4[4], g.Data4[5], g.Data4[6], g.Data4[7],
3274 static_cast<unsigned long long>(desc.Version), gpu_props.vendorID, gpu_props.deviceID,
3275 gpu_props.driverVersion);
3276 } else {
3277 std::swprintf(name, std::size(name), L"leonida_sc_%08lx%04x%04x%02x%02x%02x%02x%02x%02x%02x%02x_v%llu.bin",
3278 static_cast<unsigned long>(g.Data1), g.Data2, g.Data3, g.Data4[0], g.Data4[1], g.Data4[2],
3279 g.Data4[3], g.Data4[4], g.Data4[5], g.Data4[6], g.Data4[7],
3280 static_cast<unsigned long long>(desc.Version));
3281 }
3282 return dir / name;
3283}
3284
3285class ShaderCacheSession final
3286 : public Child<ShaderCacheSession, ID3D12ShaderCacheSessionStubs, ID3D12Object, ID3D12DeviceChild,
3287 ID3D12ShaderCacheSession> {
3288public:
3289 // {9a4f1b2c-8d6e-43a7-b152-7e3c9f0d4a81}
3290 static constexpr GUID kTag{0x9a4f1b2c, 0x8d6e, 0x43a7, {0xb1, 0x52, 0x7e, 0x3c, 0x9f, 0x0d, 0x4a, 0x81}};
3291
3292 ShaderCacheSession(const D3D12_SHADER_CACHE_SESSION_DESC& desc, const ShaderCacheKey& key,
3293 ShaderCacheRegistry& registry, std::shared_ptr<ShaderCacheStore> store)
3294 : desc_(desc), key_(key), registry_(&registry), store_(std::move(store)) {}
3295
3296 ~ShaderCacheSession() override {
3297 if (registry_) registry_->release(key_, store_);
3298 }
3299
3300 HRESULT STDMETHODCALLTYPE FindValue(const void* key, UINT key_size, void* value, UINT* value_size) override {
3301 if (!key || !key_size || !value_size) return E_INVALIDARG;
3302 if (registry_ && registry_->disabled.load(std::memory_order_relaxed)) return DXGI_ERROR_NOT_FOUND;
3303 std::lock_guard lock(store_->mutex);
3304 const std::string k(static_cast<const char*>(key), key_size);
3305 const auto it = store_->entries.find(k);
3306 if (it == store_->entries.end()) return DXGI_ERROR_NOT_FOUND;
3307 const UINT stored_size = static_cast<UINT>(it->second.size());
3308 if (!value) {
3309 *value_size = stored_size;
3310 return S_OK;
3311 }
3312 if (*value_size < stored_size) {
3313 *value_size = stored_size;
3314 return DXGI_ERROR_MORE_DATA;
3315 }
3316 std::memcpy(value, it->second.data(), stored_size);
3317 *value_size = stored_size;
3318 return S_OK;
3319 }
3320
3321 HRESULT STDMETHODCALLTYPE StoreValue(const void* key, UINT key_size, const void* value, UINT value_size) override {
3322 if (!key || !key_size || !value || !value_size) return E_INVALIDARG;
3323 if (registry_ && registry_->disabled.load(std::memory_order_relaxed)) return S_OK;
3324 std::lock_guard lock(store_->mutex);
3325 const std::string k(static_cast<const char*>(key), key_size);
3326 if (store_->entries.find(k) != store_->entries.end()) return DXGI_ERROR_ALREADY_EXISTS;
3327 if (desc_.MaximumInMemoryCacheEntries && store_->entries.size() >= desc_.MaximumInMemoryCacheEntries)
3328 return E_OUTOFMEMORY;
3329 if (desc_.MaximumInMemoryCacheSizeBytes &&
3330 (value_size > desc_.MaximumInMemoryCacheSizeBytes ||
3331 store_->total_bytes > desc_.MaximumInMemoryCacheSizeBytes - value_size))
3332 return E_OUTOFMEMORY;
3333 if (desc_.Mode == D3D12_SHADER_CACHE_MODE_DISK && desc_.MaximumValueFileSizeBytes &&
3334 (value_size > desc_.MaximumValueFileSizeBytes ||
3335 store_->total_bytes > desc_.MaximumValueFileSizeBytes - value_size))
3336 return E_OUTOFMEMORY;
3337 const auto* bytes = static_cast<const std::uint8_t*>(value);
3338 auto [it, inserted] = store_->entries.emplace(k, std::vector<std::uint8_t>(bytes, bytes + value_size));
3339 store_->total_bytes += value_size;
3340 if (desc_.Mode == D3D12_SHADER_CACHE_MODE_DISK && !store_->save_to_disk_locked()) {
3341 store_->total_bytes -= value_size;
3342 store_->entries.erase(it);
3343 return E_FAIL;
3344 }
3345 return S_OK;
3346 }
3347
3348 void STDMETHODCALLTYPE SetDeleteOnDestroy() override {
3349 if (registry_) registry_->mark_delete_on_destroy(store_);
3350 }
3351
3352#if defined(_MSC_VER) || !defined(_WIN32)
3353 D3D12_SHADER_CACHE_SESSION_DESC STDMETHODCALLTYPE GetDesc() override { return desc_; }
3354#else
3355 D3D12_SHADER_CACHE_SESSION_DESC* STDMETHODCALLTYPE GetDesc(D3D12_SHADER_CACHE_SESSION_DESC* out) override {
3356 *out = desc_;
3357 return out;
3358 }
3359#endif
3360
3361private:
3362 D3D12_SHADER_CACHE_SESSION_DESC desc_{};
3363 ShaderCacheKey key_{};
3364 ShaderCacheRegistry* registry_ = nullptr;
3365 std::shared_ptr<ShaderCacheStore> store_;
3366};
3367
2930// The T# of a view: what the shader gets to know about it, in the structure the console's shaders read. 3368// The T# of a view: what the shader gets to know about it, in the structure the console's shaders read.
2931// False (with a log) for a view set 0 cannot show yet. 3369// False (with a log) for a view set 0 cannot show yet.
2932bool image_descriptor(const Resource& resource, const TextureView& view, leonida::gfx10::Image& out) { 3370bool image_descriptor(const Resource& resource, const TextureView& view, leonida::gfx10::Image& out) {
@@ -2988,17 +3426,31 @@ bool image_descriptor(const Resource& resource, const TextureView& view, leonida
2988 return false; 3426 return false;
2989 } 3427 }
2990 } 3428 }
2991 // The depth plane of a depth-stencil texture, as R24_UNORM_X8_TYPELESS (D24S8) or R32_FLOAT_X8X24_TYPELESS 3429 // Depth and depth-stencil textures can only be viewed through their own family's depth-plane SRV format (or
2992 // (D32S8): the texture's own depth format, whose T# code is the console's depth format (8_24_UNORM or 3430 // UNKNOWN on typed depth textures): in Vulkan a depth image's view format must equal the image's own depth
2993 // X24_8_32_FLOAT) with the depth in R; bind_image views the depth aspect for it. As in D3D12, each view format 3431 // format (VUID-VkImageViewCreateInfo-image-01762 / 09594), so colour view formats such as R16_FLOAT on D16 or
2994 // belongs to its own family only: the other family's depth view leaves the slot null, whatever format backs the 3432 // R32_UINT on D32 must be rejected. Each view format belongs to its own DXGI family only, whatever format
2995 // texture (a D24 texture may be D32_SFLOAT_S8_UINT underneath). 3433 // backs the texture (a D24 texture may be D32_SFLOAT_S8_UINT underneath).
2996 const DXGI_FORMAT family = desc.Format; 3434 const bool depth_plane = (resource.aspects() & VK_IMAGE_ASPECT_DEPTH_BIT) && !stencil;
2997 const bool d24_family = family == DXGI_FORMAT_R24G8_TYPELESS || family == DXGI_FORMAT_D24_UNORM_S8_UINT; 3435 if (depth_plane) {
2998 const bool d32s8_family = family == DXGI_FORMAT_R32G8X24_TYPELESS || family == DXGI_FORMAT_D32_FLOAT_S8X24_UINT; 3436 const bool depth_format_fits =
2999 const bool depth_plane = ((view.format == DXGI_FORMAT_R24_UNORM_X8_TYPELESS && d24_family) || 3437 (desc.Format == DXGI_FORMAT_D16_UNORM &&
3000 (view.format == DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS && d32s8_family)) && 3438 (view.format == DXGI_FORMAT_UNKNOWN || view.format == DXGI_FORMAT_R16_UNORM)) ||
3001 (resource.aspects() & VK_IMAGE_ASPECT_DEPTH_BIT); 3439 (desc.Format == DXGI_FORMAT_R16_TYPELESS && view.format == DXGI_FORMAT_R16_UNORM) ||
3440 (desc.Format == DXGI_FORMAT_D32_FLOAT &&
3441 (view.format == DXGI_FORMAT_UNKNOWN || view.format == DXGI_FORMAT_R32_FLOAT)) ||
3442 (desc.Format == DXGI_FORMAT_R32_TYPELESS && view.format == DXGI_FORMAT_R32_FLOAT) ||
3443 (desc.Format == DXGI_FORMAT_D24_UNORM_S8_UINT &&
3444 (view.format == DXGI_FORMAT_UNKNOWN || view.format == DXGI_FORMAT_R24_UNORM_X8_TYPELESS)) ||
3445 (desc.Format == DXGI_FORMAT_R24G8_TYPELESS && view.format == DXGI_FORMAT_R24_UNORM_X8_TYPELESS) ||
3446 (desc.Format == DXGI_FORMAT_D32_FLOAT_S8X24_UINT &&
3447 (view.format == DXGI_FORMAT_UNKNOWN || view.format == DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS)) ||
3448 (desc.Format == DXGI_FORMAT_R32G8X24_TYPELESS && view.format == DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS);
3449 if (!depth_format_fits) {
3450 log_once("incompatible depth shader-resource view format:", int(view.format));
3451 return false;
3452 }
3453 }
3002 if (view.format != DXGI_FORMAT_UNKNOWN && !stencil && !depth_plane) { 3454 if (view.format != DXGI_FORMAT_UNKNOWN && !stencil && !depth_plane) {
3003 if ((view.format == DXGI_FORMAT_A8_UNORM) != (desc.Format == DXGI_FORMAT_A8_UNORM)) { 3455 if ((view.format == DXGI_FORMAT_A8_UNORM) != (desc.Format == DXGI_FORMAT_A8_UNORM)) {
3004 log_once("incompatible typed A8 view format:", int(view.format)); 3456 log_once("incompatible typed A8 view format:", int(view.format));
@@ -3013,6 +3465,10 @@ bool image_descriptor(const Resource& resource, const TextureView& view, leonida
3013 return false; 3465 return false;
3014 } 3466 }
3015 named = texture_storage_format(view.format, false).format; 3467 named = texture_storage_format(view.format, false).format;
3468 if (g::is_depth_stencil_format(named)) {
3469 log_once("depth-stencil view format on a colour texture:", int(view.format));
3470 return false;
3471 }
3016 } 3472 }
3017 // A 96-bit texture takes views of its own family only (and a four-channel texture none of it), and only the 3473 // A 96-bit texture takes views of its own family only (and a four-channel texture none of it), and only the
3018 // TYPELESS one is cast between FLOAT, UINT and SINT. Its T# names the three-channel format: the swizzle below 3474 // TYPELESS one is cast between FLOAT, UINT and SINT. Its T# names the three-channel format: the swizzle below
@@ -3282,6 +3738,10 @@ public:
3282 if (get_props) { 3738 if (get_props) {
3283 VkPhysicalDeviceProperties props{}; 3739 VkPhysicalDeviceProperties props{};
3284 get_props(info.physical, &props); 3740 get_props(info.physical, &props);
3741 state_.pso_identity.vendor = props.vendorID;
3742 state_.pso_identity.device = props.deviceID;
3743 state_.pso_identity.driver = props.driverVersion;
3744 std::memcpy(state_.pso_identity.cache_uuid, props.pipelineCacheUUID, VK_UUID_SIZE);
3285 if (state_.info.max_push_constants_size == 0) { 3745 if (state_.info.max_push_constants_size == 0) {
3286 state_.info.max_push_constants_size = props.limits.maxPushConstantsSize; 3746 state_.info.max_push_constants_size = props.limits.maxPushConstantsSize;
3287 state_.info.push_constants_need_fallback = (state_.info.max_push_constants_size < 144); 3747 state_.info.push_constants_need_fallback = (state_.info.max_push_constants_size < 144);
@@ -3312,6 +3772,14 @@ public:
3312 info.conditional_rendering, info.ray_tracing, 3772 info.conditional_rendering, info.ray_tracing,
3313 info.xdxr_acceleration_structures && 3773 info.xdxr_acceleration_structures &&
3314 info.buffer_device_address); 3774 info.buffer_device_address);
3775 if (info.physical && state_.format_properties) {
3776 state_.context->set_color_attachment_format(
3777 [physical = info.physical, get_props = state_.format_properties](VkFormat format) {
3778 VkFormatProperties properties{};
3779 get_props(physical, format, &properties);
3780 return (properties.optimalTilingFeatures & VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT) != 0;
3781 });
3782 }
3315 if (info.buffer_device_address && state_.context->loaded() && !create_arena()) 3783 if (info.buffer_device_address && state_.context->loaded() && !create_arena())
3316 std::fprintf(stderr, "[rt] d3d12: the GPU address arena could not be created\n"); 3784 std::fprintf(stderr, "[rt] d3d12: the GPU address arena could not be created\n");
3317 if (info.conditional_rendering) { 3785 if (info.conditional_rendering) {
@@ -3426,7 +3894,16 @@ public:
3426 const auto layout_support = reinterpret_cast<PFN_vkGetDescriptorSetLayoutSupport>( 3894 const auto layout_support = reinterpret_cast<PFN_vkGetDescriptorSetLayoutSupport>(
3427 get_device(state_.info.device, "vkGetDescriptorSetLayoutSupport")); 3895 get_device(state_.info.device, "vkGetDescriptorSetLayoutSupport"));
3428 std::function<bool(const leonida::BindlessFeatures&)> layout_supported; 3896 std::function<bool(const leonida::BindlessFeatures&)> layout_supported;
3429 if (layout_support) 3897 // MoltenVK's vkGetDescriptorSetLayoutSupport compares every layout with maxPerSetDescriptors (1212, the
3898 // limit without argument buffers) and rejects even 1212 itself, while it creates and samples a 65536-image,
3899 // 4096-sampler update-after-bind set correctly (docs/d3d12_vulkan.md section 5). There size_bindings'
3900 // per-type update-after-bind limits, which MoltenVK takes from Metal's argument-buffer limits, decide.
3901 VkPhysicalDeviceDriverProperties driver{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES};
3902 VkPhysicalDeviceProperties2 driver_properties{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, &driver};
3903 get_properties(state_.info.physical, &driver_properties);
3904 if (driver.driverID == VK_DRIVER_ID_MOLTENVK)
3905 layout_supported = [](const leonida::BindlessFeatures&) { return true; };
3906 else if (layout_support)
3430 layout_supported = [&](const leonida::BindlessFeatures& candidate) { 3907 layout_supported = [&](const leonida::BindlessFeatures& candidate) {
3431 const leonida::bindless::SetLayout layout(candidate); 3908 const leonida::bindless::SetLayout layout(candidate);
3432 VkDescriptorSetLayoutSupport support{VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT}; 3909 VkDescriptorSetLayoutSupport support{VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT};
@@ -3447,6 +3924,13 @@ public:
3447 features.counts[b::sampled_binding(leonida::ImageDimension::dim_3d)], 3924 features.counts[b::sampled_binding(leonida::ImageDimension::dim_3d)],
3448 features.counts[b::sampled_binding(leonida::ImageDimension::dim_1d)], 3925 features.counts[b::sampled_binding(leonida::ImageDimension::dim_1d)],
3449 features.counts[b::storage_binding(leonida::ImageDimension::dim_2d, 0)]); 3926 features.counts[b::storage_binding(leonida::ImageDimension::dim_2d, 0)]);
3927 // D3D12 promises a shader holds a full shader-visible sampler heap. Past this many distinct S#s, CreateSampler
3928 // logs that the array is full and a shader reads the fallback (clamping) sampler.
3929 if (features.counts[b::sampler_binding] < D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE + 1)
3930 std::fprintf(stderr, "[rt] d3d12: the bindless set holds fewer samplers than a full shader-visible "
3931 "sampler heap (%u of %u besides the fallback): its limits or "
3932 "vkGetDescriptorSetLayoutSupport allow no more\n",
3933 features.counts[b::sampler_binding] - 1, unsigned(D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE));
3450 state_.bindless = std::make_unique<leonida::BindlessSet>(get_device, state_.info.device, state_.memory, features); 3934 state_.bindless = std::make_unique<leonida::BindlessSet>(get_device, state_.info.device, state_.memory, features);
3451 if (!state_.bindless->ok() || !state_.context->vk.vkCreateSampler) { 3935 if (!state_.bindless->ok() || !state_.context->vk.vkCreateSampler) {
3452 state_.bindless.reset(); 3936 state_.bindless.reset();
@@ -3719,7 +4203,10 @@ public:
3719 log_once("CreateCommandQueue refused (type, priority, flags or node mask), type", desc->Type); 4203 log_once("CreateCommandQueue refused (type, priority, flags or node mask), type", desc->Type);
3720 return d3d12_trace::result(method, E_INVALIDARG); 4204 return d3d12_trace::result(method, E_INVALIDARG);
3721 } 4205 }
3722 // Global realtime priority needs SeIncreaseBasePriorityPrivilege enabled in the token; without it, this answer. 4206 // Global realtime priority needs SeIncreaseBasePriorityPrivilege enabled in the effective token, as on the
4207 // Windows D3D12 runtime; without it, this answer. Vulkan queue priorities (and VK_KHR_global_priority) are
4208 // fixed at vkCreateDevice time before CreateCommandQueue is called, so a privileged request leases from the
4209 // device's pre-created VkQueue pool like D3D12_COMMAND_QUEUE_PRIORITY_HIGH and logs the approximation once.
3723 if (desc->Priority == D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME && !has_global_realtime_privilege()) { 4210 if (desc->Priority == D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME && !has_global_realtime_privilege()) {
3724 log_once("CreateCommandQueue refused (global realtime priority), type", desc->Type); 4211 log_once("CreateCommandQueue refused (global realtime priority), type", desc->Type);
3725 return d3d12_trace::result(method, DXGI_ERROR_ACCESS_DENIED); 4212 return d3d12_trace::result(method, DXGI_ERROR_ACCESS_DENIED);
@@ -3728,6 +4215,9 @@ public:
3728 *out = nullptr; 4215 *out = nullptr;
3729 if (desc->Type != D3D12_COMMAND_LIST_TYPE_DIRECT && desc->Type != D3D12_COMMAND_LIST_TYPE_COMPUTE && 4216 if (desc->Type != D3D12_COMMAND_LIST_TYPE_DIRECT && desc->Type != D3D12_COMMAND_LIST_TYPE_COMPUTE &&
3730 desc->Type != D3D12_COMMAND_LIST_TYPE_COPY) return d3d12_trace::result(method, E_INVALIDARG); 4217 desc->Type != D3D12_COMMAND_LIST_TYPE_COPY) return d3d12_trace::result(method, E_INVALIDARG);
4218 if (desc->Priority == D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME)
4219 log_once("CreateCommandQueue: global realtime priority runs on a standard-priority Vulkan queue, type",
4220 desc->Type);
3731 // Caller-owned devices that only provide the legacy queue cannot acquire more handles from their VkDevice. 4221 // Caller-owned devices that only provide the legacy queue cannot acquire more handles from their VkDevice.
3732 if (state_.info.command_queues.empty()) 4222 if (state_.info.command_queues.empty())
3733 return d3d12_trace::result(method, create_command_queue(*state_.context, state_.info.queue, 4223 return d3d12_trace::result(method, create_command_queue(*state_.context, state_.info.queue,
@@ -3769,15 +4259,8 @@ public:
3769 HRESULT STDMETHODCALLTYPE CreateCommandList(UINT, D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator* allocator, 4259 HRESULT STDMETHODCALLTYPE CreateCommandList(UINT, D3D12_COMMAND_LIST_TYPE type, ID3D12CommandAllocator* allocator,
3770 ID3D12PipelineState* state, REFIID riid, void** out) override { 4260 ID3D12PipelineState* state, REFIID riid, void** out) override {
3771 constexpr auto method = "ID3D12Device::CreateCommandList"; 4261 constexpr auto method = "ID3D12Device::CreateCommandList";
3772 HRESULT hr = create_command_list(type, allocator, riid, out, identity()); 4262 // The initial pipeline state is set as SetPipelineState would set it (a bundle's is its first deferred call).
3773 // The initial pipeline state is set as SetPipelineState would set it. 4263 HRESULT hr = create_command_list(type, allocator, riid, out, identity(), state);
3774 if (SUCCEEDED(hr) && state) {
3775 ID3D12GraphicsCommandList* list = nullptr;
3776 if (SUCCEEDED(static_cast<IUnknown*>(*out)->QueryInterface(IID_PPV_ARGS(&list)))) {
3777 list->SetPipelineState(state);
3778 list->Release();
3779 }
3780 }
3781 return d3d12_trace::result(method, hr); 4264 return d3d12_trace::result(method, hr);
3782 } 4265 }
3783 4266
@@ -3825,7 +4308,7 @@ public:
3825 // arguments, and a stride that is a multiple of 4 and holds every argument. 4308 // arguments, and a stride that is a multiple of 4 and holds every argument.
3826 if (!desc || desc->NumArgumentDescs == 0 || !desc->pArgumentDescs || (desc->NodeMask & ~1u)) 4309 if (!desc || desc->NumArgumentDescs == 0 || !desc->pArgumentDescs || (desc->NodeMask & ~1u))
3827 return E_INVALIDARG; 4310 return E_INVALIDARG;
3828 UINT size = 0; 4311 UINT64 size = 0; // 64-bit: a large Num32BitValuesToSet must not wrap past ByteStride
3829 for (UINT i = 0; i < desc->NumArgumentDescs; ++i) { 4312 for (UINT i = 0; i < desc->NumArgumentDescs; ++i) {
3830 const D3D12_INDIRECT_ARGUMENT_DESC& arg = desc->pArgumentDescs[i]; 4313 const D3D12_INDIRECT_ARGUMENT_DESC& arg = desc->pArgumentDescs[i];
3831 switch (arg.Type) { 4314 switch (arg.Type) {
@@ -3836,7 +4319,7 @@ public:
3836 case D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH: size += sizeof(D3D12_DISPATCH_MESH_ARGUMENTS); break; 4319 case D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH: size += sizeof(D3D12_DISPATCH_MESH_ARGUMENTS); break;
3837 case D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW: size += sizeof(D3D12_VERTEX_BUFFER_VIEW); break; 4320 case D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW: size += sizeof(D3D12_VERTEX_BUFFER_VIEW); break;
3838 case D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW: size += sizeof(D3D12_INDEX_BUFFER_VIEW); break; 4321 case D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW: size += sizeof(D3D12_INDEX_BUFFER_VIEW); break;
3839 case D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT: size += 4 * arg.Constant.Num32BitValuesToSet; break; 4322 case D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT: size += UINT64{4} * arg.Constant.Num32BitValuesToSet; break;
3840 case D3D12_INDIRECT_ARGUMENT_TYPE_INCREMENTING_CONSTANT: size += 4; break; 4323 case D3D12_INDIRECT_ARGUMENT_TYPE_INCREMENTING_CONSTANT: size += 4; break;
3841 case D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW: 4324 case D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW:
3842 case D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW: 4325 case D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW:
@@ -4028,7 +4511,8 @@ public:
4028 } 4511 }
4029 layout.parameters.push_back({parsed.sig.params[i].type, first, parsed.sig.params[i].num_values}); 4512 layout.parameters.push_back({parsed.sig.params[i].type, first, parsed.sig.params[i].num_values});
4030 } 4513 }
4031 auto* signature = new RootSignature(std::move(layout)); 4514 auto* signature = new RootSignature(
4515 std::move(layout), leonida::sha256_hex({static_cast<const std::uint8_t*>(blob), size}));
4032 signature->attach_device(identity()); 4516 signature->attach_device(identity());
4033 return hand_out(signature, riid, out); 4517 return hand_out(signature, riid, out);
4034 } 4518 }
@@ -4039,12 +4523,15 @@ public:
4039 if (!out) return E_POINTER; 4523 if (!out) return E_POINTER;
4040 *out = nullptr; 4524 *out = nullptr;
4041 if (!desc) return E_INVALIDARG; 4525 if (!desc) return E_INVALIDARG;
4526 leonida::cached_pso::Key key = pipeline_key(*desc);
4527 if (const HRESULT hr = check_cached_pso(state_.pso_identity, key, desc->CachedPSO); FAILED(hr)) return hr;
4042 auto* pipeline = new PipelineState(state_); 4528 auto* pipeline = new PipelineState(state_);
4043 pipeline->attach_device(identity()); 4529 pipeline->attach_device(identity());
4044 if (const HRESULT hr = pipeline->create_compute(*desc); FAILED(hr)) { 4530 if (const HRESULT hr = pipeline->create_compute(*desc); FAILED(hr)) {
4045 pipeline->Release(); 4531 pipeline->Release();
4046 return hr; 4532 return hr;
4047 } 4533 }
4534 pipeline->set_cache_key(std::move(key));
4048 return hand_out(pipeline, riid, out); 4535 return hand_out(pipeline, riid, out);
4049 } 4536 }
4050 4537
@@ -4053,12 +4540,15 @@ public:
4053 if (!out) return E_POINTER; 4540 if (!out) return E_POINTER;
4054 *out = nullptr; 4541 *out = nullptr;
4055 if (!desc) return E_INVALIDARG; 4542 if (!desc) return E_INVALIDARG;
4543 leonida::cached_pso::Key key = pipeline_key(*desc);
4544 if (const HRESULT hr = check_cached_pso(state_.pso_identity, key, desc->CachedPSO); FAILED(hr)) return hr;
4056 auto* pipeline = new PipelineState(state_); 4545 auto* pipeline = new PipelineState(state_);
4057 pipeline->attach_device(identity()); 4546 pipeline->attach_device(identity());
4058 if (const HRESULT hr = pipeline->create_graphics(*desc); FAILED(hr)) { 4547 if (const HRESULT hr = pipeline->create_graphics(*desc); FAILED(hr)) {
4059 pipeline->Release(); 4548 pipeline->Release();
4060 return hr; 4549 return hr;
4061 } 4550 }
4551 pipeline->set_cache_key(std::move(key));
4062 return hand_out(pipeline, riid, out); 4552 return hand_out(pipeline, riid, out);
4063 } 4553 }
4064 4554
@@ -4075,6 +4565,64 @@ public:
4075 return d3d12_trace::result(method, hand_out(lib, riid, out)); 4565 return d3d12_trace::result(method, hand_out(lib, riid, out));
4076 } 4566 }
4077 4567
4568 // Device9: process-wide shader cache sessions (in-memory and disk-backed) and control (D3D-34).
4569 HRESULT STDMETHODCALLTYPE CreateShaderCacheSession(const D3D12_SHADER_CACHE_SESSION_DESC* desc, REFIID riid,
4570 void** out) override {
4571 constexpr auto method = "ID3D12Device9::CreateShaderCacheSession";
4572 if (out) *out = nullptr;
4573 if (!desc) return d3d12_trace::result(method, E_INVALIDARG);
4574 const GUID zero_guid{};
4575 if (std::memcmp(&desc->Identifier, &zero_guid, sizeof(GUID)) == 0)
4576 return d3d12_trace::result(method, E_INVALIDARG);
4577 if (desc->Mode != D3D12_SHADER_CACHE_MODE_MEMORY && desc->Mode != D3D12_SHADER_CACHE_MODE_DISK)
4578 return d3d12_trace::result(method, E_INVALIDARG);
4579 constexpr UINT kKnownFlags = D3D12_SHADER_CACHE_FLAG_DRIVER_VERSIONED | D3D12_SHADER_CACHE_FLAG_USE_WORKING_DIR;
4580 if (UINT(desc->Flags) & ~kKnownFlags) return d3d12_trace::result(method, E_INVALIDARG);
4581 if (!out) return d3d12_trace::result(method, S_FALSE);
4582 std::wstring disk_path;
4583 if (desc->Mode == D3D12_SHADER_CACHE_MODE_DISK) {
4584 VkPhysicalDeviceProperties props{};
4585 if (state_.info.get_instance_proc && state_.info.instance && state_.info.physical) {
4586 if (const auto get_props = reinterpret_cast<PFN_vkGetPhysicalDeviceProperties>(
4587 state_.info.get_instance_proc(state_.info.instance, "vkGetPhysicalDeviceProperties")))
4588 get_props(state_.info.physical, &props);
4589 }
4590 const auto path = shader_cache_disk_path(*desc, props);
4591 if (path.empty()) return d3d12_trace::result(method, E_FAIL);
4592 disk_path = path.wstring();
4593 }
4594 const ShaderCacheKey key{desc->Identifier, desc->Mode, desc->Version, std::move(disk_path)};
4595 auto& registry = process_shader_cache_registry();
4596 auto store = registry.acquire(key);
4597 auto* session = new ShaderCacheSession(*desc, key, registry, std::move(store));
4598 session->attach_device(identity());
4599 return d3d12_trace::result(method, hand_out(session, riid, out));
4600 }
4601
4602 HRESULT STDMETHODCALLTYPE ShaderCacheControl(D3D12_SHADER_CACHE_KIND_FLAGS kinds,
4603 D3D12_SHADER_CACHE_CONTROL_FLAGS control) override {
4604 constexpr auto method = "ID3D12Device9::ShaderCacheControl";
4605 constexpr UINT kKnownKinds = D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_D3D_CACHE_FOR_DRIVER |
4606 D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_D3D_CONVERSIONS |
4607 D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_DRIVER_MANAGED |
4608 D3D12_SHADER_CACHE_KIND_FLAG_APPLICATION_MANAGED;
4609 constexpr UINT kKnownControls = D3D12_SHADER_CACHE_CONTROL_FLAG_DISABLE |
4610 D3D12_SHADER_CACHE_CONTROL_FLAG_ENABLE | D3D12_SHADER_CACHE_CONTROL_FLAG_CLEAR;
4611 if (!kinds || (UINT(kinds) & ~kKnownKinds) || !control || (UINT(control) & ~kKnownControls))
4612 return d3d12_trace::result(method, E_INVALIDARG);
4613 if ((control & D3D12_SHADER_CACHE_CONTROL_FLAG_ENABLE) && (control & D3D12_SHADER_CACHE_CONTROL_FLAG_DISABLE))
4614 return d3d12_trace::result(method, E_INVALIDARG);
4615 auto& registry = process_shader_cache_registry();
4616 if (kinds & D3D12_SHADER_CACHE_KIND_FLAG_APPLICATION_MANAGED) {
4617 if (control & D3D12_SHADER_CACHE_CONTROL_FLAG_CLEAR) registry.clear_all();
4618 if (control & D3D12_SHADER_CACHE_CONTROL_FLAG_DISABLE)
4619 registry.disabled.store(true, std::memory_order_relaxed);
4620 if (control & D3D12_SHADER_CACHE_CONTROL_FLAG_ENABLE)
4621 registry.disabled.store(false, std::memory_order_relaxed);
4622 }
4623 return d3d12_trace::result(method, S_OK);
4624 }
4625
4078 UINT STDMETHODCALLTYPE GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE) override { 4626 UINT STDMETHODCALLTYPE GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE) override {
4079 return kDescriptorSize; 4627 return kDescriptorSize;
4080 } 4628 }
@@ -4098,6 +4646,11 @@ public:
4098 view = {rid, 0, 0, rd.DepthOrArraySize}; 4646 view = {rid, 0, 0, rd.DepthOrArraySize};
4099 if (rd.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D) { 4647 if (rd.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D) {
4100 view = volume_rtv(rid, rd, desc); 4648 view = volume_rtv(rid, rd, desc);
4649 } else if (desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE1D) {
4650 view = line_target_view(rid, rd, desc->Texture1D.MipSlice, 0, 1);
4651 } else if (desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE1DARRAY) {
4652 view = line_target_view(rid, rd, desc->Texture1DArray.MipSlice,
4653 desc->Texture1DArray.FirstArraySlice, desc->Texture1DArray.ArraySize);
4101 } else if (desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2D) { 4654 } else if (desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2D) {
4102 view = {rid, desc->Texture2D.MipSlice, 0, 1}; 4655 view = {rid, desc->Texture2D.MipSlice, 0, 1};
4103 } else if (desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2DMS) { 4656 } else if (desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2DMS) {
@@ -4112,7 +4665,9 @@ public:
4112 log_once("render-target view dimension not supported:", desc->ViewDimension); 4665 log_once("render-target view dimension not supported:", desc->ViewDimension);
4113 view = {}; 4666 view = {};
4114 } 4667 }
4115 const bool typeless_rgba8 = rd.Format == DXGI_FORMAT_R8G8B8A8_TYPELESS; 4668 // A TYPELESS color texture of any family takes RTVs in its family's formats (D3D-275; RGBA8 only before).
4669 const bool typeless_color = vulkan_format(rd.Format, false).typeless &&
4670 !(rd.Flags & D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL);
4116 const bool typed_rgba8 = rd.Format == DXGI_FORMAT_R8G8B8A8_UNORM || 4671 const bool typed_rgba8 = rd.Format == DXGI_FORMAT_R8G8B8A8_UNORM ||
4117 rd.Format == DXGI_FORMAT_R8G8B8A8_UNORM_SRGB || rd.Format == DXGI_FORMAT_R8G8B8A8_UINT; 4672 rd.Format == DXGI_FORMAT_R8G8B8A8_UNORM_SRGB || rd.Format == DXGI_FORMAT_R8G8B8A8_UINT;
4118 if (rd.Format == DXGI_FORMAT_A8_UNORM || (desc && desc->Format == DXGI_FORMAT_A8_UNORM)) { 4673 if (rd.Format == DXGI_FORMAT_A8_UNORM || (desc && desc->Format == DXGI_FORMAT_A8_UNORM)) {
@@ -4122,40 +4677,45 @@ public:
4122 if (rd.Format != DXGI_FORMAT_R9G9B9E5_SHAREDEXP || !(rd.Flags & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET) || 4677 if (rd.Format != DXGI_FORMAT_R9G9B9E5_SHAREDEXP || !(rd.Flags & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET) ||
4123 (desc && desc->Format != DXGI_FORMAT_UNKNOWN && desc->Format != rd.Format)) 4678 (desc && desc->Format != DXGI_FORMAT_UNKNOWN && desc->Format != rd.Format))
4124 view = {}; 4679 view = {};
4125 } else if (typeless_rgba8 || typed_rgba8) { 4680 } else if (typeless_color || typed_rgba8) {
4126 const DXGI_FORMAT requested = desc && desc->Format != DXGI_FORMAT_UNKNOWN ? desc->Format : rd.Format; 4681 const DXGI_FORMAT requested = desc && desc->Format != DXGI_FORMAT_UNKNOWN ? desc->Format : rd.Format;
4127 // A typed UNORM RGBA8 resource with a castable list may be viewed in a listed family format 4682 // A typed UNORM RGBA8 resource with a castable list may be viewed in a listed family format
4128 // (D3D-85's committed path, D3D-90's placed one): its image is mutable and lists the view 4683 // (D3D-85's committed path, D3D-90's placed one): its image is mutable and lists the view
4129 // format, so the reinterpretation is the typeless path's. Only a UNORM image is advertised, 4684 // format, so the reinterpretation is the typeless path's. Only a UNORM image is advertised,
4130 // as that is what the clear path reinterprets. The switch knows the RGBA8 family only. 4685 // as that is what the clear path reinterprets.
4131 const bool listed = requested == rd.Format || 4686 const bool listed = requested == rd.Format ||
4132 (r && r->has_view_format_list() && 4687 (r && r->has_view_format_list() &&
4133 r->allows_view_format(vulkan_format(requested, false).format)); 4688 r->allows_view_format(vulkan_format(requested, false).format));
4134 if (typeless_rgba8 || (requested != rd.Format && listed && 4689 if (typeless_color || (requested != rd.Format && listed &&
4135 rd.Format == DXGI_FORMAT_R8G8B8A8_UNORM)) { 4690 rd.Format == DXGI_FORMAT_R8G8B8A8_UNORM)) {
4136 const bool msaa = rd.SampleDesc.Count > 1; 4691 const bool msaa = rd.SampleDesc.Count > 1;
4137 const bool plain = !msaa && desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2D; 4692 const bool plain_1d = !msaa && desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE1D;
4138 const bool array = !msaa && desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2DARRAY; 4693 const bool array_1d = !msaa && desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE1DARRAY;
4694 const bool plain_2d = !msaa && desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2D;
4695 const bool array_2d = !msaa && desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2DARRAY;
4139 const bool ms = msaa && desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2DMS; 4696 const bool ms = msaa && desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2DMS;
4140 const bool ms_array = msaa && desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY; 4697 const bool ms_array = msaa && desc && desc->ViewDimension == D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY;
4141 const UINT plane = plain ? desc->Texture2D.PlaneSlice : 4698 const UINT plane = plain_2d ? desc->Texture2D.PlaneSlice :
4142 array ? desc->Texture2DArray.PlaneSlice : 0; 4699 array_2d ? desc->Texture2DArray.PlaneSlice : 0;
4700 const bool dim_ok = ((plain_1d || array_1d) && rd.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE1D) ||
4701 ((plain_2d || array_2d || ms || ms_array) &&
4702 rd.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D);
4143 // Subtraction keeps malformed layer ranges from overflowing during validation. 4703 // Subtraction keeps malformed layer ranges from overflowing during validation.
4144 if ((!plain && !array && !ms && !ms_array) || rd.Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE2D || 4704 if (!dim_ok || plane || !view.resource || view.mip >= rd.MipLevels ||
4145 plane || !view.resource || view.mip >= rd.MipLevels ||
4146 !view.layer_count || view.first_layer >= rd.DepthOrArraySize || 4705 !view.layer_count || view.first_layer >= rd.DepthOrArraySize ||
4147 view.layer_count > rd.DepthOrArraySize - view.first_layer || 4706 view.layer_count > rd.DepthOrArraySize - view.first_layer ||
4148 !(rd.Flags & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET)) { 4707 !(rd.Flags & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET)) {
4149 view = {}; 4708 view = {};
4150 } else { 4709 } else {
4151 switch (requested) { 4710 // The view's own format, of the resource's family (B8G8R8X8 and B8G8R8A8 are two families
4152 case DXGI_FORMAT_R8G8B8A8_UNORM: view.format = leonida::ColorViewFormat::rgba8_unorm; break; 4711 // that share Vulkan formats); the clear and the attachment view reinterpret the image in it.
4153 case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: view.format = leonida::ColorViewFormat::rgba8_srgb; break; 4712 const Format named = vulkan_format(requested, false);
4154 case DXGI_FORMAT_R8G8B8A8_UINT: view.format = leonida::ColorViewFormat::rgba8_uint; break; 4713 const int family = leonida::detail::typeless_view_family(named.format);
4155 case DXGI_FORMAT_R8G8B8A8_SINT: view.format = leonida::ColorViewFormat::rgba8_sint; break; 4714 if (named.typeless || named.rgb96 || !family || alpha_unused(requested) != alpha_unused(rd.Format) ||
4156 case DXGI_FORMAT_R8G8B8A8_SNORM: view.format = leonida::ColorViewFormat::rgba8_snorm; break; 4715 family != leonida::detail::typeless_view_family(vulkan_format(rd.Format, false).format))
4157 default: view = {}; break; 4716 view = {};
4158 } 4717 else
4718 view.format = static_cast<leonida::ColorViewFormat>(named.format);
4159 if (view.resource) { 4719 if (view.resource) {
4160 const auto format = vulkan_format(requested, false); 4720 const auto format = vulkan_format(requested, false);
4161 VkFormatProperties properties{}; 4721 VkFormatProperties properties{};
@@ -4166,7 +4726,7 @@ public:
4166 } else if (requested != rd.Format) { 4726 } else if (requested != rd.Format) {
4167 view = {}; // No typed-resource format casting is advertised by this backend. 4727 view = {}; // No typed-resource format casting is advertised by this backend.
4168 } 4728 }
4169 if (!view.resource) log_once("unsupported RGBA8 RTV format/subresource:", int(requested)); 4729 if (!view.resource) log_once("unsupported typeless or RGBA8 RTV format/subresource:", int(requested));
4170 } 4730 }
4171 } else if (resource) { 4731 } else if (resource) {
4172 stub("ID3D12Device::CreateRenderTargetView(resource from another device)"); 4732 stub("ID3D12Device::CreateRenderTargetView(resource from another device)");
@@ -4182,7 +4742,12 @@ public:
4182 if (const Resource* r = Resource::from<Resource>(resource)) { 4742 if (const Resource* r = Resource::from<Resource>(resource)) {
4183 const D3D12_RESOURCE_DESC rd = const_cast<Resource*>(r)->GetDesc(); 4743 const D3D12_RESOURCE_DESC rd = const_cast<Resource*>(r)->GetDesc();
4184 view = {r->id(), 0, 0, rd.DepthOrArraySize}; 4744 view = {r->id(), 0, 0, rd.DepthOrArraySize};
4185 if (desc && desc->ViewDimension == D3D12_DSV_DIMENSION_TEXTURE2D) { 4745 if (desc && desc->ViewDimension == D3D12_DSV_DIMENSION_TEXTURE1D) {
4746 view = line_target_view(r->id(), rd, desc->Texture1D.MipSlice, 0, 1);
4747 } else if (desc && desc->ViewDimension == D3D12_DSV_DIMENSION_TEXTURE1DARRAY) {
4748 view = line_target_view(r->id(), rd, desc->Texture1DArray.MipSlice,
4749 desc->Texture1DArray.FirstArraySlice, desc->Texture1DArray.ArraySize);
4750 } else if (desc && desc->ViewDimension == D3D12_DSV_DIMENSION_TEXTURE2D) {
4186 view = {r->id(), desc->Texture2D.MipSlice, 0, 1}; 4751 view = {r->id(), desc->Texture2D.MipSlice, 0, 1};
4187 } else if (desc && desc->ViewDimension == D3D12_DSV_DIMENSION_TEXTURE2DMS) { 4752 } else if (desc && desc->ViewDimension == D3D12_DSV_DIMENSION_TEXTURE2DMS) {
4188 view = {r->id(), 0, 0, 1}; 4753 view = {r->id(), 0, 0, 1};
@@ -4464,10 +5029,20 @@ public:
4464 TextureView view{}; 5029 TextureView view{};
4465 view.mip_count = 1; 5030 view.mip_count = 1;
4466 if (!desc) { 5031 if (!desc) {
4467 if (r->desc().DepthOrArraySize > 1) view.type = leonida::gfx10::ImageType::image_2d_array; 5032 const bool array = r->desc().DepthOrArraySize > 1;
5033 if (r->desc().Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE1D && !array) {
5034 view.type = leonida::gfx10::ImageType::image_1d;
5035 view.layer_count = 1;
5036 } else if (array)
5037 view.type = leonida::gfx10::ImageType::image_2d_array;
4468 } else { 5038 } else {
4469 view.format = desc->Format; 5039 view.format = desc->Format;
4470 switch (desc->ViewDimension) { 5040 switch (desc->ViewDimension) {
5041 case D3D12_UAV_DIMENSION_TEXTURE1D:
5042 view.type = leonida::gfx10::ImageType::image_1d;
5043 view.first_mip = desc->Texture1D.MipSlice;
5044 view.layer_count = 1;
5045 break;
4471 case D3D12_UAV_DIMENSION_TEXTURE2D: 5046 case D3D12_UAV_DIMENSION_TEXTURE2D:
4472 view.first_mip = desc->Texture2D.MipSlice; 5047 view.first_mip = desc->Texture2D.MipSlice;
4473 view.layer_count = 1; 5048 view.layer_count = 1;
@@ -5482,7 +6057,13 @@ public:
5482 if (size != sizeof(D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS)) return d3d12_trace::result(method, E_INVALIDARG); 6057 if (size != sizeof(D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS)) return d3d12_trace::result(method, E_INVALIDARG);
5483 auto* levels = static_cast<D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS*>(data); 6058 auto* levels = static_cast<D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS*>(data);
5484 levels->NumQualityLevels = 0; 6059 levels->NumQualityLevels = 0;
5485 if (levels->Flags != D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE || 6060 // TILED_RESOURCE asks about tiled (reserved, 64KB_UNDEFINED_SWIZZLE) textures. Measured natively on an
6061 // RX 7800 XT, a Radeon iGPU and WARP: 1x and 4x keep the plain answer, every other count has none, and a
6062 // format without a tile shape (96-bit) has none at any count. That is GetResourceAllocationInfo's rule
6063 // here (tiled MSAA is 4x only). 128-bit formats at 4x: the AMD drivers answer 0, WARP and the RTX 5070 Ti
6064 // allocate them; this follows the latter, as the allocation path does.
6065 const bool tiled = levels->Flags == D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_TILED_RESOURCE;
6066 if ((levels->Flags != D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE && !tiled) ||
5486 levels->SampleCount == 0 || levels->SampleCount > D3D12_MAX_MULTISAMPLE_SAMPLE_COUNT || 6067 levels->SampleCount == 0 || levels->SampleCount > D3D12_MAX_MULTISAMPLE_SAMPLE_COUNT ||
5487 (levels->SampleCount & (levels->SampleCount - 1)) != 0) 6068 (levels->SampleCount & (levels->SampleCount - 1)) != 0)
5488 return d3d12_trace::result(method, E_INVALIDARG); 6069 return d3d12_trace::result(method, E_INVALIDARG);
@@ -5503,8 +6084,8 @@ public:
5503 } 6084 }
5504 if (format.format == VK_FORMAT_UNDEFINED || !state_.image_format_properties) 6085 if (format.format == VK_FORMAT_UNDEFINED || !state_.image_format_properties)
5505 return d3d12_trace::result(method, DXGI_ERROR_UNSUPPORTED); 6086 return d3d12_trace::result(method, DXGI_ERROR_UNSUPPORTED);
5506 if (format.rgb96) { // no 96-bit render targets yet, so no multisampled ones 6087 if (format.rgb96) { // no 96-bit render targets yet, so no multisampled ones; no tile shape either
5507 levels->NumQualityLevels = levels->SampleCount == 1 ? 1 : 0; 6088 levels->NumQualityLevels = levels->SampleCount == 1 && !tiled ? 1 : 0;
5508 return d3d12_trace::result(method, S_OK); 6089 return d3d12_trace::result(method, S_OK);
5509 } 6090 }
5510 6091
@@ -5527,6 +6108,7 @@ public:
5527 const VkSampleCountFlagBits samples = VkSampleCountFlagBits(levels->SampleCount); 6108 const VkSampleCountFlagBits samples = VkSampleCountFlagBits(levels->SampleCount);
5528 if (result == VK_SUCCESS && (image_properties.sampleCounts & samples)) 6109 if (result == VK_SUCCESS && (image_properties.sampleCounts & samples))
5529 levels->NumQualityLevels = 1; 6110 levels->NumQualityLevels = 1;
6111 if (tiled && levels->SampleCount != 1 && levels->SampleCount != 4) levels->NumQualityLevels = 0;
5530 return d3d12_trace::result(method, S_OK); 6112 return d3d12_trace::result(method, S_OK);
5531 } 6113 }
5532 case D3D12_FEATURE_SHADER_MODEL: { 6114 case D3D12_FEATURE_SHADER_MODEL: {
@@ -5588,12 +6170,12 @@ public:
5588 prio->Priority != D3D12_COMMAND_QUEUE_PRIORITY_HIGH && 6170 prio->Priority != D3D12_COMMAND_QUEUE_PRIORITY_HIGH &&
5589 prio->Priority != D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME)) 6171 prio->Priority != D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME))
5590 return d3d12_trace::result(method, E_INVALIDARG); 6172 return d3d12_trace::result(method, E_INVALIDARG);
5591 // Matches CreateCommandQueue: DIRECT/COMPUTE/COPY work at NORMAL or HIGH; GLOBAL_REALTIME is refused. 6173 // DIRECT/COMPUTE/COPY report NORMAL only: all VkQueues share priority 1.0f (HIGH has no distinct scheduling)
6174 // and GLOBAL_REALTIME is refused in CreateCommandQueue.
5592 const bool supported_type = prio->CommandListType == D3D12_COMMAND_LIST_TYPE_DIRECT || 6175 const bool supported_type = prio->CommandListType == D3D12_COMMAND_LIST_TYPE_DIRECT ||
5593 prio->CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE || 6176 prio->CommandListType == D3D12_COMMAND_LIST_TYPE_COMPUTE ||
5594 prio->CommandListType == D3D12_COMMAND_LIST_TYPE_COPY; 6177 prio->CommandListType == D3D12_COMMAND_LIST_TYPE_COPY;
5595 const bool supported_priority = prio->Priority == D3D12_COMMAND_QUEUE_PRIORITY_NORMAL || 6178 const bool supported_priority = prio->Priority == D3D12_COMMAND_QUEUE_PRIORITY_NORMAL;
5596 prio->Priority == D3D12_COMMAND_QUEUE_PRIORITY_HIGH;
5597 prio->PriorityForTypeIsSupported = (supported_type && supported_priority) ? TRUE : FALSE; 6179 prio->PriorityForTypeIsSupported = (supported_type && supported_priority) ? TRUE : FALSE;
5598 return d3d12_trace::result(method, S_OK); 6180 return d3d12_trace::result(method, S_OK);
5599 } 6181 }
@@ -6109,6 +6691,13 @@ VkBuffer vulkan_buffer(ID3D12Resource* resource) {
6109 return r ? r->buffer() : VK_NULL_HANDLE; 6691 return r ? r->buffer() : VK_NULL_HANDLE;
6110} 6692}
6111 6693
6694const VulkanDeviceInfo* vulkan_device_info(ID3D12Device* device) {
6695 if (!device) return nullptr;
6696 ID3D12Device* real = rt::d3d12_xs::device_proxy_real_device(device);
6697 if (auto* d = Device::from<Device>(real ? real : device)) return &d->state().info;
6698 return nullptr;
6699}
6700
6112bool device_supports_ray_tracing(ID3D12Device* device) { 6701bool device_supports_ray_tracing(ID3D12Device* device) {
6113 if (!device) return false; 6702 if (!device) return false;
6114 ID3D12Device* real = rt::d3d12_xs::device_proxy_real_device(device); 6703 ID3D12Device* real = rt::d3d12_xs::device_proxy_real_device(device);
@@ -6124,6 +6713,10 @@ VkAccelerationStructureKHR vulkan_acceleration_structure(ID3D12Device* device, D
6124 return VK_NULL_HANDLE; 6713 return VK_NULL_HANDLE;
6125} 6714}
6126 6715
6716bool color_resolve_format_is_integer(DXGI_FORMAT format) {
6717 return DeviceState::numeric_class(vulkan_format(format, false).format) != 0;
6718}
6719
6127bool color_resolve_format_matches(DXGI_FORMAT format, ID3D12Resource* dst, ID3D12Resource* src) { 6720bool color_resolve_format_matches(DXGI_FORMAT format, ID3D12Resource* dst, ID3D12Resource* src) {
6128 if (!dst || !src) return false; 6721 if (!dst || !src) return false;
6129 const Format requested = vulkan_format(format, false); 6722 const Format requested = vulkan_format(format, false);
@@ -6235,6 +6828,12 @@ std::uint32_t bindless_hash_lookup(ID3D12Device* device, const std::uint32_t (&k
6235 return set ? set->table().lookup(key) : 0; 6828 return set ? set->table().lookup(key) : 0;
6236} 6829}
6237 6830
6831BindlessRoom bindless_room(ID3D12Device* device) {
6832 const leonida::BindlessSet* set = bindless_of(device);
6833 if (!set) return {};
6834 return {set->free_images(leonida::ImageDimension::dim_2d), set->free_samplers()};
6835}
6836
6238WindowPresenter::WindowPresenter(IUnknown* device, std::unique_ptr<leonida::VulkanPresenter> presenter) 6837WindowPresenter::WindowPresenter(IUnknown* device, std::unique_ptr<leonida::VulkanPresenter> presenter)
6239 : device_(device), presenter_(std::move(presenter)) { 6838 : device_(device), presenter_(std::move(presenter)) {
6240 device_->AddRef(); 6839 device_->AddRef();
@@ -6622,6 +7221,10 @@ HRESULT create_vulkan_device_standalone(REFIID riid, void** out) {
6622 enable12.descriptorBindingPartiallyBound = info.bindless_partially_bound; 7221 enable12.descriptorBindingPartiallyBound = info.bindless_partially_bound;
6623 enable12.samplerMirrorClampToEdge = info.sampler_mirror_clamp_to_edge; 7222 enable12.samplerMirrorClampToEdge = info.sampler_mirror_clamp_to_edge;
6624 enable12.samplerFilterMinmax = info.sampler_filter_minmax; 7223 enable12.samplerFilterMinmax = info.sampler_filter_minmax;
7224 info.shader_output_layer = chosen12.shaderOutputLayer == VK_TRUE;
7225 info.shader_output_viewport_index = chosen12.shaderOutputViewportIndex == VK_TRUE;
7226 enable12.shaderOutputLayer = info.shader_output_layer;
7227 enable12.shaderOutputViewportIndex = info.shader_output_viewport_index;
6625 if (!info.bindless) 7228 if (!info.bindless)
6626 std::fprintf(stderr, "[rt] d3d12: the GPU lacks a descriptor-indexing feature the bindless set needs\n"); 7229 std::fprintf(stderr, "[rt] d3d12: the GPU lacks a descriptor-indexing feature the bindless set needs\n");
6627 enable12.bufferDeviceAddress = VK_TRUE; 7230 enable12.bufferDeviceAddress = VK_TRUE;
@@ -6688,6 +7291,49 @@ HRESULT create_vulkan_device_standalone(REFIID riid, void** out) {
6688 std::fprintf(stderr, "[rt] d3d12: no VK_EXT_host_image_copy; CPU texture copies use a staging submit\n"); 7291 std::fprintf(stderr, "[rt] d3d12: no VK_EXT_host_image_copy; CPU texture copies use a staging submit\n");
6689 } 7292 }
6690 7293
7294 // The pixel-shader extensions translated shaders can declare (VulkanDeviceInfo::fragment_shader_barycentric and
7295 // the two after it). Each is queried, and enabled with its feature where the GPU has it.
7296 const auto has_device_extension = [&](const char* name) {
7297 return std::any_of(extensions.begin(), extensions.end(),
7298 [&](const auto& e) { return std::strcmp(e.extensionName, name) == 0; });
7299 };
7300 VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR barycentric{
7301 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR};
7302 if (has_device_extension(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME)) {
7303 VkPhysicalDeviceFeatures2 query{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, &barycentric};
7304 vkGetPhysicalDeviceFeatures2(info.physical, &query);
7305 info.fragment_shader_barycentric = barycentric.fragmentShaderBarycentric == VK_TRUE;
7306 if (info.fragment_shader_barycentric) {
7307 barycentric.pNext = *v13.next();
7308 *v13.next() = &barycentric;
7309 }
7310 }
7311 VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT interlock{
7312 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT};
7313 if (has_device_extension(VK_EXT_FRAGMENT_SHADER_INTERLOCK_EXTENSION_NAME)) {
7314 VkPhysicalDeviceFeatures2 query{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, &interlock};
7315 vkGetPhysicalDeviceFeatures2(info.physical, &query);
7316 info.fragment_shader_interlock = interlock.fragmentShaderPixelInterlock == VK_TRUE;
7317 if (info.fragment_shader_interlock) {
7318 interlock.fragmentShaderSampleInterlock = VK_FALSE; // the translator only declares the pixel interlock
7319 interlock.fragmentShaderShadingRateInterlock = VK_FALSE;
7320 interlock.pNext = *v13.next();
7321 *v13.next() = &interlock;
7322 }
7323 }
7324#ifdef VK_KHR_MAINTENANCE_8_EXTENSION_NAME
7325 VkPhysicalDeviceMaintenance8FeaturesKHR maintenance8{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_8_FEATURES_KHR};
7326 if (has_device_extension(VK_KHR_MAINTENANCE_8_EXTENSION_NAME)) {
7327 VkPhysicalDeviceFeatures2 query{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, &maintenance8};
7328 vkGetPhysicalDeviceFeatures2(info.physical, &query);
7329 info.maintenance8 = maintenance8.maintenance8 == VK_TRUE;
7330 if (info.maintenance8) {
7331 maintenance8.pNext = *v13.next();
7332 *v13.next() = &maintenance8;
7333 }
7334 }
7335#endif
7336
6691#ifdef VK_KHR_SHADER_FMA_EXTENSION_NAME 7337#ifdef VK_KHR_SHADER_FMA_EXTENSION_NAME
6692 // VK_KHR_shader_fma: OpFmaKHR is a single-rounding multiply-add in SPIR-V (GLSL.std.450 Fma may round twice). 7338 // VK_KHR_shader_fma: OpFmaKHR is a single-rounding multiply-add in SPIR-V (GLSL.std.450 Fma may round twice).
6693 // Translated shaders built with `rdna2spirv.py --fma khr` need it (index capability FMAKHR, feature 7339 // Translated shaders built with `rdna2spirv.py --fma khr` need it (index capability FMAKHR, feature
@@ -6714,13 +7360,19 @@ HRESULT create_vulkan_device_standalone(REFIID riid, void** out) {
6714 enable.logicOp = chosen_features.logicOp; 7360 enable.logicOp = chosen_features.logicOp;
6715 enable.depthClamp = chosen_features.depthClamp; 7361 enable.depthClamp = chosen_features.depthClamp;
6716 // What translated shaders declare (the index's `features`): 64-bit integers in most of the corpus (25,803 of 7362 // What translated shaders declare (the index's `features`): 64-bit integers in most of the corpus (25,803 of
6717 // 26,503 entries), doubles, 16-bit integers, and clip and cull distances in a few vertex shaders. Enabled where 7363 // 26,503 entries), doubles, 16-bit integers, clip and cull distances in a few vertex shaders, image stores
6718 // the GPU has them; without one, vkCreateShaderModule reports the capability (VUID-...-pCode-08740). 7364 // without a format (StorageImageWriteWithoutFormat), gather offsets (ImageGatherExtended) and LOD-clamped samples
7365 // (MinLod), and the layer or viewport a vertex shader writes (above, in Vulkan 1.2). Enabled where the GPU has
7366 // them; without one, vkCreateShaderModule reports the capability (VUID-...-pCode-08740).
6719 enable.shaderInt64 = chosen_features.shaderInt64; 7367 enable.shaderInt64 = chosen_features.shaderInt64;
6720 enable.shaderFloat64 = chosen_features.shaderFloat64; 7368 enable.shaderFloat64 = chosen_features.shaderFloat64;
6721 enable.shaderInt16 = chosen_features.shaderInt16; 7369 enable.shaderInt16 = chosen_features.shaderInt16;
6722 enable.shaderClipDistance = chosen_features.shaderClipDistance; 7370 enable.shaderClipDistance = chosen_features.shaderClipDistance;
6723 enable.shaderCullDistance = chosen_features.shaderCullDistance; 7371 enable.shaderCullDistance = chosen_features.shaderCullDistance;
7372 enable.shaderStorageImageWriteWithoutFormat = chosen_features.shaderStorageImageWriteWithoutFormat;
7373 enable.shaderStorageImageReadWithoutFormat = chosen_features.shaderStorageImageReadWithoutFormat;
7374 enable.shaderImageGatherExtended = chosen_features.shaderImageGatherExtended;
7375 enable.shaderResourceMinLod = chosen_features.shaderResourceMinLod;
6724 info.features = enable; 7376 info.features = enable;
6725 7377
6726 // GetClockCalibration reads both clocks at once with calibrated timestamps (KHR, or the older EXT). 7378 // GetClockCalibration reads both clocks at once with calibrated timestamps (KHR, or the older EXT).
@@ -6793,6 +7445,12 @@ HRESULT create_vulkan_device_standalone(REFIID riid, void** out) {
6793 if (info.image_view_min_lod) device_extensions.push_back(VK_EXT_IMAGE_VIEW_MIN_LOD_EXTENSION_NAME); 7445 if (info.image_view_min_lod) device_extensions.push_back(VK_EXT_IMAGE_VIEW_MIN_LOD_EXTENSION_NAME);
6794 if (info.conditional_rendering) device_extensions.push_back(conditional_extension); 7446 if (info.conditional_rendering) device_extensions.push_back(conditional_extension);
6795 if (info.host_image_copy) device_extensions.push_back(host_image_copy_name); 7447 if (info.host_image_copy) device_extensions.push_back(host_image_copy_name);
7448 if (info.fragment_shader_barycentric)
7449 device_extensions.push_back(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME);
7450 if (info.fragment_shader_interlock) device_extensions.push_back(VK_EXT_FRAGMENT_SHADER_INTERLOCK_EXTENSION_NAME);
7451#ifdef VK_KHR_MAINTENANCE_8_EXTENSION_NAME
7452 if (info.maintenance8) device_extensions.push_back(VK_KHR_MAINTENANCE_8_EXTENSION_NAME);
7453#endif
6796#ifdef VK_KHR_SHADER_FMA_EXTENSION_NAME 7454#ifdef VK_KHR_SHADER_FMA_EXTENSION_NAME
6797 if (info.shader_fma) device_extensions.push_back(VK_KHR_SHADER_FMA_EXTENSION_NAME); 7455 if (info.shader_fma) device_extensions.push_back(VK_KHR_SHADER_FMA_EXTENSION_NAME);
6798#endif 7456#endif
@@ -6848,9 +7506,13 @@ bool has_global_realtime_privilege() {
6848 const int override_state = g_global_realtime_privilege_override.load(std::memory_order_relaxed); 7506 const int override_state = g_global_realtime_privilege_override.load(std::memory_order_relaxed);
6849 if (override_state >= 0) return override_state != 0; 7507 if (override_state >= 0) return override_state != 0;
6850 HANDLE token = nullptr; 7508 HANDLE token = nullptr;
6851 if (!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE, &token) && 7509 if (!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE, &token)) {
6852 !OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) 7510 // Fall back to the process token only when the thread is not impersonating (ERROR_NO_TOKEN); fail closed on
6853 return false; 7511 // ERROR_CANT_OPEN_ANONYMOUS or any other thread-token error so an impersonated caller cannot inherit the
7512 // process token's privilege.
7513 if (GetLastError() != ERROR_NO_TOKEN || !OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token))
7514 return false;
7515 }
6854 LUID luid{}; 7516 LUID luid{};
6855 BOOL enabled = FALSE; 7517 BOOL enabled = FALSE;
6856 if (LookupPrivilegeValueW(nullptr, L"SeIncreaseBasePriorityPrivilege", &luid)) { 7518 if (LookupPrivilegeValueW(nullptr, L"SeIncreaseBasePriorityPrivilege", &luid)) {
diff --git a/runtime/shims/file_system.cpp b/runtime/shims/file_system.cpp
index f0ae08811..2e7d93718 100644
--- a/runtime/shims/file_system.cpp
+++ b/runtime/shims/file_system.cpp
@@ -1,9 +1,10 @@
1// file_system: the file API of a mapped title, seen through the console's drives. 1// file_system: the file API of a mapped title, seen through the console's drives.
2// 2//
3// A GDK title names its files on the console's drives, "GAME:\\data\\x.sps" being one in the installed game folder, so 3// A GDK title names its files on the console's drives, "GAME:\\data\\x.sps" being one in the installed game folder, so
4// the imports it makes of CreateFile*, FindFirstFile*/FindNextFile*/FindClose, GetFileAttributes*/GetFileAttributesEx* 4// the imports it makes of CreateFile*, FindFirstFile*/FindNextFile*/FindClose, GetFileAttributes*/GetFileAttributesEx*,
5// and DeleteFile* are answered here (docs/runtime_imports.md, "Console paths and the write overlay"; the prefixes come 5// DeleteFile*, CreateDirectory*/RemoveDirectory*, MoveFile*, CopyFile*/CopyFile2 and SetFileAttributes* are answered
6// from ivall/xcl, GPL-2.0-only, as facts). The rules: 6// here (docs/runtime_imports.md, "Console paths and the write overlay"; the prefixes come from ivall/xcl,
7// GPL-2.0-only, as facts). The rules:
7// - "GAME:" (any case, "\\" or "/") maps under --game-dir; any other path is a host path and goes to the host; 8// - "GAME:" (any case, "\\" or "/") maps under --game-dir; any other path is a host path and goes to the host;
8// - an open that can write, and DeleteFile, go to the overlay (--overlay, default <game-dir>\\overlay), so the 9// - an open that can write, and DeleteFile, go to the overlay (--overlay, default <game-dir>\\overlay), so the
9// package stays exactly as installed. A write-open of a package file copies it into the overlay first, so 10// package stays exactly as installed. A write-open of a package file copies it into the overlay first, so
@@ -14,6 +15,8 @@
14// - reads prefer the overlay copy and then the package; 15// - reads prefer the overlay copy and then the package;
15// - FindFirstFile merges the two folders, the overlay winning on a name, and hides deleted names and the marker 16// - FindFirstFile merges the two folders, the overlay winning on a name, and hides deleted names and the marker
16// folder; 17// folder;
18// - folders are made in the overlay; a removed package folder is hidden by a marker, a moved package file is
19// copied into the overlay and its old name deleted, and attributes are set on the overlay copy;
17// - a path that climbs above the root with ".." or names another drive is refused with ERROR_INVALID_NAME, so a 20// - a path that climbs above the root with ".." or names another drive is refused with ERROR_INVALID_NAME, so a
18// title cannot reach outside the package and the overlay. 21// title cannot reach outside the package and the overlay.
19// Only images mapped by the loader see these: they are bound through the registry, the runtime's own code calls the 22// Only images mapped by the loader see these: they are bound through the registry, the runtime's own code calls the
@@ -39,6 +42,9 @@ namespace {
39constexpr wchar_t kGamePrefix[] = L"game:"; 42constexpr wchar_t kGamePrefix[] = L"game:";
40constexpr size_t kGamePrefixLength = 5; 43constexpr size_t kGamePrefixLength = 5;
41constexpr wchar_t kDeletedDir[] = L".gta6rt-deleted"; 44constexpr wchar_t kDeletedDir[] = L".gta6rt-deleted";
45// A removed package folder is marked by this file inside its marker folder: the marker folder itself can already
46// exist because files below it were deleted, and that alone does not hide the folder.
47constexpr wchar_t kRemovedDirMarker[] = L".gta6rt-dir";
42 48
43std::mutex g_mutex; 49std::mutex g_mutex;
44std::filesystem::path g_game_dir; 50std::filesystem::path g_game_dir;
@@ -139,12 +145,115 @@ std::filesystem::path marker(const std::filesystem::path& overlay, const std::ve
139 return join(overlay / kDeletedDir, parts); 145 return join(overlay / kDeletedDir, parts);
140} 146}
141 147
148// A deleted file leaves an empty file at its marker path and a removed folder leaves kRemovedDirMarker inside its
149// marker folder.
142bool deleted(const std::filesystem::path& overlay, const std::vector<std::wstring>& parts) { 150bool deleted(const std::filesystem::path& overlay, const std::vector<std::wstring>& parts) {
143 if (overlay.empty() || parts.empty()) return false; 151 if (overlay.empty() || parts.empty()) return false;
144 std::error_code ec; 152 std::error_code ec;
145 // Only regular files are deletion markers; parent directories inside .gta6rt-deleted/ exist only to hold markers 153 // Only regular files are deletion markers; parent directories inside .gta6rt-deleted/ exist only to hold markers
146 // for nested deleted files and must not hide the corresponding ancestor directories in the package. 154 // for nested deleted files and must not hide the corresponding ancestor directories in the package.
147 return std::filesystem::is_regular_file(marker(overlay, parts), ec); 155 const std::filesystem::path m = marker(overlay, parts);
156 return std::filesystem::is_regular_file(m, ec) || std::filesystem::is_regular_file(m / kRemovedDirMarker, ec);
157}
158
159// Writes an empty hidden marker file. On failure `error` holds the reason.
160bool write_marker(const std::filesystem::path& mark, DWORD& error) {
161 std::error_code ec;
162 std::filesystem::create_directories(mark.parent_path(), ec);
163 if (ec) {
164 error = static_cast<DWORD>(ec.value());
165 return false;
166 }
167 const HANDLE h = ::CreateFileW(mark.c_str(), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
168 nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_HIDDEN, nullptr);
169 if (h == INVALID_HANDLE_VALUE) {
170 error = ::GetLastError();
171 return false;
172 }
173 ::CloseHandle(h);
174 return true;
175}
176
177// Flushes a file the shim wrote on the title's behalf, for MOVEFILE_WRITE_THROUGH. On failure `error` holds the reason.
178bool flush_file(const std::filesystem::path& path, DWORD& error) {
179 const HANDLE h = ::CreateFileW(path.c_str(), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
180 nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
181 if (h == INVALID_HANDLE_VALUE) {
182 error = ::GetLastError();
183 return false;
184 }
185 const BOOL ok = ::FlushFileBuffers(h);
186 if (!ok) error = ::GetLastError();
187 ::CloseHandle(h);
188 return ok != FALSE;
189}
190
191// What a console path is in the title's view: the overlay copy if there is one, else the package's unless deleted.
192enum class Kind { None, File, Directory };
193struct View {
194 Kind kind = Kind::None;
195 bool in_overlay = false; // the overlay holds the name
196 bool in_package = false; // the package holds the name and it is not deleted
197};
198
199View view(const Roots& r, const std::vector<std::wstring>& parts) {
200 View v;
201 std::error_code ec;
202 if (parts.empty()) { // "GAME:" itself
203 v.kind = Kind::Directory;
204 v.in_package = !r.game.empty();
205 return v;
206 }
207 if (!r.overlay.empty()) {
208 const std::filesystem::path p = join(r.overlay, parts);
209 if (std::filesystem::exists(p, ec)) {
210 v.in_overlay = true;
211 v.kind = std::filesystem::is_directory(p, ec) ? Kind::Directory : Kind::File;
212 }
213 }
214 if (!r.game.empty() && !deleted(r.overlay, parts)) {
215 const std::filesystem::path p = join(r.game, parts);
216 if (std::filesystem::exists(p, ec)) {
217 v.in_package = true;
218 if (v.kind == Kind::None) v.kind = std::filesystem::is_directory(p, ec) ? Kind::Directory : Kind::File;
219 }
220 }
221 return v;
222}
223
224bool is_folder(const Roots& r, const std::vector<std::wstring>& parts) { return view(r, parts).kind == Kind::Directory; }
225
226std::vector<std::wstring> parent_of(const std::vector<std::wstring>& parts) {
227 return parts.empty() ? parts : std::vector<std::wstring>(parts.begin(), parts.end() - 1);
228}
229
230// Whether a folder has nothing in the title's view: no overlay entry and no package entry that is not deleted.
231bool empty_in_view(const Roots& r, const std::vector<std::wstring>& parts) {
232 std::error_code ec;
233 if (!r.overlay.empty()) {
234 const std::filesystem::path p = join(r.overlay, parts);
235 for (auto it = std::filesystem::directory_iterator(p, ec); !ec && it != std::filesystem::directory_iterator();
236 it.increment(ec)) {
237 if (parts.empty() && same_name(it->path().filename().c_str(), kDeletedDir)) continue;
238 return false;
239 }
240 }
241 ec.clear();
242 if (!r.game.empty()) {
243 const std::filesystem::path p = join(r.game, parts);
244 for (auto it = std::filesystem::directory_iterator(p, ec); !ec && it != std::filesystem::directory_iterator();
245 it.increment(ec)) {
246 std::vector<std::wstring> child = parts;
247 child.push_back(it->path().filename().wstring());
248 if (!deleted(r.overlay, child)) return false;
249 }
250 }
251 return true;
252}
253
254BOOL fail_bool(DWORD error) {
255 SetLastError(error);
256 return FALSE;
148} 257}
149 258
150Target read_target(const std::wstring& path) { 259Target read_target(const std::wstring& path) {
@@ -369,6 +478,20 @@ HANDLE WINAPI create_file_a(LPCSTR name, DWORD access, DWORD share, LPSECURITY_A
369 return create_file_w(wide.c_str(), access, share, attributes, disposition, flags, template_file); 478 return create_file_w(wide.c_str(), access, share, attributes, disposition, flags, template_file);
370} 479}
371 480
481HANDLE WINAPI create_file2(LPCWSTR name, DWORD access, DWORD share, DWORD disposition,
482 LPCREATEFILE2_EXTENDED_PARAMETERS params) {
483 if (!name) {
484 SetLastError(ERROR_INVALID_PARAMETER);
485 return INVALID_HANDLE_VALUE;
486 }
487 const Target t = open_target(name, access, disposition);
488 if (t.error) {
489 SetLastError(t.error);
490 return INVALID_HANDLE_VALUE;
491 }
492 return ::CreateFile2(t.path.c_str(), access, share, disposition, params);
493}
494
372DWORD WINAPI get_file_attributes_w(LPCWSTR name) { 495DWORD WINAPI get_file_attributes_w(LPCWSTR name) {
373 if (!name) { 496 if (!name) {
374 SetLastError(ERROR_INVALID_PARAMETER); 497 SetLastError(ERROR_INVALID_PARAMETER);
@@ -439,6 +562,72 @@ HANDLE WINAPI find_first_file_w(LPCWSTR pattern, LPWIN32_FIND_DATAW data) {
439 return register_enumeration(std::move(e)); 562 return register_enumeration(std::move(e));
440} 563}
441 564
565HANDLE WINAPI find_first_file_ex_w(LPCWSTR pattern, FINDEX_INFO_LEVELS info_level, LPVOID data,
566 FINDEX_SEARCH_OPS search_op, LPVOID search_filter, DWORD additional_flags) {
567 if (!pattern || !data) {
568 SetLastError(ERROR_INVALID_PARAMETER);
569 return INVALID_HANDLE_VALUE;
570 }
571 std::vector<std::wstring> parts;
572 const Parsed parsed = parse_console(pattern, parts);
573 if (parsed == Parsed::Host)
574 return ::FindFirstFileExW(pattern, info_level, data, search_op, search_filter, additional_flags);
575 if (parsed == Parsed::Refused) {
576 SetLastError(ERROR_INVALID_NAME);
577 return INVALID_HANDLE_VALUE;
578 }
579 if (info_level != FindExInfoStandard && info_level != FindExInfoBasic) {
580 SetLastError(ERROR_INVALID_PARAMETER);
581 return INVALID_HANDLE_VALUE;
582 }
583 if (search_op != FindExSearchNameMatch && search_op != FindExSearchLimitToDirectories) {
584 SetLastError(ERROR_INVALID_PARAMETER);
585 return INVALID_HANDLE_VALUE;
586 }
587
588 std::vector<WIN32_FIND_DATAW> entries;
589 DWORD error = 0;
590 if (!collect(pattern, parts, entries, error)) {
591 SetLastError(error);
592 return INVALID_HANDLE_VALUE;
593 }
594 if (search_op == FindExSearchLimitToDirectories) {
595 std::vector<WIN32_FIND_DATAW> dirs_only;
596 for (auto& entry : entries)
597 if ((entry.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) dirs_only.push_back(entry);
598 entries = std::move(dirs_only);
599 if (entries.empty()) {
600 SetLastError(ERROR_FILE_NOT_FOUND);
601 return INVALID_HANDLE_VALUE;
602 }
603 }
604 if (info_level == FindExInfoBasic) {
605 for (auto& entry : entries) entry.cAlternateFileName[0] = L'\0';
606 }
607 auto e = std::make_unique<Enumeration>();
608 e->entries = std::move(entries);
609 e->next = 1;
610 *static_cast<LPWIN32_FIND_DATAW>(data) = e->entries[0];
611 return register_enumeration(std::move(e));
612}
613
614HANDLE WINAPI find_first_file_ex_a(LPCSTR pattern, FINDEX_INFO_LEVELS info_level, LPVOID data,
615 FINDEX_SEARCH_OPS search_op, LPVOID search_filter, DWORD additional_flags) {
616 if (!pattern || !data) {
617 SetLastError(ERROR_INVALID_PARAMETER);
618 return INVALID_HANDLE_VALUE;
619 }
620 const std::wstring wide = widen_ansi(pattern);
621 std::vector<std::wstring> parts;
622 const Parsed parsed = parse_console(wide, parts);
623 if (parsed == Parsed::Host)
624 return ::FindFirstFileExA(pattern, info_level, data, search_op, search_filter, additional_flags);
625 WIN32_FIND_DATAW wide_data{};
626 const HANDLE h = find_first_file_ex_w(wide.c_str(), info_level, &wide_data, search_op, search_filter, additional_flags);
627 if (h != INVALID_HANDLE_VALUE) to_ansi(wide_data, static_cast<LPWIN32_FIND_DATAA>(data));
628 return h;
629}
630
442HANDLE WINAPI find_first_file_a(LPCSTR pattern, LPWIN32_FIND_DATAA data) { 631HANDLE WINAPI find_first_file_a(LPCSTR pattern, LPWIN32_FIND_DATAA data) {
443 if (!pattern || !data) { 632 if (!pattern || !data) {
444 SetLastError(ERROR_INVALID_PARAMETER); 633 SetLastError(ERROR_INVALID_PARAMETER);
@@ -527,17 +716,8 @@ BOOL WINAPI delete_file_w(LPCWSTR name) {
527 return FALSE; 716 return FALSE;
528 } 717 }
529 // The package file stays where it is; the marker is what hides it. 718 // The package file stays where it is; the marker is what hides it.
530 const std::filesystem::path mark = marker(r.overlay, parts); 719 DWORD error = 0;
531 std::filesystem::create_directories(mark.parent_path(), ec); 720 if (!write_marker(marker(r.overlay, parts), error)) return fail_bool(error);
532 if (ec) {
533 SetLastError(static_cast<DWORD>(ec.value()));
534 return FALSE;
535 }
536 const HANDLE h = ::CreateFileW(mark.c_str(), GENERIC_WRITE,
537 FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, nullptr,
538 CREATE_ALWAYS, FILE_ATTRIBUTE_HIDDEN, nullptr);
539 if (h == INVALID_HANDLE_VALUE) return FALSE; // CreateFileW's error
540 ::CloseHandle(h);
541 removed = true; 721 removed = true;
542 } 722 }
543 } 723 }
@@ -557,6 +737,287 @@ BOOL WINAPI delete_file_a(LPCSTR name) {
557 return delete_file_w(wide.c_str()); 737 return delete_file_w(wide.c_str());
558} 738}
559 739
740// ---- Folders: created in the overlay, removed by a marker when the package has them
741
742namespace {
743
744BOOL create_directory(LPCWSTR template_name, LPCWSTR name, LPSECURITY_ATTRIBUTES security) {
745 if (!name) return fail_bool(ERROR_INVALID_PARAMETER);
746 std::wstring template_path;
747 if (template_name) {
748 const Target t = read_target(template_name);
749 if (t.error) return fail_bool(t.error);
750 template_path = t.path.wstring();
751 }
752 std::vector<std::wstring> parts;
753 const Parsed parsed = parse_console(name, parts);
754 if (parsed == Parsed::Host)
755 return template_name ? ::CreateDirectoryExW(template_path.c_str(), name, security)
756 : ::CreateDirectoryW(name, security);
757 if (parsed == Parsed::Refused) return fail_bool(ERROR_INVALID_NAME);
758
759 const Roots r = roots();
760 if (r.game.empty() || r.overlay.empty()) return fail_bool(ERROR_PATH_NOT_FOUND);
761 if (view(r, parts).kind != Kind::None) return fail_bool(ERROR_ALREADY_EXISTS); // "GAME:" included
762 if (!is_folder(r, parent_of(parts))) return fail_bool(ERROR_PATH_NOT_FOUND);
763
764 const std::filesystem::path target = join(r.overlay, parts);
765 std::error_code ec;
766 std::filesystem::create_directories(target.parent_path(), ec);
767 if (ec) return fail_bool(static_cast<DWORD>(ec.value()));
768 return template_name ? ::CreateDirectoryExW(template_path.c_str(), target.c_str(), security)
769 : ::CreateDirectoryW(target.c_str(), security);
770}
771
772} // namespace
773
774BOOL WINAPI create_directory_w(LPCWSTR name, LPSECURITY_ATTRIBUTES security) {
775 return create_directory(nullptr, name, security);
776}
777
778BOOL WINAPI create_directory_a(LPCSTR name, LPSECURITY_ATTRIBUTES security) {
779 if (!name) return fail_bool(ERROR_INVALID_PARAMETER);
780 const std::wstring wide = widen_ansi(name);
781 return create_directory(nullptr, wide.c_str(), security);
782}
783
784BOOL WINAPI create_directory_ex_w(LPCWSTR template_name, LPCWSTR name, LPSECURITY_ATTRIBUTES security) {
785 if (!template_name) return fail_bool(ERROR_INVALID_PARAMETER);
786 return create_directory(template_name, name, security);
787}
788
789BOOL WINAPI create_directory_ex_a(LPCSTR template_name, LPCSTR name, LPSECURITY_ATTRIBUTES security) {
790 if (!template_name || !name) return fail_bool(ERROR_INVALID_PARAMETER);
791 const std::wstring wide_template = widen_ansi(template_name), wide = widen_ansi(name);
792 return create_directory(wide_template.c_str(), wide.c_str(), security);
793}
794
795BOOL WINAPI remove_directory_w(LPCWSTR name) {
796 if (!name) return fail_bool(ERROR_INVALID_PARAMETER);
797 std::vector<std::wstring> parts;
798 const Parsed parsed = parse_console(name, parts);
799 if (parsed == Parsed::Host) return ::RemoveDirectoryW(name);
800 if (parsed == Parsed::Refused) return fail_bool(ERROR_INVALID_NAME);
801
802 const Roots r = roots();
803 if (r.game.empty() || r.overlay.empty()) return fail_bool(ERROR_PATH_NOT_FOUND);
804 if (parts.empty()) return fail_bool(ERROR_ACCESS_DENIED); // "GAME:" itself stays
805 const View v = view(r, parts);
806 if (v.kind == Kind::None) return fail_bool(ERROR_FILE_NOT_FOUND);
807 if (v.kind == Kind::File) return fail_bool(ERROR_DIRECTORY);
808 if (!empty_in_view(r, parts)) return fail_bool(ERROR_DIR_NOT_EMPTY);
809
810 if (v.in_overlay && !::RemoveDirectoryW(join(r.overlay, parts).c_str())) return FALSE; // its error
811 if (v.in_package) {
812 // The package folder stays where it is; the marker hides it, and its files are already hidden one by one.
813 DWORD error = 0;
814 if (!write_marker(marker(r.overlay, parts) / kRemovedDirMarker, error)) return fail_bool(error);
815 }
816 return TRUE;
817}
818
819BOOL WINAPI remove_directory_a(LPCSTR name) {
820 if (!name) return fail_bool(ERROR_INVALID_PARAMETER);
821 const std::wstring wide = widen_ansi(name);
822 return remove_directory_w(wide.c_str());
823}
824
825// ---- Move, copy and attributes: the result lands in the overlay, a moved package name is deleted by a marker
826
827BOOL WINAPI move_file_ex_w(LPCWSTR from, LPCWSTR to, DWORD flags) {
828 if (!from) return fail_bool(ERROR_INVALID_PARAMETER);
829 std::vector<std::wstring> src, dst;
830 const Parsed from_kind = parse_console(from, src);
831 const Parsed to_kind = to ? parse_console(to, dst) : Parsed::Host;
832 if (from_kind == Parsed::Host && to_kind == Parsed::Host) return ::MoveFileExW(from, to, flags);
833 if (from_kind == Parsed::Refused || to_kind == Parsed::Refused) return fail_bool(ERROR_INVALID_NAME);
834 // A boot-time move or delete is a host feature a title cannot use on the console's drives.
835 if (!to || (flags & MOVEFILE_DELAY_UNTIL_REBOOT) != 0) return fail_bool(ERROR_INVALID_PARAMETER);
836 // GAME: is its own volume: a move between it and a host path is refused the way a cross-volume move is.
837 if (from_kind != to_kind) return fail_bool(ERROR_NOT_SAME_DEVICE);
838
839 const Roots r = roots();
840 if (r.game.empty() || r.overlay.empty()) return fail_bool(ERROR_PATH_NOT_FOUND);
841 if (src.empty() || dst.empty()) return fail_bool(ERROR_ACCESS_DENIED);
842 const View from_view = view(r, src);
843 if (from_view.kind == Kind::None) return fail_bool(ERROR_FILE_NOT_FOUND);
844 const View to_view = view(r, dst);
845 if (to_view.kind == Kind::Directory) return fail_bool(ERROR_ACCESS_DENIED);
846 if (to_view.kind == Kind::File && (flags & MOVEFILE_REPLACE_EXISTING) == 0) return fail_bool(ERROR_ALREADY_EXISTS);
847 if (!is_folder(r, parent_of(dst))) return fail_bool(ERROR_PATH_NOT_FOUND);
848
849 const std::filesystem::path overlay_from = join(r.overlay, src), overlay_to = join(r.overlay, dst);
850 std::error_code ec;
851 std::filesystem::create_directories(overlay_to.parent_path(), ec);
852 if (ec) return fail_bool(static_cast<DWORD>(ec.value()));
853
854 if (from_view.kind == Kind::Directory) {
855 // A package folder is left where it is (as DeleteFile does); an overlay-only folder is renamed in place.
856 if (from_view.in_package) return fail_bool(ERROR_ACCESS_DENIED);
857 if (to_view.kind != Kind::None) return fail_bool(ERROR_ACCESS_DENIED);
858 return ::MoveFileExW(overlay_from.c_str(), overlay_to.c_str(), flags & MOVEFILE_WRITE_THROUGH);
859 }
860
861 const bool write_through = (flags & MOVEFILE_WRITE_THROUGH) != 0;
862 const DWORD keep = flags & (MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH);
863 DWORD error = 0;
864 if (from_view.in_overlay) {
865 if (!::MoveFileExW(overlay_from.c_str(), overlay_to.c_str(), keep | MOVEFILE_COPY_ALLOWED)) return FALSE;
866 } else {
867 // The host never sees a move here, only a copy and a marker, so MOVEFILE_WRITE_THROUGH is honoured by
868 // flushing both before returning, as MoveFileEx does for its own copy and delete.
869 const BOOL fail_if_exists = (flags & MOVEFILE_REPLACE_EXISTING) == 0;
870 if (!::CopyFileW(join(r.game, src).c_str(), overlay_to.c_str(), fail_if_exists)) return FALSE;
871 if (write_through && !flush_file(overlay_to, error)) return fail_bool(error);
872 }
873 if (from_view.in_package) {
874 const std::filesystem::path mark = marker(r.overlay, src);
875 if (!write_marker(mark, error)) return fail_bool(error);
876 if (write_through && !flush_file(mark, error)) return fail_bool(error);
877 }
878 return TRUE;
879}
880
881BOOL WINAPI move_file_w(LPCWSTR from, LPCWSTR to) {
882 if (!from || !to) return fail_bool(ERROR_INVALID_PARAMETER);
883 return move_file_ex_w(from, to, MOVEFILE_COPY_ALLOWED); // MoveFile moves files across volumes
884}
885
886BOOL WINAPI move_file_ex_a(LPCSTR from, LPCSTR to, DWORD flags) {
887 if (!from) return fail_bool(ERROR_INVALID_PARAMETER);
888 const std::wstring wide_from = widen_ansi(from), wide_to = to ? widen_ansi(to) : std::wstring();
889 return move_file_ex_w(wide_from.c_str(), to ? wide_to.c_str() : nullptr, flags);
890}
891
892BOOL WINAPI move_file_a(LPCSTR from, LPCSTR to) {
893 if (!from || !to) return fail_bool(ERROR_INVALID_PARAMETER);
894 return move_file_ex_a(from, to, MOVEFILE_COPY_ALLOWED);
895}
896
897namespace {
898
899// Where a copy writes: a host path as given; a GAME: path is checked against the title's view (an existing name
900// counts even when only the package has it) and then means its overlay copy.
901bool copy_destination(LPCWSTR to, bool fail_if_exists, std::filesystem::path& out, DWORD& error) {
902 std::vector<std::wstring> parts;
903 const Parsed parsed = parse_console(to, parts);
904 if (parsed == Parsed::Host) {
905 out = std::filesystem::path(to);
906 return true;
907 }
908 error = ERROR_INVALID_NAME;
909 if (parsed == Parsed::Refused || parts.empty()) return false;
910 const Roots r = roots();
911 error = ERROR_PATH_NOT_FOUND;
912 if (r.game.empty() || r.overlay.empty()) return false;
913 const View v = view(r, parts);
914 error = ERROR_ACCESS_DENIED;
915 if (v.kind == Kind::Directory) return false;
916 error = ERROR_FILE_EXISTS;
917 if (v.kind == Kind::File && fail_if_exists) return false;
918 error = ERROR_PATH_NOT_FOUND;
919 if (!is_folder(r, parent_of(parts))) return false;
920 out = join(r.overlay, parts);
921 std::error_code ec;
922 std::filesystem::create_directories(out.parent_path(), ec);
923 if (ec) {
924 error = static_cast<DWORD>(ec.value());
925 return false;
926 }
927 error = 0;
928 return true;
929}
930
931// The source and destination a copy opens, or the error it fails with.
932bool copy_paths(LPCWSTR from, LPCWSTR to, bool fail_if_exists, std::filesystem::path& source,
933 std::filesystem::path& destination, DWORD& error) {
934 if (!from || !to) {
935 error = ERROR_INVALID_PARAMETER;
936 return false;
937 }
938 const Target t = read_target(from);
939 if (t.error) {
940 error = t.error;
941 return false;
942 }
943 source = t.path;
944 return copy_destination(to, fail_if_exists, destination, error);
945}
946
947} // namespace
948
949BOOL WINAPI copy_file_w(LPCWSTR from, LPCWSTR to, BOOL fail_if_exists) {
950 std::filesystem::path source, destination;
951 DWORD error = 0;
952 if (!copy_paths(from, to, fail_if_exists != FALSE, source, destination, error)) return fail_bool(error);
953 return ::CopyFileW(source.c_str(), destination.c_str(), fail_if_exists);
954}
955
956BOOL WINAPI copy_file_a(LPCSTR from, LPCSTR to, BOOL fail_if_exists) {
957 if (!from || !to) return fail_bool(ERROR_INVALID_PARAMETER);
958 const std::wstring wide_from = widen_ansi(from), wide_to = widen_ansi(to);
959 return copy_file_w(wide_from.c_str(), wide_to.c_str(), fail_if_exists);
960}
961
962BOOL WINAPI copy_file_ex_w(LPCWSTR from, LPCWSTR to, LPPROGRESS_ROUTINE progress, LPVOID data, LPBOOL cancel,
963 DWORD flags) {
964 std::filesystem::path source, destination;
965 DWORD error = 0;
966 if (!copy_paths(from, to, (flags & COPY_FILE_FAIL_IF_EXISTS) != 0, source, destination, error))
967 return fail_bool(error);
968 return ::CopyFileExW(source.c_str(), destination.c_str(), progress, data, cancel, flags);
969}
970
971BOOL WINAPI copy_file_ex_a(LPCSTR from, LPCSTR to, LPPROGRESS_ROUTINE progress, LPVOID data, LPBOOL cancel,
972 DWORD flags) {
973 if (!from || !to) return fail_bool(ERROR_INVALID_PARAMETER);
974 const std::wstring wide_from = widen_ansi(from), wide_to = widen_ansi(to);
975 return copy_file_ex_w(wide_from.c_str(), wide_to.c_str(), progress, data, cancel, flags);
976}
977
978HRESULT WINAPI copy_file2(PCWSTR from, PCWSTR to, COPYFILE2_EXTENDED_PARAMETERS* parameters) {
979 const bool fail_if_exists = parameters && (parameters->dwCopyFlags & COPY_FILE_FAIL_IF_EXISTS) != 0;
980 std::filesystem::path source, destination;
981 DWORD error = 0;
982 if (!copy_paths(from, to, fail_if_exists, source, destination, error)) return HRESULT_FROM_WIN32(error);
983 return ::CopyFile2(source.c_str(), destination.c_str(), parameters);
984}
985
986BOOL WINAPI set_file_attributes_w(LPCWSTR name, DWORD attributes) {
987 if (!name) return fail_bool(ERROR_INVALID_PARAMETER);
988 std::vector<std::wstring> parts;
989 const Parsed parsed = parse_console(name, parts);
990 if (parsed == Parsed::Host) return ::SetFileAttributesW(name, attributes);
991 if (parsed == Parsed::Refused) return fail_bool(ERROR_INVALID_NAME);
992
993 const Roots r = roots();
994 if (r.game.empty() || r.overlay.empty()) return fail_bool(ERROR_PATH_NOT_FOUND);
995 if (parts.empty()) return fail_bool(ERROR_ACCESS_DENIED);
996 const View v = view(r, parts);
997 if (v.kind == Kind::None) return fail_bool(ERROR_FILE_NOT_FOUND);
998
999 // The attributes belong to the overlay copy: a package file is copied up and a package folder mirrored first,
1000 // so the package keeps its own attributes and reads, which prefer the overlay, see the new ones.
1001 const std::filesystem::path target = join(r.overlay, parts);
1002 if (!v.in_overlay) {
1003 std::error_code ec;
1004 if (v.kind == Kind::Directory) {
1005 std::filesystem::create_directories(target, ec);
1006 if (ec) return fail_bool(static_cast<DWORD>(ec.value()));
1007 } else {
1008 const Target t = write_target(name, true);
1009 if (t.error) return fail_bool(t.error);
1010 }
1011 }
1012 return ::SetFileAttributesW(target.c_str(), attributes);
1013}
1014
1015BOOL WINAPI set_file_attributes_a(LPCSTR name, DWORD attributes) {
1016 if (!name) return fail_bool(ERROR_INVALID_PARAMETER);
1017 const std::wstring wide = widen_ansi(name);
1018 return set_file_attributes_w(wide.c_str(), attributes);
1019}
1020
560} // namespace rt::fs 1021} // namespace rt::fs
561 1022
562namespace { 1023namespace {
@@ -568,8 +1029,11 @@ using namespace rt::fs;
568#define FILE_API(dll) \ 1029#define FILE_API(dll) \
569 {dll, "CreateFileA", reinterpret_cast<void*>(&create_file_a)}, \ 1030 {dll, "CreateFileA", reinterpret_cast<void*>(&create_file_a)}, \
570 {dll, "CreateFileW", reinterpret_cast<void*>(&create_file_w)}, \ 1031 {dll, "CreateFileW", reinterpret_cast<void*>(&create_file_w)}, \
1032 {dll, "CreateFile2", reinterpret_cast<void*>(&create_file2)}, \
571 {dll, "FindFirstFileA", reinterpret_cast<void*>(&find_first_file_a)}, \ 1033 {dll, "FindFirstFileA", reinterpret_cast<void*>(&find_first_file_a)}, \
572 {dll, "FindFirstFileW", reinterpret_cast<void*>(&find_first_file_w)}, \ 1034 {dll, "FindFirstFileW", reinterpret_cast<void*>(&find_first_file_w)}, \
1035 {dll, "FindFirstFileExA", reinterpret_cast<void*>(&find_first_file_ex_a)}, \
1036 {dll, "FindFirstFileExW", reinterpret_cast<void*>(&find_first_file_ex_w)}, \
573 {dll, "FindNextFileA", reinterpret_cast<void*>(&find_next_file_a)}, \ 1037 {dll, "FindNextFileA", reinterpret_cast<void*>(&find_next_file_a)}, \
574 {dll, "FindNextFileW", reinterpret_cast<void*>(&find_next_file_w)}, \ 1038 {dll, "FindNextFileW", reinterpret_cast<void*>(&find_next_file_w)}, \
575 {dll, "FindClose", reinterpret_cast<void*>(&find_close)}, \ 1039 {dll, "FindClose", reinterpret_cast<void*>(&find_close)}, \
@@ -578,7 +1042,24 @@ using namespace rt::fs;
578 {dll, "GetFileAttributesExA", reinterpret_cast<void*>(&get_file_attributes_ex_a)}, \ 1042 {dll, "GetFileAttributesExA", reinterpret_cast<void*>(&get_file_attributes_ex_a)}, \
579 {dll, "GetFileAttributesExW", reinterpret_cast<void*>(&get_file_attributes_ex_w)}, \ 1043 {dll, "GetFileAttributesExW", reinterpret_cast<void*>(&get_file_attributes_ex_w)}, \
580 {dll, "DeleteFileA", reinterpret_cast<void*>(&delete_file_a)}, \ 1044 {dll, "DeleteFileA", reinterpret_cast<void*>(&delete_file_a)}, \
581 {dll, "DeleteFileW", reinterpret_cast<void*>(&delete_file_w)} 1045 {dll, "DeleteFileW", reinterpret_cast<void*>(&delete_file_w)}, \
1046 {dll, "CreateDirectoryA", reinterpret_cast<void*>(&create_directory_a)}, \
1047 {dll, "CreateDirectoryW", reinterpret_cast<void*>(&create_directory_w)}, \
1048 {dll, "CreateDirectoryExA", reinterpret_cast<void*>(&create_directory_ex_a)}, \
1049 {dll, "CreateDirectoryExW", reinterpret_cast<void*>(&create_directory_ex_w)}, \
1050 {dll, "RemoveDirectoryA", reinterpret_cast<void*>(&remove_directory_a)}, \
1051 {dll, "RemoveDirectoryW", reinterpret_cast<void*>(&remove_directory_w)}, \
1052 {dll, "MoveFileA", reinterpret_cast<void*>(&move_file_a)}, \
1053 {dll, "MoveFileW", reinterpret_cast<void*>(&move_file_w)}, \
1054 {dll, "MoveFileExA", reinterpret_cast<void*>(&move_file_ex_a)}, \
1055 {dll, "MoveFileExW", reinterpret_cast<void*>(&move_file_ex_w)}, \
1056 {dll, "CopyFileA", reinterpret_cast<void*>(&copy_file_a)}, \
1057 {dll, "CopyFileW", reinterpret_cast<void*>(&copy_file_w)}, \
1058 {dll, "CopyFileExA", reinterpret_cast<void*>(&copy_file_ex_a)}, \
1059 {dll, "CopyFileExW", reinterpret_cast<void*>(&copy_file_ex_w)}, \
1060 {dll, "CopyFile2", reinterpret_cast<void*>(&copy_file2)}, \
1061 {dll, "SetFileAttributesA", reinterpret_cast<void*>(&set_file_attributes_a)}, \
1062 {dll, "SetFileAttributesW", reinterpret_cast<void*>(&set_file_attributes_w)}
582} // namespace 1063} // namespace
583 1064
584SHIM_TABLE(file_system, 1065SHIM_TABLE(file_system,
diff --git a/runtime/shims/file_system.h b/runtime/shims/file_system.h
index 042326f86..1a0fa365a 100644
--- a/runtime/shims/file_system.h
+++ b/runtime/shims/file_system.h
@@ -12,7 +12,8 @@
12// A GAME: path that climbs above the root with ".." or names another drive is refused with ERROR_INVALID_NAME. 12// A GAME: path that climbs above the root with ".." or names another drive is refused with ERROR_INVALID_NAME.
13// 13//
14// The shims that use this live in file_system.cpp: CreateFile*, FindFirstFile*/FindNextFile*/FindClose, 14// The shims that use this live in file_system.cpp: CreateFile*, FindFirstFile*/FindNextFile*/FindClose,
15// GetFileAttributes*/GetFileAttributesEx* and DeleteFile*. 15// GetFileAttributes*/GetFileAttributesEx*, DeleteFile*, CreateDirectory*/RemoveDirectory*, MoveFile*/MoveFileEx*,
16// CopyFile*/CopyFileEx*/CopyFile2 and SetFileAttributes* (the rules for each are in docs/runtime_imports.md).
16#pragma once 17#pragma once
17 18
18#include <filesystem> 19#include <filesystem>
diff --git a/runtime/shims/gameinput.cpp b/runtime/shims/gameinput.cpp
index 35eac4c4e..21924801c 100644
--- a/runtime/shims/gameinput.cpp
+++ b/runtime/shims/gameinput.cpp
@@ -106,6 +106,8 @@ rt::gameinput::Config read_config() {
106 else if (!t.empty() && t != "rumble") std::fprintf(stderr, "[rt] gameinput: LEONIDA_DS_TRIGGERS=%s unknown, using rumble\n", t.c_str()); 106 else if (!t.empty() && t != "rumble") std::fprintf(stderr, "[rt] gameinput: LEONIDA_DS_TRIGGERS=%s unknown, using rumble\n", t.c_str());
107 if (const std::string g = env("LEONIDA_DS_TRIGGER_GAIN"); !g.empty()) 107 if (const std::string g = env("LEONIDA_DS_TRIGGER_GAIN"); !g.empty())
108 c.ds_trigger_gain = std::clamp(static_cast<float>(std::atof(g.c_str())), 0.0f, 4.0f); 108 c.ds_trigger_gain = std::clamp(static_cast<float>(std::atof(g.c_str())), 0.0f, 4.0f);
109 if (const std::string g = env("LEONIDA_MOUSE_SENSITIVITY"); !g.empty())
110 c.mouse_sensitivity = std::clamp(static_cast<float>(std::atof(g.c_str())), 0.1f, 10.0f);
109 if (const std::string f = env("LEONIDA_DS_TRIGGER_FREQ"); !f.empty()) 111 if (const std::string f = env("LEONIDA_DS_TRIGGER_FREQ"); !f.empty())
110 c.ds_trigger_frequency = static_cast<uint8_t>(std::clamp(std::atoi(f.c_str()), 1, 255)); 112 c.ds_trigger_frequency = static_cast<uint8_t>(std::clamp(std::atoi(f.c_str()), 1, 255));
111 if (const std::string l = env("LEONIDA_DS_LIGHTBAR"); !l.empty()) { 113 if (const std::string l = env("LEONIDA_DS_LIGHTBAR"); !l.empty()) {
@@ -875,8 +877,76 @@ constexpr int kMouseDecayNum = 7, kMouseDecayDen = 8;
875 877
876bool async_key_down(int vk) { return (GetAsyncKeyState(vk) & 0x8000) != 0; } 878bool async_key_down(int vk) { return (GetAsyncKeyState(vk) & 0x8000) != 0; }
877 879
878// shortcut: plain cursor deltas stop at the screen edge; capture or recenter the cursor if that matters in game. 880// ---- raw mouse input (its own thread) ----
881//
882// The cursor stops at the edge of the screen, so cursor deltas stop too. Raw input reports what the mouse itself
883// moved, with no edge and no pointer acceleration. A message-only window (never shown) on its own thread receives
884// WM_INPUT and adds each movement to a running total; system_cursor_pos then returns that total as an edgeless
885// "cursor", and update_keyboard_pad takes the difference between polls exactly as it did with the real cursor.
886std::atomic<long long> g_raw_x{0}, g_raw_y{0}; // total raw movement since the thread started, mouse counts
887std::atomic<bool> g_raw_ready{false}; // registration worked; system_cursor_pos uses the totals
888std::atomic<bool> g_raw_started{false}; // the thread is started once per process
889
890LRESULT CALLBACK raw_mouse_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) {
891 if (msg == WM_INPUT) {
892 RAWINPUT raw{};
893 UINT size = sizeof(raw);
894 if (GetRawInputData(reinterpret_cast<HRAWINPUT>(lp), RID_INPUT, &raw, &size, sizeof(RAWINPUTHEADER)) !=
895 static_cast<UINT>(-1) &&
896 raw.header.dwType == RIM_TYPEMOUSE && !(raw.data.mouse.usFlags & MOUSE_MOVE_ABSOLUTE)) {
897 // Relative movement only: absolute reports (remote desktop, some VMs, tablets) are positions, not
898 // movement, and would make the stick jump.
899 g_raw_x += raw.data.mouse.lLastX;
900 g_raw_y += raw.data.mouse.lLastY; // +Y is down, as for the cursor
901 }
902 }
903 return DefWindowProcW(hwnd, msg, wp, lp); // also for WM_INPUT, which lets Windows clean up the input
904}
905
906void raw_mouse_thread() {
907 const HINSTANCE inst = GetModuleHandleW(nullptr);
908 WNDCLASSEXW wc{};
909 wc.cbSize = sizeof(wc);
910 wc.lpfnWndProc = raw_mouse_proc;
911 wc.hInstance = inst;
912 wc.lpszClassName = L"LeonidaRawMouse";
913 RegisterClassExW(&wc);
914 // HWND_MESSAGE: a window that is never shown and only receives messages. It must be created on the thread that
915 // runs the message loop below, because a window's messages go to the thread that created it.
916 HWND hwnd = CreateWindowExW(0, L"LeonidaRawMouse", L"", 0, 0, 0, 0, 0,
917 HWND_MESSAGE, nullptr, inst, nullptr);
918 if (!hwnd) {
919 std::fprintf(stderr, "[rt] gameinput: no raw mouse input (window: error %lu); using the cursor position\n",
920 GetLastError());
921 return;
922 }
923 RAWINPUTDEVICE dev{};
924 dev.usUsagePage = 0x01; // HID generic desktop
925 dev.usUsage = 0x02; // mouse
926 dev.dwFlags = RIDEV_INPUTSINK; // also while this (invisible) window has no focus; focus is checked per poll
927 dev.hwndTarget = hwnd;
928 if (!RegisterRawInputDevices(&dev, 1, sizeof(dev))) {
929 std::fprintf(stderr, "[rt] gameinput: no raw mouse input (register: error %lu); using the cursor position\n",
930 GetLastError());
931 DestroyWindow(hwnd);
932 return;
933 }
934 g_raw_ready = true;
935 std::fprintf(stderr, "[rt] gameinput: raw mouse input on (the right stick does not stop at the screen edge)\n");
936 MSG m;
937 while (GetMessageW(&m, nullptr, 0, 0) > 0) DispatchMessageW(&m);
938}
939
940void start_raw_mouse() {
941 if (!g_raw_started.exchange(true)) std::thread(raw_mouse_thread).detach();
942}
943
879bool system_cursor_pos(int* x, int* y) { 944bool system_cursor_pos(int* x, int* y) {
945 if (g_raw_ready) { // the edgeless total; it wraps only after ±2^31 counts, and the poll uses differences
946 *x = static_cast<int>(g_raw_x.load());
947 *y = static_cast<int>(g_raw_y.load());
948 return true;
949 }
880 POINT p; 950 POINT p;
881 if (!GetCursorPos(&p)) return false; 951 if (!GetCursorPos(&p)) return false;
882 *x = p.x; 952 *x = p.x;
@@ -911,6 +981,33 @@ void detach_keyboard_pad() {
911 g_keyboard = {}; 981 g_keyboard = {};
912} 982}
913 983
984// Keeps the cursor inside the game window while it has focus, so a click cannot land on another window, and releases
985// it on focus loss. Only with raw input (a clipped plain cursor would stop the stick at the window edge) and only for
986// a real foreground window of this process: not KeyboardPadMode::Always over a terminal, nor a test's fake focus.
987// Re-applied every 100 ms, because Windows drops the clip on some focus and resize changes.
988bool g_clipped = false;
989uint64_t g_clip_at = 0;
990
991void clip_cursor(bool want) {
992 if (!want) {
993 if (g_clipped) ClipCursor(nullptr);
994 g_clipped = false;
995 return;
996 }
997 const uint64_t now = now_us();
998 if (g_clipped && now - g_clip_at < 100'000) return;
999 const HWND w = GetForegroundWindow();
1000 RECT r;
1001 if (!w || !GetClientRect(w, &r)) return;
1002 POINT top_left{r.left, r.top}, bottom_right{r.right, r.bottom};
1003 if (!ClientToScreen(w, &top_left) || !ClientToScreen(w, &bottom_right)) return;
1004 const RECT screen{top_left.x, top_left.y, bottom_right.x, bottom_right.y};
1005 if (screen.right > screen.left && screen.bottom > screen.top && ClipCursor(&screen)) {
1006 g_clipped = true;
1007 g_clip_at = now;
1008 }
1009}
1010
914bool attach_keyboard_pad() { 1011bool attach_keyboard_pad() {
915 SDL_VirtualJoystickDesc d; 1012 SDL_VirtualJoystickDesc d;
916 SDL_INIT_INTERFACE(&d); 1013 SDL_INIT_INTERFACE(&d);
@@ -931,17 +1028,21 @@ bool attach_keyboard_pad() {
931 std::fprintf(stderr, "[rt] gameinput: keyboard pad attached (arrows d-pad, Enter A, Backspace B, X X, Y Y, " 1028 std::fprintf(stderr, "[rt] gameinput: keyboard pad attached (arrows d-pad, Enter A, Backspace B, X X, Y Y, "
932 "Q/E shoulders, Esc Menu, Tab View, WASD left stick, mouse right stick, right/left " 1029 "Q/E shoulders, Esc Menu, Tab View, WASD left stick, mouse right stick, right/left "
933 "button LT/RT)\n"); 1030 "button LT/RT)\n");
1031 start_raw_mouse();
934 return true; 1032 return true;
935} 1033}
936 1034
937// Before SDL_UpdateGamepads, so the buttons set here are in this poll's reading. 1035// Before SDL_UpdateGamepads, so the buttons set here are in this poll's reading.
938void update_keyboard_pad() { 1036void update_keyboard_pad() {
1037 float sens;
939 rt::gameinput::KeyboardPadMode mode; 1038 rt::gameinput::KeyboardPadMode mode;
940 { 1039 {
941 std::lock_guard lock(g().mu); 1040 std::lock_guard lock(g().mu);
942 mode = g().config.keyboard_pad; 1041 mode = g().config.keyboard_pad;
1042 sens = g().config.mouse_sensitivity;
943 } 1043 }
944 if (mode == rt::gameinput::KeyboardPadMode::Off) { 1044 if (mode == rt::gameinput::KeyboardPadMode::Off) {
1045 clip_cursor(false);
945 if (g_keyboard.id) detach_keyboard_pad(); 1046 if (g_keyboard.id) detach_keyboard_pad();
946 g_keyboard.failed = false; 1047 g_keyboard.failed = false;
947 return; 1048 return;
@@ -953,7 +1054,8 @@ void update_keyboard_pad() {
953 bool aim = false, fire = false; 1054 bool aim = false, fire = false;
954 // Out of focus every button, stick and trigger is released, so a key held while switching windows does not stay 1055 // Out of focus every button, stick and trigger is released, so a key held while switching windows does not stay
955 // pressed, and the cursor is read afresh on return, so moving it in another window does not swing the stick. 1056 // pressed, and the cursor is read afresh on return, so moving it in another window does not swing the stick.
956 if (mode == rt::gameinput::KeyboardPadMode::Always || g_has_focus.load()()) { 1057 const bool active = mode == rt::gameinput::KeyboardPadMode::Always || g_has_focus.load()();
1058 if (active) {
957 const rt::gameinput::KeyDownFn key_down = g_key_down.load(); 1059 const rt::gameinput::KeyDownFn key_down = g_key_down.load();
958 for (const auto& b : kKeyBindings) down[b.sdl_button] |= key_down(b.virtual_key); 1060 for (const auto& b : kKeyBindings) down[b.sdl_button] |= key_down(b.virtual_key);
959 lx = key_down('D') - key_down('A'); // opposite keys cancel 1061 lx = key_down('D') - key_down('A'); // opposite keys cancel
@@ -964,9 +1066,9 @@ void update_keyboard_pad() {
964 int x = 0, y = 0; 1066 int x = 0, y = 0;
965 const bool have = g_cursor_pos.load()(&x, &y); 1067 const bool have = g_cursor_pos.load()(&x, &y);
966 const bool moved = have && g_keyboard.have_cursor; 1068 const bool moved = have && g_keyboard.have_cursor;
967 auto step = [](int v, int pixels) { 1069 auto step = [sens](int v, int pixels) {
968 const long long n = static_cast<long long>(v) * kMouseDecayNum / kMouseDecayDen + 1070 const long long n = static_cast<long long>(v) * kMouseDecayNum / kMouseDecayDen +
969 static_cast<long long>(pixels) * kMouseAxisPerPixel; 1071 std::lround(static_cast<long long>(pixels) * kMouseAxisPerPixel * sens);
970 return static_cast<int>(std::clamp<long long>(n, -kStickFull, kStickFull)); 1072 return static_cast<int>(std::clamp<long long>(n, -kStickFull, kStickFull));
971 }; 1073 };
972 g_keyboard.right_x = step(g_keyboard.right_x, moved ? x - g_keyboard.cursor_x : 0); 1074 g_keyboard.right_x = step(g_keyboard.right_x, moved ? x - g_keyboard.cursor_x : 0);
@@ -977,6 +1079,7 @@ void update_keyboard_pad() {
977 g_keyboard.right_x = g_keyboard.right_y = 0; 1079 g_keyboard.right_x = g_keyboard.right_y = 0;
978 g_keyboard.have_cursor = false; 1080 g_keyboard.have_cursor = false;
979 } 1081 }
1082 clip_cursor(active && g_raw_ready && g_cursor_pos.load() == system_cursor_pos && foreground_is_ours());
980 for (const auto& b : kKeyBindings) SDL_SetJoystickVirtualButton(g_keyboard.js, b.sdl_button, down[b.sdl_button]); 1083 for (const auto& b : kKeyBindings) SDL_SetJoystickVirtualButton(g_keyboard.js, b.sdl_button, down[b.sdl_button]);
981 const int reach = lx && ly ? kStickDiagonal : kStickFull; 1084 const int reach = lx && ly ? kStickDiagonal : kStickFull;
982 SDL_SetJoystickVirtualAxis(g_keyboard.js, SDL_GAMEPAD_AXIS_LEFTX, static_cast<Sint16>(lx * reach)); 1085 SDL_SetJoystickVirtualAxis(g_keyboard.js, SDL_GAMEPAD_AXIS_LEFTX, static_cast<Sint16>(lx * reach));
@@ -1190,10 +1293,12 @@ HRESULT find_reading(IGameInputReading* ref, uint32_t kind, IGameInputDevice* de
1190 if (device) { 1293 if (device) {
1191 Device* dev = as_device(device); 1294 Device* dev = as_device(device);
1192 if (dev->info.deviceFamily == GameInputFamilyAggregate) { 1295 if (dev->info.deviceFamily == GameInputFamilyAggregate) {
1193 const uint32_t effective_kind = (kind != GameInputKindUnknown) ? kind : dev->info.supportedInput; 1296 if (kind != GameInputKindUnknown && !(kind & dev->info.supportedInput))
1297 return GAMEINPUT_E_READING_NOT_FOUND;
1298 const uint32_t effective_kind = (kind != GameInputKindUnknown) ? (kind & dev->info.supportedInput) : dev->info.supportedInput;
1194 scope.clear(); 1299 scope.clear();
1195 for (Device* cd : s.connected) { 1300 for (Device* cd : s.connected) {
1196 if (effective_kind == GameInputKindUnknown || (effective_kind & cd->info.supportedInput)) { 1301 if (effective_kind & cd->info.supportedInput) {
1197 scope.push_back(cd); 1302 scope.push_back(cd);
1198 } 1303 }
1199 } 1304 }
@@ -1246,9 +1351,11 @@ public:
1246 if (device) { 1351 if (device) {
1247 Device* d = as_device(device); 1352 Device* d = as_device(device);
1248 if (d->info.deviceFamily == GameInputFamilyAggregate) { 1353 if (d->info.deviceFamily == GameInputFamilyAggregate) {
1249 const uint32_t effective_kind = (kind != GameInputKindUnknown) ? kind : d->info.supportedInput; 1354 if (kind != GameInputKindUnknown && !(kind & d->info.supportedInput))
1355 return GAMEINPUT_E_READING_NOT_FOUND;
1356 const uint32_t effective_kind = (kind != GameInputKindUnknown) ? (kind & d->info.supportedInput) : d->info.supportedInput;
1250 for (Device* cd : g().connected) { 1357 for (Device* cd : g().connected) {
1251 if (effective_kind != GameInputKindUnknown && !(effective_kind & cd->info.supportedInput)) continue; 1358 if (!(effective_kind & cd->info.supportedInput)) continue;
1252 if (Reading* r = cd->latest(); r && (!best || r->GetTimestamp() >= best->GetTimestamp())) best = r; 1359 if (Reading* r = cd->latest(); r && (!best || r->GetTimestamp() >= best->GetTimestamp())) best = r;
1253 } 1360 }
1254 } else { 1361 } else {
@@ -1275,6 +1382,8 @@ public:
1275 IGameInputReading** out) override { 1382 IGameInputReading** out) override {
1276 return find_reading(ref, kind, device, out, false); 1383 return find_reading(ref, kind, device, out, false);
1277 } 1384 }
1385 // E_NOTIMPL is GameInput v0's own answer: Microsoft's reference page says the method "was never implemented in
1386 // v0" and returns E_NOTIMPL, and v1 removed it. A history lookup here would give a title what no GameInput does.
1278 HRESULT STDMETHODCALLTYPE GetTemporalReading(uint64_t, IGameInputDevice*, IGameInputReading** out) override { 1387 HRESULT STDMETHODCALLTYPE GetTemporalReading(uint64_t, IGameInputDevice*, IGameInputReading** out) override {
1279 if (!out) return E_POINTER; 1388 if (!out) return E_POINTER;
1280 *out = nullptr; 1389 *out = nullptr;
@@ -1283,6 +1392,9 @@ public:
1283 1392
1284 HRESULT STDMETHODCALLTYPE RegisterReadingCallback(IGameInputDevice* device, uint32_t kind, float, void* context, 1393 HRESULT STDMETHODCALLTYPE RegisterReadingCallback(IGameInputDevice* device, uint32_t kind, float, void* context,
1285 GameInputReadingCallback fn, GameInputCallbackToken* token) override { 1394 GameInputReadingCallback fn, GameInputCallbackToken* token) override {
1395 if (token) *token = kInvalidCallbackToken;
1396 if (!fn) return E_INVALIDARG;
1397 if (device && as_device(device)->info.deviceFamily == GameInputFamilyAggregate) return E_NOTIMPL;
1286 return add({0, CbType::Reading, as_device(device), kind, 0, context, reinterpret_cast<void*>(fn), true}, token); 1398 return add({0, CbType::Reading, as_device(device), kind, 0, context, reinterpret_cast<void*>(fn), true}, token);
1287 } 1399 }
1288 1400
@@ -1291,6 +1403,7 @@ public:
1291 GameInputDeviceCallback fn, GameInputCallbackToken* token) override { 1403 GameInputDeviceCallback fn, GameInputCallbackToken* token) override {
1292 if (token) *token = kInvalidCallbackToken; 1404 if (token) *token = kInvalidCallbackToken;
1293 if (!fn) return E_INVALIDARG; 1405 if (!fn) return E_INVALIDARG;
1406 if (device && as_device(device)->info.deviceFamily == GameInputFamilyAggregate) return E_NOTIMPL;
1294 State& s = g(); 1407 State& s = g();
1295 GameInputCallbackToken t; 1408 GameInputCallbackToken t;
1296 std::vector<Event> now; 1409 std::vector<Event> now;
diff --git a/runtime/shims/gameinput.h b/runtime/shims/gameinput.h
index c78cea16e..0aa3cf38d 100644
--- a/runtime/shims/gameinput.h
+++ b/runtime/shims/gameinput.h
@@ -15,6 +15,7 @@ enum class KeyboardPadMode { Off, Focused, Always };
15struct Config { 15struct Config {
16 DsTriggerMode ds_triggers = DsTriggerMode::Rumble; // LEONIDA_DS_TRIGGERS=off|rumble|resistance 16 DsTriggerMode ds_triggers = DsTriggerMode::Rumble; // LEONIDA_DS_TRIGGERS=off|rumble|resistance
17 float ds_trigger_gain = 1.0f; // LEONIDA_DS_TRIGGER_GAIN, 0..4, scales the effect strength 17 float ds_trigger_gain = 1.0f; // LEONIDA_DS_TRIGGER_GAIN, 0..4, scales the effect strength
18 float mouse_sensitivity = 1.0f; // LEONIDA_MOUSE_SENSITIVITY, 0.1..10, scales mouse movement
18 uint8_t ds_trigger_frequency = 30; // LEONIDA_DS_TRIGGER_FREQ, Hz for the rumble mode, 1..255 19 uint8_t ds_trigger_frequency = 30; // LEONIDA_DS_TRIGGER_FREQ, Hz for the rumble mode, 1..255
19 bool lightbar_set = false; // LEONIDA_DS_LIGHTBAR=RRGGBB|off; unset keeps SDL's 20 bool lightbar_set = false; // LEONIDA_DS_LIGHTBAR=RRGGBB|off; unset keeps SDL's
20 uint8_t lightbar[3] = {0, 0, 0}; // player colour 21 uint8_t lightbar[3] = {0, 0, 0}; // player colour
diff --git a/runtime/shims/library_loader.cpp b/runtime/shims/library_loader.cpp
index b67a38660..0093e6050 100644
--- a/runtime/shims/library_loader.cpp
+++ b/runtime/shims/library_loader.cpp
@@ -95,7 +95,7 @@ namespace {
95constexpr DWORD kDataFileLoadFlags = 95constexpr DWORD kDataFileLoadFlags =
96 LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE | LOAD_LIBRARY_AS_IMAGE_RESOURCE; 96 LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE | LOAD_LIBRARY_AS_IMAGE_RESOURCE;
97 97
98HMODULE load_shim_or_bundled(const std::string& path, bool& handled) { 98HMODULE load_shim_or_bundled(const std::string& path, DWORD flags, bool& handled) {
99 handled = false; 99 handled = false;
100 if (HMODULE h = owned_handle(path)) { 100 if (HMODULE h = owned_handle(path)) {
101 handled = true; 101 handled = true;
@@ -103,7 +103,8 @@ HMODULE load_shim_or_bundled(const std::string& path, bool& handled) {
103 } 103 }
104 const std::string dll = module_name(path); 104 const std::string dll = module_name(path);
105 if (!dll.empty()) { 105 if (!dll.empty()) {
106 if (void* h = load_bundled_module(dll, handled); handled) return reinterpret_cast<HMODULE>(h); 106 if (void* h = load_bundled_module(dll, static_cast<uint32_t>(flags), handled); handled)
107 return reinterpret_cast<HMODULE>(h);
107 } 108 }
108 return nullptr; 109 return nullptr;
109} 110}
@@ -111,7 +112,7 @@ HMODULE load_shim_or_bundled(const std::string& path, bool& handled) {
111HMODULE WINAPI load_library_a(LPCSTR name) { 112HMODULE WINAPI load_library_a(LPCSTR name) {
112 if (name) { 113 if (name) {
113 bool handled = false; 114 bool handled = false;
114 HMODULE h = load_shim_or_bundled(name, handled); 115 HMODULE h = load_shim_or_bundled(name, 0, handled);
115 if (handled) return h; 116 if (handled) return h;
116 } 117 }
117 return LoadLibraryA(name); 118 return LoadLibraryA(name);
@@ -120,7 +121,7 @@ HMODULE WINAPI load_library_a(LPCSTR name) {
120HMODULE WINAPI load_library_w(LPCWSTR name) { 121HMODULE WINAPI load_library_w(LPCWSTR name) {
121 if (name) { 122 if (name) {
122 bool handled = false; 123 bool handled = false;
123 HMODULE h = load_shim_or_bundled(narrow(name), handled); 124 HMODULE h = load_shim_or_bundled(narrow(name), 0, handled);
124 if (handled) return h; 125 if (handled) return h;
125 } 126 }
126 return LoadLibraryW(name); 127 return LoadLibraryW(name);
@@ -129,7 +130,7 @@ HMODULE WINAPI load_library_w(LPCWSTR name) {
129HMODULE WINAPI load_library_ex_a(LPCSTR name, HANDLE file, DWORD flags) { 130HMODULE WINAPI load_library_ex_a(LPCSTR name, HANDLE file, DWORD flags) {
130 if (name && (flags & kDataFileLoadFlags) == 0) { 131 if (name && (flags & kDataFileLoadFlags) == 0) {
131 bool handled = false; 132 bool handled = false;
132 HMODULE h = load_shim_or_bundled(name, handled); 133 HMODULE h = load_shim_or_bundled(name, flags, handled);
133 if (handled) return h; 134 if (handled) return h;
134 } 135 }
135 return LoadLibraryExA(name, file, flags); 136 return LoadLibraryExA(name, file, flags);
@@ -138,7 +139,7 @@ HMODULE WINAPI load_library_ex_a(LPCSTR name, HANDLE file, DWORD flags) {
138HMODULE WINAPI load_library_ex_w(LPCWSTR name, HANDLE file, DWORD flags) { 139HMODULE WINAPI load_library_ex_w(LPCWSTR name, HANDLE file, DWORD flags) {
139 if (name && (flags & kDataFileLoadFlags) == 0) { 140 if (name && (flags & kDataFileLoadFlags) == 0) {
140 bool handled = false; 141 bool handled = false;
141 HMODULE h = load_shim_or_bundled(narrow(name), handled); 142 HMODULE h = load_shim_or_bundled(narrow(name), flags, handled);
142 if (handled) return h; 143 if (handled) return h;
143 } 144 }
144 return LoadLibraryExW(name, file, flags); 145 return LoadLibraryExW(name, file, flags);
diff --git a/runtime/shims/process.cpp b/runtime/shims/process.cpp
index d3f76a684..9da50e4e9 100644
--- a/runtime/shims/process.cpp
+++ b/runtime/shims/process.cpp
@@ -38,8 +38,6 @@ std::wstring g_wcmdline;
38int g_argc = 0; 38int g_argc = 0;
39char** g_argv_ptr = nullptr; 39char** g_argv_ptr = nullptr;
40wchar_t** g_wargv_ptr = nullptr; 40wchar_t** g_wargv_ptr = nullptr;
41char** g_env = nullptr;
42wchar_t** g_wenv = nullptr;
43 41
44std::atomic<bool> g_running{false}; 42std::atomic<bool> g_running{false};
45std::atomic<bool> g_exited{false}; 43std::atomic<bool> g_exited{false};
@@ -130,17 +128,40 @@ C* after_program_name(C* p) {
130char* __cdecl game_get_narrow_winmain_command_line() { return after_program_name(g_cmdline.data()); } 128char* __cdecl game_get_narrow_winmain_command_line() { return after_program_name(g_cmdline.data()); }
131wchar_t* __cdecl game_get_wide_winmain_command_line() { return after_program_name(g_wcmdline.data()); } 129wchar_t* __cdecl game_get_wide_winmain_command_line() { return after_program_name(g_wcmdline.data()); }
132 130
131// The host CRT's environment tables, read when the game asks (RT-136). _environ and _wenviron are not stable: the host
132// CRT builds the wide table only when a wide environment function first runs (a host started through main() has
133// none until then), and _putenv/_wputenv reallocate both, so a pointer taken in set_command_line would be null or
134// dangling by the time a wide-character startup calls __wgetmainargs. A lookup of a name no one sets makes the CRT
135// create the table if it does not exist yet (from the other table or the OS block) without changing it.
136// Like the msvcrt.dll original, the returned table is the CRT's own and is only valid until the next _putenv: a CRT
137// startup reads it once, before the game has other threads, and a host that edits its environment concurrently with
138// a game's startup is not covered.
139char** current_environment() {
140 if (!_environ) {
141 size_t size = 0;
142 (void)getenv_s(&size, nullptr, 0, "LEONIDA_RT_ENV_INIT");
143 }
144 return _environ;
145}
146wchar_t** current_wide_environment() {
147 if (!_wenviron) {
148 size_t size = 0;
149 (void)_wgetenv_s(&size, nullptr, 0, L"LEONIDA_RT_ENV_INIT");
150 }
151 return _wenviron;
152}
153
133// msvcrt.dll: int __getmainargs(int* argc, char*** argv, char*** env, int expand, void* startinfo) 154// msvcrt.dll: int __getmainargs(int* argc, char*** argv, char*** env, int expand, void* startinfo)
134int __cdecl game_getmainargs(int* argc, char*** argv, char*** env, int, void*) { 155int __cdecl game_getmainargs(int* argc, char*** argv, char*** env, int, void*) {
135 *argc = g_argc; 156 *argc = g_argc;
136 *argv = g_argv_ptr; 157 *argv = g_argv_ptr;
137 if (env) *env = g_env; 158 if (env) *env = current_environment();
138 return 0; 159 return 0;
139} 160}
140int __cdecl game_wgetmainargs(int* argc, wchar_t*** argv, wchar_t*** env, int, void*) { 161int __cdecl game_wgetmainargs(int* argc, wchar_t*** argv, wchar_t*** env, int, void*) {
141 *argc = g_argc; 162 *argc = g_argc;
142 *argv = g_wargv_ptr; 163 *argv = g_wargv_ptr;
143 if (env) *env = g_wenv; 164 if (env) *env = current_wide_environment();
144 return 0; 165 return 0;
145} 166}
146 167
@@ -179,8 +200,6 @@ void set_command_line(const std::wstring& program, const std::vector<std::wstrin
179 g_argc = static_cast<int>(g_args.size()); 200 g_argc = static_cast<int>(g_args.size());
180 g_argv_ptr = g_argv.data(); 201 g_argv_ptr = g_argv.data();
181 g_wargv_ptr = g_wargv.data(); 202 g_wargv_ptr = g_wargv.data();
182 g_env = _environ;
183 g_wenv = _wenviron;
184} 203}
185 204
186int run_entry(void* entry, size_t stack_bytes) { 205int run_entry(void* entry, size_t stack_bytes) {
diff --git a/runtime/shims/registry.cpp b/runtime/shims/registry.cpp
index 52c168484..37ff540c5 100644
--- a/runtime/shims/registry.cpp
+++ b/runtime/shims/registry.cpp
@@ -422,11 +422,11 @@ void* find_loaded_bundled_module(const std::string& dll_lower) {
422 return nullptr; 422 return nullptr;
423} 423}
424 424
425void* load_bundled_module(const std::string& dll_lower, bool& handled) { 425void* load_bundled_module(const std::string& dll_lower, uint32_t flags, bool& handled) {
426 handled = false; 426 handled = false;
427 for (const auto& entry : snapshot_bundled_loaders()) { 427 for (const auto& entry : snapshot_bundled_loaders()) {
428 bool loader_handled = false; 428 bool loader_handled = false;
429 void* h = entry.ops->load_bundled(entry.ctx, dll_lower, loader_handled); 429 void* h = entry.ops->load_bundled(entry.ctx, dll_lower, flags, loader_handled);
430 if (loader_handled) { 430 if (loader_handled) {
431 handled = true; 431 handled = true;
432 return h; 432 return h;
diff --git a/runtime/shims/shims.h b/runtime/shims/shims.h
index 80feee3fa..e317ec298 100644
--- a/runtime/shims/shims.h
+++ b/runtime/shims/shims.h
@@ -62,7 +62,7 @@ bool mapped_image_base(uint64_t address, uint64_t& base);
62// Loader. Registered in Loader::Loader and removed in Loader::~Loader. 62// Loader. Registered in Loader::Loader and removed in Loader::~Loader.
63struct BundledModuleOps { 63struct BundledModuleOps {
64 void* (*find_loaded)(void* ctx, const std::string& dll_lower); 64 void* (*find_loaded)(void* ctx, const std::string& dll_lower);
65 void* (*load_bundled)(void* ctx, const std::string& dll_lower, bool& handled); 65 void* (*load_bundled)(void* ctx, const std::string& dll_lower, uint32_t flags, bool& handled);
66 void* (*get_proc)(void* ctx, void* module, const std::string& sym, bool& owns_handle); 66 void* (*get_proc)(void* ctx, void* module, const std::string& sym, bool& owns_handle);
67 bool (*owns_handle)(void* ctx, void* module); 67 bool (*owns_handle)(void* ctx, void* module);
68}; 68};
@@ -70,7 +70,7 @@ void add_bundled_loader(void* ctx, const BundledModuleOps* ops);
70void remove_bundled_loader(void* ctx); 70void remove_bundled_loader(void* ctx);
71 71
72void* find_loaded_bundled_module(const std::string& dll_lower); 72void* find_loaded_bundled_module(const std::string& dll_lower);
73void* load_bundled_module(const std::string& dll_lower, bool& handled); 73void* load_bundled_module(const std::string& dll_lower, uint32_t flags, bool& handled);
74void* get_bundled_proc_address(void* module, const std::string& sym, bool& owns_handle); 74void* get_bundled_proc_address(void* module, const std::string& sym, bool& owns_handle);
75bool owns_bundled_module_handle(void* module); 75bool owns_bundled_module_handle(void* module);
76 76
diff --git a/runtime/shims/xgameruntime.cpp b/runtime/shims/xgameruntime.cpp
index 46aec5af7..032ca1f4f 100644
--- a/runtime/shims/xgameruntime.cpp
+++ b/runtime/shims/xgameruntime.cpp
@@ -100,6 +100,7 @@ void print_guid(char (&out)[40], const GUID* g) {
100 100
101constexpr GUID kThreadingClass = {0x073b7dcb, 0x1fcf, 0x4030, {0x94, 0xbe, 0xe3, 0xc9, 0xeb, 0x62, 0x34, 0x28}}; 101constexpr GUID kThreadingClass = {0x073b7dcb, 0x1fcf, 0x4030, {0x94, 0xbe, 0xe3, 0xc9, 0xeb, 0x62, 0x34, 0x28}};
102constexpr GUID kErrorClass = {0x8ca467f7, 0x22e8, 0x4096, {0x84, 0x56, 0xbb, 0x8a, 0xa1, 0x3f, 0x79, 0xd8}}; 102constexpr GUID kErrorClass = {0x8ca467f7, 0x22e8, 0x4096, {0x84, 0x56, 0xbb, 0x8a, 0xa1, 0x3f, 0x79, 0xd8}};
103constexpr GUID kNetworkingClass = {0x37e56907, 0x2f10, 0x41e8, {0xb7, 0x2f, 0x36, 0xed, 0xb1, 0x85, 0x33, 0x1a}};
103 104
104// A function's arguments after `this`, forwarded unchanged (x64 has one calling convention). 105// A function's arguments after `this`, forwarded unchanged (x64 has one calling convention).
105// Specialised on the function's exact type, so a noexcept function matches only one form. 106// Specialised on the function's exact type, so a noexcept function matches only one form.
@@ -220,13 +221,130 @@ const void* const kErrorVtable[] = {
220 reinterpret_cast<const void*>(&error_set_options), // 5 221 reinterpret_cast<const void*>(&error_set_options), // 5
221}; 222};
222 223
224// IXNetworkingImpl2: 18 methods (slots 3-20). XCurl.dll calls slots 11-17 (docs/runtime_imports.md):
225// the UTF-16 XNetworkingQuerySecurityInformationForUrl* trio, XNetworkingVerifyServerCertificate,
226// XNetworkingGetConnectivityHint, XNetworkingRegisterConnectivityHintChanged and
227// XNetworkingUnregisterConnectivityHintChanged. Offline, connectivity hints report an initialized
228// network with unrestricted internet access, certificate verification succeeds, and registered callbacks
229// are tracked safely.
230enum class XNetworkingConnectivityLevelHint : uint32_t {
231 Unknown = 0,
232 None = 1,
233 LocalAccess = 2,
234 InternetAccess = 3,
235 ConstrainedInternetAccess = 4,
236};
237
238enum class XNetworkingConnectivityCostHint : uint32_t {
239 Unknown = 0,
240 Unrestricted = 1,
241 Fixed = 2,
242 Variable = 3,
243};
244
245struct XNetworkingConnectivityHint {
246 XNetworkingConnectivityLevelHint connectivityLevelHint;
247 XNetworkingConnectivityCostHint connectivityCostHint;
248 uint32_t ianaInterfaceType;
249 bool networkInitialized;
250 bool approachingDataLimit;
251 bool overDataLimit;
252 bool roaming;
253};
254
255using XNetworkingConnectivityHintChangedCallback = void(CALLBACK*)(void* context, const XNetworkingConnectivityHint* hint);
256
257template <int Slot> uint64_t STDMETHODCALLTYPE networking_slot(void*) {
258 static std::atomic<bool> s_logged{false};
259 if (!s_logged.exchange(true))
260 std::fprintf(stderr, "[rt] xgameruntime: XNetworkingImpl slot %d called; answering 0\n", Slot);
261 return 0;
262}
263
264// Slot 11: XNetworkingQuerySecurityInformationForUrlUtf16Async(const wchar_t* url, XAsyncBlock* async)
265HRESULT STDMETHODCALLTYPE networking_query_security_info_async(void*, const wchar_t*, XAsyncBlock* async) {
266 if (async) XAsyncComplete(async, S_OK, 0);
267 return S_OK;
268}
269
270// Slot 12: XNetworkingQuerySecurityInformationForUrlUtf16AsyncResultSize(XAsyncBlock* async, size_t* size)
271HRESULT STDMETHODCALLTYPE networking_query_security_info_size(void*, XAsyncBlock*, size_t* size) {
272 if (size) *size = 0;
273 return S_OK;
274}
275
276// Slot 13: XNetworkingQuerySecurityInformationForUrlUtf16AsyncResult(XAsyncBlock*, size_t, size_t*, uint8_t*, void**)
277HRESULT STDMETHODCALLTYPE networking_query_security_info_result(void*, XAsyncBlock*, size_t, size_t* used, uint8_t*, void** info) {
278 if (used) *used = 0;
279 if (info) *info = nullptr;
280 return S_OK;
281}
282
283// Slot 14: XNetworkingVerifyServerCertificate(void* requestHandle, const void* securityInformation)
284HRESULT STDMETHODCALLTYPE networking_verify_server_cert(void*, void*, const void*) {
285 return S_OK;
286}
287
288// Slot 15: XNetworkingGetConnectivityHint(XNetworkingConnectivityHint* hint)
289HRESULT STDMETHODCALLTYPE networking_get_connectivity_hint(void*, XNetworkingConnectivityHint* hint) {
290 if (!hint) return E_POINTER;
291 hint->connectivityLevelHint = XNetworkingConnectivityLevelHint::InternetAccess;
292 hint->connectivityCostHint = XNetworkingConnectivityCostHint::Unrestricted;
293 hint->ianaInterfaceType = 6; // MIB_IF_TYPE_ETHERNET
294 hint->networkInitialized = true;
295 hint->approachingDataLimit = false;
296 hint->overDataLimit = false;
297 hint->roaming = false;
298 return S_OK;
299}
300
301// Slot 16: XNetworkingRegisterConnectivityHintChanged(XTaskQueueHandle, void*, Callback, XTaskQueueRegistrationToken*)
302std::atomic<uint64_t> g_next_network_token{1};
303HRESULT STDMETHODCALLTYPE networking_register_connectivity_hint_changed(void*, XTaskQueueHandle, void*,
304 XNetworkingConnectivityHintChangedCallback,
305 XTaskQueueRegistrationToken* token) {
306 if (token) token->token = g_next_network_token.fetch_add(1);
307 return S_OK;
308}
309
310// Slot 17: XNetworkingUnregisterConnectivityHintChanged(XTaskQueueRegistrationToken token, bool wait)
311bool STDMETHODCALLTYPE networking_unregister_connectivity_hint_changed(void*, XTaskQueueRegistrationToken, bool) {
312 return true;
313}
314
315const void* const kNetworkingVtable[] = {
316 reinterpret_cast<const void*>(&object_query_interface),
317 reinterpret_cast<const void*>(&object_add_ref),
318 reinterpret_cast<const void*>(&object_release),
319 reinterpret_cast<const void*>(&networking_slot<3>), // 3
320 reinterpret_cast<const void*>(&networking_slot<4>), // 4
321 reinterpret_cast<const void*>(&networking_slot<5>), // 5
322 reinterpret_cast<const void*>(&networking_slot<6>), // 6
323 reinterpret_cast<const void*>(&networking_slot<7>), // 7
324 reinterpret_cast<const void*>(&networking_slot<8>), // 8
325 reinterpret_cast<const void*>(&networking_slot<9>), // 9
326 reinterpret_cast<const void*>(&networking_slot<10>), // 10
327 reinterpret_cast<const void*>(&networking_query_security_info_async), // 11
328 reinterpret_cast<const void*>(&networking_query_security_info_size), // 12
329 reinterpret_cast<const void*>(&networking_query_security_info_result), // 13
330 reinterpret_cast<const void*>(&networking_verify_server_cert), // 14
331 reinterpret_cast<const void*>(&networking_get_connectivity_hint), // 15
332 reinterpret_cast<const void*>(&networking_register_connectivity_hint_changed), // 16
333 reinterpret_cast<const void*>(&networking_unregister_connectivity_hint_changed), // 17
334 reinterpret_cast<const void*>(&networking_slot<18>), // 18
335 reinterpret_cast<const void*>(&networking_slot<19>), // 19
336 reinterpret_cast<const void*>(&networking_slot<20>), // 20
337};
338static_assert(std::size(kNetworkingVtable) == 21, "IUnknown + IXNetworkingImpl2's 18 methods");
339
223RuntimeObject g_threading{kThreadingVtable, &kThreadingClass}; 340RuntimeObject g_threading{kThreadingVtable, &kThreadingClass};
224RuntimeObject g_error{kErrorVtable, &kErrorClass}; 341RuntimeObject g_error{kErrorVtable, &kErrorClass};
342RuntimeObject g_networking{kNetworkingVtable, &kNetworkingClass};
225 343
226HRESULT WINAPI QueryApiImpl(const GUID* class_id, REFIID interface_id, void** out) { 344HRESULT WINAPI QueryApiImpl(const GUID* class_id, REFIID interface_id, void** out) {
227 if (out) *out = nullptr; 345 if (out) *out = nullptr;
228 if (class_id && out) { 346 if (class_id && out) {
229 for (RuntimeObject* o : {&g_threading, &g_error}) 347 for (RuntimeObject* o : {&g_threading, &g_error, &g_networking})
230 if (*class_id == *o->class_id) return object_query_interface(o, interface_id, out); 348 if (*class_id == *o->class_id) return object_query_interface(o, interface_id, out);
231 } 349 }
232 char cls[40], iid[40]; 350 char cls[40], iid[40];
diff --git a/runtime/shims/xmem.cpp b/runtime/shims/xmem.cpp
index ea9385c74..7d4a1bcfd 100644
--- a/runtime/shims/xmem.cpp
+++ b/runtime/shims/xmem.cpp
@@ -17,6 +17,7 @@
17#include <cstdint> 17#include <cstdint>
18#include <cstdio> 18#include <cstdio>
19#include <cstring> 19#include <cstring>
20#include <limits>
20 21
21#include "shims.h" 22#include "shims.h"
22 23
@@ -84,6 +85,100 @@ BOOL __stdcall XMemGetWorkingSetStatistics(uint32_t /*kind*/, void* stats) {
84 return TRUE; 85 return TRUE;
85} 86}
86 87
88// XMem allocation-type page bits select the guest page granularity and must not be forwarded as Win32 flags.
89constexpr DWORD kXmemLargePages = 0x20000000;
90constexpr DWORD kXmem64kPages = 0x20400000;
91constexpr DWORD kXmemPageModeMask = kXmem64kPages;
92constexpr SIZE_T kXmemPageSize64k = 0x10000;
93constexpr DWORD kXmemHostAllocationTypeMask =
94 MEM_COMMIT | MEM_RESERVE | MEM_RESET | MEM_TOP_DOWN | MEM_WRITE_WATCH | 0x01000000;
95
96bool round_up_size(SIZE_T value, SIZE_T alignment, SIZE_T& rounded) {
97 const SIZE_T max = (std::numeric_limits<SIZE_T>::max)();
98 if (alignment == 0 || (alignment & (alignment - 1)) != 0 || value > max - (alignment - 1)) return false;
99 rounded = (value + alignment - 1) & ~(alignment - 1);
100 return true;
101}
102
103void* WINAPI XMemVirtualAlloc(void* address, SIZE_T size, DWORD allocation_type, ULONGLONG attributes, DWORD protect) {
104 // Host-backed support covers ordinary and 64 KiB guest reservations. The 2 MiB guest mode needs an aligned
105 // reservation strategy that this shim does not provide, so fail explicitly instead of returning a misaligned
106 // region. Nonzero attribute flags also fail until their host mapping is known.
107 if (size == 0) {
108 SetLastError(ERROR_INVALID_PARAMETER);
109 return nullptr;
110 }
111 if (attributes != 0) {
112 SetLastError(ERROR_NOT_SUPPORTED);
113 return nullptr;
114 }
115
116 const DWORD page_mode = allocation_type & kXmemPageModeMask;
117 if (page_mode == kXmemLargePages) {
118 SetLastError(ERROR_NOT_SUPPORTED);
119 return nullptr;
120 }
121 if (page_mode != 0 && page_mode != kXmem64kPages) {
122 SetLastError(ERROR_INVALID_PARAMETER);
123 return nullptr;
124 }
125
126 const DWORD unsupported = allocation_type & ~(kXmemHostAllocationTypeMask | kXmemPageModeMask);
127 if (unsupported != 0) {
128 SetLastError(ERROR_INVALID_PARAMETER);
129 return nullptr;
130 }
131
132 DWORD host_type = allocation_type & kXmemHostAllocationTypeMask;
133 if (host_type == 0) host_type = MEM_RESERVE | MEM_COMMIT;
134
135 SYSTEM_INFO system_info{};
136 GetSystemInfo(&system_info);
137 const SIZE_T page_granularity = page_mode == kXmem64kPages ? kXmemPageSize64k : system_info.dwPageSize;
138 const SIZE_T base_granularity =
139 page_mode == kXmem64kPages
140 ? kXmemPageSize64k
141 : ((host_type & MEM_RESERVE) ? system_info.dwAllocationGranularity : system_info.dwPageSize);
142 if (page_granularity == 0 || (page_granularity & (page_granularity - 1)) != 0 || base_granularity == 0 ||
143 (base_granularity & (base_granularity - 1)) != 0) {
144 SetLastError(ERROR_INVALID_PARAMETER);
145 return nullptr;
146 }
147
148 if (address != nullptr) {
149 const uintptr_t requested = reinterpret_cast<uintptr_t>(address);
150 const uintptr_t max = (std::numeric_limits<uintptr_t>::max)();
151 if (size > max - requested) {
152 SetLastError(ERROR_INVALID_PARAMETER);
153 return nullptr;
154 }
155 const uintptr_t requested_end = requested + size;
156 const uintptr_t base = requested & ~(static_cast<uintptr_t>(base_granularity) - 1);
157 if (requested_end > max - (static_cast<uintptr_t>(page_granularity) - 1)) {
158 SetLastError(ERROR_INVALID_PARAMETER);
159 return nullptr;
160 }
161 const uintptr_t end = (requested_end + static_cast<uintptr_t>(page_granularity) - 1) &
162 ~(static_cast<uintptr_t>(page_granularity) - 1);
163 address = reinterpret_cast<void*>(base);
164 size = static_cast<SIZE_T>(end - base);
165 } else if (page_mode == kXmem64kPages && !round_up_size(size, page_granularity, size)) {
166 SetLastError(ERROR_INVALID_PARAMETER);
167 return nullptr;
168 }
169
170 return VirtualAlloc(address, size, host_type, protect);
171}
172
173UINT WINAPI XMemGetWriteWatch(DWORD flags, void* base_address, SIZE_T region_size, void** addresses, ULONG_PTR* count,
174 ULONG* granularity) {
175 return GetWriteWatch(flags, base_address, region_size, addresses, count, granularity);
176}
177
178UINT WINAPI XMemResetWriteWatch(void* base_address, SIZE_T region_size) {
179 return ResetWriteWatch(base_address, region_size);
180}
181
87} // namespace 182} // namespace
88 183
89SHIM_TABLE(xmem, 184SHIM_TABLE(xmem,
@@ -91,4 +186,7 @@ SHIM_TABLE(xmem,
91 {"xmem.dll", "XMemFree", reinterpret_cast<void*>(&XMemFree)}, 186 {"xmem.dll", "XMemFree", reinterpret_cast<void*>(&XMemFree)},
92 {"xmem.dll", "XMemVirtualQuery", reinterpret_cast<void*>(&XMemVirtualQuery)}, 187 {"xmem.dll", "XMemVirtualQuery", reinterpret_cast<void*>(&XMemVirtualQuery)},
93 {"xmem.dll", "XMemGetWorkingSetStatistics", reinterpret_cast<void*>(&XMemGetWorkingSetStatistics)}, 188 {"xmem.dll", "XMemGetWorkingSetStatistics", reinterpret_cast<void*>(&XMemGetWorkingSetStatistics)},
189 {"xmem.dll", "XMemVirtualAlloc", reinterpret_cast<void*>(&XMemVirtualAlloc)},
190 {"xmem.dll", "XMemGetWriteWatch", reinterpret_cast<void*>(&XMemGetWriteWatch)},
191 {"xmem.dll", "XMemResetWriteWatch", reinterpret_cast<void*>(&XMemResetWriteWatch)},
94); 192);
diff --git a/runtime/src/cached_pso.h b/runtime/src/cached_pso.h
new file mode 100644
index 000000000..32710244e
--- /dev/null
+++ b/runtime/src/cached_pso.h
@@ -0,0 +1,110 @@
1// The blob ID3D12PipelineState::GetCachedBlob hands out and Create*PipelineState checks in CachedPSO.
2//
3// The Vulkan layer keeps no driver-compiled pipeline in it (D3D-34 seeds a VkPipelineCache from the build instead);
4// the blob only records what the PC runtime checks before accepting a cached PSO, measured with the host runtime on
5// an RTX 3060 (driver 32.0.16.1714) and WARP:
6// - the same description: accepted;
7// - another shader, or a root signature with other content: E_INVALIDARG (an equal root signature object is fine;
8// D3D12_PIPELINE_STATE_DESC::Flags is not part of the match);
9// - any byte changed, a truncated blob, or a pointer with CachedBlobSizeInBytes 0: E_INVALIDARG;
10// - a null pointer with a size: ignored, the PSO is created;
11// - a blob from another adapter: D3D12_ERROR_ADAPTER_NOT_FOUND.
12// A blob from the same adapter and another driver gives D3D12_ERROR_DRIVER_VERSION_MISMATCH (DirectX docs; not
13// measured, it needs a driver change).
14#pragma once
15
16#include <cstddef>
17#include <cstdint>
18#include <cstring>
19#include <span>
20#include <string>
21#include <vector>
22
23namespace leonida::cached_pso {
24
25// The physical device the blob was made on: VkPhysicalDeviceProperties' IDs, driverVersion and pipelineCacheUUID.
26struct Identity {
27 std::uint32_t vendor = 0;
28 std::uint32_t device = 0;
29 std::uint32_t driver = 0;
30 std::uint8_t cache_uuid[16] = {};
31};
32
33// What a blob is checked against: the SHA-256 (hex) of the parts of the description the PC runtime matches.
34using Key = std::string;
35
36enum class Check { accepted, invalid, other_adapter, other_driver, other_description };
37
38inline constexpr std::uint32_t magic = 0x4f53504c; // "LPSO"
39inline constexpr std::uint32_t version = 1;
40inline constexpr std::size_t key_bytes = 64;
41inline constexpr std::size_t blob_bytes = 4 + 4 + 12 + 16 + key_bytes + 4;
42
43inline std::uint32_t fnv1a(const std::uint8_t* data, std::size_t size) {
44 std::uint32_t h = 0x811c9dc5u;
45 for (std::size_t i = 0; i < size; ++i) h = (h ^ data[i]) * 0x01000193u;
46 return h;
47}
48
49inline void put32(std::vector<std::uint8_t>& out, std::uint32_t v) {
50 for (int i = 0; i < 4; ++i) out.push_back(std::uint8_t(v >> (8 * i)));
51}
52
53inline std::uint32_t get32(const std::uint8_t* p) {
54 return std::uint32_t(p[0]) | (std::uint32_t(p[1]) << 8) | (std::uint32_t(p[2]) << 16) | (std::uint32_t(p[3]) << 24);
55}
56
57// magic, version, vendor, device, driver, pipelineCacheUUID, key, then FNV-1a of everything before it: a changed
58// byte anywhere makes the blob invalid, as with the PC runtime.
59inline std::vector<std::uint8_t> encode(const Identity& identity, const Key& key) {
60 std::vector<std::uint8_t> out;
61 out.reserve(blob_bytes);
62 put32(out, magic);
63 put32(out, version);
64 put32(out, identity.vendor);
65 put32(out, identity.device);
66 put32(out, identity.driver);
67 out.insert(out.end(), std::begin(identity.cache_uuid), std::end(identity.cache_uuid));
68 std::string padded = key;
69 padded.resize(key_bytes, '\0');
70 out.insert(out.end(), padded.begin(), padded.end());
71 put32(out, fnv1a(out.data(), out.size()));
72 return out;
73}
74
75inline Check check(const Identity& identity, const Key& key, std::span<const std::uint8_t> blob) {
76 if (blob.size() != blob_bytes) return Check::invalid;
77 const std::uint8_t* p = blob.data();
78 if (get32(p + blob_bytes - 4) != fnv1a(p, blob_bytes - 4)) return Check::invalid;
79 if (get32(p) != magic || get32(p + 4) != version) return Check::invalid;
80 if (get32(p + 8) != identity.vendor || get32(p + 12) != identity.device) return Check::other_adapter;
81 if (get32(p + 16) != identity.driver || std::memcmp(p + 20, identity.cache_uuid, 16) != 0)
82 return Check::other_driver;
83 std::string padded = key;
84 padded.resize(key_bytes, '\0');
85 if (std::memcmp(p + 36, padded.data(), key_bytes) != 0) return Check::other_description;
86 return Check::accepted;
87}
88
89// Builds the bytes a key is hashed from: every field the PC runtime matches, in a fixed order with lengths, so two
90// descriptions give the same bytes only when those fields are equal.
91class KeyBuilder {
92public:
93 KeyBuilder& tag(const char* name) { return bytes(name, std::strlen(name)); }
94 KeyBuilder& u32(std::uint32_t v) {
95 put32(data_, v);
96 return *this;
97 }
98 KeyBuilder& bytes(const void* p, std::size_t n) {
99 put32(data_, std::uint32_t(n));
100 if (n) data_.insert(data_.end(), static_cast<const std::uint8_t*>(p), static_cast<const std::uint8_t*>(p) + n);
101 return *this;
102 }
103 KeyBuilder& text(const char* s) { return s ? bytes(s, std::strlen(s)) : u32(0xffffffffu); }
104 const std::vector<std::uint8_t>& data() const { return data_; }
105
106private:
107 std::vector<std::uint8_t> data_;
108};
109
110} // namespace leonida::cached_pso
diff --git a/runtime/src/command_list.h b/runtime/src/command_list.h
index 47a0561b3..2b6c03358 100644
--- a/runtime/src/command_list.h
+++ b/runtime/src/command_list.h
@@ -151,8 +151,11 @@ inline constexpr std::uint32_t clear_depth = 0x1;
151inline constexpr std::uint32_t clear_stencil = 0x2; 151inline constexpr std::uint32_t clear_stencil = 0x2;
152inline constexpr std::uint32_t texture_barrier_discard = 0x1; 152inline constexpr std::uint32_t texture_barrier_discard = 0x1;
153 153
154// Portable color-view interpretation. Other views inherit their resource format as before. 154// The format a color view names, as a VkFormat number (0, `resource`, is the resource's own). The named values are
155enum class ColorViewFormat : std::uint32_t { resource, rgba8_unorm, rgba8_srgb, rgba8_uint, rgba8_sint, rgba8_snorm }; 155// the RGBA8 family's; a typeless resource of any other family stores its view's VkFormat the same way (D3D-275).
156enum class ColorViewFormat : std::uint32_t {
157 resource = 0, rgba8_unorm = 37, rgba8_snorm = 38, rgba8_uint = 41, rgba8_sint = 42, rgba8_srgb = 43
158};
156 159
157// D3D12_QUERY_HEAP_TYPE and D3D12_QUERY_TYPE. 160// D3D12_QUERY_HEAP_TYPE and D3D12_QUERY_TYPE.
158namespace d3d12_query_heap { 161namespace d3d12_query_heap {
@@ -769,11 +772,15 @@ public:
769 return append(ClearUnorderedAccess{view, is_float, values, {rects.begin(), rects.end()}}); 772 return append(ClearUnorderedAccess{view, is_float, values, {rects.begin(), rects.end()}});
770 } 773 }
771 774
772 // ExecuteBundle copies the closed bundle's commands at the call site. The COM layer validates D3D12 list 775 // ExecuteBundle copies the closed bundle's commands [first, last) at the call site. The COM layer validates D3D12
773 // types and bundle-only restrictions before calling this method. 776 // list types and bundle-only restrictions before calling this method, and calls it once per stretch between the
774 bool execute_bundle(const CommandList& bundle) { 777 // bundle's deferred state calls and draws (d3d12_com.cpp, GraphicsCommandList::ExecuteBundle).
778 bool execute_bundle(const CommandList& bundle, std::size_t first = 0, std::size_t last = std::size_t(-1)) {
775 if (this == &bundle || closed_ || !bundle.closed_) return false; 779 if (this == &bundle || closed_ || !bundle.closed_) return false;
776 commands_.insert(commands_.end(), bundle.commands_.begin(), bundle.commands_.end()); 780 last = std::min(last, bundle.commands_.size());
781 if (first < last)
782 commands_.insert(commands_.end(), bundle.commands_.begin() + std::ptrdiff_t(first),
783 bundle.commands_.begin() + std::ptrdiff_t(last));
777 return true; 784 return true;
778 } 785 }
779 786
diff --git a/runtime/src/frame_pacer.h b/runtime/src/frame_pacer.h
index 7540795d9..0b14c8d20 100644
--- a/runtime/src/frame_pacer.h
+++ b/runtime/src/frame_pacer.h
@@ -282,10 +282,8 @@ public:
282 timing.period_us = period_us_; 282 timing.period_us = period_us_;
283 if (!pending_.empty()) return timing; 283 if (!pending_.empty()) return timing;
284 for (const Record& r : records_) 284 for (const Record& r : records_)
285 if (r.token == token && !r.presented && token > last_presented_) { 285 if (r.token == token && !r.presented && token > last_presented_ && now > r.due_us)
286 const std::uint64_t due = r.origin_us - std::min<std::uint64_t>(r.origin_us, offset_us_) + period_us_; 286 timing.late_us = now - r.due_us;
287 if (now > due) timing.late_us = now - due;
288 }
289 return timing; 287 return timing;
290 } 288 }
291 289
@@ -312,10 +310,7 @@ public:
312 flip = now; 310 flip = now;
313 std::uint64_t late_us = 0; 311 std::uint64_t late_us = 0;
314 for (const Record& r : records_) 312 for (const Record& r : records_)
315 if (r.token == token) { 313 if (r.token == token && now > r.due_us) late_us = now - r.due_us;
316 const std::uint64_t due = r.origin_us - std::min<std::uint64_t>(r.origin_us, offset_us_) + period_us_;
317 if (now > due) late_us = now - due;
318 }
319 percent = scan_percent(late_us, period_us_); 314 percent = scan_percent(late_us, period_us_);
320 ++immediate_presents_; 315 ++immediate_presents_;
321 } 316 }
@@ -374,6 +369,7 @@ private:
374 }; 369 };
375 struct Record { 370 struct Record {
376 std::uint64_t token = 0, origin_us = 0, present_us = 0, display_us = 0; 371 std::uint64_t token = 0, origin_us = 0, present_us = 0, display_us = 0;
372 std::uint64_t due_us = 0; // vblank after this token's origin, fixed when issued
377 float percent_scanned = 0.0f; 373 float percent_scanned = 0.0f;
378 bool presented = false, displayed = false; 374 bool presented = false, displayed = false;
379 }; 375 };
@@ -412,6 +408,7 @@ private:
412 Record record; 408 Record record;
413 record.token = *token; 409 record.token = *token;
414 record.origin_us = first + std::uint64_t(origin) * period_us_; 410 record.origin_us = first + std::uint64_t(origin) * period_us_;
411 record.due_us = record.origin_us - offset_us_ + period_us_;
415 records_.push_back(record); 412 records_.push_back(record);
416 if (records_.size() > 64) records_.pop_front(); 413 if (records_.size() > 64) records_.pop_front();
417 return pacer_hr::ok; 414 return pacer_hr::ok;
diff --git a/runtime/src/gfx10_descriptors.h b/runtime/src/gfx10_descriptors.h
index 91826fbea..537f81623 100644
--- a/runtime/src/gfx10_descriptors.h
+++ b/runtime/src/gfx10_descriptors.h
@@ -352,19 +352,36 @@ inline constexpr Swizzle format_swizzle(VkFormat format) {
352 return row ? row->channels : identity_swizzle; 352 return row ? row->channels : identity_swizzle;
353} 353}
354 354
355inline constexpr bool is_depth_stencil_format(VkFormat format) {
356 switch (format) {
357 case VK_FORMAT_D16_UNORM:
358 case VK_FORMAT_X8_D24_UNORM_PACK32:
359 case VK_FORMAT_D32_SFLOAT:
360 case VK_FORMAT_S8_UINT:
361 case VK_FORMAT_D16_UNORM_S8_UINT:
362 case VK_FORMAT_D24_UNORM_S8_UINT:
363 case VK_FORMAT_D32_SFLOAT_S8_UINT:
364 return true;
365 default:
366 return false;
367 }
368}
369
355// The format to view an image of `image_format` in when a T# names `gfx10_format`: the image's own format when 370// The format to view an image of `image_format` in when a T# names `gfx10_format`: the image's own format when
356// the codes agree, else the format of that code with the image's channel order (the sRGB view of a UNORM image, 371// the codes agree, else the format of that code with the image's channel order (the sRGB view of a UNORM image,
357// say). With `allow_channel_cast`, a listed same-size cross-family cast may use the code's first Vulkan format 372// say). With `allow_channel_cast`, a listed same-size cross-family cast may use the code's first Vulkan format
358// when no channel-order match exists (R8G8B8A8_UINT viewed as R32_UINT, say). VK_FORMAT_UNDEFINED: the table has 373// when no channel-order match exists (R8G8B8A8_UINT viewed as R32_UINT, say). Depth/stencil images are only
359// no such format. 374// compatible with their own format in Vulkan (VUID-VkImageViewCreateInfo-image-01762 / 09594), and colour
375// images can never be viewed as depth/stencil. VK_FORMAT_UNDEFINED: no compatible format exists.
360inline constexpr VkFormat vulkan_view_format(VkFormat image_format, std::uint32_t gfx10_format, 376inline constexpr VkFormat vulkan_view_format(VkFormat image_format, std::uint32_t gfx10_format,
361 bool allow_channel_cast = false) { 377 bool allow_channel_cast = false) {
362 const FormatRow* image = format_row(image_format); 378 const FormatRow* image = format_row(image_format);
363 if (!image) return VK_FORMAT_UNDEFINED; 379 if (!image) return VK_FORMAT_UNDEFINED;
364 if (image->gfx10 == gfx10_format) return image_format; 380 if (image->gfx10 == gfx10_format) return image_format;
381 if (is_depth_stencil_format(image_format)) return VK_FORMAT_UNDEFINED;
365 const FormatRow* fallback = nullptr; 382 const FormatRow* fallback = nullptr;
366 for (const FormatRow& row : format_table) { 383 for (const FormatRow& row : format_table) {
367 if (row.gfx10 != gfx10_format) continue; 384 if (row.gfx10 != gfx10_format || is_depth_stencil_format(row.vulkan)) continue;
368 if (row.channels == image->channels) return row.vulkan; 385 if (row.channels == image->channels) return row.vulkan;
369 if (!fallback) fallback = &row; 386 if (!fallback) fallback = &row;
370 } 387 }
diff --git a/runtime/src/pe_loader.cpp b/runtime/src/pe_loader.cpp
index bdb3df6f5..a59f9d0b1 100644
--- a/runtime/src/pe_loader.cpp
+++ b/runtime/src/pe_loader.cpp
@@ -4,6 +4,7 @@
4#include <intrin.h> 4#include <intrin.h>
5 5
6#include <algorithm> 6#include <algorithm>
7#include <array>
7#include <atomic> 8#include <atomic>
8#include <cstdio> 9#include <cstdio>
9#include <cstdlib> 10#include <cstdlib>
@@ -74,8 +75,11 @@ IMAGE_TLS_DIRECTORY64* tls_directory(Module& m) {
74// loader-assigned per-module TLS index and is a different index space from TlsAlloc/TlsGetValue (TlsSlots). Only the OS 75// loader-assigned per-module TLS index and is a different index space from TlsAlloc/TlsGetValue (TlsSlots). Only the OS
75// loader can allocate a module index, so the runtime ships a minimal DLL whose only content is a TLS anchor 76// loader can allocate a module index, so the runtime ships a minimal DLL whose only content is a TLS anchor
76// (src/tls_host.cpp). Loading it makes the OS reserve an index and give every thread a block for it; the native loader 77// (src/tls_host.cpp). Loading it makes the OS reserve an index and give every thread a block for it; the native loader
77// reuses that index for the mapped image. One helper means one mapped TLS module at a time. 78// reuses that index for the mapped image. When more than one manually mapped module uses static TLS at once, the loader
79// clones gta6rt_tls_host.dll to a per-process temporary path on demand and loads it, so the OS assigns an independent
80// module TLS index for each simultaneous module (up to kMaxMappedTlsModules).
78constexpr DWORD kMaxModuleTlsSlots = 64; 81constexpr DWORD kMaxModuleTlsSlots = 64;
82constexpr size_t kMaxMappedTlsModules = 16;
79void** module_tls_slots() { return reinterpret_cast<void**>(__readgsqword(0x58)); } 83void** module_tls_slots() { return reinterpret_cast<void**>(__readgsqword(0x58)); }
80 84
81void __cdecl on_host_thread_event(DWORD reason); 85void __cdecl on_host_thread_event(DWORD reason);
@@ -85,22 +89,64 @@ struct TlsHostModule {
85 DWORD index = TLS_OUT_OF_INDEXES; 89 DWORD index = TLS_OUT_OF_INDEXES;
86}; 90};
87 91
88TlsHostModule load_tls_host() { 92std::filesystem::path tls_host_base_path() {
89 TlsHostModule host;
90 // Dynamic buffer loop for paths that exceed MAX_PATH
91 std::wstring exe_path; 93 std::wstring exe_path;
92 DWORD size = MAX_PATH; 94 DWORD size = MAX_PATH;
93 while (true) { 95 while (true) {
94 exe_path.resize(size); 96 exe_path.resize(size);
95 DWORD len = GetModuleFileNameW(nullptr, exe_path.data(), size); 97 DWORD len = GetModuleFileNameW(nullptr, exe_path.data(), size);
96 if (len == 0) return host; 98 if (len == 0) return {};
97 if (len < size - 1) { 99 if (len < size - 1) {
98 exe_path.resize(len); 100 exe_path.resize(len);
99 break; 101 break;
100 } 102 }
101 size *= 2; 103 size *= 2;
102 } 104 }
103 const std::filesystem::path path = std::filesystem::path(exe_path).parent_path() / L"gta6rt_tls_host.dll"; 105 return std::filesystem::path(exe_path).parent_path() / L"gta6rt_tls_host.dll";
106}
107
108std::filesystem::path tls_host_clone_dir() {
109 wchar_t buf[MAX_PATH];
110 DWORD n = GetTempPathW(MAX_PATH, buf);
111 if (n > 0 && n < MAX_PATH) return std::filesystem::path(buf);
112 return std::filesystem::temp_directory_path();
113}
114
115struct TlsCloneRecord {
116 HMODULE module = nullptr;
117 std::filesystem::path path;
118};
119
120std::mutex g_tls_alloc_mutex;
121std::array<TlsHostModule, kMaxMappedTlsModules> g_tls_hosts{};
122std::array<std::atomic<Module*>, kMaxMappedTlsModules> g_tls_slot_owners{};
123std::vector<TlsCloneRecord> g_tls_clones;
124
125void cleanup_tls_clones_at_exit() {
126 for (const auto& rec : g_tls_clones) {
127 if (rec.module) FreeLibrary(rec.module);
128 if (!rec.path.empty()) DeleteFileW(rec.path.c_str());
129 }
130 g_tls_clones.clear();
131}
132
133void sweep_stale_tls_clones(const std::filesystem::path& dir) {
134 WIN32_FIND_DATAW fd{};
135 const std::filesystem::path pattern = dir / L"leonida_tls_host_*.dll";
136 HANDLE h = FindFirstFileW(pattern.c_str(), &fd);
137 if (h == INVALID_HANDLE_VALUE) return;
138 do {
139 if ((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
140 // Fails harmlessly for clones still mapped in live processes; deletes orphaned ones from exited processes.
141 DeleteFileW((dir / fd.cFileName).c_str());
142 }
143 } while (FindNextFileW(h, &fd));
144 FindClose(h);
145}
146
147TlsHostModule load_tls_host_image(const std::filesystem::path& path, bool hook_thread_events) {
148 TlsHostModule host;
149 if (path.empty()) return host;
104 // The helper is linked with the static CRT (/MT), so it needs only system DLLs. Restricting the dependency search 150 // The helper is linked with the static CRT (/MT), so it needs only system DLLs. Restricting the dependency search
105 // to System32 keeps a game-supplied vcruntime next to the executable from being picked up. 151 // to System32 keeps a game-supplied vcruntime next to the executable from being picked up.
106 host.module = LoadLibraryExW(path.c_str(), nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32); 152 host.module = LoadLibraryExW(path.c_str(), nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
@@ -122,31 +168,81 @@ TlsHostModule load_tls_host() {
122 return host; 168 return host;
123 } 169 }
124 host.index = *reinterpret_cast<DWORD*>(tls->AddressOfIndex); 170 host.index = *reinterpret_cast<DWORD*>(tls->AddressOfIndex);
125 // From here on the helper's DllMain reports every thread the process starts or ends (on_host_thread_event). 171 if (hook_thread_events) {
126 using SetThreadEvent = void(__cdecl*)(void(__cdecl*)(DWORD)); 172 // Only the primary helper reports thread attach/detach events; on_host_thread_event iterates all active slots.
127 if (auto set = reinterpret_cast<SetThreadEvent>(GetProcAddress(host.module, "gta6rt_tls_host_set_thread_event"))) 173 using SetThreadEvent = void(__cdecl*)(void(__cdecl*)(DWORD));
128 set(&on_host_thread_event); 174 if (auto set = reinterpret_cast<SetThreadEvent>(GetProcAddress(host.module, "gta6rt_tls_host_set_thread_event")))
175 set(&on_host_thread_event);
176 }
129 return host; 177 return host;
130} 178}
131 179
132TlsHostModule& tls_host() { 180// Must be called with g_tls_alloc_mutex held and WITHOUT g_tls_lock held (LoadLibraryExW takes the Windows loader lock).
133 // The helper stays loaded for the process lifetime: unloading it would release the reserved TLS index. Its own 181TlsHostModule ensure_tls_host(size_t slot) {
134 // per-thread blocks are restored by uninstall_tls_for_thread, so the OS loader can free them normally. 182 if (slot >= kMaxMappedTlsModules) return {};
135 static TlsHostModule host = load_tls_host(); 183 if (g_tls_hosts[slot].index != TLS_OUT_OF_INDEXES) return g_tls_hosts[slot];
136 return host; 184
185 const std::filesystem::path primary = tls_host_base_path();
186 if (primary.empty()) return {};
187
188 if (slot == 0) {
189 g_tls_hosts[0] = load_tls_host_image(primary, true);
190 return g_tls_hosts[0];
191 }
192
193 // Ensure slot 0 is loaded first so thread attach/detach events are hooked.
194 if (g_tls_hosts[0].index == TLS_OUT_OF_INDEXES) {
195 g_tls_hosts[0] = load_tls_host_image(primary, true);
196 if (g_tls_hosts[0].index == TLS_OUT_OF_INDEXES) return {};
197 }
198
199 // Clone gta6rt_tls_host.dll to a distinct path using CopyFileW (Wine 9 lacks CopyFile2 used by std::filesystem).
200 const std::filesystem::path dir = tls_host_clone_dir();
201 static bool swept = false;
202 if (!swept) {
203 swept = true;
204 sweep_stale_tls_clones(dir);
205 std::atexit(&cleanup_tls_clones_at_exit);
206 }
207 const std::wstring name =
208 L"leonida_tls_host_" + std::to_wstring(GetCurrentProcessId()) + L"_" + std::to_wstring(slot) + L".dll";
209 const std::filesystem::path clone_path = dir / name;
210 if (!CopyFileW(primary.c_str(), clone_path.c_str(), FALSE)) return {};
211
212 // Hold a read-only-shared handle across LoadLibraryExW so another process cannot overwrite the clone in between.
213 HANDLE guard = CreateFileW(clone_path.c_str(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_DELETE, nullptr,
214 OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
215 TlsHostModule loaded = load_tls_host_image(clone_path, false);
216 if (guard != INVALID_HANDLE_VALUE) CloseHandle(guard);
217
218 if (loaded.index == TLS_OUT_OF_INDEXES) {
219 DeleteFileW(clone_path.c_str());
220 return {};
221 }
222 for (size_t i = 0; i < kMaxMappedTlsModules; ++i) {
223 if (i != slot && g_tls_hosts[i].index == loaded.index) {
224 FreeLibrary(loaded.module);
225 DeleteFileW(clone_path.c_str());
226 return {};
227 }
228 }
229 g_tls_clones.push_back({loaded.module, clone_path});
230 g_tls_hosts[slot] = loaded;
231 return g_tls_hosts[slot];
137} 232}
138 233
139std::atomic<Module*> g_tls_slot_owner{nullptr}; 234struct ThreadTlsSlot {
235 Module* module = nullptr;
236 void* saved = nullptr;
237 void* block = nullptr;
238 uint32_t index = kNoTlsIndex;
239};
140 240
141// Per-thread installation state. Only one mapped TLS module can own the reserved slot, so one entry per thread is 241// Per-thread installation state for each reserved TLS slot.
142// enough; the saved pointer is the helper DLL's own block that the OS loader will free at thread exit. 242thread_local std::array<ThreadTlsSlot, kMaxMappedTlsModules> g_thread_tls_slots{};
143thread_local Module* g_thread_tls_module = nullptr;
144thread_local void* g_thread_tls_saved = nullptr;
145thread_local void* g_thread_tls_block = nullptr;
146thread_local uint32_t g_thread_tls_index = kNoTlsIndex;
147 243
148// Orders the TLS owner's publication, its `initialised` flag and its retirement against the thread events. Shared in 244// Orders the TLS owners' publication, their `initialised` flags and their retirement against the thread events. Shared
149// on_host_thread_event, exclusive only for those short writes (no allocation and no call that takes the Windows 245// in on_host_thread_event, exclusive only for those short writes (no allocation and no call that takes the Windows
150// loader lock, which the events run under). 246// loader lock, which the events run under).
151SRWLOCK g_tls_lock = SRWLOCK_INIT; 247SRWLOCK g_tls_lock = SRWLOCK_INIT;
152struct SharedTlsLock { 248struct SharedTlsLock {
@@ -164,30 +260,38 @@ struct ExclusiveTlsLock {
164 260
165// Puts the helper DLL's own block back in this thread's slot and frees the copy that replaced it. Uses only this 261// Puts the helper DLL's own block back in this thread's slot and frees the copy that replaced it. Uses only this
166// thread's record, so it also works after the module that installed the copy is gone. 262// thread's record, so it also works after the module that installed the copy is gone.
167void release_thread_block() { 263void release_thread_slot(size_t slot) {
168 if (!g_thread_tls_block) return; 264 if (slot >= kMaxMappedTlsModules) return;
169 void** slots = module_tls_slots(); 265 ThreadTlsSlot& entry = g_thread_tls_slots[slot];
170 if (slots && g_thread_tls_index < kMaxModuleTlsSlots && slots[g_thread_tls_index] == g_thread_tls_block) 266 if (!entry.module && !entry.block) return;
171 slots[g_thread_tls_index] = g_thread_tls_saved; 267 if (entry.block) {
172 VirtualFree(g_thread_tls_block, 0, MEM_RELEASE); 268 void** slots = module_tls_slots();
173 g_thread_tls_module = nullptr; 269 if (slots && entry.index < kMaxModuleTlsSlots && slots[entry.index] == entry.block)
174 g_thread_tls_saved = nullptr; 270 slots[entry.index] = entry.saved;
175 g_thread_tls_block = nullptr; 271 VirtualFree(entry.block, 0, MEM_RELEASE);
176 g_thread_tls_index = kNoTlsIndex; 272 }
273 entry = ThreadTlsSlot{};
177} 274}
178 275
179void install_thread_block(Module& m) { 276void install_thread_block(Module& m) {
180 if (m.tls_index == kNoTlsIndex) return; 277 if (m.tls_slot >= kMaxMappedTlsModules) return;
181 if (g_thread_tls_module == &m) return; 278 const size_t slot = m.tls_slot;
182 if (g_thread_tls_module) { 279 ThreadTlsSlot& entry = g_thread_tls_slots[slot];
280 if (entry.module == &m) return;
281 if (entry.module) {
183 // A copy left by a module whose Loader is gone is released; a live module's is a conflict. 282 // A copy left by a module whose Loader is gone is released; a live module's is a conflict.
184 if (g_thread_tls_module == g_tls_slot_owner.load()) 283 if (entry.module == g_tls_slot_owners[slot].load())
185 throw std::runtime_error("another manually mapped module's TLS is already installed in this thread"); 284 throw std::runtime_error("another manually mapped module's TLS is already installed in this thread slot");
186 release_thread_block(); 285 release_thread_slot(slot);
187 } 286 }
188 287
189 const uint64_t total = static_cast<uint64_t>(m.tls_raw_size) + m.tls_zero_fill; 288 const uint64_t total = static_cast<uint64_t>(m.tls_raw_size) + m.tls_zero_fill;
190 if (!total) return; 289 if (!total) {
290 // Callback-only TLS module (no data block): still record attachment in this slot so DLL_THREAD_DETACH runs.
291 entry.module = &m;
292 return;
293 }
294 if (m.tls_index == kNoTlsIndex) return;
191 void** slots = module_tls_slots(); 295 void** slots = module_tls_slots();
192 if (!slots || m.tls_index >= kMaxModuleTlsSlots) 296 if (!slots || m.tls_index >= kMaxModuleTlsSlots)
193 throw std::runtime_error(m.name + ": cannot install TLS in this thread"); 297 throw std::runtime_error(m.name + ": cannot install TLS in this thread");
@@ -200,19 +304,22 @@ void install_thread_block(Module& m) {
200 304
201 void* saved = slots[m.tls_index]; 305 void* saved = slots[m.tls_index];
202 slots[m.tls_index] = block; 306 slots[m.tls_index] = block;
203 g_thread_tls_module = &m; 307 entry.module = &m;
204 g_thread_tls_saved = saved; 308 entry.saved = saved;
205 g_thread_tls_block = block; 309 entry.block = block;
206 g_thread_tls_index = m.tls_index; 310 entry.index = m.tls_index;
207} 311}
208 312
209void uninstall_thread_block(Module& m) { 313void uninstall_thread_block(Module& m) {
210 if (g_thread_tls_module != &m) return; 314 if (m.tls_slot >= kMaxMappedTlsModules) return;
211 if (m.tls_block == g_thread_tls_block) { 315 const size_t slot = m.tls_slot;
316 ThreadTlsSlot& entry = g_thread_tls_slots[slot];
317 if (entry.module != &m) return;
318 if (m.tls_block == entry.block) {
212 m.tls_block = nullptr; 319 m.tls_block = nullptr;
213 m.tls_saved_block = nullptr; 320 m.tls_saved_block = nullptr;
214 } 321 }
215 release_thread_block(); 322 release_thread_slot(slot);
216} 323}
217 324
218// `trace`: record each callback in the startup trace. Only the Loader's own calls (process attach and detach) pass 325// `trace`: record each callback in the startup trace. Only the Loader's own calls (process attach and detach) pass
@@ -238,24 +345,28 @@ void run_callbacks(Module& m, uint32_t reason, bool trace = false) {
238} 345}
239 346
240// Runs in gta6rt_tls_host.dll's DllMain for each thread the process starts or ends once the helper is loaded, under 347// Runs in gta6rt_tls_host.dll's DllMain for each thread the process starts or ends once the helper is loaded, under
241// the Windows loader lock, on that thread. A new thread gets its own copy of the TLS owner's template; an ending one 348// the Windows loader lock, on that thread. A new thread gets its own copy of each active TLS owner's template; an
242// gives the helper's block back before the Windows loader frees it. TLS callbacks get the thread events only after 349// ending one gives each helper's block back before the Windows loader frees it. TLS callbacks get the thread events
243// the module's DLL_PROCESS_ATTACH (initialise()), as the Windows loader orders them. Threads that existed before the 350// only after the module's DLL_PROCESS_ATTACH (initialise()), as the Windows loader orders them.
244// module was loaded get nothing: install_tls_for_thread is still the way to cover those.
245void __cdecl on_host_thread_event(DWORD reason) { 351void __cdecl on_host_thread_event(DWORD reason) {
246 SharedTlsLock lock; 352 SharedTlsLock lock;
247 Module* m = g_tls_slot_owner.load();
248 try { 353 try {
249 if (reason == DLL_THREAD_ATTACH) { 354 if (reason == DLL_THREAD_ATTACH) {
250 if (!m) return; 355 for (size_t slot = 0; slot < kMaxMappedTlsModules; ++slot) {
251 install_thread_block(*m); 356 Module* m = g_tls_slot_owners[slot].load();
252 if (m->initialised) run_callbacks(*m, DLL_THREAD_ATTACH); 357 if (!m) continue;
358 install_thread_block(*m);
359 if (m->initialised) run_callbacks(*m, DLL_THREAD_ATTACH);
360 }
253 } else if (reason == DLL_THREAD_DETACH) { 361 } else if (reason == DLL_THREAD_DETACH) {
254 if (m && g_thread_tls_module == m) { 362 for (size_t i = kMaxMappedTlsModules; i-- > 0;) {
255 if (m->initialised) run_callbacks(*m, DLL_THREAD_DETACH); 363 Module* m = g_tls_slot_owners[i].load();
256 uninstall_thread_block(*m); 364 if (m && g_thread_tls_slots[i].module == m) {
257 } else { 365 if (m->initialised) run_callbacks(*m, DLL_THREAD_DETACH);
258 release_thread_block(); // installed by a module whose Loader is gone (or nothing to do) 366 uninstall_thread_block(*m);
367 } else {
368 release_thread_slot(i); // installed by a module whose Loader is gone (or nothing to do)
369 }
259 } 370 }
260 } 371 }
261 } catch (const std::exception& e) { 372 } catch (const std::exception& e) {
@@ -357,8 +468,8 @@ void* bundled_find_loaded(void* ctx, const std::string& dll_lower) {
357 return static_cast<Loader*>(ctx)->find_loaded_module(dll_lower); 468 return static_cast<Loader*>(ctx)->find_loaded_module(dll_lower);
358} 469}
359 470
360void* bundled_load(void* ctx, const std::string& dll_lower, bool& handled) { 471void* bundled_load(void* ctx, const std::string& dll_lower, uint32_t flags, bool& handled) {
361 return static_cast<Loader*>(ctx)->load_runtime_module(dll_lower, handled); 472 return static_cast<Loader*>(ctx)->load_runtime_module(dll_lower, flags, handled);
362} 473}
363 474
364void* bundled_get_proc(void* ctx, void* module, const std::string& sym, bool& owns_handle) { 475void* bundled_get_proc(void* ctx, void* module, const std::string& sym, bool& owns_handle) {
@@ -407,13 +518,13 @@ Loader::~Loader() {
407 shims::remove_module_lookup(this); 518 shims::remove_module_lookup(this);
408 for (auto* m : order_) { 519 for (auto* m : order_) {
409 // TLS state must go away before the image and its TLS block are unmapped. 520 // TLS state must go away before the image and its TLS block are unmapped.
410 if (m->tls_index != kNoTlsIndex) { 521 if (m->tls_index != kNoTlsIndex && m->tls_slot < kMaxMappedTlsModules) {
411 // Retired first, under the lock: no thread event installs it or runs its callbacks after this, and a 522 // Retired first, under the lock: no thread event installs it or runs its callbacks after this, and a
412 // thread that still holds a copy frees it when it ends (on_host_thread_event). 523 // thread that still holds a copy frees it when it ends (on_host_thread_event).
413 { 524 {
414 ExclusiveTlsLock lock; 525 ExclusiveTlsLock lock;
415 Module* owner = m; 526 Module* owner = m;
416 g_tls_slot_owner.compare_exchange_strong(owner, nullptr); 527 g_tls_slot_owners[m->tls_slot].compare_exchange_strong(owner, nullptr);
417 } 528 }
418 uninstall_tls_for_thread(*m); 529 uninstall_tls_for_thread(*m);
419 } 530 }
@@ -448,16 +559,32 @@ void* Loader::find_loaded_module(const std::string& dll_lower) const {
448 return it == by_name_.end() ? nullptr : static_cast<void*>(it->second->base); 559 return it == by_name_.end() ? nullptr : static_cast<void*>(it->second->base);
449} 560}
450 561
451void* Loader::load_runtime_module(const std::string& dll_lower, bool& handled) { 562void* Loader::load_runtime_module(const std::string& dll_lower, uint32_t flags, bool& handled) {
452 handled = false; 563 handled = false;
453 if (dll_lower.empty() || prefer_host_copy(dll_lower)) return nullptr; 564 if (dll_lower.empty() || prefer_host_copy(dll_lower)) return nullptr;
454 565
455 std::lock_guard lock(mutex_); 566 std::lock_guard lock(mutex_);
456 if (auto it = by_name_.find(dll_lower); it != by_name_.end()) { 567 const auto existing = by_name_.find(dll_lower);
457 handled = true; 568 const std::filesystem::path candidate = game_dir_ / dll_lower;
569 std::error_code ec;
570 const bool is_bundled = existing != by_name_.end() || std::filesystem::is_regular_file(candidate, ec);
571 if (!is_bundled) return nullptr;
572
573 handled = true;
574 // Win32 DONT_RESOLVE_DLL_REFERENCES (0x1) forbids resolving dependencies or running TLS/DllMain; refuse it
575 // explicitly instead of silently performing a normal resolving + initialising load.
576 if ((flags & DONT_RESOLVE_DLL_REFERENCES) != 0) {
577 std::fprintf(stderr,
578 "[rt] loader: LoadLibraryEx(%s, DONT_RESOLVE_DLL_REFERENCES) is not supported for bundled DLLs\n",
579 dll_lower.c_str());
580 SetLastError(ERROR_NOT_SUPPORTED);
581 return nullptr;
582 }
583
584 if (existing != by_name_.end()) {
458 try { 585 try {
459 initialise(); 586 initialise();
460 return static_cast<void*>(it->second->base); 587 return static_cast<void*>(existing->second->base);
461 } catch (const std::exception& e) { 588 } catch (const std::exception& e) {
462 std::fprintf(stderr, "[rt] loader: run-time initialise of %s failed: %s\n", dll_lower.c_str(), e.what()); 589 std::fprintf(stderr, "[rt] loader: run-time initialise of %s failed: %s\n", dll_lower.c_str(), e.what());
463 SetLastError(ERROR_DLL_INIT_FAILED); 590 SetLastError(ERROR_DLL_INIT_FAILED);
@@ -465,11 +592,6 @@ void* Loader::load_runtime_module(const std::string& dll_lower, bool& handled) {
465 } 592 }
466 } 593 }
467 594
468 const std::filesystem::path candidate = game_dir_ / dll_lower;
469 std::error_code ec;
470 if (!std::filesystem::is_regular_file(candidate, ec)) return nullptr;
471
472 handled = true;
473 try { 595 try {
474 Module& m = load(candidate); 596 Module& m = load(candidate);
475 initialise(); 597 initialise();
@@ -726,19 +848,36 @@ void Loader::initialize_tls(Module& m) {
726 require_range(m.name, index_rva, sizeof(uint32_t), m.size, "the TLS index"); 848 require_range(m.name, index_rva, sizeof(uint32_t), m.size, "the TLS index");
727 } 849 }
728 850
729 DWORD index = tls_host().index;
730 if (index == TLS_OUT_OF_INDEXES)
731 throw std::runtime_error(m.name + ": gta6rt_tls_host.dll is missing or has no module TLS index");
732 if (index >= kMaxModuleTlsSlots) throw std::runtime_error(m.name + ": reserved TLS index is out of range");
733 if (!module_tls_slots()) throw std::runtime_error(m.name + ": this thread has no TLS array"); 851 if (!module_tls_slots()) throw std::runtime_error(m.name + ": this thread has no TLS array");
734 852
853 size_t slot = kMaxMappedTlsModules;
854 DWORD index = TLS_OUT_OF_INDEXES;
735 { 855 {
856 std::lock_guard alloc_lock(g_tls_alloc_mutex);
857 for (size_t i = 0; i < kMaxMappedTlsModules; ++i) {
858 if (g_tls_slot_owners[i].load() == nullptr) {
859 slot = i;
860 break;
861 }
862 }
863 if (slot >= kMaxMappedTlsModules)
864 throw std::runtime_error(m.name + ": all " + std::to_string(kMaxMappedTlsModules) +
865 " manually mapped static TLS slots are in use");
866
867 // Load/clone gta6rt_tls_host.dll OUTSIDE ExclusiveTlsLock so LoadLibraryExW cannot deadlock with
868 // on_host_thread_event (which runs under the Windows loader lock and takes SharedTlsLock).
869 index = ensure_tls_host(slot).index;
870 if (index == TLS_OUT_OF_INDEXES)
871 throw std::runtime_error(m.name + ": gta6rt_tls_host.dll is missing or has no module TLS index");
872 if (index >= kMaxModuleTlsSlots) throw std::runtime_error(m.name + ": reserved TLS index is out of range");
873
736 // The fields are complete before a thread event can see the owner. 874 // The fields are complete before a thread event can see the owner.
737 ExclusiveTlsLock lock; 875 ExclusiveTlsLock lock;
738 Module* expected = nullptr; 876 Module* expected = nullptr;
739 if (!g_tls_slot_owner.compare_exchange_strong(expected, &m)) 877 if (!g_tls_slot_owners[slot].compare_exchange_strong(expected, &m))
740 throw std::runtime_error(m.name + ": only one manually mapped module may use static TLS at a time"); 878 throw std::runtime_error(m.name + ": static TLS slot was claimed concurrently");
741 879
880 m.tls_slot = static_cast<uint32_t>(slot);
742 m.tls_index = index; 881 m.tls_index = index;
743 m.tls_template = raw ? m.base + raw_rva : nullptr; 882 m.tls_template = raw ? m.base + raw_rva : nullptr;
744 m.tls_raw_size = static_cast<uint32_t>(raw); 883 m.tls_raw_size = static_cast<uint32_t>(raw);
@@ -753,13 +892,14 @@ void Loader::initialize_tls(Module& m) {
753 } catch (...) { 892 } catch (...) {
754 ExclusiveTlsLock lock; 893 ExclusiveTlsLock lock;
755 m.tls_index = kNoTlsIndex; 894 m.tls_index = kNoTlsIndex;
756 g_tls_slot_owner = nullptr; 895 m.tls_slot = kNoTlsIndex;
896 g_tls_slot_owners[slot].store(nullptr);
757 throw; 897 throw;
758 } 898 }
759 // The loading thread's copy is the one the Module records (and ~Loader frees on that thread). 899 // The loading thread's copy is the one the Module records (and ~Loader frees on that thread).
760 if (g_thread_tls_module == &m) { 900 if (g_thread_tls_slots[slot].module == &m) {
761 m.tls_block = g_thread_tls_block; 901 m.tls_block = g_thread_tls_slots[slot].block;
762 m.tls_saved_block = g_thread_tls_saved; 902 m.tls_saved_block = g_thread_tls_slots[slot].saved;
763 } 903 }
764} 904}
765 905
diff --git a/runtime/src/pe_loader.h b/runtime/src/pe_loader.h
index d9f89f542..7cfe7a771 100644
--- a/runtime/src/pe_loader.h
+++ b/runtime/src/pe_loader.h
@@ -46,12 +46,12 @@ struct Module {
46 46
47 // Static TLS (IMAGE_DIRECTORY_ENTRY_TLS). load() installs tls_block in the calling thread and writes tls_index to 47 // Static TLS (IMAGE_DIRECTORY_ENTRY_TLS). load() installs tls_block in the calling thread and writes tls_index to
48 // the image's _tls_index. tls_index names TEB->ThreadLocalStoragePointer[tls_index], the array 48 // the image's _tls_index. tls_index names TEB->ThreadLocalStoragePointer[tls_index], the array
49 // __declspec(thread) reads; it is not a TlsAlloc slot. The loader reserves the index by loading 49 // __declspec(thread) reads; it is not a TlsAlloc slot. The loader reserves distinct indices by loading
50 // gta6rt_tls_host.dll, so only one manually mapped TLS module can be live at a time; a second one is rejected 50 // gta6rt_tls_host.dll (and cloning it on demand for additional simultaneous TLS modules, up to 16 at a time).
51 // rather than sharing (and corrupting) the slot. Every thread started after load() gets its own copy through the 51 // Every thread started after load() gets its own copy through the helper's DLL_THREAD_ATTACH, and gives it back
52 // helper's DLL_THREAD_ATTACH, and gives it back at DLL_THREAD_DETACH; install_tls_for_thread() is for threads 52 // at DLL_THREAD_DETACH; install_tls_for_thread() is for threads that already existed.
53 // that already existed.
54 uint32_t tls_index = kNoTlsIndex; 53 uint32_t tls_index = kNoTlsIndex;
54 uint32_t tls_slot = kNoTlsIndex; // index into the loader's reserved TLS-host slot pool
55 void* tls_block = nullptr; // calling thread's copy of the image's template 55 void* tls_block = nullptr; // calling thread's copy of the image's template
56 void* tls_saved_block = nullptr; // helper DLL block replaced in that thread, restored by ~Loader 56 void* tls_saved_block = nullptr; // helper DLL block replaced in that thread, restored by ~Loader
57 uint32_t tls_block_size = 0; // raw template + zero fill 57 uint32_t tls_block_size = 0; // raw template + zero fill
@@ -106,7 +106,7 @@ public:
106 106
107 // Run-time module lookup/loading used by the library_loader shim for bundled package DLLs. 107 // Run-time module lookup/loading used by the library_loader shim for bundled package DLLs.
108 void* find_loaded_module(const std::string& dll_lower) const; 108 void* find_loaded_module(const std::string& dll_lower) const;
109 void* load_runtime_module(const std::string& dll_lower, bool& handled); 109 void* load_runtime_module(const std::string& dll_lower, uint32_t flags, bool& handled);
110 void* resolve_module_export(void* module_handle, const std::string& sym, bool& owns_handle); 110 void* resolve_module_export(void* module_handle, const std::string& sym, bool& owns_handle);
111 bool owns_module_handle(void* module_handle) const; 111 bool owns_module_handle(void* module_handle) const;
112 112
diff --git a/runtime/src/vulkan_backend.h b/runtime/src/vulkan_backend.h
index 93d7e5259..140d7234b 100644
--- a/runtime/src/vulkan_backend.h
+++ b/runtime/src/vulkan_backend.h
@@ -1017,6 +1017,12 @@ public:
1017 replay_.zero_offset = offset; 1017 replay_.zero_offset = offset;
1018 replay_.zero_size = size; 1018 replay_.zero_size = size;
1019 } 1019 }
1020
1021 // Physical-device COLOR_ATTACHMENT format check for reinterpreted UAV clears.
1022 void set_color_attachment_format(std::function<bool(VkFormat)> check) {
1023 std::unique_lock lock(resource_mutex_);
1024 replay_.color_attachment_format = std::move(check);
1025 }
1020 std::uint64_t heap_base() { 1026 std::uint64_t heap_base() {
1021 std::shared_lock lock(resource_mutex_); 1027 std::shared_lock lock(resource_mutex_);
1022 return replay_.heap_base; 1028 return replay_.heap_base;
@@ -1238,10 +1244,10 @@ private:
1238 info.format = r.format; 1244 info.format = r.format;
1239 info.subresourceRange = range; 1245 info.subresourceRange = range;
1240 // Attachment views need only color-attachment usage. Inheriting STORAGE usage from a mutable/extended 1246 // Attachment views need only color-attachment usage. Inheriting STORAGE usage from a mutable/extended
1241 // resource (typeless RGBA8 sRGB views, or R32_UINT-backed R9G9B9E5 UAV images) would require unrelated usages. 1247 // resource (typeless views such as RGBA8 sRGB, or R32_UINT-backed R9G9B9E5 UAV images) would require unrelated usages.
1242 VkImageViewUsageCreateInfo usage{VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO}; 1248 VkImageViewUsageCreateInfo usage{VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO};
1243 usage.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; 1249 usage.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
1244 if (r.rgba8_typeless || (range.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT && r.color_attachment)) 1250 if (r.typeless || (range.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT && r.color_attachment))
1245 info.pNext = &usage; 1251 info.pNext = &usage;
1246 VkImageView view = VK_NULL_HANDLE; 1252 VkImageView view = VK_NULL_HANDLE;
1247 if (vk.vkCreateImageView(device_, &info, nullptr, &view) != VK_SUCCESS) return VK_NULL_HANDLE; 1253 if (vk.vkCreateImageView(device_, &info, nullptr, &view) != VK_SUCCESS) return VK_NULL_HANDLE;
diff --git a/runtime/src/vulkan_bindless.h b/runtime/src/vulkan_bindless.h
index 5f484bf16..d8a4c9846 100644
--- a/runtime/src/vulkan_bindless.h
+++ b/runtime/src/vulkan_bindless.h
@@ -345,6 +345,14 @@ public:
345 return bindless::multisampled(dimension) ? 0 : features_.counts[bindless::storage_binding(dimension, 0)]; 345 return bindless::multisampled(dimension) ? 0 : features_.counts[bindless::storage_binding(dimension, 0)];
346 } 346 }
347 std::uint32_t sampler_capacity() const { return features_.counts[bindless::sampler_binding]; } 347 std::uint32_t sampler_capacity() const { return features_.counts[bindless::sampler_binding]; }
348 // How many more images of a dimension, or samplers, add_image and add_sampler can take before they return 0.
349 std::uint32_t free_images(ImageDimension dimension) const {
350 const auto& used = image_used_[std::uint32_t(dimension)];
351 return std::uint32_t(std::count(used.begin(), used.end(), std::uint8_t(0)));
352 }
353 std::uint32_t free_samplers() const {
354 return std::uint32_t(std::count(sampler_used_.begin(), sampler_used_.end(), std::uint8_t(0)));
355 }
348 // Set 0 of every pipeline layout made for translated shaders. 356 // Set 0 of every pipeline layout made for translated shaders.
349 VkDescriptorSetLayout layout() const { return layout_; } 357 VkDescriptorSetLayout layout() const { return layout_; }
350 // Bound at set 0. The same set for the life of this object: flush() updates it in place. 358 // Bound at set 0. The same set for the life of this object: flush() updates it in place.
diff --git a/runtime/src/vulkan_present.h b/runtime/src/vulkan_present.h
index 15a706668..9a73d2f82 100644
--- a/runtime/src/vulkan_present.h
+++ b/runtime/src/vulkan_present.h
@@ -224,11 +224,12 @@ public:
224 } 224 }
225 225
226 // The last presented frame as the swapchain stores it (4 bytes a texel, rows tightly packed, format() order). 226 // The last presented frame as the swapchain stores it (4 bytes a texel, rows tightly packed, format() order).
227 // Waits for the frame to finish. False when nothing was presented since enable_capture(). 227 // Waits for the frame to finish. False if no captured frame is available or the wait fails.
228 bool read_back(std::vector<std::uint8_t>& pixels, VkExtent2D* extent, VkFormat* format) { 228 bool read_back(std::vector<std::uint8_t>& pixels, VkExtent2D* extent, VkFormat* format) {
229 if (!capture_ || !capture_ptr_ || !captured_) return false; 229 if (!capture_ || !capture_ptr_ || !captured_) return false;
230 const Frame& frame = frames_[(frame_index_ + frames_.size() - 1) % frames_.size()]; 230 const Frame& frame = frames_[(frame_index_ + frames_.size() - 1) % frames_.size()];
231 vkWaitForFences_(context_.device(), 1, &frame.done, VK_TRUE, UINT64_MAX); 231 if (vkWaitForFences_(context_.device(), 1, &frame.done, VK_TRUE, UINT64_MAX) != VK_SUCCESS)
232 return false;
232 pixels.assign(capture_ptr_, capture_ptr_ + std::size_t(captured_extent_.width) * captured_extent_.height * 4); 233 pixels.assign(capture_ptr_, capture_ptr_ + std::size_t(captured_extent_.width) * captured_extent_.height * 4);
233 if (extent) *extent = captured_extent_; 234 if (extent) *extent = captured_extent_;
234 if (format) *format = captured_format_; 235 if (format) *format = captured_format_;
diff --git a/runtime/src/vulkan_replay.h b/runtime/src/vulkan_replay.h
index 8ece08d1e..fd69ab91b 100644
--- a/runtime/src/vulkan_replay.h
+++ b/runtime/src/vulkan_replay.h
@@ -76,7 +76,7 @@ struct ResourceBinding {
76 std::uint32_t depth = 1; 76 std::uint32_t depth = 1;
77 bool volume = false; // one array layer, including at mips with a single slice 77 bool volume = false; // one array layer, including at mips with a single slice
78 std::uint32_t samples = 1; // more than one: a multisampled 2D texture 78 std::uint32_t samples = 1; // more than one: a multisampled 2D texture
79 bool rgba8_typeless = false; // Original resource was R8G8B8A8_TYPELESS; views may reinterpret it. 79 bool typeless = false; // A TYPELESS color resource: views name a format of its family (D3D-275).
80 bool castable_view_formats = false; // A creation-time castable list made the image mutable (D3D-85/D3D-90), 80 bool castable_view_formats = false; // A creation-time castable list made the image mutable (D3D-85/D3D-90),
81 // so views may reinterpret it as typeless resources do. 81 // so views may reinterpret it as typeless resources do.
82 // D24_UNORM_S8_UINT stored as D32_SFLOAT_S8_UINT (the GPU has no D24): footprint copies of the depth plane convert 82 // D24_UNORM_S8_UINT stored as D32_SFLOAT_S8_UINT (the GPU has no D24): footprint copies of the depth plane convert
@@ -855,6 +855,9 @@ struct ReplayFunctions {
855 std::function<void(VkCommandBuffer, const std::vector<PredicatedCopyDispatch>&)> emit_predicated_copy; 855 std::function<void(VkCommandBuffer, const std::vector<PredicatedCopyDispatch>&)> emit_predicated_copy;
856 // Returns a 2D-array view of the range (caller-owned, alive until execution completes); rectangle clears. 856 // Returns a 2D-array view of the range (caller-owned, alive until execution completes); rectangle clears.
857 std::function<VkImageView(const ResourceBinding&, const VkImageSubresourceRange&)> image_view; 857 std::function<VkImageView(const ResourceBinding&, const VkImageSubresourceRange&)> image_view;
858 // Optional format check for color-attachment reinterpretation on mutable UAV clears; unset assumes every format
859 // except E5B9G9R9_UFLOAT_PACK32 supports COLOR_ATTACHMENT.
860 std::function<bool(VkFormat)> color_attachment_format;
858 // Footprint copies of a depth24_as_float texture (depth24.h): `depth24_prepare` makes the scratch and descriptors 861 // Footprint copies of a depth24_as_float texture (depth24.h): `depth24_prepare` makes the scratch and descriptors
859 // for a job while the list is checked, `depth24_run` records its dispatch. Without them such a copy is unsupported. 862 // for a job while the list is checked, `depth24_run` records its dispatch. Without them such a copy is unsupported.
860 std::function<bool(Depth24Job&, std::vector<Depth24Job>&)> depth24_prepare; // whole copy in, dispatches out 863 std::function<bool(Depth24Job&, std::vector<Depth24Job>&)> depth24_prepare; // whole copy in, dispatches out
@@ -917,7 +920,7 @@ struct Prepared {
917 ResourceBinding binding; 920 ResourceBinding binding;
918 VkImageSubresourceRange range{}; // the barrier range, or the cleared view (cleared aspects only) 921 VkImageSubresourceRange range{}; // the barrier range, or the cleared view (cleared aspects only)
919 VkImageView view = VK_NULL_HANDLE; 922 VkImageView view = VK_NULL_HANDLE;
920 VkFormat clear_format = VK_FORMAT_UNDEFINED; // The RTV format, without changing the resource binding. 923 VkFormat clear_format = VK_FORMAT_UNDEFINED; // The clear view format (RTV or reinterpreted UAV), without changing the resource binding.
921 std::vector<VkClearRect> rects; // rectangle clears, clipped to the mip 924 std::vector<VkClearRect> rects; // rectangle clears, clipped to the mip
922 bool skip = false; // every rectangle was empty 925 bool skip = false; // every rectangle was empty
923 ResourceBinding source; // copies: the source resource 926 ResourceBinding source; // copies: the source resource
@@ -1017,24 +1020,42 @@ inline VkClearColorValue render_target_clear_color(VkFormat format, const ClearC
1017 return value; 1020 return value;
1018} 1021}
1019 1022
1020// Only the RGBA8 family is explicitly reinterpreted here. Legacy views retain their resource format. A typeless 1023// The DXGI typeless family a color view format belongs to, by the Vulkan formats the layer maps its members to: the
1021// resource or one created with a castable-format list (its image is mutable and lists the view formats) may be 1024// same nonzero number for formats one typeless resource can be viewed as, 0 for a format of no such family.
1022// reinterpreted; the reinterpretation itself is the UNORM image's. 1025inline int typeless_view_family(VkFormat format) {
1026 switch (format) {
1027 case VK_FORMAT_R8G8B8A8_UNORM: case VK_FORMAT_R8G8B8A8_SRGB: case VK_FORMAT_R8G8B8A8_SNORM:
1028 case VK_FORMAT_R8G8B8A8_UINT: case VK_FORMAT_R8G8B8A8_SINT: return 1;
1029 case VK_FORMAT_B8G8R8A8_UNORM: case VK_FORMAT_B8G8R8A8_SRGB: return 2;
1030 case VK_FORMAT_R16G16B16A16_SFLOAT: case VK_FORMAT_R16G16B16A16_UNORM: case VK_FORMAT_R16G16B16A16_SNORM:
1031 case VK_FORMAT_R16G16B16A16_UINT: case VK_FORMAT_R16G16B16A16_SINT: return 3;
1032 case VK_FORMAT_R32G32B32A32_SFLOAT: case VK_FORMAT_R32G32B32A32_UINT: case VK_FORMAT_R32G32B32A32_SINT: return 4;
1033 case VK_FORMAT_R32G32_SFLOAT: case VK_FORMAT_R32G32_UINT: case VK_FORMAT_R32G32_SINT: return 5;
1034 case VK_FORMAT_R16G16_SFLOAT: case VK_FORMAT_R16G16_UNORM: case VK_FORMAT_R16G16_SNORM:
1035 case VK_FORMAT_R16G16_UINT: case VK_FORMAT_R16G16_SINT: return 6;
1036 case VK_FORMAT_A2B10G10R10_UNORM_PACK32: case VK_FORMAT_A2B10G10R10_UINT_PACK32: return 7;
1037 case VK_FORMAT_R8G8_UNORM: case VK_FORMAT_R8G8_SNORM: case VK_FORMAT_R8G8_UINT: case VK_FORMAT_R8G8_SINT: return 8;
1038 case VK_FORMAT_R32_SFLOAT: case VK_FORMAT_R32_UINT: case VK_FORMAT_R32_SINT: return 9;
1039 case VK_FORMAT_R16_SFLOAT: case VK_FORMAT_R16_UNORM: case VK_FORMAT_R16_SNORM: case VK_FORMAT_R16_UINT:
1040 case VK_FORMAT_R16_SINT: return 10;
1041 case VK_FORMAT_R8_UNORM: case VK_FORMAT_R8_SNORM: case VK_FORMAT_R8_UINT: case VK_FORMAT_R8_SINT: return 11;
1042 default: return 0;
1043 }
1044}
1045
1046// The format a color view clears or renders in. A view of the resource's own format keeps it (a typeless resource
1047// has none, so it needs an explicit one). A typeless resource, or one created with a castable-format list (its image
1048// is mutable and lists the view formats), may be viewed in another format of its family: the image is mutable, so
1049// the view reinterprets its bits (D3D-275; before it only the RGBA8 family was). A volume keeps its own format.
1023inline VkFormat color_view_format(const ResourceBinding& resource, const TargetView& target) { 1050inline VkFormat color_view_format(const ResourceBinding& resource, const TargetView& target) {
1024 if (target.format == ColorViewFormat::resource) 1051 if (target.format == ColorViewFormat::resource)
1025 return resource.rgba8_typeless ? VK_FORMAT_UNDEFINED : resource.format; 1052 return resource.typeless ? VK_FORMAT_UNDEFINED : resource.format;
1026 VkFormat format = VK_FORMAT_UNDEFINED; 1053 const auto format = static_cast<VkFormat>(target.format);
1027 switch (target.format) { 1054 const int family = typeless_view_family(format);
1028 case ColorViewFormat::rgba8_unorm: format = VK_FORMAT_R8G8B8A8_UNORM; break; 1055 if (!family) return VK_FORMAT_UNDEFINED;
1029 case ColorViewFormat::rgba8_srgb: format = VK_FORMAT_R8G8B8A8_SRGB; break; 1056 if (!resource.typeless && !resource.castable_view_formats)
1030 case ColorViewFormat::rgba8_uint: format = VK_FORMAT_R8G8B8A8_UINT; break;
1031 case ColorViewFormat::rgba8_sint: format = VK_FORMAT_R8G8B8A8_SINT; break;
1032 case ColorViewFormat::rgba8_snorm: format = VK_FORMAT_R8G8B8A8_SNORM; break;
1033 default: return VK_FORMAT_UNDEFINED;
1034 }
1035 if (!resource.rgba8_typeless && !resource.castable_view_formats)
1036 return format == resource.format ? format : VK_FORMAT_UNDEFINED; 1057 return format == resource.format ? format : VK_FORMAT_UNDEFINED;
1037 if (resource.format != VK_FORMAT_R8G8B8A8_UNORM || resource.volume || resource.depth != 1) 1058 if (family != typeless_view_family(resource.format) || resource.volume || resource.depth != 1)
1038 return VK_FORMAT_UNDEFINED; 1059 return VK_FORMAT_UNDEFINED;
1039 return format; 1060 return format;
1040} 1061}
@@ -2190,7 +2211,7 @@ ReplayResult prepare(const CommandList& list, Resolve&& resolve, const ReplayFun
2190 // Older ownerless replay callers omit the resource format for float-only clears. Preserve 2211 // Older ownerless replay callers omit the resource format for float-only clears. Preserve
2191 // that path; an explicit format or a typeless resource must still resolve a concrete RTV. 2212 // that path; an explicit format or a typeless resource must still resolve a concrete RTV.
2192 if (p.clear_format == VK_FORMAT_UNDEFINED && 2213 if (p.clear_format == VK_FORMAT_UNDEFINED &&
2193 (p.binding.rgba8_typeless || color_clear->target.format != ColorViewFormat::resource)) 2214 (p.binding.typeless || color_clear->target.format != ColorViewFormat::resource))
2194 return ReplayResult::invalid_clear; 2215 return ReplayResult::invalid_clear;
2195 const bool partial_volume = p.binding.volume && 2216 const bool partial_volume = p.binding.volume &&
2196 color_clear->target.layer_count != std::max(1u, p.binding.depth >> color_clear->target.mip); 2217 color_clear->target.layer_count != std::max(1u, p.binding.depth >> color_clear->target.mip);
@@ -2234,18 +2255,35 @@ ReplayResult prepare(const CommandList& list, Resolve&& resolve, const ReplayFun
2234 const TargetView target{view.resource, view.mip, view.first_layer, view.layer_count}; 2255 const TargetView target{view.resource, view.mip, view.first_layer, view.layer_count};
2235 if (!detail::view_range(p.binding, target, VK_IMAGE_ASPECT_COLOR_BIT, p.range)) 2256 if (!detail::view_range(p.binding, target, VK_IMAGE_ASPECT_COLOR_BIT, p.range))
2236 return ReplayResult::invalid_subresource; 2257 return ReplayResult::invalid_subresource;
2237 // The view's format turns the values into bytes; the image's own format clears them in. 2258 // The view's format turns the values into bytes. When the view format differs from the image's backing
2259 // format (a typeless or castable texture) and can be cleared as a color attachment, clear through a view of
2260 // view_format instead of decoding into the backing format (which turns non-float bit patterns like
2261 // R16G16_UNORM 1.0 = 0xffff or R32_UINT 0x7f800001 into SFLOAT NaNs that vkCmdClearColorImage quiets).
2262 // Emulated R9G9B9E5_SHAREDEXP images (backed by R32_UINT) lack COLOR_ATTACHMENT on E5B9G9R9 and keep the
2263 // bit-exact R32_UINT backing path.
2238 const VkFormat view_format = view.format ? VkFormat(view.format) : p.binding.format; 2264 const VkFormat view_format = view.format ? VkFormat(view.format) : p.binding.format;
2239 if (!uav_clear::encode(view_format, uav->is_float, uav->values, p.element) || 2265 if (!uav_clear::encode(view_format, uav->is_float, uav->values, p.element))
2240 !uav_clear::decode(p.binding.format, p.element, p.clear_color))
2241 return ReplayResult::unsupported; 2266 return ReplayResult::unsupported;
2242 if (!uav->rects.empty() && (!p.binding.color_attachment || p.binding.volume)) 2267 const auto* image_layout = uav_clear::layout(p.binding.format);
2268 if (!image_layout || image_layout->bytes != p.element.size)
2269 return ReplayResult::unsupported;
2270 const bool attachment = p.binding.color_attachment && !p.binding.volume;
2271 const bool view_attachable = vk.color_attachment_format
2272 ? vk.color_attachment_format(view_format)
2273 : view_format != VK_FORMAT_E5B9G9R9_UFLOAT_PACK32;
2274 const bool reinterpret = view_format != p.binding.format && attachment && view_attachable;
2275 const VkFormat clear_format = reinterpret ? view_format : p.binding.format;
2276 if (!uav_clear::decode(clear_format, p.element, p.clear_color))
2277 return ReplayResult::unsupported;
2278 if (reinterpret) p.clear_format = view_format;
2279 if (!uav->rects.empty() && !attachment)
2243 return ReplayResult::unsupported; 2280 return ReplayResult::unsupported;
2244 // Under a predicate a whole view is cleared as one rectangle where the image can be an attachment, as 2281 // Under a predicate a whole view is cleared as one rectangle where the image can be an attachment, as
2245 // render targets are; otherwise vkCmdClearColorImage runs unconditionally and is counted. 2282 // render targets are; otherwise vkCmdClearColorImage runs unconditionally and is counted.
2246 const bool attachment = p.binding.color_attachment && !p.binding.volume;
2247 if (predicated && uav->rects.empty() && !attachment) ++out.unpredicated_copies; 2283 if (predicated && uav->rects.empty() && !attachment) ++out.unpredicated_copies;
2248 const auto rects = attachment ? clear_rects(uav->rects) : std::span<const Rect>(uav->rects); 2284 const auto rects = (reinterpret && uav->rects.empty())
2285 ? std::span<const Rect>(&whole_view, 1)
2286 : attachment ? clear_rects(uav->rects) : std::span<const Rect>(uav->rects);
2249 if (const auto r = rect_view(rects, target, VK_IMAGE_ASPECT_COLOR_BIT); r != ReplayResult::success) 2287 if (const auto r = rect_view(rects, target, VK_IMAGE_ASPECT_COLOR_BIT); r != ReplayResult::success)
2250 return r; 2288 return r;
2251 if (!p.skip && p.rects.empty() && !vk.clear_color_image) return ReplayResult::unsupported; 2289 if (!p.skip && p.rects.empty() && !vk.clear_color_image) return ReplayResult::unsupported;
@@ -3329,9 +3367,10 @@ inline void emit(const PreparedList& prepared, VkCommandBuffer command_buffer, c
3329 vk.xdxr_record(command_buffer, *xdxr_build); 3367 vk.xdxr_record(command_buffer, *xdxr_build);
3330 } else if (const auto* copy = std::get_if<CopyAccelerationStructure>(&command)) { 3368 } else if (const auto* copy = std::get_if<CopyAccelerationStructure>(&command)) {
3331 vk.xdxr_copy(command_buffer, copy->src_va, copy->dst_va, p.xdxr_bytes); 3369 vk.xdxr_copy(command_buffer, copy->src_va, copy->dst_va, p.xdxr_bytes);
3332 } else if (const auto* info = std::get_if<AccelerationStructurePostbuild>(&command); info && !p.skip) { 3370 } else if (const auto* postbuild = std::get_if<AccelerationStructurePostbuild>(&command);
3333 for (std::size_t i = 0; i < info->sources.size(); ++i) 3371 postbuild && !p.skip) {
3334 vk.xdxr_postbuild(command_buffer, info->sources[i], info->dest_va + 8 * i); 3372 for (std::size_t s = 0; s < postbuild->sources.size(); ++s)
3373 vk.xdxr_postbuild(command_buffer, postbuild->sources[s], postbuild->dest_va + 8 * s);
3335 } else if (const auto* build = std::get_if<BuildAccelerationStructure>(&command)) { 3374 } else if (const auto* build = std::get_if<BuildAccelerationStructure>(&command)) {
3336 // The build's addresses are console VAs into the GPU address arena (heap_base is its device address). 3375 // The build's addresses are console VAs into the GPU address arena (heap_base is its device address).
3337 // A null VA (no index buffer, no transform) stays null: heap_base + 0 would name the arena's zero page. 3376 // A null VA (no index buffer, no transform) stays null: heap_base + 0 would name the arena's zero page.
diff --git a/runtime/src/xdxr_build.comp b/runtime/src/xdxr_build.comp
index 908006897..17e809b92 100644
--- a/runtime/src/xdxr_build.comp
+++ b/runtime/src/xdxr_build.comp
@@ -24,11 +24,12 @@
24// grouping is kept, so there is no Morton pass and no sort), and MODE_HEADER rewrites the bounds. 24// grouping is kept, so there is no Morton pass and no sort), and MODE_HEADER rewrites the bounds.
25// MODE_COPY one thread per word: count words from src0 to dst 25// MODE_COPY one thread per word: count words from src0 to dst
26// MODE_COPY_AS CopyRaytracingAccelerationStructure CLONE / COMPACT: the source structure's size comes from its 26// MODE_COPY_AS CopyRaytracingAccelerationStructure CLONE / COMPACT: the source structure's size comes from its
27// header (totalSizeIn64BNodes), so the copy can follow a build in the same list; at most count 27// header (totalSizeIn64BNodes, which does not count the 64-byte header: the size is 64 * (field +
28// 1) bytes), so the copy can follow a build in the same list; at most count
28// words. The records are position-independent (node pointers count from the structure's start, and 29// words. The records are position-independent (node pointers count from the structure's start, and
29// a TLAS names its BLASes by address), so the bytes are the copy. 30// a TLAS names its BLASes by address), so the bytes are the copy.
30// MODE_POSTBUILD one thread: the 8-byte COMPACTED_SIZE or CURRENT_SIZE of the structure at src0, at dst. A build 31// MODE_POSTBUILD one thread: the 8-byte COMPACTED_SIZE or CURRENT_SIZE of the structure at src0, at dst. A build
31// is already exactly its layout's size, so both are totalSizeIn64BNodes * 64. 32// is already exactly its layout's size, so both are (totalSizeIn64BNodes + 1) * 64.
32// The tree groups four consecutive children per node in Morton order, level by level, so its shape depends only on 33// The tree groups four consecutive children per node in Morton order, level by level, so its shape depends only on
33// the element count and the layout (xdxr_build.h XdxrLayout) is known when the command is recorded. 34// the element count and the layout (xdxr_build.h XdxrLayout) is known when the command is recorded.
34// 35//
@@ -436,7 +437,7 @@ void build_header() {
436 vec3 lo, hi; 437 vec3 lo, hi;
437 load_box(pc.elements + root, lo, hi); 438 load_box(pc.elements + root, lo, hi);
438 store(pc.dst, 0u, (pc.tlas != 0u ? 0u : FLAG_BOTTOM_LEVEL) | VERSION_2403); 439 store(pc.dst, 0u, (pc.tlas != 0u ? 0u : FLAG_BOTTOM_LEVEL) | VERSION_2403);
439 store(pc.dst, 4u, pc.total_size / 64u); 440 store(pc.dst, 4u, pc.total_size / 64u - 1u); // totalSizeIn64BNodes does not count the header: 64 * (field + 1) bytes
440 store(pc.dst, 8u, 0u); // crc32: not computed for runtime builds 441 store(pc.dst, 8u, 0u); // crc32: not computed for runtime builds
441 store(pc.dst, 12u, pc.elements); 442 store(pc.dst, 12u, pc.elements);
442 storef(pc.dst, 16u, lo.x); storef(pc.dst, 20u, lo.y); storef(pc.dst, 24u, lo.z); 443 storef(pc.dst, 16u, lo.x); storef(pc.dst, 20u, lo.y); storef(pc.dst, 24u, lo.z);
@@ -462,11 +463,11 @@ void main() {
462 } 463 }
463 if (i >= pc.count) return; 464 if (i >= pc.count) return;
464 if (pc.mode == MODE_POSTBUILD) { 465 if (pc.mode == MODE_POSTBUILD) {
465 if (i == 0u) { store(pc.dst, 0u, load(pc.src0, 4u) * 64u); store(pc.dst, 4u, 0u); } 466 if (i == 0u) { store(pc.dst, 0u, (load(pc.src0, 4u) + 1u) * 64u); store(pc.dst, 4u, 0u); }
466 return; 467 return;
467 } 468 }
468 if (pc.mode == MODE_COPY_AS) { 469 if (pc.mode == MODE_COPY_AS) {
469 if (4u * i < load(pc.src0, 4u) * 64u) store(pc.dst, 4u * i, load(pc.src0, 4u * i)); 470 if (4u * i < (load(pc.src0, 4u) + 1u) * 64u) store(pc.dst, 4u * i, load(pc.src0, 4u * i));
470 return; 471 return;
471 } 472 }
472 if (pc.mode == MODE_COPY) { 473 if (pc.mode == MODE_COPY) {
diff --git a/runtime/src/xdxr_build.inc b/runtime/src/xdxr_build.inc
index bbc1bb888..c2923046b 100644
--- a/runtime/src/xdxr_build.inc
+++ b/runtime/src/xdxr_build.inc
@@ -1,12 +1,12 @@
1{0x07230203,0x00010500,0x000d000b,0x000032b4, 1{0x07230203,0x00010500,0x000d000b,0x000032a6,
20x00000000,0x00020011,0x00000001,0x00020011, 20x00000000,0x00020011,0x00000001,0x00020011,
30x000014e3,0x0006000b,0x00000001,0x4c534c47, 30x000014e3,0x0006000b,0x00000001,0x4c534c47,
40x6474732e,0x3035342e,0x00000000,0x0003000e, 40x6474732e,0x3035342e,0x00000000,0x0003000e,
50x000014e4,0x00000001,0x000f000f,0x00000005, 50x000014e4,0x00000001,0x000f000f,0x00000005,
60x00000004,0x6e69616d,0x00000000,0x000000fc, 60x00000004,0x6e69616d,0x00000000,0x000000fc,
70x000006af,0x000006c4,0x000007a3,0x0000080d, 70x000006aa,0x000006bf,0x0000079e,0x00000808,
80x00000856,0x000008af,0x00000b0e,0x00000b17, 80x00000851,0x000008aa,0x00000b06,0x00000b0f,
90x00000b18,0x00060010,0x00000004,0x00000011, 90x00000b10,0x00060010,0x00000004,0x00000011,
100x00000040,0x00000001,0x00000001,0x00040047, 100x00000040,0x00000001,0x00000001,0x00040047,
110x00000015,0x00000006,0x00000004,0x00030047, 110x00000015,0x00000006,0x00000004,0x00030047,
120x00000016,0x00000002,0x00050048,0x00000016, 120x00000016,0x00000002,0x00050048,0x00000016,
@@ -36,10 +36,10 @@
360x000000fa,0x00000011,0x00000023,0x0000005c, 360x000000fa,0x00000011,0x00000023,0x0000005c,
370x00050048,0x000000fa,0x00000012,0x00000023, 370x00050048,0x000000fa,0x00000012,0x00000023,
380x00000060,0x00050048,0x000000fa,0x00000013, 380x00000060,0x00050048,0x000000fa,0x00000013,
390x00000023,0x00000064,0x00040047,0x00000b0e, 390x00000023,0x00000064,0x00040047,0x00000b06,
400x0000000b,0x0000001c,0x00040047,0x00000b17, 400x0000000b,0x0000001c,0x00040047,0x00000b0f,
410x0000000b,0x0000001a,0x00040047,0x00000b18, 410x0000000b,0x0000001a,0x00040047,0x00000b10,
420x0000000b,0x0000001b,0x00040047,0x00000bf1, 420x0000000b,0x0000001b,0x00040047,0x00000beb,
430x0000000b,0x00000019,0x00020013,0x00000002, 430x0000000b,0x00000019,0x00020013,0x00000002,
440x00030021,0x00000003,0x00000002,0x00040015, 440x00030021,0x00000003,0x00000002,0x00040015,
450x00000006,0x00000020,0x00000000,0x00040017, 450x00000006,0x00000020,0x00000000,0x00040017,
@@ -113,3980 +113,3984 @@
1130x00000006,0x00000380,0xffffffff,0x0004002b, 1130x00000006,0x00000380,0xffffffff,0x0004002b,
1140x00000006,0x00000388,0x0000003c,0x0004002b, 1140x00000006,0x00000388,0x0000003c,0x0004002b,
1150x00000006,0x0000038a,0x00000009,0x00040017, 1150x00000006,0x0000038a,0x00000009,0x00040017,
1160x00000395,0x0000002f,0x00000003,0x0004001c, 1160x00000395,0x0000002f,0x00000003,0x0004002b,
1170x000003d9,0x00000027,0x00000118,0x00040020, 1170x00000027,0x000003bd,0x7f800000,0x0006002c,
1180x000003da,0x00000007,0x000003d9,0x0004002b, 1180x0000004b,0x000003be,0x000003bd,0x000003bd,
1190x00000006,0x00000463,0x0000001c,0x0004002b, 1190x000003bd,0x0004001c,0x000003d8,0x00000027,
1200x00000006,0x00000469,0x00000020,0x0004002b, 1200x00000118,0x00040020,0x000003d9,0x00000007,
1210x000000d9,0x0000047e,0x00000018,0x0004002b, 1210x000003d8,0x0004002b,0x00000006,0x00000460,
1220x000000d9,0x000004d8,0x00000007,0x0004002b, 1220x0000001c,0x0004002b,0x00000006,0x00000466,
1230x00000027,0x000004fc,0x3f800000,0x0004002b, 1230x00000020,0x0004002b,0x000000d9,0x0000047b,
1240x00000006,0x00000531,0x3fffffff,0x00040018, 1240x00000018,0x0004002b,0x000000d9,0x000004d5,
1250x0000054b,0x0000004b,0x00000003,0x00040020, 1250x00000007,0x0004002b,0x00000027,0x000004f9,
1260x0000054c,0x00000007,0x0000054b,0x0006002c, 1260x3f800000,0x0004002b,0x00000006,0x0000052e,
1270x0000004b,0x00000570,0x0000026d,0x0000026d, 1270x3fffffff,0x00040018,0x00000548,0x0000004b,
1280x0000026d,0x0006002c,0x0000054b,0x00000571, 1280x00000003,0x00040020,0x00000549,0x00000007,
1290x00000570,0x00000570,0x00000570,0x0004002b, 1290x00000548,0x0006002c,0x0000004b,0x0000056d,
1300x00000006,0x00000597,0x00000044,0x0004002b, 1300x0000026d,0x0000026d,0x0000026d,0x0006002c,
1310x00000006,0x000005a6,0x00000048,0x0004002b, 1310x00000548,0x0000056e,0x0000056d,0x0000056d,
1320x00000006,0x000005b5,0x0000004c,0x0004002b, 1320x0000056d,0x0004002b,0x00000006,0x00000594,
1330x00000006,0x000005c6,0x00000070,0x0004002b, 1330x00000044,0x0004002b,0x00000006,0x000005a3,
1340x00000006,0x000005d0,0x00000074,0x0004002b, 1340x00000048,0x0004002b,0x00000006,0x000005b2,
1350x00000006,0x000005d9,0x00000078,0x0004002b, 1350x0000004c,0x0004002b,0x00000006,0x000005c3,
1360x00000006,0x000005e2,0x0000007c,0x0004002b, 1360x00000070,0x0004002b,0x00000006,0x000005cd,
1370x00000006,0x000005fe,0x000003ff,0x0004002b, 1370x00000074,0x0004002b,0x00000006,0x000005d6,
1380x00000006,0x00000605,0x030000ff,0x0004002b, 1380x00000078,0x0004002b,0x00000006,0x000005df,
1390x00000006,0x0000060b,0x0300f00f,0x0004002b, 1390x0000007c,0x0004002b,0x00000006,0x000005f9,
1400x00000006,0x00000611,0x030c30c3,0x0004002b, 1400x000003ff,0x0004002b,0x00000006,0x00000600,
1410x00000006,0x00000617,0x09249249,0x0004002b, 1410x030000ff,0x0004002b,0x00000006,0x00000606,
1420x00000027,0x0000065a,0x0da24260,0x0006002c, 1420x0300f00f,0x0004002b,0x00000006,0x0000060c,
1430x0000004b,0x0000065b,0x0000065a,0x0000065a, 1430x030c30c3,0x0004002b,0x00000006,0x00000612,
1440x0000065a,0x00040017,0x0000065d,0x00000006, 1440x09249249,0x0004002b,0x00000027,0x00000655,
1450x00000003,0x0004002b,0x00000027,0x0000066b, 1450x0da24260,0x0006002c,0x0000004b,0x00000656,
1460x447fc000,0x0004002b,0x00000006,0x000006ac, 1460x00000655,0x00000655,0x00000655,0x00040017,
1470x00000400,0x0004001c,0x000006ad,0x00000006, 1470x00000658,0x00000006,0x00000003,0x0004002b,
1480x000006ac,0x00040020,0x000006ae,0x00000004, 1480x00000027,0x00000666,0x447fc000,0x0004002b,
1490x000006ad,0x0004003b,0x000006ae,0x000006af, 1490x00000006,0x000006a7,0x00000400,0x0004001c,
1500x00000004,0x00040020,0x000006c2,0x00000004, 1500x000006a8,0x00000006,0x000006a7,0x00040020,
1510x00000006,0x0004003b,0x000006ae,0x000006c4, 1510x000006a9,0x00000004,0x000006a8,0x0004003b,
1520x00000004,0x0004002b,0x00000006,0x000006da, 1520x000006a9,0x000006aa,0x00000004,0x00040020,
1530x00000108,0x0004002b,0x00000006,0x00000799, 1530x000006bd,0x00000004,0x00000006,0x0004003b,
1540x0000000f,0x0004001c,0x000007a1,0x00000006, 1540x000006a9,0x000006bf,0x00000004,0x0004002b,
1550x0000011f,0x00040020,0x000007a2,0x00000004, 1550x00000006,0x000006d5,0x00000108,0x0004002b,
1560x000007a1,0x0004003b,0x000007a2,0x000007a3, 1560x00000006,0x00000794,0x0000000f,0x0004001c,
1570x00000004,0x0004002b,0x00000006,0x000007e4, 1570x0000079c,0x00000006,0x0000011f,0x00040020,
1580x0000003f,0x0004001c,0x0000080b,0x00000006, 1580x0000079d,0x00000004,0x0000079c,0x0004003b,
1590x00000107,0x00040020,0x0000080c,0x00000004, 1590x0000079d,0x0000079e,0x00000004,0x0004002b,
1600x0000080b,0x0004003b,0x0000080c,0x0000080d, 1600x00000006,0x000007df,0x0000003f,0x0004001c,
1610x00000004,0x0004003b,0x000007a2,0x00000856, 1610x00000806,0x00000006,0x00000107,0x00040020,
1620x00000004,0x0004001c,0x000008ad,0x0000080b, 1620x00000807,0x00000004,0x00000806,0x0004003b,
1630x0000011f,0x00040020,0x000008ae,0x00000004, 1630x00000807,0x00000808,0x00000004,0x0004003b,
1640x000008ad,0x0004003b,0x000008ae,0x000008af, 1640x0000079d,0x00000851,0x00000004,0x0004001c,
1650x00000004,0x00040020,0x000008cb,0x00000007, 1650x000008a8,0x00000806,0x0000011f,0x00040020,
1660x000007a1,0x0004002b,0x000000d9,0x0000091d, 1660x000008a9,0x00000004,0x000008a8,0x0004003b,
1670x0000003f,0x0004002b,0x00000006,0x00000967, 1670x000008a9,0x000008aa,0x00000004,0x00040020,
1680x00000007,0x0004002b,0x000000d9,0x0000096c, 1680x000008c6,0x00000007,0x0000079c,0x0004002b,
1690x0000000d,0x0004002b,0x000000d9,0x000009ef, 1690x000000d9,0x00000918,0x0000003f,0x0004002b,
1700x00000011,0x0004002b,0x000000d9,0x00000a97, 1700x00000006,0x0000095e,0x00000007,0x0004002b,
1710x00000012,0x00040020,0x00000b0d,0x00000001, 1710x000000d9,0x00000963,0x0000000d,0x0004002b,
1720x0000065d,0x0004003b,0x00000b0d,0x00000b0e, 1720x000000d9,0x000009e6,0x00000011,0x0004002b,
1730x00000001,0x00040020,0x00000b0f,0x00000001, 1730x000000d9,0x00000a8e,0x00000012,0x00040020,
1740x00000006,0x0004003b,0x00000b0d,0x00000b17, 1740x00000b05,0x00000001,0x00000658,0x0004003b,
1750x00000001,0x0004003b,0x00000b0d,0x00000b18, 1750x00000b05,0x00000b06,0x00000001,0x00040020,
1760x00000001,0x0004002b,0x00000006,0x00000b3a, 1760x00000b07,0x00000001,0x00000006,0x0004003b,
1770x0000000a,0x0004002b,0x00000006,0x00000b57, 1770x00000b05,0x00000b0f,0x00000001,0x0004003b,
1780x0000000d,0x0004002b,0x00000006,0x00000b94, 1780x00000b05,0x00000b10,0x00000001,0x0004002b,
1790x0000000b,0x0006002c,0x0000065d,0x00000bf1, 1790x00000006,0x00000b32,0x0000000a,0x0004002b,
1800x00000107,0x000000b0,0x000000b0,0x0006002c, 1800x00000006,0x00000b4f,0x0000000d,0x0004002b,
1810x0000004b,0x000032a2,0x000004fc,0x000004fc, 1810x00000006,0x00000b8e,0x0000000b,0x0006002c,
1820x000004fc,0x0004002b,0x00000027,0x000032a4, 1820x00000658,0x00000beb,0x00000107,0x000000b0,
1830x7f800000,0x0006002c,0x0000004b,0x000032a5, 1830x000000b0,0x0004002b,0x00000027,0x00003293,
1840x000032a4,0x000032a4,0x000032a4,0x0004002b, 1840xff800000,0x0006002c,0x0000004b,0x00003294,
1850x00000027,0x000032a6,0xff800000,0x0006002c, 1850x00003293,0x00003293,0x00003293,0x0006002c,
1860x0000004b,0x000032a7,0x000032a6,0x000032a6, 1860x0000004b,0x00003295,0x000004f9,0x000004f9,
1870x000032a6,0x0004002b,0x00000006,0x000032a8, 1870x000004f9,0x0004002b,0x00000006,0x00003297,
1880x000000ff,0x00050036,0x00000002,0x00000004, 1880x000000ff,0x0004002b,0x00000006,0x0000329a,
1890x80000006,0x00050036,0x00000002,0x00000004,
1890x00000000,0x00000003,0x000200f8,0x00000005, 1900x00000000,0x00000003,0x000200f8,0x00000005,
1900x0004003b,0x000003da,0x00001c65,0x00000007, 1910x0004003b,0x000003d9,0x00001c5e,0x00000007,
1910x0004003b,0x0000054c,0x00001ca6,0x00000007, 1920x0004003b,0x00000549,0x00001c9f,0x00000007,
1920x0004003b,0x0000004c,0x00001ca9,0x00000007, 1930x0004003b,0x0000004c,0x00001ca2,0x00000007,
1930x0004003b,0x0000004c,0x00001805,0x00000007, 1940x0004003b,0x0000004c,0x000017fe,0x00000007,
1940x0004003b,0x000002f7,0x0000161a,0x00000007, 1950x0004003b,0x000002f7,0x00001615,0x00000007,
1950x0004003b,0x000008cb,0x00000daf,0x00000007, 1960x0004003b,0x000008c6,0x00000da9,0x00000007,
1960x000300f7,0x00000bf3,0x00000000,0x000300fb, 1970x000300f7,0x00000bed,0x00000000,0x000300fb,
1970x000000a6,0x00000bf4,0x000200f8,0x00000bf4, 1980x000000a6,0x00000bee,0x000200f8,0x00000bee,
1980x00050041,0x00000b0f,0x00000b10,0x00000b0e, 1990x00050041,0x00000b07,0x00000b08,0x00000b06,
1990x000000a6,0x0004003d,0x00000006,0x00000b11, 2000x000000a6,0x0004003d,0x00000006,0x00000b09,
2000x00000b10,0x00050041,0x000000fe,0x00000b12, 2010x00000b08,0x00050041,0x000000fe,0x00000b0a,
2010x000000fc,0x00000233,0x0004003d,0x00000006, 2020x000000fc,0x00000233,0x0004003d,0x00000006,
2020x00000b13,0x00000b12,0x000500aa,0x0000002f, 2030x00000b0b,0x00000b0a,0x000500aa,0x0000002f,
2030x00000b14,0x00000b13,0x00000967,0x000300f7, 2040x00000b0c,0x00000b0b,0x0000095e,0x000300f7,
2040x00000b16,0x00000000,0x000400fa,0x00000b14, 2050x00000b0e,0x00000000,0x000400fa,0x00000b0c,
2050x00000b15,0x00000b16,0x000200f8,0x00000b15, 2060x00000b0d,0x00000b0e,0x000200f8,0x00000b0d,
2060x00050041,0x00000b0f,0x00000b1a,0x00000b17, 2070x00050041,0x00000b07,0x00000b12,0x00000b0f,
2070x000000a6,0x0004003d,0x00000006,0x00000b1b, 2080x000000a6,0x0004003d,0x00000006,0x00000b13,
2080x00000b1a,0x00050041,0x00000b0f,0x00000b1d, 2090x00000b12,0x00050041,0x00000b07,0x00000b15,
2090x00000b18,0x000000a6,0x0004003d,0x00000006, 2100x00000b10,0x000000a6,0x0004003d,0x00000006,
2100x00000b1e,0x00000b1d,0x000500b0,0x0000002f, 2110x00000b16,0x00000b15,0x000500b0,0x0000002f,
2110x00000c10,0x00000b1e,0x0000011f,0x000300f7, 2120x00000c0a,0x00000b16,0x0000011f,0x000300f7,
2120x00000c14,0x00000000,0x000400fa,0x00000c10, 2130x00000c0e,0x00000000,0x000400fa,0x00000c0a,
2130x00000c11,0x00000c14,0x000200f8,0x00000c11, 2140x00000c0b,0x00000c0e,0x000200f8,0x00000c0b,
2140x00050041,0x000006c2,0x00000c13,0x000007a3, 2150x00050041,0x000006bd,0x00000c0d,0x0000079e,
2150x00000b1e,0x0003003e,0x00000c13,0x000000a6, 2160x00000b16,0x0003003e,0x00000c0d,0x000000a6,
2160x000200f9,0x00000c14,0x000200f8,0x00000c14, 2170x000200f9,0x00000c0e,0x000200f8,0x00000c0e,
2170x000400e0,0x00000170,0x00000170,0x000006da, 2180x000400e0,0x00000170,0x00000170,0x000006d5,
2180x00050084,0x00000006,0x00000c16,0x00000b1b, 2190x00050084,0x00000006,0x00000c10,0x00000b13,
2190x00000101,0x00050080,0x00000006,0x00000c18, 2200x00000101,0x00050080,0x00000006,0x00000c12,
2200x00000c16,0x00000101,0x00050041,0x000000fe, 2210x00000c10,0x00000101,0x00050041,0x000000fe,
2210x00000c19,0x000000fc,0x000000fd,0x0004003d, 2220x00000c13,0x000000fc,0x000000fd,0x0004003d,
2220x00000006,0x00000c1a,0x00000c19,0x0007000c, 2230x00000006,0x00000c14,0x00000c13,0x0007000c,
2230x00000006,0x00000c1b,0x00000001,0x00000026, 2240x00000006,0x00000c15,0x00000001,0x00000026,
2240x00000c18,0x00000c1a,0x00050080,0x00000006, 2250x00000c12,0x00000c14,0x00050080,0x00000006,
2250x00000c1e,0x00000c16,0x00000b1e,0x000200f9, 2260x00000c18,0x00000c10,0x00000b16,0x000200f9,
2260x00000c1f,0x000200f8,0x00000c1f,0x000700f5, 2270x00000c19,0x000200f8,0x00000c19,0x000700f5,
2270x00000006,0x00003283,0x00000c1e,0x00000c14, 2280x00000006,0x00003274,0x00000c18,0x00000c0e,
2280x00000c31,0x00000c2f,0x000500b0,0x0000002f, 2290x00000c2b,0x00000c29,0x000500b0,0x0000002f,
2290x00000c23,0x00003283,0x00000c1b,0x000400f6, 2300x00000c1d,0x00003274,0x00000c15,0x000400f6,
2300x00000c32,0x00000c2f,0x00000000,0x000400fa, 2310x00000c2c,0x00000c29,0x00000000,0x000400fa,
2310x00000c23,0x00000c24,0x00000c32,0x000200f8, 2320x00000c1d,0x00000c1e,0x00000c2c,0x000200f8,
2320x00000c24,0x00050041,0x000000fe,0x00000c48, 2330x00000c1e,0x00050041,0x000000fe,0x00000c42,
2330x000000fc,0x00000308,0x0004003d,0x00000006, 2340x000000fc,0x00000308,0x0004003d,0x00000006,
2340x00000c49,0x00000c48,0x000500c7,0x00000006, 2350x00000c43,0x00000c42,0x000500c7,0x00000006,
2350x00000c4a,0x00000c49,0x000000b0,0x000500aa, 2360x00000c44,0x00000c43,0x000000b0,0x000500aa,
2360x0000002f,0x00000c4b,0x00000c4a,0x000000a6, 2370x0000002f,0x00000c45,0x00000c44,0x000000a6,
2370x000300f7,0x00000c50,0x00000000,0x000400fa, 2380x000300f7,0x00000c4a,0x00000000,0x000400fa,
2380x00000c4b,0x00000c4c,0x00000c4e,0x000200f8, 2390x00000c45,0x00000c46,0x00000c48,0x000200f8,
2390x00000c4c,0x000200f9,0x00000c50,0x000200f8, 2400x00000c46,0x000200f9,0x00000c4a,0x000200f8,
2400x00000c4e,0x00050084,0x00000006,0x00000c58, 2410x00000c48,0x00050084,0x00000006,0x00000c52,
2410x00000111,0x00000c1a,0x00050080,0x00000006, 2420x00000111,0x00000c14,0x00050080,0x00000006,
2420x00000c59,0x00000107,0x00000c58,0x000200f9, 2430x00000c53,0x00000107,0x00000c52,0x000200f9,
2430x00000c50,0x000200f8,0x00000c50,0x000700f5, 2440x00000c4a,0x000200f8,0x00000c4a,0x000700f5,
2440x00000006,0x00003284,0x00000107,0x00000c4c, 2450x00000006,0x00003275,0x00000107,0x00000c46,
2450x00000c59,0x00000c4e,0x00050084,0x00000006, 2460x00000c53,0x00000c48,0x00050084,0x00000006,
2460x00000c27,0x0000010a,0x00003283,0x00050080, 2470x00000c21,0x0000010a,0x00003274,0x00050080,
2470x00000006,0x00000c28,0x00003284,0x00000c27, 2480x00000006,0x00000c22,0x00003275,0x00000c21,
2480x00050041,0x00000156,0x00000c29,0x000000fc, 2490x00050041,0x00000156,0x00000c23,0x000000fc,
2490x00000154,0x0004003d,0x00000007,0x00000c2a, 2500x00000154,0x0004003d,0x00000007,0x00000c24,
2500x00000c29,0x00050051,0x00000006,0x00000c70, 2510x00000c23,0x00050051,0x00000006,0x00000c6a,
2510x00000c2a,0x00000000,0x00050095,0x000000ab, 2520x00000c24,0x00000000,0x00050095,0x000000ab,
2520x00000c72,0x00000c70,0x00000c28,0x00050051, 2530x00000c6c,0x00000c6a,0x00000c22,0x00050051,
2530x00000006,0x00000c73,0x00000c72,0x00000001, 2540x00000006,0x00000c6d,0x00000c6c,0x00000001,
2540x00050051,0x00000006,0x00000c74,0x00000c72, 2550x00050051,0x00000006,0x00000c6e,0x00000c6c,
2550x00000000,0x00050051,0x00000006,0x00000c77, 2560x00000000,0x00050051,0x00000006,0x00000c71,
2560x00000c2a,0x00000001,0x00050080,0x00000006, 2570x00000c24,0x00000001,0x00050080,0x00000006,
2570x00000c79,0x00000c77,0x00000c73,0x00050050, 2580x00000c73,0x00000c71,0x00000c6d,0x00050050,
2580x00000007,0x00000c7a,0x00000c74,0x00000c79, 2590x00000007,0x00000c74,0x00000c6e,0x00000c73,
2590x0004007c,0x00000014,0x00000c6a,0x00000c7a, 2600x0004007c,0x00000014,0x00000c64,0x00000c74,
2600x00060041,0x000000db,0x00000c61,0x00000c6a, 2610x00060041,0x000000db,0x00000c5b,0x00000c64,
2610x000000da,0x000000da,0x0006003d,0x00000006, 2620x000000da,0x000000da,0x0006003d,0x00000006,
2620x00000c62,0x00000c61,0x00000002,0x00000004, 2630x00000c5c,0x00000c5b,0x00000002,0x00000004,
2630x00050084,0x00000006,0x00000c80,0x0000010a, 2640x00050084,0x00000006,0x00000c7a,0x0000010a,
2640x00000c49,0x000500c2,0x00000006,0x00000c81, 2650x00000c43,0x000500c2,0x00000006,0x00000c7b,
2650x00000c62,0x00000c80,0x000500c7,0x00000006, 2660x00000c5c,0x00000c7a,0x000500c7,0x00000006,
2660x00000c82,0x00000c81,0x00000799,0x00050041, 2670x00000c7c,0x00000c7b,0x00000794,0x00050041,
2670x000006c2,0x00000c2d,0x000007a3,0x00000c82, 2680x000006bd,0x00000c27,0x0000079e,0x00000c7c,
2680x000700ea,0x00000006,0x00000c2e,0x00000c2d, 2690x000700ea,0x00000006,0x00000c28,0x00000c27,
2690x000000b0,0x000000a6,0x000000b0,0x000200f9, 2700x000000b0,0x000000a6,0x000000b0,0x000200f9,
2700x00000c2f,0x000200f8,0x00000c2f,0x00050080, 2710x00000c29,0x000200f8,0x00000c29,0x00050080,
2710x00000006,0x00000c31,0x00003283,0x00000107, 2720x00000006,0x00000c2b,0x00003274,0x00000107,
2720x000200f9,0x00000c1f,0x000200f8,0x00000c32, 2730x000200f9,0x00000c19,0x000200f8,0x00000c2c,
2730x000400e0,0x00000170,0x00000170,0x000006da, 2740x000400e0,0x00000170,0x00000170,0x000006d5,
2740x000300f7,0x00000c44,0x00000000,0x000400fa, 2750x000300f7,0x00000c3e,0x00000000,0x000400fa,
2750x00000c10,0x00000c35,0x00000c44,0x000200f8, 2760x00000c0a,0x00000c2f,0x00000c3e,0x000200f8,
2760x00000c35,0x00050084,0x00000006,0x00000c87, 2770x00000c2f,0x00050084,0x00000006,0x00000c81,
2770x0000011f,0x00000c1a,0x00050080,0x00000006, 2780x0000011f,0x00000c14,0x00050080,0x00000006,
2780x00000c88,0x00000107,0x00000c87,0x00050080, 2790x00000c82,0x00000107,0x00000c81,0x00050080,
2790x00000006,0x00000c8e,0x00000c1a,0x000032a8, 2800x00000006,0x00000c88,0x00000c14,0x00003297,
2800x00050086,0x00000006,0x00000c8f,0x00000c8e, 2810x00050086,0x00000006,0x00000c89,0x00000c88,
2810x00000101,0x00050084,0x00000006,0x00000c39, 2820x00000101,0x00050084,0x00000006,0x00000c33,
2820x00000b1e,0x00000c8f,0x00050080,0x00000006, 2830x00000b16,0x00000c89,0x00050080,0x00000006,
2830x00000c3b,0x00000c39,0x00000b1b,0x00050084, 2840x00000c35,0x00000c33,0x00000b13,0x00050084,
2840x00000006,0x00000c3c,0x0000010a,0x00000c3b, 2850x00000006,0x00000c36,0x0000010a,0x00000c35,
2850x00050080,0x00000006,0x00000c3d,0x00000c88, 2860x00050080,0x00000006,0x00000c37,0x00000c82,
2860x00000c3c,0x00050041,0x00000156,0x00000c3f, 2870x00000c36,0x00050041,0x00000156,0x00000c39,
2870x000000fc,0x00000154,0x0004003d,0x00000007, 2880x000000fc,0x00000154,0x0004003d,0x00000007,
2880x00000c40,0x00000c3f,0x00050041,0x000006c2, 2890x00000c3a,0x00000c39,0x00050041,0x000006bd,
2890x00000c41,0x000007a3,0x00000b1e,0x0004003d, 2900x00000c3b,0x0000079e,0x00000b16,0x0004003d,
2900x00000006,0x00000c42,0x00000c41,0x00050051, 2910x00000006,0x00000c3c,0x00000c3b,0x00050051,
2910x00000006,0x00000ca5,0x00000c40,0x00000000, 2920x00000006,0x00000c9f,0x00000c3a,0x00000000,
2920x00050095,0x000000ab,0x00000ca7,0x00000ca5, 2930x00050095,0x000000ab,0x00000ca1,0x00000c9f,
2930x00000c3d,0x00050051,0x00000006,0x00000ca8, 2940x00000c37,0x00050051,0x00000006,0x00000ca2,
2940x00000ca7,0x00000001,0x00050051,0x00000006, 2950x00000ca1,0x00000001,0x00050051,0x00000006,
2950x00000ca9,0x00000ca7,0x00000000,0x00050051, 2960x00000ca3,0x00000ca1,0x00000000,0x00050051,
2960x00000006,0x00000cac,0x00000c40,0x00000001, 2970x00000006,0x00000ca6,0x00000c3a,0x00000001,
2970x00050080,0x00000006,0x00000cae,0x00000cac, 2980x00050080,0x00000006,0x00000ca8,0x00000ca6,
2980x00000ca8,0x00050050,0x00000007,0x00000caf, 2990x00000ca2,0x00050050,0x00000007,0x00000ca9,
2990x00000ca9,0x00000cae,0x0004007c,0x00000014, 3000x00000ca3,0x00000ca8,0x0004007c,0x00000014,
3000x00000c9f,0x00000caf,0x00060041,0x000000db, 3010x00000c99,0x00000ca9,0x00060041,0x000000db,
3010x00000c97,0x00000c9f,0x000000da,0x000000da, 3020x00000c91,0x00000c99,0x000000da,0x000000da,
3020x0005003e,0x00000c97,0x00000c42,0x00000002, 3030x0005003e,0x00000c91,0x00000c3c,0x00000002,
3030x00000004,0x000200f9,0x00000c44,0x000200f8, 3040x00000004,0x000200f9,0x00000c3e,0x000200f8,
3040x00000c44,0x000200f9,0x00000bf3,0x000200f8, 3050x00000c3e,0x000200f9,0x00000bed,0x000200f8,
3050x00000b16,0x000500aa,0x0000002f,0x00000b23, 3060x00000b0e,0x000500aa,0x0000002f,0x00000b1b,
3060x00000b13,0x00000111,0x000300f7,0x00000b25, 3070x00000b0b,0x00000111,0x000300f7,0x00000b1d,
3070x00000000,0x000400fa,0x00000b23,0x00000b24, 3080x00000000,0x000400fa,0x00000b1b,0x00000b1c,
3080x00000b25,0x000200f8,0x00000b24,0x00050041, 3090x00000b1d,0x000200f8,0x00000b1c,0x00050041,
3090x00000b0f,0x00000b27,0x00000b18,0x000000a6, 3100x00000b07,0x00000b1f,0x00000b10,0x000000a6,
3100x0004003d,0x00000006,0x00000b28,0x00000b27, 3110x0004003d,0x00000006,0x00000b20,0x00000b1f,
3110x00050041,0x000000fe,0x00000d22,0x000000fc, 3120x00050041,0x000000fe,0x00000d1c,0x000000fc,
3120x000000fd,0x0004003d,0x00000006,0x00000d23, 3130x000000fd,0x0004003d,0x00000006,0x00000d1d,
3130x00000d22,0x00050080,0x00000006,0x00000d25, 3140x00000d1c,0x00050080,0x00000006,0x00000d1f,
3140x00000d23,0x000032a8,0x00050086,0x00000006, 3150x00000d1d,0x00003297,0x00050086,0x00000006,
3150x00000d26,0x00000d25,0x00000101,0x00050084, 3160x00000d20,0x00000d1f,0x00000101,0x00050084,
3160x00000006,0x00000cc5,0x0000011f,0x00000d26, 3170x00000006,0x00000cbf,0x0000011f,0x00000d20,
3170x00050080,0x00000006,0x00000cc7,0x00000cc5, 3180x00050080,0x00000006,0x00000cc1,0x00000cbf,
3180x000007e4,0x00050086,0x00000006,0x00000cc8, 3190x000007df,0x00050086,0x00000006,0x00000cc2,
3190x00000cc7,0x00000107,0x00050084,0x00000006, 3200x00000cc1,0x00000107,0x00050084,0x00000006,
3200x00000ccb,0x00000b28,0x00000cc8,0x0007000c, 3210x00000cc5,0x00000b20,0x00000cc2,0x0007000c,
3210x00000006,0x00000ccd,0x00000001,0x00000026, 3220x00000006,0x00000cc7,0x00000001,0x00000026,
3220x00000ccb,0x00000cc5,0x00050080,0x00000006, 3230x00000cc5,0x00000cbf,0x00050080,0x00000006,
3230x00000cd0,0x00000ccd,0x00000cc8,0x0007000c, 3240x00000cca,0x00000cc7,0x00000cc2,0x0007000c,
3240x00000006,0x00000cd2,0x00000001,0x00000026, 3250x00000006,0x00000ccc,0x00000001,0x00000026,
3250x00000cd0,0x00000cc5,0x000200f9,0x00000cd4, 3260x00000cca,0x00000cbf,0x000200f9,0x00000cce,
3260x000200f8,0x00000cd4,0x000700f5,0x00000006, 3270x000200f8,0x00000cce,0x000700f5,0x00000006,
3270x0000327e,0x000000a6,0x00000b24,0x00000ce2, 3280x0000326f,0x000000a6,0x00000b1c,0x00000cdc,
3280x00000cd9,0x000700f5,0x00000006,0x0000327d, 3290x00000cd3,0x000700f5,0x00000006,0x0000326e,
3290x00000ccd,0x00000b24,0x00000ce5,0x00000cd9, 3300x00000cc7,0x00000b1c,0x00000cdf,0x00000cd3,
3300x000500b0,0x0000002f,0x00000cd8,0x0000327d, 3310x000500b0,0x0000002f,0x00000cd2,0x0000326e,
3310x00000cd2,0x000400f6,0x00000ce6,0x00000cd9, 3320x00000ccc,0x000400f6,0x00000ce0,0x00000cd3,
3320x00000000,0x000400fa,0x00000cd8,0x00000cd9, 3330x00000000,0x000400fa,0x00000cd2,0x00000cd3,
3330x00000ce6,0x000200f8,0x00000cd9,0x00050084, 3340x00000ce0,0x000200f8,0x00000cd3,0x00050084,
3340x00000006,0x00000d2b,0x0000011f,0x00000d23, 3350x00000006,0x00000d25,0x0000011f,0x00000d1d,
3350x00050080,0x00000006,0x00000d2c,0x00000107, 3360x00050080,0x00000006,0x00000d26,0x00000107,
3360x00000d2b,0x00050084,0x00000006,0x00000cdc, 3370x00000d25,0x00050084,0x00000006,0x00000cd6,
3370x0000010a,0x0000327d,0x00050080,0x00000006, 3380x0000010a,0x0000326e,0x00050080,0x00000006,
3380x00000cdd,0x00000d2c,0x00000cdc,0x00050041, 3390x00000cd7,0x00000d26,0x00000cd6,0x00050041,
3390x00000156,0x00000cde,0x000000fc,0x00000154, 3400x00000156,0x00000cd8,0x000000fc,0x00000154,
3400x0004003d,0x00000007,0x00000cdf,0x00000cde, 3410x0004003d,0x00000007,0x00000cd9,0x00000cd8,
3410x00050051,0x00000006,0x00000d43,0x00000cdf, 3420x00050051,0x00000006,0x00000d3d,0x00000cd9,
3420x00000000,0x00050095,0x000000ab,0x00000d45, 3430x00000000,0x00050095,0x000000ab,0x00000d3f,
3430x00000d43,0x00000cdd,0x00050051,0x00000006, 3440x00000d3d,0x00000cd7,0x00050051,0x00000006,
3440x00000d46,0x00000d45,0x00000001,0x00050051, 3450x00000d40,0x00000d3f,0x00000001,0x00050051,
3450x00000006,0x00000d47,0x00000d45,0x00000000, 3460x00000006,0x00000d41,0x00000d3f,0x00000000,
3460x00050051,0x00000006,0x00000d4a,0x00000cdf, 3470x00050051,0x00000006,0x00000d44,0x00000cd9,
3470x00000001,0x00050080,0x00000006,0x00000d4c, 3480x00000001,0x00050080,0x00000006,0x00000d46,
3480x00000d4a,0x00000d46,0x00050050,0x00000007, 3490x00000d44,0x00000d40,0x00050050,0x00000007,
3490x00000d4d,0x00000d47,0x00000d4c,0x0004007c, 3500x00000d47,0x00000d41,0x00000d46,0x0004007c,
3500x00000014,0x00000d3d,0x00000d4d,0x00060041, 3510x00000014,0x00000d37,0x00000d47,0x00060041,
3510x000000db,0x00000d34,0x00000d3d,0x000000da, 3520x000000db,0x00000d2e,0x00000d37,0x000000da,
3520x000000da,0x0006003d,0x00000006,0x00000d35, 3530x000000da,0x0006003d,0x00000006,0x00000d2f,
3530x00000d34,0x00000002,0x00000004,0x00050080, 3540x00000d2e,0x00000002,0x00000004,0x00050080,
3540x00000006,0x00000ce2,0x0000327e,0x00000d35, 3550x00000006,0x00000cdc,0x0000326f,0x00000d2f,
3550x00050080,0x00000006,0x00000ce5,0x0000327d, 3560x00050080,0x00000006,0x00000cdf,0x0000326e,
3560x00000154,0x000200f9,0x00000cd4,0x000200f8, 3570x00000154,0x000200f9,0x00000cce,0x000200f8,
3570x00000ce6,0x00050041,0x000006c2,0x00000ce9, 3580x00000ce0,0x00050041,0x000006bd,0x00000ce3,
3580x0000080d,0x00000b28,0x0003003e,0x00000ce9, 3590x00000808,0x00000b20,0x0003003e,0x00000ce3,
3590x0000327e,0x000400e0,0x00000170,0x00000170, 3600x0000326f,0x000400e0,0x00000170,0x00000170,
3600x000006da,0x000500aa,0x0000002f,0x00000ceb, 3610x000006d5,0x000500aa,0x0000002f,0x00000ce5,
3610x00000b28,0x000000a6,0x000300f7,0x00000cff, 3620x00000b20,0x000000a6,0x000300f7,0x00000cf9,
3620x00000000,0x000400fa,0x00000ceb,0x00000cec, 3630x00000000,0x000400fa,0x00000ce5,0x00000ce6,
3630x00000cff,0x000200f8,0x00000cec,0x000200f9, 3640x00000cf9,0x000200f8,0x00000ce6,0x000200f9,
3640x00000ced,0x000200f8,0x00000ced,0x000700f5, 3650x00000ce7,0x000200f8,0x00000ce7,0x000700f5,
3650x00000006,0x00003282,0x000000a6,0x00000cec, 3660x00000006,0x00003273,0x000000a6,0x00000ce6,
3660x00000cfa,0x00000cf1,0x000700f5,0x00000006, 3670x00000cf4,0x00000ceb,0x000700f5,0x00000006,
3670x0000327f,0x000000a6,0x00000cec,0x00000cfd, 3680x00003270,0x000000a6,0x00000ce6,0x00000cf7,
3680x00000cf1,0x000500b0,0x0000002f,0x00000cf0, 3690x00000ceb,0x000500b0,0x0000002f,0x00000cea,
3690x0000327f,0x00000107,0x000400f6,0x00000cfe, 3700x00003270,0x00000107,0x000400f6,0x00000cf8,
3700x00000cf1,0x00000000,0x000400fa,0x00000cf0, 3710x00000ceb,0x00000000,0x000400fa,0x00000cea,
3710x00000cf1,0x00000cfe,0x000200f8,0x00000cf1, 3720x00000ceb,0x00000cf8,0x000200f8,0x00000ceb,
3720x00050041,0x000006c2,0x00000cf3,0x0000080d, 3730x00050041,0x000006bd,0x00000ced,0x00000808,
3730x0000327f,0x0004003d,0x00000006,0x00000cf4, 3740x00003270,0x0004003d,0x00000006,0x00000cee,
3740x00000cf3,0x0003003e,0x00000cf3,0x00003282, 3750x00000ced,0x0003003e,0x00000ced,0x00003273,
3750x00050080,0x00000006,0x00000cfa,0x00003282, 3760x00050080,0x00000006,0x00000cf4,0x00003273,
3760x00000cf4,0x00050080,0x00000006,0x00000cfd, 3770x00000cee,0x00050080,0x00000006,0x00000cf7,
3770x0000327f,0x00000154,0x000200f9,0x00000ced, 3780x00003270,0x00000154,0x000200f9,0x00000ce7,
3780x000200f8,0x00000cfe,0x000200f9,0x00000cff, 3790x000200f8,0x00000cf8,0x000200f9,0x00000cf9,
3790x000200f8,0x00000cff,0x000400e0,0x00000170, 3800x000200f8,0x00000cf9,0x000400e0,0x00000170,
3800x00000170,0x000006da,0x0004003d,0x00000006, 3810x00000170,0x000006d5,0x0004003d,0x00000006,
3810x00000d02,0x00000ce9,0x000200f9,0x00000d04, 3820x00000cfc,0x00000ce3,0x000200f9,0x00000cfe,
3820x000200f8,0x00000d04,0x000700f5,0x00000006, 3830x000200f8,0x00000cfe,0x000700f5,0x00000006,
3830x00003281,0x00000d02,0x00000cff,0x00000d1b, 3840x00003272,0x00000cfc,0x00000cf9,0x00000d15,
3840x00000d09,0x000700f5,0x00000006,0x00003280, 3850x00000d03,0x000700f5,0x00000006,0x00003271,
3850x00000ccd,0x00000cff,0x00000d1e,0x00000d09, 3860x00000cc7,0x00000cf9,0x00000d18,0x00000d03,
3860x000500b0,0x0000002f,0x00000d08,0x00003280, 3870x000500b0,0x0000002f,0x00000d02,0x00003271,
3870x00000cd2,0x000400f6,0x00000d1f,0x00000d09, 3880x00000ccc,0x000400f6,0x00000d19,0x00000d03,
3880x00000000,0x000400fa,0x00000d08,0x00000d09, 3890x00000000,0x000400fa,0x00000d02,0x00000d03,
3890x00000d1f,0x000200f8,0x00000d09,0x00050084, 3900x00000d19,0x000200f8,0x00000d03,0x00050084,
3900x00000006,0x00000d52,0x0000011f,0x00000d23, 3910x00000006,0x00000d4c,0x0000011f,0x00000d1d,
3910x00050080,0x00000006,0x00000d53,0x00000107, 3920x00050080,0x00000006,0x00000d4d,0x00000107,
3920x00000d52,0x00050084,0x00000006,0x00000d0c, 3930x00000d4c,0x00050084,0x00000006,0x00000d06,
3930x0000010a,0x00003280,0x00050080,0x00000006, 3940x0000010a,0x00003271,0x00050080,0x00000006,
3940x00000d0d,0x00000d53,0x00000d0c,0x00050041, 3950x00000d07,0x00000d4d,0x00000d06,0x00050041,
3950x00000156,0x00000d0e,0x000000fc,0x00000154, 3960x00000156,0x00000d08,0x000000fc,0x00000154,
3960x0004003d,0x00000007,0x00000d0f,0x00000d0e, 3970x0004003d,0x00000007,0x00000d09,0x00000d08,
3970x00050051,0x00000006,0x00000d6a,0x00000d0f, 3980x00050051,0x00000006,0x00000d64,0x00000d09,
3980x00000000,0x00050095,0x000000ab,0x00000d6c, 3990x00000000,0x00050095,0x000000ab,0x00000d66,
3990x00000d6a,0x00000d0d,0x00050051,0x00000006, 4000x00000d64,0x00000d07,0x00050051,0x00000006,
4000x00000d6d,0x00000d6c,0x00000001,0x00050051, 4010x00000d67,0x00000d66,0x00000001,0x00050051,
4010x00000006,0x00000d6e,0x00000d6c,0x00000000, 4020x00000006,0x00000d68,0x00000d66,0x00000000,
4020x00050051,0x00000006,0x00000d71,0x00000d0f, 4030x00050051,0x00000006,0x00000d6b,0x00000d09,
4030x00000001,0x00050080,0x00000006,0x00000d73, 4040x00000001,0x00050080,0x00000006,0x00000d6d,
4040x00000d71,0x00000d6d,0x00050050,0x00000007, 4050x00000d6b,0x00000d67,0x00050050,0x00000007,
4050x00000d74,0x00000d6e,0x00000d73,0x0004007c, 4060x00000d6e,0x00000d68,0x00000d6d,0x0004007c,
4060x00000014,0x00000d64,0x00000d74,0x00060041, 4070x00000014,0x00000d5e,0x00000d6e,0x00060041,
4070x000000db,0x00000d5b,0x00000d64,0x000000da, 4080x000000db,0x00000d55,0x00000d5e,0x000000da,
4080x000000da,0x0006003d,0x00000006,0x00000d5c, 4090x000000da,0x0006003d,0x00000006,0x00000d56,
4090x00000d5b,0x00000002,0x00000004,0x0005003e, 4100x00000d55,0x00000002,0x00000004,0x0005003e,
4100x00000d5b,0x00003281,0x00000002,0x00000004, 4110x00000d55,0x00003272,0x00000002,0x00000004,
4110x00050080,0x00000006,0x00000d1b,0x00003281, 4120x00050080,0x00000006,0x00000d15,0x00003272,
4120x00000d5c,0x00050080,0x00000006,0x00000d1e, 4130x00000d56,0x00050080,0x00000006,0x00000d18,
4130x00003280,0x00000154,0x000200f9,0x00000d04, 4140x00003271,0x00000154,0x000200f9,0x00000cfe,
4140x000200f8,0x00000d1f,0x000200f9,0x00000bf3, 4150x000200f8,0x00000d19,0x000200f9,0x00000bed,
4150x000200f8,0x00000b25,0x000500aa,0x0000002f, 4160x000200f8,0x00000b1d,0x000500aa,0x0000002f,
4160x00000b2d,0x00000b13,0x0000038a,0x000300f7, 4170x00000b25,0x00000b0b,0x0000038a,0x000300f7,
4170x00000b2f,0x00000000,0x000400fa,0x00000b2d, 4180x00000b27,0x00000000,0x000400fa,0x00000b25,
4180x00000b2e,0x00000b2f,0x000200f8,0x00000b2e, 4190x00000b26,0x00000b27,0x000200f8,0x00000b26,
4190x00050041,0x00000b0f,0x00000b31,0x00000b17, 4200x00050041,0x00000b07,0x00000b29,0x00000b0f,
4200x000000a6,0x0004003d,0x00000006,0x00000b32, 4210x000000a6,0x0004003d,0x00000006,0x00000b2a,
4210x00000b31,0x00050041,0x00000b0f,0x00000b34, 4220x00000b29,0x00050041,0x00000b07,0x00000b2c,
4220x00000b18,0x000000a6,0x0004003d,0x00000006, 4230x00000b10,0x000000a6,0x0004003d,0x00000006,
4230x00000b35,0x00000b34,0x000500b0,0x0000002f, 4240x00000b2d,0x00000b2c,0x000500b0,0x0000002f,
4240x00000dbb,0x00000b35,0x0000011f,0x000300f7, 4250x00000db5,0x00000b2d,0x0000011f,0x000300f7,
4250x00000dca,0x00000000,0x000400fa,0x00000dbb, 4260x00000dc4,0x00000000,0x000400fa,0x00000db5,
4260x00000dbc,0x00000dca,0x000200f8,0x00000dbc, 4270x00000db6,0x00000dc4,0x000200f8,0x00000db6,
4270x00050041,0x000000fe,0x00000e6c,0x000000fc, 4280x00050041,0x000000fe,0x00000e66,0x000000fc,
4280x000000fd,0x0004003d,0x00000006,0x00000e6d, 4290x000000fd,0x0004003d,0x00000006,0x00000e67,
4290x00000e6c,0x00050084,0x00000006,0x00000e6e, 4300x00000e66,0x00050084,0x00000006,0x00000e68,
4300x0000011f,0x00000e6d,0x00050080,0x00000006, 4310x0000011f,0x00000e67,0x00050080,0x00000006,
4310x00000e6f,0x00000107,0x00000e6e,0x00050080, 4320x00000e69,0x00000107,0x00000e68,0x00050080,
4320x00000006,0x00000e75,0x00000e6d,0x000032a8, 4330x00000006,0x00000e6f,0x00000e67,0x00003297,
4330x00050086,0x00000006,0x00000e76,0x00000e75, 4340x00050086,0x00000006,0x00000e70,0x00000e6f,
4340x00000101,0x00050084,0x00000006,0x00000dc1, 4350x00000101,0x00050084,0x00000006,0x00000dbb,
4350x00000b35,0x00000e76,0x00050080,0x00000006, 4360x00000b2d,0x00000e70,0x00050080,0x00000006,
4360x00000dc3,0x00000dc1,0x00000b32,0x00050084, 4370x00000dbd,0x00000dbb,0x00000b2a,0x00050084,
4370x00000006,0x00000dc4,0x0000010a,0x00000dc3, 4380x00000006,0x00000dbe,0x0000010a,0x00000dbd,
4380x00050080,0x00000006,0x00000dc5,0x00000e6f, 4390x00050080,0x00000006,0x00000dbf,0x00000e69,
4390x00000dc4,0x00050041,0x00000156,0x00000dc6, 4400x00000dbe,0x00050041,0x00000156,0x00000dc0,
4400x000000fc,0x00000154,0x0004003d,0x00000007, 4410x000000fc,0x00000154,0x0004003d,0x00000007,
4410x00000dc7,0x00000dc6,0x00050051,0x00000006, 4420x00000dc1,0x00000dc0,0x00050051,0x00000006,
4420x00000e8d,0x00000dc7,0x00000000,0x00050095, 4430x00000e87,0x00000dc1,0x00000000,0x00050095,
4430x000000ab,0x00000e8f,0x00000e8d,0x00000dc5, 4440x000000ab,0x00000e89,0x00000e87,0x00000dbf,
4440x00050051,0x00000006,0x00000e90,0x00000e8f, 4450x00050051,0x00000006,0x00000e8a,0x00000e89,
4450x00000001,0x00050051,0x00000006,0x00000e91, 4460x00000001,0x00050051,0x00000006,0x00000e8b,
4460x00000e8f,0x00000000,0x00050051,0x00000006, 4470x00000e89,0x00000000,0x00050051,0x00000006,
4470x00000e94,0x00000dc7,0x00000001,0x00050080, 4480x00000e8e,0x00000dc1,0x00000001,0x00050080,
4480x00000006,0x00000e96,0x00000e94,0x00000e90, 4490x00000006,0x00000e90,0x00000e8e,0x00000e8a,
4490x00050050,0x00000007,0x00000e97,0x00000e91, 4500x00050050,0x00000007,0x00000e91,0x00000e8b,
4500x00000e96,0x0004007c,0x00000014,0x00000e87, 4510x00000e90,0x0004007c,0x00000014,0x00000e81,
4510x00000e97,0x00060041,0x000000db,0x00000e7e, 4520x00000e91,0x00060041,0x000000db,0x00000e78,
4520x00000e87,0x000000da,0x000000da,0x0006003d, 4530x00000e81,0x000000da,0x000000da,0x0006003d,
4530x00000006,0x00000e7f,0x00000e7e,0x00000002, 4540x00000006,0x00000e79,0x00000e78,0x00000002,
4540x00000004,0x00050041,0x000006c2,0x00000dc9, 4550x00000004,0x00050041,0x000006bd,0x00000dc3,
4550x00000856,0x00000b35,0x0003003e,0x00000dc9, 4560x00000851,0x00000b2d,0x0003003e,0x00000dc3,
4560x00000e7f,0x000200f9,0x00000dca,0x000200f8, 4570x00000e79,0x000200f9,0x00000dc4,0x000200f8,
4570x00000dca,0x00050084,0x00000006,0x00000dcc, 4580x00000dc4,0x00050084,0x00000006,0x00000dc6,
4580x00000b32,0x00000101,0x00050080,0x00000006, 4590x00000b2a,0x00000101,0x00050080,0x00000006,
4590x00000dce,0x00000dcc,0x00000101,0x00050041, 4600x00000dc8,0x00000dc6,0x00000101,0x00050041,
4600x000000fe,0x00000dcf,0x000000fc,0x000000fd, 4610x000000fe,0x00000dc9,0x000000fc,0x000000fd,
4610x0004003d,0x00000006,0x00000dd0,0x00000dcf, 4620x0004003d,0x00000006,0x00000dca,0x00000dc9,
4620x0007000c,0x00000006,0x00000dd1,0x00000001, 4630x0007000c,0x00000006,0x00000dcb,0x00000001,
4630x00000026,0x00000dce,0x00000dd0,0x000200f9, 4640x00000026,0x00000dc8,0x00000dca,0x000200f9,
4640x00000dd3,0x000200f8,0x00000dd3,0x000700f5, 4650x00000dcd,0x000200f8,0x00000dcd,0x000700f5,
4650x00000006,0x00003264,0x00000dcc,0x00000dca, 4660x00000006,0x00003255,0x00000dc6,0x00000dc4,
4660x00000e68,0x00000e66,0x000500b0,0x0000002f, 4670x00000e62,0x00000e60,0x000500b0,0x0000002f,
4670x00000dd7,0x00003264,0x00000dd1,0x000400f6, 4680x00000dd1,0x00003255,0x00000dcb,0x000400f6,
4680x00000e69,0x00000e66,0x00000000,0x000400fa, 4690x00000e63,0x00000e60,0x00000000,0x000400fa,
4690x00000dd7,0x00000dd8,0x00000e69,0x000200f8, 4700x00000dd1,0x00000dd2,0x00000e63,0x000200f8,
4700x00000dd8,0x00050080,0x00000006,0x00000ddb, 4710x00000dd2,0x00050080,0x00000006,0x00000dd5,
4710x00003264,0x00000b35,0x000500b0,0x0000002f, 4720x00003255,0x00000b2d,0x000500b0,0x0000002f,
4720x00000dde,0x00000ddb,0x00000dd1,0x000300f7, 4730x00000dd8,0x00000dd5,0x00000dcb,0x000300f7,
4730x00000de9,0x00000000,0x000400fa,0x00000dde, 4740x00000de3,0x00000000,0x000400fa,0x00000dd8,
4740x00000de0,0x00000de8,0x000200f8,0x00000de0, 4750x00000dda,0x00000de2,0x000200f8,0x00000dda,
4750x00050041,0x000000fe,0x00000e9b,0x000000fc, 4760x00050041,0x000000fe,0x00000e95,0x000000fc,
4760x00000308,0x0004003d,0x00000006,0x00000e9c, 4770x00000308,0x0004003d,0x00000006,0x00000e96,
4770x00000e9b,0x000500c7,0x00000006,0x00000e9d, 4780x00000e95,0x000500c7,0x00000006,0x00000e97,
4780x00000e9c,0x000000b0,0x000500aa,0x0000002f, 4790x00000e96,0x000000b0,0x000500aa,0x0000002f,
4790x00000e9e,0x00000e9d,0x000000a6,0x000300f7, 4800x00000e98,0x00000e97,0x000000a6,0x000300f7,
4800x00000ea3,0x00000000,0x000400fa,0x00000e9e, 4810x00000e9d,0x00000000,0x000400fa,0x00000e98,
4810x00000e9f,0x00000ea1,0x000200f8,0x00000e9f, 4820x00000e99,0x00000e9b,0x000200f8,0x00000e99,
4820x000200f9,0x00000ea3,0x000200f8,0x00000ea1, 4830x000200f9,0x00000e9d,0x000200f8,0x00000e9b,
4830x00050084,0x00000006,0x00000eab,0x00000111, 4840x00050084,0x00000006,0x00000ea5,0x00000111,
4840x00000dd0,0x00050080,0x00000006,0x00000eac, 4850x00000dca,0x00050080,0x00000006,0x00000ea6,
4850x00000107,0x00000eab,0x000200f9,0x00000ea3, 4860x00000107,0x00000ea5,0x000200f9,0x00000e9d,
4860x000200f8,0x00000ea3,0x000700f5,0x00000006, 4870x000200f8,0x00000e9d,0x000700f5,0x00000006,
4870x00003265,0x00000107,0x00000e9f,0x00000eac, 4880x00003256,0x00000107,0x00000e99,0x00000ea6,
4880x00000ea1,0x00050084,0x00000006,0x00000de3, 4890x00000e9b,0x00050084,0x00000006,0x00000ddd,
4890x0000010a,0x00000ddb,0x00050080,0x00000006, 4900x0000010a,0x00000dd5,0x00050080,0x00000006,
4900x00000de4,0x00003265,0x00000de3,0x00050041, 4910x00000dde,0x00003256,0x00000ddd,0x00050041,
4910x00000156,0x00000de5,0x000000fc,0x00000154, 4920x00000156,0x00000ddf,0x000000fc,0x00000154,
4920x0004003d,0x00000007,0x00000de6,0x00000de5, 4930x0004003d,0x00000007,0x00000de0,0x00000ddf,
4930x00050051,0x00000006,0x00000ec3,0x00000de6, 4940x00050051,0x00000006,0x00000ebd,0x00000de0,
4940x00000000,0x00050095,0x000000ab,0x00000ec5, 4950x00000000,0x00050095,0x000000ab,0x00000ebf,
4950x00000ec3,0x00000de4,0x00050051,0x00000006, 4960x00000ebd,0x00000dde,0x00050051,0x00000006,
4960x00000ec6,0x00000ec5,0x00000001,0x00050051, 4970x00000ec0,0x00000ebf,0x00000001,0x00050051,
4970x00000006,0x00000ec7,0x00000ec5,0x00000000, 4980x00000006,0x00000ec1,0x00000ebf,0x00000000,
4980x00050051,0x00000006,0x00000eca,0x00000de6, 4990x00050051,0x00000006,0x00000ec4,0x00000de0,
4990x00000001,0x00050080,0x00000006,0x00000ecc, 5000x00000001,0x00050080,0x00000006,0x00000ec6,
5000x00000eca,0x00000ec6,0x00050050,0x00000007, 5010x00000ec4,0x00000ec0,0x00050050,0x00000007,
5010x00000ecd,0x00000ec7,0x00000ecc,0x0004007c, 5020x00000ec7,0x00000ec1,0x00000ec6,0x0004007c,
5020x00000014,0x00000ebd,0x00000ecd,0x00060041, 5030x00000014,0x00000eb7,0x00000ec7,0x00060041,
5030x000000db,0x00000eb4,0x00000ebd,0x000000da, 5040x000000db,0x00000eae,0x00000eb7,0x000000da,
5040x000000da,0x0006003d,0x00000006,0x00000eb5, 5050x000000da,0x0006003d,0x00000006,0x00000eaf,
5050x00000eb4,0x00000002,0x00000004,0x000200f9, 5060x00000eae,0x00000002,0x00000004,0x000200f9,
5060x00000de9,0x000200f8,0x00000de8,0x000200f9, 5070x00000de3,0x000200f8,0x00000de2,0x000200f9,
5070x00000de9,0x000200f8,0x00000de9,0x000700f5, 5080x00000de3,0x000200f8,0x00000de3,0x000700f5,
5080x00000006,0x00003266,0x00000eb5,0x00000ea3, 5090x00000006,0x00003257,0x00000eaf,0x00000e9d,
5090x000000a6,0x00000de8,0x000300f7,0x00000df5, 5100x000000a6,0x00000de2,0x000300f7,0x00000def,
5100x00000000,0x000400fa,0x00000dde,0x00000dec, 5110x00000000,0x000400fa,0x00000dd8,0x00000de6,
5110x00000df4,0x000200f8,0x00000dec,0x00050041, 5120x00000dee,0x000200f8,0x00000de6,0x00050041,
5120x000000fe,0x00000ed1,0x000000fc,0x00000308, 5130x000000fe,0x00000ecb,0x000000fc,0x00000308,
5130x0004003d,0x00000006,0x00000ed2,0x00000ed1, 5140x0004003d,0x00000006,0x00000ecc,0x00000ecb,
5140x000500c7,0x00000006,0x00000ed3,0x00000ed2, 5150x000500c7,0x00000006,0x00000ecd,0x00000ecc,
5150x000000b0,0x000500aa,0x0000002f,0x00000ed4, 5160x000000b0,0x000500aa,0x0000002f,0x00000ece,
5160x00000ed3,0x000000a6,0x000300f7,0x00000ed9, 5170x00000ecd,0x000000a6,0x000300f7,0x00000ed3,
5170x00000000,0x000400fa,0x00000ed4,0x00000ed5, 5180x00000000,0x000400fa,0x00000ece,0x00000ecf,
5180x00000ed7,0x000200f8,0x00000ed5,0x00050084, 5190x00000ed1,0x000200f8,0x00000ecf,0x00050084,
5190x00000006,0x00000edf,0x0000010a,0x00000dd0, 5200x00000006,0x00000ed9,0x0000010a,0x00000dca,
5200x00050080,0x00000006,0x00000ee0,0x00000107, 5210x00050080,0x00000006,0x00000eda,0x00000107,
5210x00000edf,0x000200f9,0x00000ed9,0x000200f8, 5220x00000ed9,0x000200f9,0x00000ed3,0x000200f8,
5220x00000ed7,0x00050084,0x00000006,0x00000ee5, 5230x00000ed1,0x00050084,0x00000006,0x00000edf,
5230x00000118,0x00000dd0,0x00050080,0x00000006, 5240x00000118,0x00000dca,0x00050080,0x00000006,
5240x00000ee6,0x00000107,0x00000ee5,0x000200f9, 5250x00000ee0,0x00000107,0x00000edf,0x000200f9,
5250x00000ed9,0x000200f8,0x00000ed9,0x000700f5, 5260x00000ed3,0x000200f8,0x00000ed3,0x000700f5,
5260x00000006,0x00003267,0x00000ee0,0x00000ed5, 5270x00000006,0x00003258,0x00000eda,0x00000ecf,
5270x00000ee6,0x00000ed7,0x00050084,0x00000006, 5280x00000ee0,0x00000ed1,0x00050084,0x00000006,
5280x00000def,0x0000010a,0x00000ddb,0x00050080, 5290x00000de9,0x0000010a,0x00000dd5,0x00050080,
5290x00000006,0x00000df0,0x00003267,0x00000def, 5300x00000006,0x00000dea,0x00003258,0x00000de9,
5300x00050041,0x00000156,0x00000df1,0x000000fc, 5310x00050041,0x00000156,0x00000deb,0x000000fc,
5310x00000154,0x0004003d,0x00000007,0x00000df2, 5320x00000154,0x0004003d,0x00000007,0x00000dec,
5320x00000df1,0x00050051,0x00000006,0x00000efd, 5330x00000deb,0x00050051,0x00000006,0x00000ef7,
5330x00000df2,0x00000000,0x00050095,0x000000ab, 5340x00000dec,0x00000000,0x00050095,0x000000ab,
5340x00000eff,0x00000efd,0x00000df0,0x00050051, 5350x00000ef9,0x00000ef7,0x00000dea,0x00050051,
5350x00000006,0x00000f00,0x00000eff,0x00000001, 5360x00000006,0x00000efa,0x00000ef9,0x00000001,
5360x00050051,0x00000006,0x00000f01,0x00000eff, 5370x00050051,0x00000006,0x00000efb,0x00000ef9,
5370x00000000,0x00050051,0x00000006,0x00000f04, 5380x00000000,0x00050051,0x00000006,0x00000efe,
5380x00000df2,0x00000001,0x00050080,0x00000006, 5390x00000dec,0x00000001,0x00050080,0x00000006,
5390x00000f06,0x00000f04,0x00000f00,0x00050050, 5400x00000f00,0x00000efe,0x00000efa,0x00050050,
5400x00000007,0x00000f07,0x00000f01,0x00000f06, 5410x00000007,0x00000f01,0x00000efb,0x00000f00,
5410x0004007c,0x00000014,0x00000ef7,0x00000f07, 5420x0004007c,0x00000014,0x00000ef1,0x00000f01,
5420x00060041,0x000000db,0x00000eee,0x00000ef7, 5430x00060041,0x000000db,0x00000ee8,0x00000ef1,
5430x000000da,0x000000da,0x0006003d,0x00000006, 5440x000000da,0x000000da,0x0006003d,0x00000006,
5440x00000eef,0x00000eee,0x00000002,0x00000004, 5450x00000ee9,0x00000ee8,0x00000002,0x00000004,
5450x000200f9,0x00000df5,0x000200f8,0x00000df4, 5460x000200f9,0x00000def,0x000200f8,0x00000dee,
5460x000200f9,0x00000df5,0x000200f8,0x00000df5, 5470x000200f9,0x00000def,0x000200f8,0x00000def,
5470x000700f5,0x00000006,0x00003268,0x00000eef, 5480x000700f5,0x00000006,0x00003259,0x00000ee9,
5480x00000ed9,0x000000a6,0x00000df4,0x00050041, 5490x00000ed3,0x000000a6,0x00000dee,0x00050041,
5490x000000fe,0x00000f0b,0x000000fc,0x00000308, 5500x000000fe,0x00000f05,0x000000fc,0x00000308,
5500x0004003d,0x00000006,0x00000f0c,0x00000f0b, 5510x0004003d,0x00000006,0x00000f06,0x00000f05,
5510x00050084,0x00000006,0x00000f0d,0x0000010a, 5520x00050084,0x00000006,0x00000f07,0x0000010a,
5520x00000f0c,0x000500c2,0x00000006,0x00000f0e, 5530x00000f06,0x000500c2,0x00000006,0x00000f08,
5530x00003266,0x00000f0d,0x000500c7,0x00000006, 5540x00003257,0x00000f07,0x000500c7,0x00000006,
5540x00000f0f,0x00000f0e,0x00000799,0x000200f9, 5550x00000f09,0x00000f08,0x00000794,0x000200f9,
5550x00000df9,0x000200f8,0x00000df9,0x000700f5, 5560x00000df3,0x000200f8,0x00000df3,0x000700f5,
5560x00000006,0x00003269,0x000000a6,0x00000df5, 5570x00000006,0x0000325a,0x000000a6,0x00000def,
5570x00000e09,0x00000dfd,0x000500b0,0x0000002f, 5580x00000e03,0x00000df7,0x000500b0,0x0000002f,
5580x00000dfc,0x00003269,0x0000011f,0x000400f6, 5590x00000df6,0x0000325a,0x0000011f,0x000400f6,
5590x00000e0a,0x00000dfd,0x00000000,0x000400fa, 5600x00000e04,0x00000df7,0x00000000,0x000400fa,
5600x00000dfc,0x00000dfd,0x00000e0a,0x000200f8, 5610x00000df6,0x00000df7,0x00000e04,0x000200f8,
5610x00000dfd,0x000500aa,0x0000002f,0x00000e03, 5620x00000df7,0x000500aa,0x0000002f,0x00000dfd,
5620x00003269,0x00000f0f,0x000500a7,0x0000002f, 5630x0000325a,0x00000f09,0x000500a7,0x0000002f,
5630x00000e04,0x00000dde,0x00000e03,0x000600a9, 5640x00000dfe,0x00000dd8,0x00000dfd,0x000600a9,
5640x00000006,0x00000e05,0x00000e04,0x000000b0, 5650x00000006,0x00000dff,0x00000dfe,0x000000b0,
5650x000000a6,0x00060041,0x000006c2,0x00000e06, 5660x000000a6,0x00060041,0x000006bd,0x00000e00,
5660x000008af,0x00003269,0x00000b35,0x0003003e, 5670x000008aa,0x0000325a,0x00000b2d,0x0003003e,
5670x00000e06,0x00000e05,0x00050080,0x00000006, 5680x00000e00,0x00000dff,0x00050080,0x00000006,
5680x00000e09,0x00003269,0x00000154,0x000200f9, 5690x00000e03,0x0000325a,0x00000154,0x000200f9,
5690x00000df9,0x000200f8,0x00000e0a,0x000400e0, 5700x00000df3,0x000200f8,0x00000e04,0x000400e0,
5700x00000170,0x00000170,0x000006da,0x000200f9, 5710x00000170,0x00000170,0x000006d5,0x000200f9,
5710x00000e0b,0x000200f8,0x00000e0b,0x000700f5, 5720x00000e05,0x000200f8,0x00000e05,0x000700f5,
5720x00000006,0x0000326a,0x000000b0,0x00000e0a, 5730x00000006,0x0000325b,0x000000b0,0x00000e04,
5730x00000e3c,0x00000e3a,0x000500b0,0x0000002f, 5740x00000e36,0x00000e34,0x000500b0,0x0000002f,
5740x00000e0e,0x0000326a,0x00000107,0x000400f6, 5750x00000e08,0x0000325b,0x00000107,0x000400f6,
5750x00000e3d,0x00000e3a,0x00000000,0x000400fa, 5760x00000e37,0x00000e34,0x00000000,0x000400fa,
5760x00000e0e,0x00000e0f,0x00000e3d,0x000200f8, 5770x00000e08,0x00000e09,0x00000e37,0x000200f8,
5770x00000e0f,0x000200f9,0x00000e10,0x000200f8, 5780x00000e09,0x000200f9,0x00000e0a,0x000200f8,
5780x00000e10,0x000700f5,0x00000006,0x00003277, 5790x00000e0a,0x000700f5,0x00000006,0x00003268,
5790x000000a6,0x00000e0f,0x00000e26,0x00000e24, 5800x000000a6,0x00000e09,0x00000e20,0x00000e1e,
5800x000500b0,0x0000002f,0x00000e13,0x00003277, 5810x000500b0,0x0000002f,0x00000e0d,0x00003268,
5810x0000011f,0x000400f6,0x00000e27,0x00000e24, 5820x0000011f,0x000400f6,0x00000e21,0x00000e1e,
5820x00000000,0x000400fa,0x00000e13,0x00000e14, 5830x00000000,0x000400fa,0x00000e0d,0x00000e0e,
5830x00000e27,0x000200f8,0x00000e14,0x000500ae, 5840x00000e21,0x000200f8,0x00000e0e,0x000500ae,
5840x0000002f,0x00000e18,0x00000b35,0x0000326a, 5850x0000002f,0x00000e12,0x00000b2d,0x0000325b,
5850x000300f7,0x00000e21,0x00000000,0x000400fa, 5860x000300f7,0x00000e1b,0x00000000,0x000400fa,
5860x00000e18,0x00000e19,0x00000e20,0x000200f8, 5870x00000e12,0x00000e13,0x00000e1a,0x000200f8,
5870x00000e19,0x00050082,0x00000006,0x00000e1d, 5880x00000e13,0x00050082,0x00000006,0x00000e17,
5880x00000b35,0x0000326a,0x00060041,0x000006c2, 5890x00000b2d,0x0000325b,0x00060041,0x000006bd,
5890x00000e1e,0x000008af,0x00003277,0x00000e1d, 5900x00000e18,0x000008aa,0x00003268,0x00000e17,
5900x0004003d,0x00000006,0x00000e1f,0x00000e1e, 5910x0004003d,0x00000006,0x00000e19,0x00000e18,
5910x000200f9,0x00000e21,0x000200f8,0x00000e20, 5920x000200f9,0x00000e1b,0x000200f8,0x00000e1a,
5920x000200f9,0x00000e21,0x000200f8,0x00000e21, 5930x000200f9,0x00000e1b,0x000200f8,0x00000e1b,
5930x000700f5,0x00000006,0x0000327b,0x00000e1f, 5940x000700f5,0x00000006,0x0000326c,0x00000e19,
5940x00000e19,0x000000a6,0x00000e20,0x00050041, 5950x00000e13,0x000000a6,0x00000e1a,0x00050041,
5950x00000009,0x00000e23,0x00000daf,0x00003277, 5960x00000009,0x00000e1d,0x00000da9,0x00003268,
5960x0003003e,0x00000e23,0x0000327b,0x000200f9, 5970x0003003e,0x00000e1d,0x0000326c,0x000200f9,
5970x00000e24,0x000200f8,0x00000e24,0x00050080, 5980x00000e1e,0x000200f8,0x00000e1e,0x00050080,
5980x00000006,0x00000e26,0x00003277,0x00000154, 5990x00000006,0x00000e20,0x00003268,0x00000154,
5990x000200f9,0x00000e10,0x000200f8,0x00000e27, 6000x000200f9,0x00000e0a,0x000200f8,0x00000e21,
6000x000400e0,0x00000170,0x00000170,0x000006da, 6010x000400e0,0x00000170,0x00000170,0x000006d5,
6010x000200f9,0x00000e28,0x000200f8,0x00000e28, 6020x000200f9,0x00000e22,0x000200f8,0x00000e22,
6020x000700f5,0x00000006,0x00003278,0x000000a6, 6030x000700f5,0x00000006,0x00003269,0x000000a6,
6030x00000e27,0x00000e38,0x00000e2c,0x000500b0, 6040x00000e21,0x00000e32,0x00000e26,0x000500b0,
6040x0000002f,0x00000e2b,0x00003278,0x0000011f, 6050x0000002f,0x00000e25,0x00003269,0x0000011f,
6050x000400f6,0x00000e39,0x00000e2c,0x00000000, 6060x000400f6,0x00000e33,0x00000e26,0x00000000,
6060x000400fa,0x00000e2b,0x00000e2c,0x00000e39, 6070x000400fa,0x00000e25,0x00000e26,0x00000e33,
6070x000200f8,0x00000e2c,0x00050041,0x00000009, 6080x000200f8,0x00000e26,0x00050041,0x00000009,
6080x00000e30,0x00000daf,0x00003278,0x0004003d, 6090x00000e2a,0x00000da9,0x00003269,0x0004003d,
6090x00000006,0x00000e31,0x00000e30,0x00060041, 6100x00000006,0x00000e2b,0x00000e2a,0x00060041,
6100x000006c2,0x00000e32,0x000008af,0x00003278, 6110x000006bd,0x00000e2c,0x000008aa,0x00003269,
6110x00000b35,0x0004003d,0x00000006,0x00000e33, 6120x00000b2d,0x0004003d,0x00000006,0x00000e2d,
6120x00000e32,0x00050080,0x00000006,0x00000e34, 6130x00000e2c,0x00050080,0x00000006,0x00000e2e,
6130x00000e33,0x00000e31,0x0003003e,0x00000e32, 6140x00000e2d,0x00000e2b,0x0003003e,0x00000e2c,
6140x00000e34,0x00050080,0x00000006,0x00000e38, 6150x00000e2e,0x00050080,0x00000006,0x00000e32,
6150x00003278,0x00000154,0x000200f9,0x00000e28, 6160x00003269,0x00000154,0x000200f9,0x00000e22,
6160x000200f8,0x00000e39,0x000400e0,0x00000170, 6170x000200f8,0x00000e33,0x000400e0,0x00000170,
6170x00000170,0x000006da,0x000200f9,0x00000e3a, 6180x00000170,0x000006d5,0x000200f9,0x00000e34,
6180x000200f8,0x00000e3a,0x000500c4,0x00000006, 6190x000200f8,0x00000e34,0x000500c4,0x00000006,
6190x00000e3c,0x0000326a,0x00000154,0x000200f9, 6200x00000e36,0x0000325b,0x00000154,0x000200f9,
6200x00000e0b,0x000200f8,0x00000e3d,0x000300f7, 6210x00000e05,0x000200f8,0x00000e37,0x000300f7,
6210x00000e59,0x00000000,0x000400fa,0x00000dde, 6220x00000e53,0x00000000,0x000400fa,0x00000dd8,
6220x00000e3f,0x00000e59,0x000200f8,0x00000e3f, 6230x00000e39,0x00000e53,0x000200f8,0x00000e39,
6230x00050041,0x000006c2,0x00000e41,0x00000856, 6240x00050041,0x000006bd,0x00000e3b,0x00000851,
6240x00000f0f,0x0004003d,0x00000006,0x00000e42, 6250x00000f09,0x0004003d,0x00000006,0x00000e3c,
6250x00000e41,0x00060041,0x000006c2,0x00000e45, 6260x00000e3b,0x00060041,0x000006bd,0x00000e3f,
6260x000008af,0x00000f0f,0x00000b35,0x0004003d, 6270x000008aa,0x00000f09,0x00000b2d,0x0004003d,
6270x00000006,0x00000e46,0x00000e45,0x00050080, 6280x00000006,0x00000e40,0x00000e3f,0x00050080,
6280x00000006,0x00000e47,0x00000e42,0x00000e46, 6290x00000006,0x00000e41,0x00000e3c,0x00000e40,
6290x00050082,0x00000006,0x00000e48,0x00000e47, 6300x00050082,0x00000006,0x00000e42,0x00000e41,
6300x000000b0,0x000500c7,0x00000006,0x00000f15, 6310x000000b0,0x000500c7,0x00000006,0x00000f0f,
6310x00000f0c,0x000000b0,0x000500aa,0x0000002f, 6320x00000f06,0x000000b0,0x000500aa,0x0000002f,
6320x00000f16,0x00000f15,0x000000a6,0x000300f7, 6330x00000f10,0x00000f0f,0x000000a6,0x000300f7,
6330x00000f1b,0x00000000,0x000400fa,0x00000f16, 6340x00000f15,0x00000000,0x000400fa,0x00000f10,
6340x00000f17,0x00000f19,0x000200f8,0x00000f17, 6350x00000f11,0x00000f13,0x000200f8,0x00000f11,
6350x00050084,0x00000006,0x00000f21,0x00000111, 6360x00050084,0x00000006,0x00000f1b,0x00000111,
6360x00000dd0,0x00050080,0x00000006,0x00000f22, 6370x00000dca,0x00050080,0x00000006,0x00000f1c,
6370x00000107,0x00000f21,0x000200f9,0x00000f1b, 6380x00000107,0x00000f1b,0x000200f9,0x00000f15,
6380x000200f8,0x00000f19,0x000200f9,0x00000f1b, 6390x000200f8,0x00000f13,0x000200f9,0x00000f15,
6390x000200f8,0x00000f1b,0x000700f5,0x00000006, 6400x000200f8,0x00000f15,0x000700f5,0x00000006,
6400x0000326b,0x00000f22,0x00000f17,0x00000107, 6410x0000325c,0x00000f1c,0x00000f11,0x00000107,
6410x00000f19,0x00050084,0x00000006,0x00000e4b, 6420x00000f13,0x00050084,0x00000006,0x00000e45,
6420x0000010a,0x00000e48,0x00050080,0x00000006, 6430x0000010a,0x00000e42,0x00050080,0x00000006,
6430x00000e4c,0x0000326b,0x00000e4b,0x00050041, 6440x00000e46,0x0000325c,0x00000e45,0x00050041,
6440x00000156,0x00000e4d,0x000000fc,0x00000154, 6450x00000156,0x00000e47,0x000000fc,0x00000154,
6450x0004003d,0x00000007,0x00000e4e,0x00000e4d, 6460x0004003d,0x00000007,0x00000e48,0x00000e47,
6460x00050051,0x00000006,0x00000f3a,0x00000e4e, 6470x00050051,0x00000006,0x00000f34,0x00000e48,
6470x00000000,0x00050095,0x000000ab,0x00000f3c, 6480x00000000,0x00050095,0x000000ab,0x00000f36,
6480x00000f3a,0x00000e4c,0x00050051,0x00000006, 6490x00000f34,0x00000e46,0x00050051,0x00000006,
6490x00000f3d,0x00000f3c,0x00000001,0x00050051, 6500x00000f37,0x00000f36,0x00000001,0x00050051,
6500x00000006,0x00000f3e,0x00000f3c,0x00000000, 6510x00000006,0x00000f38,0x00000f36,0x00000000,
6510x00050051,0x00000006,0x00000f41,0x00000e4e, 6520x00050051,0x00000006,0x00000f3b,0x00000e48,
6520x00000001,0x00050080,0x00000006,0x00000f43, 6530x00000001,0x00050080,0x00000006,0x00000f3d,
6530x00000f41,0x00000f3d,0x00050050,0x00000007, 6540x00000f3b,0x00000f37,0x00050050,0x00000007,
6540x00000f44,0x00000f3e,0x00000f43,0x0004007c, 6550x00000f3e,0x00000f38,0x00000f3d,0x0004007c,
6550x00000014,0x00000f34,0x00000f44,0x00060041, 6560x00000014,0x00000f2e,0x00000f3e,0x00060041,
6560x000000db,0x00000f2c,0x00000f34,0x000000da, 6570x000000db,0x00000f26,0x00000f2e,0x000000da,
6570x000000da,0x0005003e,0x00000f2c,0x00003266, 6580x000000da,0x0005003e,0x00000f26,0x00003257,
6580x00000002,0x00000004,0x000300f7,0x00000f50, 6590x00000002,0x00000004,0x000300f7,0x00000f4a,
6590x00000000,0x000400fa,0x00000f16,0x00000f4c, 6600x00000000,0x000400fa,0x00000f10,0x00000f46,
6600x00000f4e,0x000200f8,0x00000f4c,0x00050084, 6610x00000f48,0x000200f8,0x00000f46,0x00050084,
6610x00000006,0x00000f56,0x00000118,0x00000dd0, 6620x00000006,0x00000f50,0x00000118,0x00000dca,
6620x00050080,0x00000006,0x00000f57,0x00000107, 6630x00050080,0x00000006,0x00000f51,0x00000107,
6630x00000f56,0x000200f9,0x00000f50,0x000200f8, 6640x00000f50,0x000200f9,0x00000f4a,0x000200f8,
6640x00000f4e,0x00050084,0x00000006,0x00000f5c, 6650x00000f48,0x00050084,0x00000006,0x00000f56,
6650x0000010a,0x00000dd0,0x00050080,0x00000006, 6660x0000010a,0x00000dca,0x00050080,0x00000006,
6660x00000f5d,0x00000107,0x00000f5c,0x000200f9, 6670x00000f57,0x00000107,0x00000f56,0x000200f9,
6670x00000f50,0x000200f8,0x00000f50,0x000700f5, 6680x00000f4a,0x000200f8,0x00000f4a,0x000700f5,
6680x00000006,0x0000326c,0x00000f57,0x00000f4c, 6690x00000006,0x0000325d,0x00000f51,0x00000f46,
6690x00000f5d,0x00000f4e,0x00050080,0x00000006, 6700x00000f57,0x00000f48,0x00050080,0x00000006,
6700x00000e54,0x0000326c,0x00000e4b,0x00050095, 6710x00000e4e,0x0000325d,0x00000e45,0x00050095,
6710x000000ab,0x00000f75,0x00000f3a,0x00000e54, 6720x000000ab,0x00000f6f,0x00000f34,0x00000e4e,
6720x00050051,0x00000006,0x00000f76,0x00000f75, 6730x00050051,0x00000006,0x00000f70,0x00000f6f,
6730x00000001,0x00050051,0x00000006,0x00000f77, 6740x00000001,0x00050051,0x00000006,0x00000f71,
6740x00000f75,0x00000000,0x00050080,0x00000006, 6750x00000f6f,0x00000000,0x00050080,0x00000006,
6750x00000f7c,0x00000f41,0x00000f76,0x00050050, 6760x00000f76,0x00000f3b,0x00000f70,0x00050050,
6760x00000007,0x00000f7d,0x00000f77,0x00000f7c, 6770x00000007,0x00000f77,0x00000f71,0x00000f76,
6770x0004007c,0x00000014,0x00000f6d,0x00000f7d, 6780x0004007c,0x00000014,0x00000f67,0x00000f77,
6780x00060041,0x000000db,0x00000f65,0x00000f6d, 6790x00060041,0x000000db,0x00000f5f,0x00000f67,
6790x000000da,0x000000da,0x0005003e,0x00000f65, 6800x000000da,0x000000da,0x0005003e,0x00000f5f,
6800x00003268,0x00000002,0x00000004,0x000200f9, 6810x00003259,0x00000002,0x00000004,0x000200f9,
6810x00000e59,0x000200f8,0x00000e59,0x000400e0, 6820x00000e53,0x000200f8,0x00000e53,0x000400e0,
6820x00000170,0x00000170,0x000006da,0x000300f7, 6830x00000170,0x00000170,0x000006d5,0x000300f7,
6830x00000e65,0x00000000,0x000400fa,0x00000dbb, 6840x00000e5f,0x00000000,0x000400fa,0x00000db5,
6840x00000e5c,0x00000e65,0x000200f8,0x00000e5c, 6850x00000e56,0x00000e5f,0x000200f8,0x00000e56,
6850x00060041,0x000006c2,0x00000e5f,0x000008af, 6860x00060041,0x000006bd,0x00000e59,0x000008aa,
6860x00000b35,0x0000091d,0x0004003d,0x00000006, 6870x00000b2d,0x00000918,0x0004003d,0x00000006,
6870x00000e60,0x00000e5f,0x00050041,0x000006c2, 6880x00000e5a,0x00000e59,0x00050041,0x000006bd,
6880x00000e61,0x00000856,0x00000b35,0x0004003d, 6890x00000e5b,0x00000851,0x00000b2d,0x0004003d,
6890x00000006,0x00000e62,0x00000e61,0x00050080, 6900x00000006,0x00000e5c,0x00000e5b,0x00050080,
6900x00000006,0x00000e63,0x00000e62,0x00000e60, 6910x00000006,0x00000e5d,0x00000e5c,0x00000e5a,
6910x0003003e,0x00000e61,0x00000e63,0x000200f9, 6920x0003003e,0x00000e5b,0x00000e5d,0x000200f9,
6920x00000e65,0x000200f8,0x00000e65,0x000400e0, 6930x00000e5f,0x000200f8,0x00000e5f,0x000400e0,
6930x00000170,0x00000170,0x000006da,0x000200f9, 6940x00000170,0x00000170,0x000006d5,0x000200f9,
6940x00000e66,0x000200f8,0x00000e66,0x00050080, 6950x00000e60,0x000200f8,0x00000e60,0x00050080,
6950x00000006,0x00000e68,0x00003264,0x00000107, 6960x00000006,0x00000e62,0x00003255,0x00000107,
6960x000200f9,0x00000dd3,0x000200f8,0x00000e69, 6970x000200f9,0x00000dcd,0x000200f8,0x00000e63,
6970x000200f9,0x00000bf3,0x000200f8,0x00000b2f, 6980x000200f9,0x00000bed,0x000200f8,0x00000b27,
6980x000500aa,0x0000002f,0x00000b3b,0x00000b13, 6990x000500aa,0x0000002f,0x00000b33,0x00000b0b,
6990x00000b3a,0x000300f7,0x00000b3d,0x00000000, 7000x00000b32,0x000300f7,0x00000b35,0x00000000,
7000x000400fa,0x00000b3b,0x00000b3c,0x00000b3d, 7010x000400fa,0x00000b33,0x00000b34,0x00000b35,
7010x000200f8,0x00000b3c,0x00050041,0x00000b0f, 7020x000200f8,0x00000b34,0x00050041,0x00000b07,
7020x00000b3f,0x00000b18,0x000000a6,0x0004003d, 7030x00000b37,0x00000b10,0x000000a6,0x0004003d,
7030x00000006,0x00000b40,0x00000b3f,0x00050041, 7040x00000006,0x00000b38,0x00000b37,0x00050041,
7040x000000fe,0x00000f98,0x000000fc,0x000000fd, 7050x000000fe,0x00000f92,0x000000fc,0x000000fd,
7050x0004003d,0x00000006,0x00000f99,0x00000f98, 7060x0004003d,0x00000006,0x00000f93,0x00000f92,
7060x000200f9,0x00000f9a,0x000200f8,0x00000f9a, 7070x000200f9,0x00000f94,0x000200f8,0x00000f94,
7070x000700f5,0x00000006,0x0000324f,0x000000b0, 7080x000700f5,0x00000006,0x00003240,0x000000b0,
7080x00000b3c,0x00000fa1,0x00000f9f,0x000500b0, 7090x00000b34,0x00000f9b,0x00000f99,0x000500b0,
7090x0000002f,0x00000f9e,0x0000324f,0x00000f99, 7100x0000002f,0x00000f98,0x00003240,0x00000f93,
7100x000400f6,0x00000fa3,0x00000f9f,0x00000000, 7110x000400f6,0x00000f9d,0x00000f99,0x00000000,
7110x000400fa,0x00000f9e,0x00000f9f,0x00000fa3, 7120x000400fa,0x00000f98,0x00000f99,0x00000f9d,
7120x000200f8,0x00000f9f,0x000500c4,0x00000006, 7130x000200f8,0x00000f99,0x000500c4,0x00000006,
7130x00000fa1,0x0000324f,0x00000154,0x000200f9, 7140x00000f9b,0x00003240,0x00000154,0x000200f9,
7140x00000f9a,0x000200f8,0x00000fa3,0x000200f9, 7150x00000f94,0x000200f8,0x00000f9d,0x000200f9,
7150x00000fa5,0x000200f8,0x00000fa5,0x000700f5, 7160x00000f9f,0x000200f8,0x00000f9f,0x000700f5,
7160x00000006,0x00003250,0x00000b40,0x00000fa3, 7170x00000006,0x00003241,0x00000b38,0x00000f9d,
7170x00000fcd,0x00000fcb,0x000500b0,0x0000002f, 7180x00000fc7,0x00000fc5,0x000500b0,0x0000002f,
7180x00000fa9,0x00003250,0x0000324f,0x000400f6, 7190x00000fa3,0x00003241,0x00003240,0x000400f6,
7190x00000fce,0x00000fcb,0x00000000,0x000400fa, 7200x00000fc8,0x00000fc5,0x00000000,0x000400fa,
7200x00000fa9,0x00000faa,0x00000fce,0x000200f8, 7210x00000fa3,0x00000fa4,0x00000fc8,0x000200f8,
7210x00000faa,0x000500b0,0x0000002f,0x00000fae, 7220x00000fa4,0x000500b0,0x0000002f,0x00000fa8,
7220x00003250,0x00000f99,0x000300f7,0x00000fb8, 7230x00003241,0x00000f93,0x000300f7,0x00000fb2,
7230x00000000,0x000400fa,0x00000fae,0x00000faf, 7240x00000000,0x000400fa,0x00000fa8,0x00000fa9,
7240x00000fb7,0x000200f8,0x00000faf,0x00050084, 7250x00000fb1,0x000200f8,0x00000fa9,0x00050084,
7250x00000006,0x00000fb2,0x0000010a,0x00003250, 7260x00000006,0x00000fac,0x0000010a,0x00003241,
7260x00050080,0x00000006,0x00000fb3,0x00000107, 7270x00050080,0x00000006,0x00000fad,0x00000107,
7270x00000fb2,0x00050041,0x00000156,0x00000fb4, 7280x00000fac,0x00050041,0x00000156,0x00000fae,
7280x000000fc,0x00000154,0x0004003d,0x00000007, 7290x000000fc,0x00000154,0x0004003d,0x00000007,
7290x00000fb5,0x00000fb4,0x00050051,0x00000006, 7300x00000faf,0x00000fae,0x00050051,0x00000006,
7300x0000105c,0x00000fb5,0x00000000,0x00050095, 7310x00001056,0x00000faf,0x00000000,0x00050095,
7310x000000ab,0x0000105e,0x0000105c,0x00000fb3, 7320x000000ab,0x00001058,0x00001056,0x00000fad,
7320x00050051,0x00000006,0x0000105f,0x0000105e, 7330x00050051,0x00000006,0x00001059,0x00001058,
7330x00000001,0x00050051,0x00000006,0x00001060, 7340x00000001,0x00050051,0x00000006,0x0000105a,
7340x0000105e,0x00000000,0x00050051,0x00000006, 7350x00001058,0x00000000,0x00050051,0x00000006,
7350x00001063,0x00000fb5,0x00000001,0x00050080, 7360x0000105d,0x00000faf,0x00000001,0x00050080,
7360x00000006,0x00001065,0x00001063,0x0000105f, 7370x00000006,0x0000105f,0x0000105d,0x00001059,
7370x00050050,0x00000007,0x00001066,0x00001060, 7380x00050050,0x00000007,0x00001060,0x0000105a,
7380x00001065,0x0004007c,0x00000014,0x00001056, 7390x0000105f,0x0004007c,0x00000014,0x00001050,
7390x00001066,0x00060041,0x000000db,0x0000104d, 7400x00001060,0x00060041,0x000000db,0x00001047,
7400x00001056,0x000000da,0x000000da,0x0006003d, 7410x00001050,0x000000da,0x000000da,0x0006003d,
7410x00000006,0x0000104e,0x0000104d,0x00000002, 7420x00000006,0x00001048,0x00001047,0x00000002,
7420x00000004,0x000200f9,0x00000fb8,0x000200f8, 7430x00000004,0x000200f9,0x00000fb2,0x000200f8,
7430x00000fb7,0x000200f9,0x00000fb8,0x000200f8, 7440x00000fb1,0x000200f9,0x00000fb2,0x000200f8,
7440x00000fb8,0x000700f5,0x00000006,0x00003260, 7450x00000fb2,0x000700f5,0x00000006,0x00003251,
7450x0000104e,0x00000faf,0x00000380,0x00000fb7, 7460x00001048,0x00000fa9,0x00000380,0x00000fb1,
7460x00050041,0x000006c2,0x00000fba,0x000006af, 7470x00050041,0x000006bd,0x00000fb4,0x000006aa,
7470x00003250,0x0003003e,0x00000fba,0x00003260, 7480x00003241,0x0003003e,0x00000fb4,0x00003251,
7480x000300f7,0x00000fc8,0x00000000,0x000400fa, 7490x000300f7,0x00000fc2,0x00000000,0x000400fa,
7490x00000fae,0x00000fbf,0x00000fc7,0x000200f8, 7500x00000fa8,0x00000fb9,0x00000fc1,0x000200f8,
7500x00000fbf,0x00050084,0x00000006,0x0000106b, 7510x00000fb9,0x00050084,0x00000006,0x00001065,
7510x0000010a,0x00000f99,0x00050080,0x00000006, 7520x0000010a,0x00000f93,0x00050080,0x00000006,
7520x0000106c,0x00000107,0x0000106b,0x00050084, 7530x00001066,0x00000107,0x00001065,0x00050084,
7530x00000006,0x00000fc2,0x0000010a,0x00003250, 7540x00000006,0x00000fbc,0x0000010a,0x00003241,
7540x00050080,0x00000006,0x00000fc3,0x0000106c, 7550x00050080,0x00000006,0x00000fbd,0x00001066,
7550x00000fc2,0x00050041,0x00000156,0x00000fc4, 7560x00000fbc,0x00050041,0x00000156,0x00000fbe,
7560x000000fc,0x00000154,0x0004003d,0x00000007, 7570x000000fc,0x00000154,0x0004003d,0x00000007,
7570x00000fc5,0x00000fc4,0x00050051,0x00000006, 7580x00000fbf,0x00000fbe,0x00050051,0x00000006,
7580x00001083,0x00000fc5,0x00000000,0x00050095, 7590x0000107d,0x00000fbf,0x00000000,0x00050095,
7590x000000ab,0x00001085,0x00001083,0x00000fc3, 7600x000000ab,0x0000107f,0x0000107d,0x00000fbd,
7600x00050051,0x00000006,0x00001086,0x00001085, 7610x00050051,0x00000006,0x00001080,0x0000107f,
7610x00000001,0x00050051,0x00000006,0x00001087, 7620x00000001,0x00050051,0x00000006,0x00001081,
7620x00001085,0x00000000,0x00050051,0x00000006, 7630x0000107f,0x00000000,0x00050051,0x00000006,
7630x0000108a,0x00000fc5,0x00000001,0x00050080, 7640x00001084,0x00000fbf,0x00000001,0x00050080,
7640x00000006,0x0000108c,0x0000108a,0x00001086, 7650x00000006,0x00001086,0x00001084,0x00001080,
7650x00050050,0x00000007,0x0000108d,0x00001087, 7660x00050050,0x00000007,0x00001087,0x00001081,
7660x0000108c,0x0004007c,0x00000014,0x0000107d, 7670x00001086,0x0004007c,0x00000014,0x00001077,
7670x0000108d,0x00060041,0x000000db,0x00001074, 7680x00001087,0x00060041,0x000000db,0x0000106e,
7680x0000107d,0x000000da,0x000000da,0x0006003d, 7690x00001077,0x000000da,0x000000da,0x0006003d,
7690x00000006,0x00001075,0x00001074,0x00000002, 7700x00000006,0x0000106f,0x0000106e,0x00000002,
7700x00000004,0x000200f9,0x00000fc8,0x000200f8, 7710x00000004,0x000200f9,0x00000fc2,0x000200f8,
7710x00000fc7,0x000200f9,0x00000fc8,0x000200f8, 7720x00000fc1,0x000200f9,0x00000fc2,0x000200f8,
7720x00000fc8,0x000700f5,0x00000006,0x00003262, 7730x00000fc2,0x000700f5,0x00000006,0x00003253,
7730x00001075,0x00000fbf,0x00000380,0x00000fc7, 7740x0000106f,0x00000fb9,0x00000380,0x00000fc1,
7740x00050041,0x000006c2,0x00000fca,0x000006c4, 7750x00050041,0x000006bd,0x00000fc4,0x000006bf,
7750x00003250,0x0003003e,0x00000fca,0x00003262, 7760x00003241,0x0003003e,0x00000fc4,0x00003253,
7760x000200f9,0x00000fcb,0x000200f8,0x00000fcb, 7770x000200f9,0x00000fc5,0x000200f8,0x00000fc5,
7770x00050080,0x00000006,0x00000fcd,0x00003250, 7780x00050080,0x00000006,0x00000fc7,0x00003241,
7780x00000107,0x000200f9,0x00000fa5,0x000200f8, 7790x00000107,0x000200f9,0x00000f9f,0x000200f8,
7790x00000fce,0x000400e0,0x00000170,0x00000170, 7800x00000fc8,0x000400e0,0x00000170,0x00000170,
7800x000006da,0x000200f9,0x00000fcf,0x000200f8, 7810x000006d5,0x000200f9,0x00000fc9,0x000200f8,
7810x00000fcf,0x000700f5,0x00000006,0x00003252, 7820x00000fc9,0x000700f5,0x00000006,0x00003243,
7820x00000170,0x00000fce,0x00001023,0x00001021, 7830x00000170,0x00000fc8,0x0000101d,0x0000101b,
7830x000500b2,0x0000002f,0x00000fd3,0x00003252, 7840x000500b2,0x0000002f,0x00000fcd,0x00003243,
7840x0000324f,0x000400f6,0x00001024,0x00001021, 7850x00003240,0x000400f6,0x0000101e,0x0000101b,
7850x00000000,0x000400fa,0x00000fd3,0x00000fd4, 7860x00000000,0x000400fa,0x00000fcd,0x00000fce,
7860x00001024,0x000200f8,0x00000fd4,0x000500c2, 7870x0000101e,0x000200f8,0x00000fce,0x000500c2,
7870x00000006,0x00000fd6,0x00003252,0x00000154, 7880x00000006,0x00000fd0,0x00003243,0x00000154,
7880x000200f9,0x00000fd7,0x000200f8,0x00000fd7, 7890x000200f9,0x00000fd1,0x000200f8,0x00000fd1,
7890x000700f5,0x00000006,0x00003255,0x00000fd6, 7900x000700f5,0x00000006,0x00003246,0x00000fd0,
7900x00000fd4,0x0000101f,0x0000101d,0x000500ac, 7910x00000fce,0x00001019,0x00001017,0x000500ac,
7910x0000002f,0x00000fda,0x00003255,0x000000a6, 7920x0000002f,0x00000fd4,0x00003246,0x000000a6,
7920x000400f6,0x00001020,0x0000101d,0x00000000, 7930x000400f6,0x0000101a,0x00001017,0x00000000,
7930x000400fa,0x00000fda,0x00000fdb,0x00001020, 7940x000400fa,0x00000fd4,0x00000fd5,0x0000101a,
7940x000200f8,0x00000fdb,0x000200f9,0x00000fdd, 7950x000200f8,0x00000fd5,0x000200f9,0x00000fd7,
7950x000200f8,0x00000fdd,0x000700f5,0x00000006, 7960x000200f8,0x00000fd7,0x000700f5,0x00000006,
7960x00003257,0x00000b40,0x00000fdb,0x0000101b, 7970x00003248,0x00000b38,0x00000fd5,0x00001015,
7970x00001019,0x000500b0,0x0000002f,0x00000fe1, 7980x00001013,0x000500b0,0x0000002f,0x00000fdb,
7980x00003257,0x0000324f,0x000400f6,0x0000101c, 7990x00003248,0x00003240,0x000400f6,0x00001016,
7990x00001019,0x00000000,0x000400fa,0x00000fe1, 8000x00001013,0x00000000,0x000400fa,0x00000fdb,
8000x00000fe2,0x0000101c,0x000200f8,0x00000fe2, 8010x00000fdc,0x00001016,0x000200f8,0x00000fdc,
8010x000500c6,0x00000006,0x00000fe5,0x00003257, 8020x000500c6,0x00000006,0x00000fdf,0x00003248,
8020x00003255,0x000500ac,0x0000002f,0x00000fe8, 8030x00003246,0x000500ac,0x0000002f,0x00000fe2,
8030x00000fe5,0x00003257,0x000300f7,0x00001018, 8040x00000fdf,0x00003248,0x000300f7,0x00001012,
8040x00000000,0x000400fa,0x00000fe8,0x00000fe9, 8050x00000000,0x000400fa,0x00000fe2,0x00000fe3,
8050x00001018,0x000200f8,0x00000fe9,0x00050041, 8060x00001012,0x000200f8,0x00000fe3,0x00050041,
8060x000006c2,0x00000feb,0x000006af,0x00003257, 8070x000006bd,0x00000fe5,0x000006aa,0x00003248,
8070x0004003d,0x00000006,0x00000fec,0x00000feb, 8080x0004003d,0x00000006,0x00000fe6,0x00000fe5,
8080x00050041,0x000006c2,0x00000fee,0x000006af, 8090x00050041,0x000006bd,0x00000fe8,0x000006aa,
8090x00000fe5,0x0004003d,0x00000006,0x00000fef, 8100x00000fdf,0x0004003d,0x00000006,0x00000fe9,
8100x00000fee,0x00050041,0x000006c2,0x00000ff1, 8110x00000fe8,0x00050041,0x000006bd,0x00000feb,
8110x000006c4,0x00003257,0x0004003d,0x00000006, 8120x000006bf,0x00003248,0x0004003d,0x00000006,
8120x00000ff2,0x00000ff1,0x00050041,0x000006c2, 8130x00000fec,0x00000feb,0x00050041,0x000006bd,
8130x00000ff4,0x000006c4,0x00000fe5,0x0004003d, 8140x00000fee,0x000006bf,0x00000fdf,0x0004003d,
8140x00000006,0x00000ff5,0x00000ff4,0x000500ac, 8150x00000006,0x00000fef,0x00000fee,0x000500ac,
8150x0000002f,0x00000ff8,0x00000fec,0x00000fef, 8160x0000002f,0x00000ff2,0x00000fe6,0x00000fe9,
8160x000400a8,0x0000002f,0x00000ff9,0x00000ff8, 8170x000400a8,0x0000002f,0x00000ff3,0x00000ff2,
8170x000300f7,0x00001002,0x00000000,0x000400fa, 8180x000300f7,0x00000ffc,0x00000000,0x000400fa,
8180x00000ff9,0x00000ffa,0x00001002,0x000200f8, 8190x00000ff3,0x00000ff4,0x00000ffc,0x000200f8,
8190x00000ffa,0x000500aa,0x0000002f,0x00000ffd, 8200x00000ff4,0x000500aa,0x0000002f,0x00000ff7,
8200x00000fec,0x00000fef,0x000500ac,0x0000002f, 8210x00000fe6,0x00000fe9,0x000500ac,0x0000002f,
8210x00001000,0x00000ff2,0x00000ff5,0x000500a7, 8220x00000ffa,0x00000fec,0x00000fef,0x000500a7,
8220x0000002f,0x00001001,0x00000ffd,0x00001000, 8230x0000002f,0x00000ffb,0x00000ff7,0x00000ffa,
8230x000200f9,0x00001002,0x000200f8,0x00001002, 8240x000200f9,0x00000ffc,0x000200f8,0x00000ffc,
8240x000700f5,0x0000002f,0x00001003,0x00000ff8, 8250x000700f5,0x0000002f,0x00000ffd,0x00000ff2,
8250x00000fe9,0x00001001,0x00000ffa,0x000500c7, 8260x00000fe3,0x00000ffb,0x00000ff4,0x000500c7,
8260x00000006,0x00001007,0x00003257,0x00003252, 8270x00000006,0x00001001,0x00003248,0x00003243,
8270x000500aa,0x0000002f,0x00001008,0x00001007, 8280x000500aa,0x0000002f,0x00001002,0x00001001,
8280x000000a6,0x000500a4,0x0000002f,0x00001009, 8290x000000a6,0x000500a4,0x0000002f,0x00001003,
8290x00001003,0x00001008,0x000300f7,0x00001017, 8300x00000ffd,0x00001002,0x000300f7,0x00001011,
8300x00000000,0x000400fa,0x00001009,0x0000100a, 8310x00000000,0x000400fa,0x00001003,0x00001004,
8310x00001017,0x000200f8,0x0000100a,0x0003003e, 8320x00001011,0x000200f8,0x00001004,0x0003003e,
8320x00000feb,0x00000fef,0x0003003e,0x00000fee, 8330x00000fe5,0x00000fe9,0x0003003e,0x00000fe8,
8330x00000fec,0x0003003e,0x00000ff1,0x00000ff5, 8340x00000fe6,0x0003003e,0x00000feb,0x00000fef,
8340x0003003e,0x00000ff4,0x00000ff2,0x000200f9, 8350x0003003e,0x00000fee,0x00000fec,0x000200f9,
8350x00001017,0x000200f8,0x00001017,0x000200f9, 8360x00001011,0x000200f8,0x00001011,0x000200f9,
8360x00001018,0x000200f8,0x00001018,0x000200f9, 8370x00001012,0x000200f8,0x00001012,0x000200f9,
8370x00001019,0x000200f8,0x00001019,0x00050080, 8380x00001013,0x000200f8,0x00001013,0x00050080,
8380x00000006,0x0000101b,0x00003257,0x00000107, 8390x00000006,0x00001015,0x00003248,0x00000107,
8390x000200f9,0x00000fdd,0x000200f8,0x0000101c, 8400x000200f9,0x00000fd7,0x000200f8,0x00001016,
8400x000400e0,0x00000170,0x00000170,0x000006da, 8410x000400e0,0x00000170,0x00000170,0x000006d5,
8410x000200f9,0x0000101d,0x000200f8,0x0000101d, 8420x000200f9,0x00001017,0x000200f8,0x00001017,
8420x000500c2,0x00000006,0x0000101f,0x00003255, 8430x000500c2,0x00000006,0x00001019,0x00003246,
8430x00000154,0x000200f9,0x00000fd7,0x000200f8, 8440x00000154,0x000200f9,0x00000fd1,0x000200f8,
8440x00001020,0x000200f9,0x00001021,0x000200f8, 8450x0000101a,0x000200f9,0x0000101b,0x000200f8,
8450x00001021,0x000500c4,0x00000006,0x00001023, 8460x0000101b,0x000500c4,0x00000006,0x0000101d,
8460x00003252,0x00000154,0x000200f9,0x00000fcf, 8470x00003243,0x00000154,0x000200f9,0x00000fc9,
8470x000200f8,0x00001024,0x000200f9,0x00001026, 8480x000200f8,0x0000101e,0x000200f9,0x00001020,
8480x000200f8,0x00001026,0x000700f5,0x00000006, 8490x000200f8,0x00001020,0x000700f5,0x00000006,
8490x00003254,0x00000b40,0x00001024,0x00001042, 8500x00003245,0x00000b38,0x0000101e,0x0000103c,
8500x0000102b,0x000500b0,0x0000002f,0x0000102a, 8510x00001025,0x000500b0,0x0000002f,0x00001024,
8510x00003254,0x00000f99,0x000400f6,0x00001043, 8520x00003245,0x00000f93,0x000400f6,0x0000103d,
8520x0000102b,0x00000000,0x000400fa,0x0000102a, 8530x00001025,0x00000000,0x000400fa,0x00001024,
8530x0000102b,0x00001043,0x000200f8,0x0000102b, 8540x00001025,0x0000103d,0x000200f8,0x00001025,
8540x00050084,0x00000006,0x0000102e,0x0000010a, 8550x00050084,0x00000006,0x00001028,0x0000010a,
8550x00003254,0x00050080,0x00000006,0x0000102f, 8560x00003245,0x00050080,0x00000006,0x00001029,
8560x00000107,0x0000102e,0x00050041,0x00000156, 8570x00000107,0x00001028,0x00050041,0x00000156,
8570x00001031,0x000000fc,0x00000154,0x0004003d, 8580x0000102b,0x000000fc,0x00000154,0x0004003d,
8580x00000007,0x00001032,0x00001031,0x00050041, 8590x00000007,0x0000102c,0x0000102b,0x00050041,
8590x000006c2,0x00001033,0x000006af,0x00003254, 8600x000006bd,0x0000102d,0x000006aa,0x00003245,
8600x0004003d,0x00000006,0x00001034,0x00001033, 8610x0004003d,0x00000006,0x0000102e,0x0000102d,
8610x00050051,0x00000006,0x000010a5,0x00001032, 8620x00050051,0x00000006,0x0000109f,0x0000102c,
8620x00000000,0x00050095,0x000000ab,0x000010a7, 8630x00000000,0x00050095,0x000000ab,0x000010a1,
8630x000010a5,0x0000102f,0x00050051,0x00000006, 8640x0000109f,0x00001029,0x00050051,0x00000006,
8640x000010a8,0x000010a7,0x00000001,0x00050051, 8650x000010a2,0x000010a1,0x00000001,0x00050051,
8650x00000006,0x000010a9,0x000010a7,0x00000000, 8660x00000006,0x000010a3,0x000010a1,0x00000000,
8660x00050051,0x00000006,0x000010ac,0x00001032, 8670x00050051,0x00000006,0x000010a6,0x0000102c,
8670x00000001,0x00050080,0x00000006,0x000010ae, 8680x00000001,0x00050080,0x00000006,0x000010a8,
8680x000010ac,0x000010a8,0x00050050,0x00000007, 8690x000010a6,0x000010a2,0x00050050,0x00000007,
8690x000010af,0x000010a9,0x000010ae,0x0004007c, 8700x000010a9,0x000010a3,0x000010a8,0x0004007c,
8700x00000014,0x0000109f,0x000010af,0x00060041, 8710x00000014,0x00001099,0x000010a9,0x00060041,
8710x000000db,0x00001097,0x0000109f,0x000000da, 8720x000000db,0x00001091,0x00001099,0x000000da,
8720x000000da,0x0005003e,0x00001097,0x00001034, 8730x000000da,0x0005003e,0x00001091,0x0000102e,
8730x00000002,0x00000004,0x00050084,0x00000006, 8740x00000002,0x00000004,0x00050084,0x00000006,
8740x000010b4,0x0000010a,0x00000f99,0x00050080, 8750x000010ae,0x0000010a,0x00000f93,0x00050080,
8750x00000006,0x000010b5,0x00000107,0x000010b4, 8760x00000006,0x000010af,0x00000107,0x000010ae,
8760x00050080,0x00000006,0x00001039,0x000010b5, 8770x00050080,0x00000006,0x00001033,0x000010af,
8770x0000102e,0x00050041,0x000006c2,0x0000103d, 8780x00001028,0x00050041,0x000006bd,0x00001037,
8780x000006c4,0x00003254,0x0004003d,0x00000006, 8790x000006bf,0x00003245,0x0004003d,0x00000006,
8790x0000103e,0x0000103d,0x00050095,0x000000ab, 8800x00001038,0x00001037,0x00050095,0x000000ab,
8800x000010cd,0x000010a5,0x00001039,0x00050051, 8810x000010c7,0x0000109f,0x00001033,0x00050051,
8810x00000006,0x000010ce,0x000010cd,0x00000001, 8820x00000006,0x000010c8,0x000010c7,0x00000001,
8820x00050051,0x00000006,0x000010cf,0x000010cd, 8830x00050051,0x00000006,0x000010c9,0x000010c7,
8830x00000000,0x00050080,0x00000006,0x000010d4, 8840x00000000,0x00050080,0x00000006,0x000010ce,
8840x000010ac,0x000010ce,0x00050050,0x00000007, 8850x000010a6,0x000010c8,0x00050050,0x00000007,
8850x000010d5,0x000010cf,0x000010d4,0x0004007c, 8860x000010cf,0x000010c9,0x000010ce,0x0004007c,
8860x00000014,0x000010c5,0x000010d5,0x00060041, 8870x00000014,0x000010bf,0x000010cf,0x00060041,
8870x000000db,0x000010bd,0x000010c5,0x000000da, 8880x000000db,0x000010b7,0x000010bf,0x000000da,
8880x000000da,0x0005003e,0x000010bd,0x0000103e, 8890x000000da,0x0005003e,0x000010b7,0x00001038,
8890x00000002,0x00000004,0x00050080,0x00000006, 8900x00000002,0x00000004,0x00050080,0x00000006,
8900x00001042,0x00003254,0x00000107,0x000200f9, 8910x0000103c,0x00003245,0x00000107,0x000200f9,
8910x00001026,0x000200f8,0x00001043,0x000200f9, 8920x00001020,0x000200f8,0x0000103d,0x000200f9,
8920x00000bf3,0x000200f8,0x00000b3d,0x000500aa, 8930x00000bed,0x000200f8,0x00000b35,0x000500aa,
8930x0000002f,0x00000b45,0x00000b13,0x00000239, 8940x0000002f,0x00000b3d,0x00000b0b,0x00000239,
8940x000300f7,0x00000b47,0x00000000,0x000400fa, 8950x000300f7,0x00000b3f,0x00000000,0x000400fa,
8950x00000b45,0x00000b46,0x00000b47,0x000200f8, 8960x00000b3d,0x00000b3e,0x00000b3f,0x000200f8,
8960x00000b46,0x000500aa,0x0000002f,0x00000b49, 8970x00000b3e,0x000500aa,0x0000002f,0x00000b41,
8970x00000b11,0x000000a6,0x000300f7,0x00000b4b, 8980x00000b09,0x000000a6,0x000300f7,0x00000b43,
8980x00000000,0x000400fa,0x00000b49,0x00000b4a, 8990x00000000,0x000400fa,0x00000b41,0x00000b42,
8990x00000b4b,0x000200f8,0x00000b4a,0x00050041, 9000x00000b43,0x000200f8,0x00000b42,0x00050041,
9000x000000fe,0x0000110e,0x000000fc,0x00000308, 9010x000000fe,0x00001108,0x000000fc,0x00000308,
9010x0004003d,0x00000006,0x0000110f,0x0000110e, 9020x0004003d,0x00000006,0x00001109,0x00001108,
9020x00050041,0x000000fe,0x00001110,0x000000fc, 9030x00050041,0x000000fe,0x0000110a,0x000000fc,
9030x0000096c,0x0004003d,0x00000006,0x00001111, 9040x00000963,0x0004003d,0x00000006,0x0000110b,
9040x00001110,0x00050080,0x00000006,0x00001113, 9050x0000110a,0x00050080,0x00000006,0x0000110d,
9050x00001111,0x0000110f,0x00050041,0x000000fe, 9060x0000110b,0x00001109,0x00050041,0x000000fe,
9060x000011a4,0x000000fc,0x000000fd,0x0004003d, 9070x0000119f,0x000000fc,0x000000fd,0x0004003d,
9070x00000006,0x000011a5,0x000011a4,0x00050084, 9080x00000006,0x000011a0,0x0000119f,0x00050084,
9080x00000006,0x000011a6,0x0000011f,0x000011a5, 9090x00000006,0x000011a1,0x0000011f,0x000011a0,
9090x00050080,0x00000006,0x000011a7,0x00000107, 9100x00050080,0x00000006,0x000011a2,0x00000107,
9100x000011a6,0x00050080,0x00000006,0x000011ad, 9110x000011a1,0x00050080,0x00000006,0x000011a8,
9110x000011a5,0x000032a8,0x00050086,0x00000006, 9120x000011a0,0x00003297,0x00050086,0x00000006,
9120x000011ae,0x000011ad,0x00000101,0x00050084, 9130x000011a9,0x000011a8,0x00000101,0x00050084,
9130x00000006,0x000011a0,0x00000107,0x000011ae, 9140x00000006,0x0000119b,0x00000107,0x000011a9,
9140x00050080,0x00000006,0x000011a1,0x000011a7, 9150x00050080,0x00000006,0x0000119c,0x000011a2,
9150x000011a0,0x00050084,0x00000006,0x00001175, 9160x0000119b,0x00050084,0x00000006,0x00001170,
9160x00000150,0x00001113,0x00050080,0x00000006, 9170x00000150,0x0000110d,0x00050080,0x00000006,
9170x00001176,0x000011a1,0x00001175,0x00050041, 9180x00001171,0x0000119c,0x00001170,0x00050041,
9180x00000156,0x00001177,0x000000fc,0x00000154, 9190x00000156,0x00001172,0x000000fc,0x00000154,
9190x0004003d,0x00000007,0x00001178,0x00001177, 9200x0004003d,0x00000007,0x00001173,0x00001172,
9200x00050051,0x00000006,0x000011c5,0x00001178, 9210x00050051,0x00000006,0x000011c0,0x00001173,
9210x00000000,0x00050095,0x000000ab,0x000011c7, 9220x00000000,0x00050095,0x000000ab,0x000011c2,
9220x000011c5,0x00001176,0x00050051,0x00000006, 9230x000011c0,0x00001171,0x00050051,0x00000006,
9230x000011c8,0x000011c7,0x00000001,0x00050051, 9240x000011c3,0x000011c2,0x00000001,0x00050051,
9240x00000006,0x000011c9,0x000011c7,0x00000000, 9250x00000006,0x000011c4,0x000011c2,0x00000000,
9250x00050051,0x00000006,0x000011cc,0x00001178, 9260x00050051,0x00000006,0x000011c7,0x00001173,
9260x00000001,0x00050080,0x00000006,0x000011ce, 9270x00000001,0x00050080,0x00000006,0x000011c9,
9270x000011cc,0x000011c8,0x00050050,0x00000007, 9280x000011c7,0x000011c3,0x00050050,0x00000007,
9280x000011cf,0x000011c9,0x000011ce,0x0004007c, 9290x000011ca,0x000011c4,0x000011c9,0x0004007c,
9290x00000014,0x000011bf,0x000011cf,0x00060041, 9300x00000014,0x000011ba,0x000011ca,0x00060041,
9300x000000db,0x000011b6,0x000011bf,0x000000da, 9310x000000db,0x000011b1,0x000011ba,0x000000da,
9310x000000da,0x0006003d,0x00000006,0x000011b7, 9320x000000da,0x0006003d,0x00000006,0x000011b2,
9320x000011b6,0x00000002,0x00000004,0x00050080, 9330x000011b1,0x00000002,0x00000004,0x00050080,
9330x00000006,0x0000117d,0x00001176,0x0000010a, 9340x00000006,0x00001178,0x00001171,0x0000010a,
9340x00050095,0x000000ab,0x000011e8,0x000011c5, 9350x00050095,0x000000ab,0x000011e3,0x000011c0,
9350x0000117d,0x00050051,0x00000006,0x000011e9, 9360x00001178,0x00050051,0x00000006,0x000011e4,
9360x000011e8,0x00000001,0x00050051,0x00000006, 9370x000011e3,0x00000001,0x00050051,0x00000006,
9370x000011ea,0x000011e8,0x00000000,0x00050080, 9380x000011e5,0x000011e3,0x00000000,0x00050080,
9380x00000006,0x000011ef,0x000011cc,0x000011e9, 9390x00000006,0x000011ea,0x000011c7,0x000011e4,
9390x00050050,0x00000007,0x000011f0,0x000011ea, 9400x00050050,0x00000007,0x000011eb,0x000011e5,
9400x000011ef,0x0004007c,0x00000014,0x000011e0, 9410x000011ea,0x0004007c,0x00000014,0x000011db,
9410x000011f0,0x00060041,0x000000db,0x000011d7, 9420x000011eb,0x00060041,0x000000db,0x000011d2,
9420x000011e0,0x000000da,0x000000da,0x0006003d, 9430x000011db,0x000000da,0x000000da,0x0006003d,
9430x00000006,0x000011d8,0x000011d7,0x00000002, 9440x00000006,0x000011d3,0x000011d2,0x00000002,
9440x00000004,0x00050080,0x00000006,0x00001183, 9450x00000004,0x00050080,0x00000006,0x0000117e,
9450x00001176,0x00000111,0x00050095,0x000000ab, 9460x00001171,0x00000111,0x00050095,0x000000ab,
9460x00001209,0x000011c5,0x00001183,0x00050051, 9470x00001204,0x000011c0,0x0000117e,0x00050051,
9470x00000006,0x0000120a,0x00001209,0x00000001, 9480x00000006,0x00001205,0x00001204,0x00000001,
9480x00050051,0x00000006,0x0000120b,0x00001209, 9490x00050051,0x00000006,0x00001206,0x00001204,
9490x00000000,0x00050080,0x00000006,0x00001210, 9500x00000000,0x00050080,0x00000006,0x0000120b,
9500x000011cc,0x0000120a,0x00050050,0x00000007, 9510x000011c7,0x00001205,0x00050050,0x00000007,
9510x00001211,0x0000120b,0x00001210,0x0004007c, 9520x0000120c,0x00001206,0x0000120b,0x0004007c,
9520x00000014,0x00001201,0x00001211,0x00060041, 9530x00000014,0x000011fc,0x0000120c,0x00060041,
9530x000000db,0x000011f8,0x00001201,0x000000da, 9540x000000db,0x000011f3,0x000011fc,0x000000da,
9540x000000da,0x0006003d,0x00000006,0x000011f9, 9550x000000da,0x0006003d,0x00000006,0x000011f4,
9550x000011f8,0x00000002,0x00000004,0x00050080, 9560x000011f3,0x00000002,0x00000004,0x00050080,
9560x00000006,0x0000118a,0x00001176,0x00000118, 9570x00000006,0x00001185,0x00001171,0x00000118,
9570x00050095,0x000000ab,0x0000122a,0x000011c5, 9580x00050095,0x000000ab,0x00001225,0x000011c0,
9580x0000118a,0x00050051,0x00000006,0x0000122b, 9590x00001185,0x00050051,0x00000006,0x00001226,
9590x0000122a,0x00000001,0x00050051,0x00000006, 9600x00001225,0x00000001,0x00050051,0x00000006,
9600x0000122c,0x0000122a,0x00000000,0x00050080, 9610x00001227,0x00001225,0x00000000,0x00050080,
9610x00000006,0x00001231,0x000011cc,0x0000122b, 9620x00000006,0x0000122c,0x000011c7,0x00001226,
9620x00050050,0x00000007,0x00001232,0x0000122c, 9630x00050050,0x00000007,0x0000122d,0x00001227,
9630x00001231,0x0004007c,0x00000014,0x00001222, 9640x0000122c,0x0004007c,0x00000014,0x0000121d,
9640x00001232,0x00060041,0x000000db,0x00001219, 9650x0000122d,0x00060041,0x000000db,0x00001214,
9650x00001222,0x000000da,0x000000da,0x0006003d, 9660x0000121d,0x000000da,0x000000da,0x0006003d,
9660x00000006,0x0000121a,0x00001219,0x00000002, 9670x00000006,0x00001215,0x00001214,0x00000002,
9670x00000004,0x00050080,0x00000006,0x00001190, 9680x00000004,0x00050080,0x00000006,0x0000118b,
9680x00001176,0x0000011f,0x00050095,0x000000ab, 9690x00001171,0x0000011f,0x00050095,0x000000ab,
9690x0000124b,0x000011c5,0x00001190,0x00050051, 9700x00001246,0x000011c0,0x0000118b,0x00050051,
9700x00000006,0x0000124c,0x0000124b,0x00000001, 9710x00000006,0x00001247,0x00001246,0x00000001,
9710x00050051,0x00000006,0x0000124d,0x0000124b, 9720x00050051,0x00000006,0x00001248,0x00001246,
9720x00000000,0x00050080,0x00000006,0x00001252, 9730x00000000,0x00050080,0x00000006,0x0000124d,
9730x000011cc,0x0000124c,0x00050050,0x00000007, 9740x000011c7,0x00001247,0x00050050,0x00000007,
9740x00001253,0x0000124d,0x00001252,0x0004007c, 9750x0000124e,0x00001248,0x0000124d,0x0004007c,
9750x00000014,0x00001243,0x00001253,0x00060041, 9760x00000014,0x0000123e,0x0000124e,0x00060041,
9760x000000db,0x0000123a,0x00001243,0x000000da, 9770x000000db,0x00001235,0x0000123e,0x000000da,
9770x000000da,0x0006003d,0x00000006,0x0000123b, 9780x000000da,0x0006003d,0x00000006,0x00001236,
9780x0000123a,0x00000002,0x00000004,0x00050080, 9790x00001235,0x00000002,0x00000004,0x00050080,
9790x00000006,0x00001196,0x00001176,0x00000189, 9800x00000006,0x00001191,0x00001171,0x00000189,
9800x00050095,0x000000ab,0x0000126c,0x000011c5, 9810x00050095,0x000000ab,0x00001267,0x000011c0,
9810x00001196,0x00050051,0x00000006,0x0000126d, 9820x00001191,0x00050051,0x00000006,0x00001268,
9820x0000126c,0x00000001,0x00050051,0x00000006, 9830x00001267,0x00000001,0x00050051,0x00000006,
9830x0000126e,0x0000126c,0x00000000,0x00050080, 9840x00001269,0x00001267,0x00000000,0x00050080,
9840x00000006,0x00001273,0x000011cc,0x0000126d, 9850x00000006,0x0000126e,0x000011c7,0x00001268,
9850x00050050,0x00000007,0x00001274,0x0000126e, 9860x00050050,0x00000007,0x0000126f,0x00001269,
9860x00001273,0x0004007c,0x00000014,0x00001264, 9870x0000126e,0x0004007c,0x00000014,0x0000125f,
9870x00001274,0x00060041,0x000000db,0x0000125b, 9880x0000126f,0x00060041,0x000000db,0x00001256,
9880x00001264,0x000000da,0x000000da,0x0006003d, 9890x0000125f,0x000000da,0x000000da,0x0006003d,
9890x00000006,0x0000125c,0x0000125b,0x00000002, 9900x00000006,0x00001257,0x00001256,0x00000002,
9900x00000004,0x00050041,0x000000fe,0x00001117, 9910x00000004,0x00050041,0x000000fe,0x00001111,
9910x000000fc,0x00000224,0x0004003d,0x00000006, 9920x000000fc,0x00000224,0x0004003d,0x00000006,
9920x00001118,0x00001117,0x000500ab,0x0000002f, 9930x00001112,0x00001111,0x000500ab,0x0000002f,
9930x00001119,0x00001118,0x000000a6,0x000600a9, 9940x00001113,0x00001112,0x000000a6,0x000600a9,
9940x00000006,0x0000111a,0x00001119,0x000000a6, 9950x00000006,0x00001115,0x00001113,0x00000239,
9950x00000130,0x000500c5,0x00000006,0x0000111b, 9960x0000329a,0x00050041,0x00000156,0x00001116,
9960x0000111a,0x00000239,0x00050041,0x00000156, 9970x000000fc,0x000000da,0x0004003d,0x00000007,
9970x0000111c,0x000000fc,0x000000da,0x0004003d, 9980x00001117,0x00001116,0x00050051,0x00000006,
9980x00000007,0x0000111d,0x0000111c,0x00050051, 9990x00001285,0x00001117,0x00000000,0x00050095,
9990x00000006,0x0000128a,0x0000111d,0x00000000, 10000x000000ab,0x00001287,0x00001285,0x000000a6,
10000x00050095,0x000000ab,0x0000128c,0x0000128a, 10010x00050051,0x00000006,0x00001288,0x00001287,
10010x000000a6,0x00050051,0x00000006,0x0000128d, 10020x00000001,0x00050051,0x00000006,0x00001289,
10020x0000128c,0x00000001,0x00050051,0x00000006, 10030x00001287,0x00000000,0x00050051,0x00000006,
10030x0000128e,0x0000128c,0x00000000,0x00050051, 10040x0000128c,0x00001117,0x00000001,0x00050080,
10040x00000006,0x00001291,0x0000111d,0x00000001, 10050x00000006,0x0000128e,0x0000128c,0x00001288,
10050x00050080,0x00000006,0x00001293,0x00001291, 10060x00050050,0x00000007,0x0000128f,0x00001289,
10060x0000128d,0x00050050,0x00000007,0x00001294, 10070x0000128e,0x0004007c,0x00000014,0x0000127f,
10070x0000128e,0x00001293,0x0004007c,0x00000014, 10080x0000128f,0x00060041,0x000000db,0x00001277,
10080x00001284,0x00001294,0x00060041,0x000000db, 10090x0000127f,0x000000da,0x000000da,0x0005003e,
10090x0000127c,0x00001284,0x000000da,0x000000da, 10100x00001277,0x00001115,0x00000002,0x00000004,
10100x0005003e,0x0000127c,0x0000111b,0x00000002, 10110x00050041,0x000000fe,0x00001119,0x000000fc,
10110x00000004,0x00050041,0x000000fe,0x0000111f, 10120x00000a8e,0x0004003d,0x00000006,0x0000111a,
10120x000000fc,0x00000a97,0x0004003d,0x00000006, 10130x00001119,0x00050086,0x00000006,0x0000111b,
10130x00001120,0x0000111f,0x00050086,0x00000006, 10140x0000111a,0x00000107,0x00050082,0x00000006,
10140x00001121,0x00001120,0x00000107,0x00050095, 10150x0000111c,0x0000111b,0x000000b0,0x00050095,
10150x000000ab,0x000012ac,0x0000128a,0x0000010a, 10160x000000ab,0x000012a7,0x00001285,0x0000010a,
10160x00050051,0x00000006,0x000012ad,0x000012ac, 10170x00050051,0x00000006,0x000012a8,0x000012a7,
10170x00000001,0x00050051,0x00000006,0x000012ae, 10180x00000001,0x00050051,0x00000006,0x000012a9,
10180x000012ac,0x00000000,0x00050080,0x00000006, 10190x000012a7,0x00000000,0x00050080,0x00000006,
10190x000012b3,0x00001291,0x000012ad,0x00050050, 10200x000012ae,0x0000128c,0x000012a8,0x00050050,
10200x00000007,0x000012b4,0x000012ae,0x000012b3, 10210x00000007,0x000012af,0x000012a9,0x000012ae,
10210x0004007c,0x00000014,0x000012a4,0x000012b4, 10220x0004007c,0x00000014,0x0000129f,0x000012af,
10220x00060041,0x000000db,0x0000129c,0x000012a4, 10230x00060041,0x000000db,0x00001297,0x0000129f,
10230x000000da,0x000000da,0x0005003e,0x0000129c, 10240x000000da,0x000000da,0x0005003e,0x00001297,
10240x00001121,0x00000002,0x00000004,0x00050095, 10250x0000111c,0x00000002,0x00000004,0x00050095,
10250x000000ab,0x000012cc,0x0000128a,0x00000111, 10260x000000ab,0x000012c7,0x00001285,0x00000111,
10260x00050051,0x00000006,0x000012cd,0x000012cc, 10270x00050051,0x00000006,0x000012c8,0x000012c7,
10270x00000001,0x00050051,0x00000006,0x000012ce, 10280x00000001,0x00050051,0x00000006,0x000012c9,
10280x000012cc,0x00000000,0x00050080,0x00000006, 10290x000012c7,0x00000000,0x00050080,0x00000006,
10290x000012d3,0x00001291,0x000012cd,0x00050050, 10300x000012ce,0x0000128c,0x000012c8,0x00050050,
10300x00000007,0x000012d4,0x000012ce,0x000012d3, 10310x00000007,0x000012cf,0x000012c9,0x000012ce,
10310x0004007c,0x00000014,0x000012c4,0x000012d4, 10320x0004007c,0x00000014,0x000012bf,0x000012cf,
10320x00060041,0x000000db,0x000012bc,0x000012c4, 10330x00060041,0x000000db,0x000012b7,0x000012bf,
10330x000000da,0x000000da,0x0005003e,0x000012bc, 10340x000000da,0x000000da,0x0005003e,0x000012b7,
10340x000000a6,0x00000002,0x00000004,0x00050095, 10350x000000a6,0x00000002,0x00000004,0x00050095,
10350x000000ab,0x000012ec,0x0000128a,0x00000118, 10360x000000ab,0x000012e7,0x00001285,0x00000118,
10360x00050051,0x00000006,0x000012ed,0x000012ec, 10370x00050051,0x00000006,0x000012e8,0x000012e7,
10370x00000001,0x00050051,0x00000006,0x000012ee, 10380x00000001,0x00050051,0x00000006,0x000012e9,
10380x000012ec,0x00000000,0x00050080,0x00000006, 10390x000012e7,0x00000000,0x00050080,0x00000006,
10390x000012f3,0x00001291,0x000012ed,0x00050050, 10400x000012ee,0x0000128c,0x000012e8,0x00050050,
10400x00000007,0x000012f4,0x000012ee,0x000012f3, 10410x00000007,0x000012ef,0x000012e9,0x000012ee,
10410x0004007c,0x00000014,0x000012e4,0x000012f4, 10420x0004007c,0x00000014,0x000012df,0x000012ef,
10420x00060041,0x000000db,0x000012dc,0x000012e4, 10430x00060041,0x000000db,0x000012d7,0x000012df,
10430x000000da,0x000000da,0x0005003e,0x000012dc, 10440x000000da,0x000000da,0x0005003e,0x000012d7,
10440x00001111,0x00000002,0x00000004,0x00050095, 10450x0000110b,0x00000002,0x00000004,0x00050095,
10450x000000ab,0x00001315,0x0000128a,0x0000011f, 10460x000000ab,0x00001310,0x00001285,0x0000011f,
10460x00050051,0x00000006,0x00001316,0x00001315, 10470x00050051,0x00000006,0x00001311,0x00001310,
10470x00000001,0x00050051,0x00000006,0x00001317, 10480x00000001,0x00050051,0x00000006,0x00001312,
10480x00001315,0x00000000,0x00050080,0x00000006, 10490x00001310,0x00000000,0x00050080,0x00000006,
10490x0000131c,0x00001291,0x00001316,0x00050050, 10500x00001317,0x0000128c,0x00001311,0x00050050,
10500x00000007,0x0000131d,0x00001317,0x0000131c, 10510x00000007,0x00001318,0x00001312,0x00001317,
10510x0004007c,0x00000014,0x0000130d,0x0000131d, 10520x0004007c,0x00000014,0x00001308,0x00001318,
10520x00060041,0x000000db,0x00001305,0x0000130d, 10530x00060041,0x000000db,0x00001300,0x00001308,
10530x000000da,0x000000da,0x0005003e,0x00001305, 10540x000000da,0x000000da,0x0005003e,0x00001300,
10540x000011b7,0x00000002,0x00000004,0x00050095, 10550x000011b2,0x00000002,0x00000004,0x00050095,
10550x000000ab,0x0000133e,0x0000128a,0x00000189, 10560x000000ab,0x00001339,0x00001285,0x00000189,
10560x00050051,0x00000006,0x0000133f,0x0000133e, 10570x00050051,0x00000006,0x0000133a,0x00001339,
10570x00000001,0x00050051,0x00000006,0x00001340, 10580x00000001,0x00050051,0x00000006,0x0000133b,
10580x0000133e,0x00000000,0x00050080,0x00000006, 10590x00001339,0x00000000,0x00050080,0x00000006,
10590x00001345,0x00001291,0x0000133f,0x00050050, 10600x00001340,0x0000128c,0x0000133a,0x00050050,
10600x00000007,0x00001346,0x00001340,0x00001345, 10610x00000007,0x00001341,0x0000133b,0x00001340,
10610x0004007c,0x00000014,0x00001336,0x00001346, 10620x0004007c,0x00000014,0x00001331,0x00001341,
10620x00060041,0x000000db,0x0000132e,0x00001336, 10630x00060041,0x000000db,0x00001329,0x00001331,
10630x000000da,0x000000da,0x0005003e,0x0000132e, 10640x000000da,0x000000da,0x0005003e,0x00001329,
10640x000011d8,0x00000002,0x00000004,0x00050095, 10650x000011d3,0x00000002,0x00000004,0x00050095,
10650x000000ab,0x00001367,0x0000128a,0x00000150, 10660x000000ab,0x00001362,0x00001285,0x00000150,
10660x00050051,0x00000006,0x00001368,0x00001367, 10670x00050051,0x00000006,0x00001363,0x00001362,
10670x00000001,0x00050051,0x00000006,0x00001369, 10680x00000001,0x00050051,0x00000006,0x00001364,
10680x00001367,0x00000000,0x00050080,0x00000006, 10690x00001362,0x00000000,0x00050080,0x00000006,
10690x0000136e,0x00001291,0x00001368,0x00050050, 10700x00001369,0x0000128c,0x00001363,0x00050050,
10700x00000007,0x0000136f,0x00001369,0x0000136e, 10710x00000007,0x0000136a,0x00001364,0x00001369,
10710x0004007c,0x00000014,0x0000135f,0x0000136f, 10720x0004007c,0x00000014,0x0000135a,0x0000136a,
10720x00060041,0x000000db,0x00001357,0x0000135f, 10730x00060041,0x000000db,0x00001352,0x0000135a,
10730x000000da,0x000000da,0x0005003e,0x00001357, 10740x000000da,0x000000da,0x0005003e,0x00001352,
10740x000011f9,0x00000002,0x00000004,0x00050095, 10750x000011f4,0x00000002,0x00000004,0x00050095,
10750x000000ab,0x00001390,0x0000128a,0x00000463, 10760x000000ab,0x0000138b,0x00001285,0x00000460,
10760x00050051,0x00000006,0x00001391,0x00001390, 10770x00050051,0x00000006,0x0000138c,0x0000138b,
10770x00000001,0x00050051,0x00000006,0x00001392, 10780x00000001,0x00050051,0x00000006,0x0000138d,
10780x00001390,0x00000000,0x00050080,0x00000006, 10790x0000138b,0x00000000,0x00050080,0x00000006,
10790x00001397,0x00001291,0x00001391,0x00050050, 10800x00001392,0x0000128c,0x0000138c,0x00050050,
10800x00000007,0x00001398,0x00001392,0x00001397, 10810x00000007,0x00001393,0x0000138d,0x00001392,
10810x0004007c,0x00000014,0x00001388,0x00001398, 10820x0004007c,0x00000014,0x00001383,0x00001393,
10820x00060041,0x000000db,0x00001380,0x00001388, 10830x00060041,0x000000db,0x0000137b,0x00001383,
10830x000000da,0x000000da,0x0005003e,0x00001380, 10840x000000da,0x000000da,0x0005003e,0x0000137b,
10840x0000121a,0x00000002,0x00000004,0x00050095, 10850x00001215,0x00000002,0x00000004,0x00050095,
10850x000000ab,0x000013b9,0x0000128a,0x00000469, 10860x000000ab,0x000013b4,0x00001285,0x00000466,
10860x00050051,0x00000006,0x000013ba,0x000013b9, 10870x00050051,0x00000006,0x000013b5,0x000013b4,
10870x00000001,0x00050051,0x00000006,0x000013bb, 10880x00000001,0x00050051,0x00000006,0x000013b6,
10880x000013b9,0x00000000,0x00050080,0x00000006, 10890x000013b4,0x00000000,0x00050080,0x00000006,
10890x000013c0,0x00001291,0x000013ba,0x00050050, 10900x000013bb,0x0000128c,0x000013b5,0x00050050,
10900x00000007,0x000013c1,0x000013bb,0x000013c0, 10910x00000007,0x000013bc,0x000013b6,0x000013bb,
10910x0004007c,0x00000014,0x000013b1,0x000013c1, 10920x0004007c,0x00000014,0x000013ac,0x000013bc,
10920x00060041,0x000000db,0x000013a9,0x000013b1, 10930x00060041,0x000000db,0x000013a4,0x000013ac,
10930x000000da,0x000000da,0x0005003e,0x000013a9, 10940x000000da,0x000000da,0x0005003e,0x000013a4,
10940x0000123b,0x00000002,0x00000004,0x00050095, 10950x00001236,0x00000002,0x00000004,0x00050095,
10950x000000ab,0x000013e2,0x0000128a,0x00000347, 10960x000000ab,0x000013dd,0x00001285,0x00000347,
10960x00050051,0x00000006,0x000013e3,0x000013e2, 10970x00050051,0x00000006,0x000013de,0x000013dd,
10970x00000001,0x00050051,0x00000006,0x000013e4, 10980x00000001,0x00050051,0x00000006,0x000013df,
10980x000013e2,0x00000000,0x00050080,0x00000006, 10990x000013dd,0x00000000,0x00050080,0x00000006,
10990x000013e9,0x00001291,0x000013e3,0x00050050, 11000x000013e4,0x0000128c,0x000013de,0x00050050,
11000x00000007,0x000013ea,0x000013e4,0x000013e9, 11010x00000007,0x000013e5,0x000013df,0x000013e4,
11010x0004007c,0x00000014,0x000013da,0x000013ea, 11020x0004007c,0x00000014,0x000013d5,0x000013e5,
11020x00060041,0x000000db,0x000013d2,0x000013da, 11030x00060041,0x000000db,0x000013cd,0x000013d5,
11030x000000da,0x000000da,0x0005003e,0x000013d2, 11040x000000da,0x000000da,0x0005003e,0x000013cd,
11040x0000125c,0x00000002,0x00000004,0x00050041, 11050x00001257,0x00000002,0x00000004,0x00050041,
11050x000000fe,0x0000114d,0x000000fc,0x0000023e, 11060x000000fe,0x00001148,0x000000fc,0x0000023e,
11060x0004003d,0x00000006,0x0000114e,0x0000114d, 11070x0004003d,0x00000006,0x00001149,0x00001148,
11070x00050095,0x000000ab,0x00001402,0x0000128a, 11080x00050095,0x000000ab,0x000013fd,0x00001285,
11080x00000352,0x00050051,0x00000006,0x00001403, 11090x00000352,0x00050051,0x00000006,0x000013fe,
11090x00001402,0x00000001,0x00050051,0x00000006, 11100x000013fd,0x00000001,0x00050051,0x00000006,
11100x00001404,0x00001402,0x00000000,0x00050080, 11110x000013ff,0x000013fd,0x00000000,0x00050080,
11110x00000006,0x00001409,0x00001291,0x00001403, 11120x00000006,0x00001404,0x0000128c,0x000013fe,
11120x00050050,0x00000007,0x0000140a,0x00001404, 11130x00050050,0x00000007,0x00001405,0x000013ff,
11130x00001409,0x0004007c,0x00000014,0x000013fa, 11140x00001404,0x0004007c,0x00000014,0x000013f5,
11140x0000140a,0x00060041,0x000000db,0x000013f2, 11150x00001405,0x00060041,0x000000db,0x000013ed,
11150x000013fa,0x000000da,0x000000da,0x0005003e, 11160x000013f5,0x000000da,0x000000da,0x0005003e,
11160x000013f2,0x0000114e,0x00000002,0x00000004, 11170x000013ed,0x00001149,0x00000002,0x00000004,
11170x00050095,0x000000ab,0x00001422,0x0000128a, 11180x00050095,0x000000ab,0x0000141d,0x00001285,
11180x0000035d,0x00050051,0x00000006,0x00001423, 11190x0000035d,0x00050051,0x00000006,0x0000141e,
11190x00001422,0x00000001,0x00050051,0x00000006, 11200x0000141d,0x00000001,0x00050051,0x00000006,
11200x00001424,0x00001422,0x00000000,0x00050080, 11210x0000141f,0x0000141d,0x00000000,0x00050080,
11210x00000006,0x00001429,0x00001291,0x00001423, 11220x00000006,0x00001424,0x0000128c,0x0000141e,
11220x00050050,0x00000007,0x0000142a,0x00001424, 11230x00050050,0x00000007,0x00001425,0x0000141f,
11230x00001429,0x0004007c,0x00000014,0x0000141a, 11240x00001424,0x0004007c,0x00000014,0x00001415,
11240x0000142a,0x00060041,0x000000db,0x00001412, 11250x00001425,0x00060041,0x000000db,0x0000140d,
11250x0000141a,0x000000da,0x000000da,0x0005003e, 11260x00001415,0x000000da,0x000000da,0x0005003e,
11260x00001412,0x000000a6,0x00000002,0x00000004, 11270x0000140d,0x000000a6,0x00000002,0x00000004,
11270x00050084,0x00000006,0x00001430,0x0000110f, 11280x00050084,0x00000006,0x0000142b,0x00001109,
11280x00000228,0x00050080,0x00000006,0x00001431, 11290x00000228,0x00050080,0x00000006,0x0000142c,
11290x0000114e,0x00001430,0x000500c2,0x00000006, 11300x00001149,0x0000142b,0x000500c2,0x00000006,
11300x00001432,0x00001431,0x00000233,0x000500c4, 11310x0000142d,0x0000142c,0x00000233,0x000500c4,
11310x00000006,0x00001433,0x00001432,0x0000020d, 11320x00000006,0x0000142e,0x0000142d,0x0000020d,
11320x000500c5,0x00000006,0x00001434,0x00001433, 11330x000500c5,0x00000006,0x0000142f,0x0000142e,
11330x00000246,0x00050095,0x000000ab,0x0000144c, 11340x00000246,0x00050095,0x000000ab,0x00001447,
11340x0000128a,0x00000368,0x00050051,0x00000006, 11350x00001285,0x00000368,0x00050051,0x00000006,
11350x0000144d,0x0000144c,0x00000001,0x00050051, 11360x00001448,0x00001447,0x00000001,0x00050051,
11360x00000006,0x0000144e,0x0000144c,0x00000000, 11370x00000006,0x00001449,0x00001447,0x00000000,
11370x00050080,0x00000006,0x00001453,0x00001291, 11380x00050080,0x00000006,0x0000144e,0x0000128c,
11380x0000144d,0x00050050,0x00000007,0x00001454, 11390x00001448,0x00050050,0x00000007,0x0000144f,
11390x0000144e,0x00001453,0x0004007c,0x00000014, 11400x00001449,0x0000144e,0x0004007c,0x00000014,
11400x00001444,0x00001454,0x00060041,0x000000db, 11410x0000143f,0x0000144f,0x00060041,0x000000db,
11410x0000143c,0x00001444,0x000000da,0x000000da, 11420x00001437,0x0000143f,0x000000da,0x000000da,
11420x0005003e,0x0000143c,0x00001434,0x00000002, 11430x0005003e,0x00001437,0x0000142f,0x00000002,
11430x00000004,0x00050041,0x000000fe,0x0000115a, 11440x00000004,0x00050041,0x000000fe,0x00001155,
11440x000000fc,0x0000022c,0x0004003d,0x00000006, 11450x000000fc,0x0000022c,0x0004003d,0x00000006,
11450x0000115b,0x0000115a,0x00050095,0x000000ab, 11460x00001156,0x00001155,0x00050095,0x000000ab,
11460x0000146c,0x0000128a,0x00000374,0x00050051, 11470x00001467,0x00001285,0x00000374,0x00050051,
11470x00000006,0x0000146d,0x0000146c,0x00000001, 11480x00000006,0x00001468,0x00001467,0x00000001,
11480x00050051,0x00000006,0x0000146e,0x0000146c, 11490x00050051,0x00000006,0x00001469,0x00001467,
11490x00000000,0x00050080,0x00000006,0x00001473, 11500x00000000,0x00050080,0x00000006,0x0000146e,
11500x00001291,0x0000146d,0x00050050,0x00000007, 11510x0000128c,0x00001468,0x00050050,0x00000007,
11510x00001474,0x0000146e,0x00001473,0x0004007c, 11520x0000146f,0x00001469,0x0000146e,0x0004007c,
11520x00000014,0x00001464,0x00001474,0x00060041, 11530x00000014,0x0000145f,0x0000146f,0x00060041,
11530x000000db,0x0000145c,0x00001464,0x000000da, 11540x000000db,0x00001457,0x0000145f,0x000000da,
11540x000000da,0x0005003e,0x0000145c,0x0000115b, 11550x000000da,0x0005003e,0x00001457,0x00001156,
11550x00000002,0x00000004,0x00050041,0x000000fe, 11560x00000002,0x00000004,0x00050041,0x000000fe,
11560x0000115f,0x000000fc,0x000009ef,0x0004003d, 11570x0000115a,0x000000fc,0x000009e6,0x0004003d,
11570x00000006,0x00001160,0x0000115f,0x00050095, 11580x00000006,0x0000115b,0x0000115a,0x00050095,
11580x000000ab,0x0000148c,0x0000128a,0x0000037e, 11590x000000ab,0x00001487,0x00001285,0x0000037e,
11590x00050051,0x00000006,0x0000148d,0x0000148c, 11600x00050051,0x00000006,0x00001488,0x00001487,
11600x00000001,0x00050051,0x00000006,0x0000148e, 11610x00000001,0x00050051,0x00000006,0x00001489,
11610x0000148c,0x00000000,0x00050080,0x00000006, 11620x00001487,0x00000000,0x00050080,0x00000006,
11620x00001493,0x00001291,0x0000148d,0x00050050, 11630x0000148e,0x0000128c,0x00001488,0x00050050,
11630x00000007,0x00001494,0x0000148e,0x00001493, 11640x00000007,0x0000148f,0x00001489,0x0000148e,
11640x0004007c,0x00000014,0x00001484,0x00001494, 11650x0004007c,0x00000014,0x0000147f,0x0000148f,
11650x00060041,0x000000db,0x0000147c,0x00001484, 11660x00060041,0x000000db,0x00001477,0x0000147f,
11660x000000da,0x000000da,0x0005003e,0x0000147c, 11670x000000da,0x000000da,0x0005003e,0x00001477,
11670x00001160,0x00000002,0x00000004,0x00050095, 11680x0000115b,0x00000002,0x00000004,0x00050095,
11680x000000ab,0x000014ac,0x0000128a,0x00000388, 11690x000000ab,0x000014a7,0x00001285,0x00000388,
11690x00050051,0x00000006,0x000014ad,0x000014ac, 11700x00050051,0x00000006,0x000014a8,0x000014a7,
11700x00000001,0x00050051,0x00000006,0x000014ae, 11710x00000001,0x00050051,0x00000006,0x000014a9,
11710x000014ac,0x00000000,0x00050080,0x00000006, 11720x000014a7,0x00000000,0x00050080,0x00000006,
11720x000014b3,0x00001291,0x000014ad,0x00050050, 11730x000014ae,0x0000128c,0x000014a8,0x00050050,
11730x00000007,0x000014b4,0x000014ae,0x000014b3, 11740x00000007,0x000014af,0x000014a9,0x000014ae,
11740x0004007c,0x00000014,0x000014a4,0x000014b4, 11750x0004007c,0x00000014,0x0000149f,0x000014af,
11750x00060041,0x000000db,0x0000149c,0x000014a4, 11760x00060041,0x000000db,0x00001497,0x0000149f,
11760x000000da,0x000000da,0x0005003e,0x0000149c, 11770x000000da,0x000000da,0x0005003e,0x00001497,
11770x000000a6,0x00000002,0x00000004,0x000200f9, 11780x000000a6,0x00000002,0x00000004,0x000200f9,
11780x00000b4b,0x000200f8,0x00000b4b,0x000200f9, 11790x00000b43,0x000200f8,0x00000b43,0x000200f9,
11790x00000bf3,0x000200f8,0x00000b47,0x00050041, 11800x00000bed,0x000200f8,0x00000b3f,0x00050041,
11800x000000fe,0x00000b4f,0x000000fc,0x000004d8, 11810x000000fe,0x00000b47,0x000000fc,0x000004d5,
11810x0004003d,0x00000006,0x00000b50,0x00000b4f, 11820x0004003d,0x00000006,0x00000b48,0x00000b47,
11820x000500ae,0x0000002f,0x00000b51,0x00000b11, 11830x000500ae,0x0000002f,0x00000b49,0x00000b09,
11830x00000b50,0x000300f7,0x00000b53,0x00000000, 11840x00000b48,0x000300f7,0x00000b4b,0x00000000,
11840x000400fa,0x00000b51,0x00000b52,0x00000b53, 11850x000400fa,0x00000b49,0x00000b4a,0x00000b4b,
11850x000200f8,0x00000b52,0x000200f9,0x00000bf3, 11860x000200f8,0x00000b4a,0x000200f9,0x00000bed,
11860x000200f8,0x00000b53,0x000500aa,0x0000002f, 11870x000200f8,0x00000b4b,0x000500aa,0x0000002f,
11870x00000b58,0x00000b13,0x00000b57,0x000300f7, 11880x00000b50,0x00000b0b,0x00000b4f,0x000300f7,
11880x00000b5a,0x00000000,0x000400fa,0x00000b58, 11890x00000b52,0x00000000,0x000400fa,0x00000b50,
11890x00000b59,0x00000b5a,0x000200f8,0x00000b59, 11900x00000b51,0x00000b52,0x000200f8,0x00000b51,
11900x000500aa,0x0000002f,0x00000b5c,0x00000b11, 11910x000500aa,0x0000002f,0x00000b54,0x00000b09,
11910x000000a6,0x000300f7,0x00000b5e,0x00000000, 11920x000000a6,0x000300f7,0x00000b56,0x00000000,
11920x000400fa,0x00000b5c,0x00000b5d,0x00000b5e, 11930x000400fa,0x00000b54,0x00000b55,0x00000b56,
11930x000200f8,0x00000b5d,0x00050041,0x00000156, 11940x000200f8,0x00000b55,0x00050041,0x00000156,
11940x00000b60,0x000000fc,0x00000205,0x0004003d, 11950x00000b58,0x000000fc,0x00000205,0x0004003d,
11950x00000007,0x00000b61,0x00000b60,0x00050051, 11960x00000007,0x00000b59,0x00000b58,0x00050051,
11960x00000006,0x000014cb,0x00000b61,0x00000000, 11970x00000006,0x000014c6,0x00000b59,0x00000000,
11970x00050095,0x000000ab,0x000014cd,0x000014cb, 11980x00050095,0x000000ab,0x000014c8,0x000014c6,
11980x0000010a,0x00050051,0x00000006,0x000014ce, 11990x0000010a,0x00050051,0x00000006,0x000014c9,
11990x000014cd,0x00000001,0x00050051,0x00000006, 12000x000014c8,0x00000001,0x00050051,0x00000006,
12000x000014cf,0x000014cd,0x00000000,0x00050051, 12010x000014ca,0x000014c8,0x00000000,0x00050051,
12010x00000006,0x000014d2,0x00000b61,0x00000001, 12020x00000006,0x000014cd,0x00000b59,0x00000001,
12020x00050080,0x00000006,0x000014d4,0x000014d2, 12030x00050080,0x00000006,0x000014cf,0x000014cd,
12030x000014ce,0x00050050,0x00000007,0x000014d5, 12040x000014c9,0x00050050,0x00000007,0x000014d0,
12040x000014cf,0x000014d4,0x0004007c,0x00000014, 12050x000014ca,0x000014cf,0x0004007c,0x00000014,
12050x000014c5,0x000014d5,0x00060041,0x000000db, 12060x000014c0,0x000014d0,0x00060041,0x000000db,
12060x000014bc,0x000014c5,0x000000da,0x000000da, 12070x000014b7,0x000014c0,0x000000da,0x000000da,
12070x0006003d,0x00000006,0x000014bd,0x000014bc, 12080x0006003d,0x00000006,0x000014b8,0x000014b7,
12080x00000002,0x00000004,0x00050084,0x00000006, 12090x00000002,0x00000004,0x00050080,0x00000006,
12090x00000b64,0x000014bd,0x00000107,0x00050041, 12100x00000b5c,0x000014b8,0x000000b0,0x00050084,
12100x00000156,0x00000b66,0x000000fc,0x000000da, 12110x00000006,0x00000b5d,0x00000b5c,0x00000107,
12110x0004003d,0x00000007,0x00000b67,0x00000b66, 12120x00050041,0x00000156,0x00000b5f,0x000000fc,
12120x00050051,0x00000006,0x000014eb,0x00000b67, 12130x000000da,0x0004003d,0x00000007,0x00000b60,
12130x00000000,0x00050095,0x000000ab,0x000014ed, 12140x00000b5f,0x00050051,0x00000006,0x000014e6,
12140x000014eb,0x000000a6,0x00050051,0x00000006, 12150x00000b60,0x00000000,0x00050095,0x000000ab,
12150x000014ee,0x000014ed,0x00000001,0x00050051, 12160x000014e8,0x000014e6,0x000000a6,0x00050051,
12160x00000006,0x000014ef,0x000014ed,0x00000000, 12170x00000006,0x000014e9,0x000014e8,0x00000001,
12170x00050051,0x00000006,0x000014f2,0x00000b67, 12180x00050051,0x00000006,0x000014ea,0x000014e8,
12180x00000001,0x00050080,0x00000006,0x000014f4, 12190x00000000,0x00050051,0x00000006,0x000014ed,
12190x000014f2,0x000014ee,0x00050050,0x00000007, 12200x00000b60,0x00000001,0x00050080,0x00000006,
12200x000014f5,0x000014ef,0x000014f4,0x0004007c, 12210x000014ef,0x000014ed,0x000014e9,0x00050050,
12210x00000014,0x000014e5,0x000014f5,0x00060041, 12220x00000007,0x000014f0,0x000014ea,0x000014ef,
12220x000000db,0x000014dd,0x000014e5,0x000000da, 12230x0004007c,0x00000014,0x000014e0,0x000014f0,
12230x000000da,0x0005003e,0x000014dd,0x00000b64, 12240x00060041,0x000000db,0x000014d8,0x000014e0,
12240x00000002,0x00000004,0x00050095,0x000000ab, 12250x000000da,0x000000da,0x0005003e,0x000014d8,
12250x0000150d,0x000014eb,0x0000010a,0x00050051, 12260x00000b5d,0x00000002,0x00000004,0x00050095,
12260x00000006,0x0000150e,0x0000150d,0x00000001, 12270x000000ab,0x00001508,0x000014e6,0x0000010a,
12270x00050051,0x00000006,0x0000150f,0x0000150d, 12280x00050051,0x00000006,0x00001509,0x00001508,
12280x00000000,0x00050080,0x00000006,0x00001514, 12290x00000001,0x00050051,0x00000006,0x0000150a,
12290x000014f2,0x0000150e,0x00050050,0x00000007, 12300x00001508,0x00000000,0x00050080,0x00000006,
12300x00001515,0x0000150f,0x00001514,0x0004007c, 12310x0000150f,0x000014ed,0x00001509,0x00050050,
12310x00000014,0x00001505,0x00001515,0x00060041, 12320x00000007,0x00001510,0x0000150a,0x0000150f,
12320x000000db,0x000014fd,0x00001505,0x000000da, 12330x0004007c,0x00000014,0x00001500,0x00001510,
12330x000000da,0x0005003e,0x000014fd,0x000000a6, 12340x00060041,0x000000db,0x000014f8,0x00001500,
12340x00000002,0x00000004,0x000200f9,0x00000b5e, 12350x000000da,0x000000da,0x0005003e,0x000014f8,
12350x000200f8,0x00000b5e,0x000200f9,0x00000bf3, 12360x000000a6,0x00000002,0x00000004,0x000200f9,
12360x000200f8,0x00000b5a,0x000500aa,0x0000002f, 12370x00000b56,0x000200f8,0x00000b56,0x000200f9,
12370x00000b74,0x00000b13,0x00000118,0x000300f7, 12380x00000bed,0x000200f8,0x00000b52,0x000500aa,
12380x00000b76,0x00000000,0x000400fa,0x00000b74, 12390x0000002f,0x00000b6d,0x00000b0b,0x00000118,
12390x00000b75,0x00000b76,0x000200f8,0x00000b75, 12400x000300f7,0x00000b6f,0x00000000,0x000400fa,
12400x00050084,0x00000006,0x00000b78,0x0000010a, 12410x00000b6d,0x00000b6e,0x00000b6f,0x000200f8,
12410x00000b11,0x00050041,0x00000156,0x00000b7a, 12420x00000b6e,0x00050084,0x00000006,0x00000b71,
12430x0000010a,0x00000b09,0x00050041,0x00000156,
12440x00000b73,0x000000fc,0x00000205,0x0004003d,
12450x00000007,0x00000b74,0x00000b73,0x00050051,
12460x00000006,0x00001527,0x00000b74,0x00000000,
12470x00050095,0x000000ab,0x00001529,0x00001527,
12480x0000010a,0x00050051,0x00000006,0x0000152a,
12490x00001529,0x00000001,0x00050051,0x00000006,
12500x0000152b,0x00001529,0x00000000,0x00050051,
12510x00000006,0x0000152e,0x00000b74,0x00000001,
12520x00050080,0x00000006,0x00001530,0x0000152e,
12530x0000152a,0x00050050,0x00000007,0x00001531,
12540x0000152b,0x00001530,0x0004007c,0x00000014,
12550x00001521,0x00001531,0x00060041,0x000000db,
12560x00001518,0x00001521,0x000000da,0x000000da,
12570x0006003d,0x00000006,0x00001519,0x00001518,
12580x00000002,0x00000004,0x00050080,0x00000006,
12590x00000b77,0x00001519,0x000000b0,0x00050084,
12600x00000006,0x00000b78,0x00000b77,0x00000107,
12610x000500b0,0x0000002f,0x00000b79,0x00000b71,
12620x00000b78,0x000300f7,0x00000b7b,0x00000000,
12630x000400fa,0x00000b79,0x00000b7a,0x00000b7b,
12640x000200f8,0x00000b7a,0x00050095,0x000000ab,
12650x0000154a,0x00001527,0x00000b71,0x00050051,
12660x00000006,0x0000154b,0x0000154a,0x00000001,
12670x00050051,0x00000006,0x0000154c,0x0000154a,
12680x00000000,0x00050080,0x00000006,0x00001551,
12690x0000152e,0x0000154b,0x00050050,0x00000007,
12700x00001552,0x0000154c,0x00001551,0x0004007c,
12710x00000014,0x00001542,0x00001552,0x00060041,
12720x000000db,0x00001539,0x00001542,0x000000da,
12730x000000da,0x0006003d,0x00000006,0x0000153a,
12740x00001539,0x00000002,0x00000004,0x00050041,
12750x00000156,0x00000b86,0x000000fc,0x000000da,
12760x0004003d,0x00000007,0x00000b87,0x00000b86,
12770x00050051,0x00000006,0x00001568,0x00000b87,
12780x00000000,0x00050095,0x000000ab,0x0000156a,
12790x00001568,0x00000b71,0x00050051,0x00000006,
12800x0000156b,0x0000156a,0x00000001,0x00050051,
12810x00000006,0x0000156c,0x0000156a,0x00000000,
12820x00050051,0x00000006,0x0000156f,0x00000b87,
12830x00000001,0x00050080,0x00000006,0x00001571,
12840x0000156f,0x0000156b,0x00050050,0x00000007,
12850x00001572,0x0000156c,0x00001571,0x0004007c,
12860x00000014,0x00001562,0x00001572,0x00060041,
12870x000000db,0x0000155a,0x00001562,0x000000da,
12880x000000da,0x0005003e,0x0000155a,0x0000153a,
12890x00000002,0x00000004,0x000200f9,0x00000b7b,
12900x000200f8,0x00000b7b,0x000200f9,0x00000bed,
12910x000200f8,0x00000b6f,0x000500aa,0x0000002f,
12920x00000b8f,0x00000b0b,0x00000b8e,0x000300f7,
12930x00000b91,0x00000000,0x000400fa,0x00000b8f,
12940x00000b90,0x00000ba1,0x000200f8,0x00000b90,
12950x00050084,0x00000006,0x00000b93,0x0000010a,
12960x00000b09,0x00050041,0x00000156,0x00000b97,
12420x000000fc,0x00000205,0x0004003d,0x00000007, 12970x000000fc,0x00000205,0x0004003d,0x00000007,
12430x00000b7b,0x00000b7a,0x00050051,0x00000006, 12980x00000b98,0x00000b97,0x00050051,0x00000006,
12440x0000152c,0x00000b7b,0x00000000,0x00050095, 12990x00001589,0x00000b98,0x00000000,0x00050095,
12450x000000ab,0x0000152e,0x0000152c,0x0000010a, 13000x000000ab,0x0000158b,0x00001589,0x00000b93,
12460x00050051,0x00000006,0x0000152f,0x0000152e, 13010x00050051,0x00000006,0x0000158c,0x0000158b,
12470x00000001,0x00050051,0x00000006,0x00001530, 13020x00000001,0x00050051,0x00000006,0x0000158d,
12480x0000152e,0x00000000,0x00050051,0x00000006, 13030x0000158b,0x00000000,0x00050051,0x00000006,
12490x00001533,0x00000b7b,0x00000001,0x00050080, 13040x00001590,0x00000b98,0x00000001,0x00050080,
12500x00000006,0x00001535,0x00001533,0x0000152f, 13050x00000006,0x00001592,0x00001590,0x0000158c,
12510x00050050,0x00000007,0x00001536,0x00001530, 13060x00050050,0x00000007,0x00001593,0x0000158d,
12520x00001535,0x0004007c,0x00000014,0x00001526, 13070x00001592,0x0004007c,0x00000014,0x00001583,
12530x00001536,0x00060041,0x000000db,0x0000151d, 13080x00001593,0x00060041,0x000000db,0x0000157a,
12540x00001526,0x000000da,0x000000da,0x0006003d, 13090x00001583,0x000000da,0x000000da,0x0006003d,
12550x00000006,0x0000151e,0x0000151d,0x00000002, 13100x00000006,0x0000157b,0x0000157a,0x00000002,
12560x00000004,0x00050084,0x00000006,0x00000b7e, 13110x00000004,0x00050041,0x00000156,0x00000b9c,
12570x0000151e,0x00000107,0x000500b0,0x0000002f,
12580x00000b7f,0x00000b78,0x00000b7e,0x000300f7,
12590x00000b81,0x00000000,0x000400fa,0x00000b7f,
12600x00000b80,0x00000b81,0x000200f8,0x00000b80,
12610x00050095,0x000000ab,0x0000154f,0x0000152c,
12620x00000b78,0x00050051,0x00000006,0x00001550,
12630x0000154f,0x00000001,0x00050051,0x00000006,
12640x00001551,0x0000154f,0x00000000,0x00050080,
12650x00000006,0x00001556,0x00001533,0x00001550,
12660x00050050,0x00000007,0x00001557,0x00001551,
12670x00001556,0x0004007c,0x00000014,0x00001547,
12680x00001557,0x00060041,0x000000db,0x0000153e,
12690x00001547,0x000000da,0x000000da,0x0006003d,
12700x00000006,0x0000153f,0x0000153e,0x00000002,
12710x00000004,0x00050041,0x00000156,0x00000b8c,
12720x000000fc,0x000000da,0x0004003d,0x00000007, 13120x000000fc,0x000000da,0x0004003d,0x00000007,
12730x00000b8d,0x00000b8c,0x00050051,0x00000006, 13130x00000b9d,0x00000b9c,0x00050051,0x00000006,
12740x0000156d,0x00000b8d,0x00000000,0x00050095, 13140x000015a9,0x00000b9d,0x00000000,0x00050095,
12750x000000ab,0x0000156f,0x0000156d,0x00000b78, 13150x000000ab,0x000015ab,0x000015a9,0x00000b93,
12760x00050051,0x00000006,0x00001570,0x0000156f, 13160x00050051,0x00000006,0x000015ac,0x000015ab,
12770x00000001,0x00050051,0x00000006,0x00001571, 13170x00000001,0x00050051,0x00000006,0x000015ad,
12780x0000156f,0x00000000,0x00050051,0x00000006, 13180x000015ab,0x00000000,0x00050051,0x00000006,
12790x00001574,0x00000b8d,0x00000001,0x00050080, 13190x000015b0,0x00000b9d,0x00000001,0x00050080,
12800x00000006,0x00001576,0x00001574,0x00001570, 13200x00000006,0x000015b2,0x000015b0,0x000015ac,
12810x00050050,0x00000007,0x00001577,0x00001571, 13210x00050050,0x00000007,0x000015b3,0x000015ad,
12820x00001576,0x0004007c,0x00000014,0x00001567, 13220x000015b2,0x0004007c,0x00000014,0x000015a3,
12830x00001577,0x00060041,0x000000db,0x0000155f, 13230x000015b3,0x00060041,0x000000db,0x0000159b,
12840x00001567,0x000000da,0x000000da,0x0005003e, 13240x000015a3,0x000000da,0x000000da,0x0005003e,
12850x0000155f,0x0000153f,0x00000002,0x00000004, 13250x0000159b,0x0000157b,0x00000002,0x00000004,
12860x000200f9,0x00000b81,0x000200f8,0x00000b81, 13260x000200f9,0x00000b91,0x000200f8,0x00000ba1,
12870x000200f9,0x00000bf3,0x000200f8,0x00000b76, 13270x000500aa,0x0000002f,0x00000ba4,0x00000b0b,
12880x000500aa,0x0000002f,0x00000b95,0x00000b13, 13280x000000a6,0x000300f7,0x00000ba6,0x00000000,
12890x00000b94,0x000300f7,0x00000b97,0x00000000, 13290x000400fa,0x00000ba4,0x00000ba5,0x00000bc7,
12900x000400fa,0x00000b95,0x00000b96,0x00000ba7, 13300x000200f8,0x00000ba5,0x00050041,0x000000fe,
12910x000200f8,0x00000b96,0x00050084,0x00000006, 13310x00000ba7,0x000000fc,0x000009e6,0x0004003d,
12920x00000b99,0x0000010a,0x00000b11,0x00050041, 13320x00000006,0x00000ba8,0x00000ba7,0x00050084,
12930x00000156,0x00000b9d,0x000000fc,0x00000205, 13330x00000006,0x00000baa,0x0000010a,0x00000b09,
12940x0004003d,0x00000007,0x00000b9e,0x00000b9d, 13340x00050080,0x00000006,0x00000bab,0x00000ba8,
12950x00050051,0x00000006,0x0000158e,0x00000b9e, 13350x00000baa,0x00050041,0x00000156,0x00000bad,
12960x00000000,0x00050095,0x000000ab,0x00001590, 13360x000000fc,0x000000da,0x0004003d,0x00000007,
12970x0000158e,0x00000b99,0x00050051,0x00000006, 13370x00000bae,0x00000bad,0x00050051,0x00000006,
12980x00001591,0x00001590,0x00000001,0x00050051, 13380x000015c9,0x00000bae,0x00000000,0x00050095,
12990x00000006,0x00001592,0x00001590,0x00000000, 13390x000000ab,0x000015cb,0x000015c9,0x00000bab,
13000x00050051,0x00000006,0x00001595,0x00000b9e, 13400x00050051,0x00000006,0x000015cc,0x000015cb,
13010x00000001,0x00050080,0x00000006,0x00001597, 13410x00000001,0x00050051,0x00000006,0x000015cd,
13020x00001595,0x00001591,0x00050050,0x00000007, 13420x000015cb,0x00000000,0x00050051,0x00000006,
13030x00001598,0x00001592,0x00001597,0x0004007c, 13430x000015d0,0x00000bae,0x00000001,0x00050080,
13040x00000014,0x00001588,0x00001598,0x00060041, 13440x00000006,0x000015d2,0x000015d0,0x000015cc,
13050x000000db,0x0000157f,0x00001588,0x000000da, 13450x00050050,0x00000007,0x000015d3,0x000015cd,
13060x000000da,0x0006003d,0x00000006,0x00001580, 13460x000015d2,0x0004007c,0x00000014,0x000015c3,
13070x0000157f,0x00000002,0x00000004,0x00050041, 13470x000015d3,0x00060041,0x000000db,0x000015bb,
13080x00000156,0x00000ba2,0x000000fc,0x000000da, 13480x000015c3,0x000000da,0x000000da,0x0005003e,
13090x0004003d,0x00000007,0x00000ba3,0x00000ba2, 13490x000015bb,0x00000380,0x00000002,0x00000004,
13100x00050051,0x00000006,0x000015ae,0x00000ba3, 13500x000500b0,0x0000002f,0x00000bb3,0x00000b09,
13110x00000000,0x00050095,0x000000ab,0x000015b0, 13510x000002b7,0x000300f7,0x00000bb5,0x00000000,
13120x000015ae,0x00000b99,0x00050051,0x00000006, 13520x000400fa,0x00000bb3,0x00000bb4,0x00000bb5,
13130x000015b1,0x000015b0,0x00000001,0x00050051, 13530x000200f8,0x00000bb4,0x00050041,0x00000156,
13140x00000006,0x000015b2,0x000015b0,0x00000000, 13540x00000bb9,0x000000fc,0x00000154,0x0004003d,
13150x00050051,0x00000006,0x000015b5,0x00000ba3, 13550x00000007,0x00000bba,0x00000bb9,0x00050051,
13160x00000001,0x00050080,0x00000006,0x000015b7, 13560x00000006,0x000015e9,0x00000bba,0x00000000,
13170x000015b5,0x000015b1,0x00050050,0x00000007, 13570x00050095,0x000000ab,0x000015eb,0x000015e9,
13180x000015b8,0x000015b2,0x000015b7,0x0004007c, 13580x00000baa,0x00050051,0x00000006,0x000015ec,
13190x00000014,0x000015a8,0x000015b8,0x00060041, 13590x000015eb,0x00000001,0x00050051,0x00000006,
13200x000000db,0x000015a0,0x000015a8,0x000000da, 13600x000015ed,0x000015eb,0x00000000,0x00050051,
13210x000000da,0x0005003e,0x000015a0,0x00001580, 13610x00000006,0x000015f0,0x00000bba,0x00000001,
13220x00000002,0x00000004,0x000200f9,0x00000b97, 13620x00050080,0x00000006,0x000015f2,0x000015f0,
13230x000200f8,0x00000ba7,0x000500aa,0x0000002f, 13630x000015ec,0x00050050,0x00000007,0x000015f3,
13240x00000baa,0x00000b13,0x000000a6,0x000300f7, 13640x000015ed,0x000015f2,0x0004007c,0x00000014,
13250x00000bac,0x00000000,0x000400fa,0x00000baa, 13650x000015e3,0x000015f3,0x00060041,0x000000db,
13260x00000bab,0x00000bcd,0x000200f8,0x00000bab, 13660x000015db,0x000015e3,0x000000da,0x000000da,
13270x00050041,0x000000fe,0x00000bad,0x000000fc, 13670x0005003e,0x000015db,0x00000380,0x00000002,
13280x000009ef,0x0004003d,0x00000006,0x00000bae, 13680x00000004,0x00050080,0x00000006,0x00000bc0,
13290x00000bad,0x00050084,0x00000006,0x00000bb0, 13690x00000118,0x00000baa,0x00050095,0x000000ab,
13300x0000010a,0x00000b11,0x00050080,0x00000006, 13700x0000160b,0x000015e9,0x00000bc0,0x00050051,
13310x00000bb1,0x00000bae,0x00000bb0,0x00050041, 13710x00000006,0x0000160c,0x0000160b,0x00000001,
13320x00000156,0x00000bb3,0x000000fc,0x000000da, 13720x00050051,0x00000006,0x0000160d,0x0000160b,
13330x0004003d,0x00000007,0x00000bb4,0x00000bb3, 13730x00000000,0x00050080,0x00000006,0x00001612,
13340x00050051,0x00000006,0x000015ce,0x00000bb4, 13740x000015f0,0x0000160c,0x00050050,0x00000007,
13350x00000000,0x00050095,0x000000ab,0x000015d0, 13750x00001613,0x0000160d,0x00001612,0x0004007c,
13360x000015ce,0x00000bb1,0x00050051,0x00000006, 13760x00000014,0x00001603,0x00001613,0x00060041,
13370x000015d1,0x000015d0,0x00000001,0x00050051, 13770x000000db,0x000015fb,0x00001603,0x000000da,
13380x00000006,0x000015d2,0x000015d0,0x00000000, 13780x000000da,0x0005003e,0x000015fb,0x000000a6,
13390x00050051,0x00000006,0x000015d5,0x00000bb4, 13790x00000002,0x00000004,0x000200f9,0x00000bb5,
13400x00000001,0x00050080,0x00000006,0x000015d7, 13800x000200f8,0x00000bb5,0x000200f9,0x00000ba6,
13410x000015d5,0x000015d1,0x00050050,0x00000007, 13810x000200f8,0x00000bc7,0x000500aa,0x0000002f,
13420x000015d8,0x000015d2,0x000015d7,0x0004007c, 13820x00000bca,0x00000b0b,0x000000b0,0x000300f7,
13430x00000014,0x000015c8,0x000015d8,0x00060041, 13830x00000bcc,0x00000000,0x000400fa,0x00000bca,
13440x000000db,0x000015c0,0x000015c8,0x000000da, 13840x00000bcb,0x00000bd0,0x000200f8,0x00000bcb,
13450x000000da,0x0005003e,0x000015c0,0x00000380, 13850x000200f9,0x00001643,0x000200f8,0x00001643,
13460x00000002,0x00000004,0x000500b0,0x0000002f, 13860x000700f5,0x00000006,0x0000322b,0x000000a6,
13470x00000bb9,0x00000b11,0x000002b7,0x000300f7, 13870x00000bcb,0x00001653,0x00001651,0x000500b0,
13480x00000bbb,0x00000000,0x000400fa,0x00000bb9, 13880x0000002f,0x00001646,0x0000322b,0x000002b7,
13490x00000bba,0x00000bbb,0x000200f8,0x00000bba, 13890x000400f6,0x00001654,0x00001651,0x00000000,
13500x00050041,0x00000156,0x00000bbf,0x000000fc, 13900x000400fa,0x00001646,0x00001647,0x00001654,
13510x00000154,0x0004003d,0x00000007,0x00000bc0, 13910x000200f8,0x00001647,0x00050084,0x00000006,
13520x00000bbf,0x00050051,0x00000006,0x000015ee, 13920x0000164a,0x000002b7,0x00000b09,0x00050080,
13530x00000bc0,0x00000000,0x00050095,0x000000ab, 13930x00000006,0x0000164c,0x0000164a,0x0000322b,
13540x000015f0,0x000015ee,0x00000bb0,0x00050051, 13940x000300f7,0x0000170f,0x00000000,0x000300fb,
13550x00000006,0x000015f1,0x000015f0,0x00000001, 13950x000000a6,0x000016ed,0x000200f8,0x000016ed,
13560x00050051,0x00000006,0x000015f2,0x000015f0, 13960x00050041,0x000000fe,0x000016ee,0x000000fc,
13570x00000000,0x00050051,0x00000006,0x000015f5, 13970x0000027b,0x0004003d,0x00000006,0x000016ef,
13580x00000bc0,0x00000001,0x00050080,0x00000006, 13980x000016ee,0x000500aa,0x0000002f,0x000016f0,
13590x000015f7,0x000015f5,0x000015f1,0x00050050, 13990x000016ef,0x000000a6,0x000300f7,0x000016f3,
13600x00000007,0x000015f8,0x000015f2,0x000015f7, 14000x00000000,0x000400fa,0x000016f0,0x000016f1,
13610x0004007c,0x00000014,0x000015e8,0x000015f8, 14010x000016f3,0x000200f8,0x000016f1,0x000200f9,
13620x00060041,0x000000db,0x000015e0,0x000015e8, 14020x0000170f,0x000200f8,0x000016f3,0x000500aa,
13630x000000da,0x000000da,0x0005003e,0x000015e0, 14030x0000002f,0x000016f6,0x000016ef,0x00000170,
13640x00000380,0x00000002,0x00000004,0x00050080, 14040x000300f7,0x000016fd,0x00000000,0x000400fa,
13650x00000006,0x00000bc6,0x00000118,0x00000bb0, 14050x000016f6,0x000016f7,0x000016fd,0x000200f8,
13660x00050095,0x000000ab,0x00001610,0x000015ee, 14060x000016f7,0x00050084,0x00000006,0x000016f9,
13670x00000bc6,0x00050051,0x00000006,0x00001611, 14070x0000010a,0x0000164c,0x00050041,0x00000156,
13680x00001610,0x00000001,0x00050051,0x00000006, 14080x000016fa,0x000000fc,0x0000020d,0x0004003d,
13690x00001612,0x00001610,0x00000000,0x00050080, 14090x00000007,0x000016fb,0x000016fa,0x00050051,
13700x00000006,0x00001617,0x000015f5,0x00001611, 14100x00000006,0x00001727,0x000016fb,0x00000000,
13710x00050050,0x00000007,0x00001618,0x00001612, 14110x00050095,0x000000ab,0x00001729,0x00001727,
13720x00001617,0x0004007c,0x00000014,0x00001608, 14120x000016f9,0x00050051,0x00000006,0x0000172a,
13730x00001618,0x00060041,0x000000db,0x00001600, 14130x00001729,0x00000001,0x00050051,0x00000006,
13740x00001608,0x000000da,0x000000da,0x0005003e, 14140x0000172b,0x00001729,0x00000000,0x00050051,
13750x00001600,0x000000a6,0x00000002,0x00000004, 14150x00000006,0x0000172e,0x000016fb,0x00000001,
13760x000200f9,0x00000bbb,0x000200f8,0x00000bbb, 14160x00050080,0x00000006,0x00001730,0x0000172e,
13770x000200f9,0x00000bac,0x000200f8,0x00000bcd, 14170x0000172a,0x00050050,0x00000007,0x00001731,
13780x000500aa,0x0000002f,0x00000bd0,0x00000b13, 14180x0000172b,0x00001730,0x0004007c,0x00000014,
13790x000000b0,0x000300f7,0x00000bd2,0x00000000, 14190x00001721,0x00001731,0x00060041,0x000000db,
13800x000400fa,0x00000bd0,0x00000bd1,0x00000bd6, 14200x00001718,0x00001721,0x000000da,0x000000da,
13810x000200f8,0x00000bd1,0x000200f9,0x00001648, 14210x0006003d,0x00000006,0x00001719,0x00001718,
13820x000200f8,0x00001648,0x000700f5,0x00000006, 14220x00000002,0x00000004,0x000200f9,0x0000170f,
13830x0000323a,0x000000a6,0x00000bd1,0x00001658, 14230x000200f8,0x000016fd,0x000500c2,0x00000006,
13840x00001656,0x000500b0,0x0000002f,0x0000164b, 14240x000016ff,0x0000164c,0x00000154,0x00050084,
13850x0000323a,0x000002b7,0x000400f6,0x00001659, 14250x00000006,0x00001700,0x0000010a,0x000016ff,
13860x00001656,0x00000000,0x000400fa,0x0000164b,
13870x0000164c,0x00001659,0x000200f8,0x0000164c,
13880x00050084,0x00000006,0x0000164f,0x000002b7,
13890x00000b11,0x00050080,0x00000006,0x00001651,
13900x0000164f,0x0000323a,0x000300f7,0x00001716,
13910x00000000,0x000300fb,0x000000a6,0x000016f4,
13920x000200f8,0x000016f4,0x00050041,0x000000fe,
13930x000016f5,0x000000fc,0x0000027b,0x0004003d,
13940x00000006,0x000016f6,0x000016f5,0x000500aa,
13950x0000002f,0x000016f7,0x000016f6,0x000000a6,
13960x000300f7,0x000016fa,0x00000000,0x000400fa,
13970x000016f7,0x000016f8,0x000016fa,0x000200f8,
13980x000016f8,0x000200f9,0x00001716,0x000200f8,
13990x000016fa,0x000500aa,0x0000002f,0x000016fd,
14000x000016f6,0x00000170,0x000300f7,0x00001704,
14010x00000000,0x000400fa,0x000016fd,0x000016fe,
14020x00001704,0x000200f8,0x000016fe,0x00050084,
14030x00000006,0x00001700,0x0000010a,0x00001651,
14040x00050041,0x00000156,0x00001701,0x000000fc, 14260x00050041,0x00000156,0x00001701,0x000000fc,
14050x0000020d,0x0004003d,0x00000007,0x00001702, 14270x0000020d,0x0004003d,0x00000007,0x00001702,
14060x00001701,0x00050051,0x00000006,0x0000172e, 14280x00001701,0x00050051,0x00000006,0x00001748,
14070x00001702,0x00000000,0x00050095,0x000000ab, 14290x00001702,0x00000000,0x00050095,0x000000ab,
14080x00001730,0x0000172e,0x00001700,0x00050051, 14300x0000174a,0x00001748,0x00001700,0x00050051,
14090x00000006,0x00001731,0x00001730,0x00000001, 14310x00000006,0x0000174b,0x0000174a,0x00000001,
14100x00050051,0x00000006,0x00001732,0x00001730, 14320x00050051,0x00000006,0x0000174c,0x0000174a,
14110x00000000,0x00050051,0x00000006,0x00001735, 14330x00000000,0x00050051,0x00000006,0x0000174f,
14120x00001702,0x00000001,0x00050080,0x00000006, 14340x00001702,0x00000001,0x00050080,0x00000006,
14130x00001737,0x00001735,0x00001731,0x00050050, 14350x00001751,0x0000174f,0x0000174b,0x00050050,
14140x00000007,0x00001738,0x00001732,0x00001737, 14360x00000007,0x00001752,0x0000174c,0x00001751,
14150x0004007c,0x00000014,0x00001728,0x00001738, 14370x0004007c,0x00000014,0x00001742,0x00001752,
14160x00060041,0x000000db,0x0000171f,0x00001728, 14380x00060041,0x000000db,0x00001739,0x00001742,
14170x000000da,0x000000da,0x0006003d,0x00000006, 14390x000000da,0x000000da,0x0006003d,0x00000006,
14180x00001720,0x0000171f,0x00000002,0x00000004, 14400x0000173a,0x00001739,0x00000002,0x00000004,
14190x000200f9,0x00001716,0x000200f8,0x00001704, 14410x000500c7,0x00000006,0x00001705,0x0000164c,
14200x000500c2,0x00000006,0x00001706,0x00001651, 14420x000000b0,0x000500ab,0x0000002f,0x00001706,
14210x00000154,0x00050084,0x00000006,0x00001707, 14430x00001705,0x000000a6,0x000300f7,0x0000170d,
14220x0000010a,0x00001706,0x00050041,0x00000156, 14440x00000000,0x000400fa,0x00001706,0x00001707,
14230x00001708,0x000000fc,0x0000020d,0x0004003d, 14450x0000170a,0x000200f8,0x00001707,0x000500c2,
14240x00000007,0x00001709,0x00001708,0x00050051, 14460x00000006,0x00001709,0x0000173a,0x0000023e,
14250x00000006,0x0000174f,0x00001709,0x00000000, 14470x000200f9,0x0000170d,0x000200f8,0x0000170a,
14260x00050095,0x000000ab,0x00001751,0x0000174f, 14480x000500c7,0x00000006,0x0000170c,0x0000173a,
14270x00001707,0x00050051,0x00000006,0x00001752, 14490x000002a3,0x000200f9,0x0000170d,0x000200f8,
14280x00001751,0x00000001,0x00050051,0x00000006, 14500x0000170d,0x000700f5,0x00000006,0x00003235,
14290x00001753,0x00001751,0x00000000,0x00050051, 14510x00001709,0x00001707,0x0000170c,0x0000170a,
14300x00000006,0x00001756,0x00001709,0x00000001, 14520x000200f9,0x0000170f,0x000200f8,0x0000170f,
14310x00050080,0x00000006,0x00001758,0x00001756, 14530x000900f5,0x00000006,0x00003236,0x0000164c,
14320x00001752,0x00050050,0x00000007,0x00001759, 14540x000016f1,0x00001719,0x000016f7,0x00003235,
14330x00001753,0x00001758,0x0004007c,0x00000014, 14550x0000170d,0x00050041,0x000000fe,0x00001763,
14340x00001749,0x00001759,0x00060041,0x000000db, 14560x000000fc,0x00000250,0x0004003d,0x00000006,
14350x00001740,0x00001749,0x000000da,0x000000da, 14570x00001764,0x00001763,0x00050084,0x00000006,
14360x0006003d,0x00000006,0x00001741,0x00001740, 14580x00001765,0x00003236,0x00001764,0x00050041,
14370x00000002,0x00000004,0x000500c7,0x00000006, 14590x00000156,0x00001766,0x000000fc,0x00000205,
14380x0000170c,0x00001651,0x000000b0,0x000500ab, 14600x0004003d,0x00000007,0x00001767,0x00001766,
14390x0000002f,0x0000170d,0x0000170c,0x000000a6, 14610x00050051,0x00000006,0x00001782,0x00001767,
14400x000300f7,0x00001714,0x00000000,0x000400fa, 14620x00000000,0x00050095,0x000000ab,0x00001784,
14410x0000170d,0x0000170e,0x00001711,0x000200f8, 14630x00001782,0x00001765,0x00050051,0x00000006,
14420x0000170e,0x000500c2,0x00000006,0x00001710, 14640x00001785,0x00001784,0x00000001,0x00050051,
14430x00001741,0x0000023e,0x000200f9,0x00001714, 14650x00000006,0x00001786,0x00001784,0x00000000,
14440x000200f8,0x00001711,0x000500c7,0x00000006, 14660x00050051,0x00000006,0x00001789,0x00001767,
14450x00001713,0x00001741,0x000002a3,0x000200f9, 14670x00000001,0x00050080,0x00000006,0x0000178b,
14460x00001714,0x000200f8,0x00001714,0x000700f5, 14680x00001789,0x00001785,0x00050095,0x000000ab,
14470x00000006,0x00003244,0x00001710,0x0000170e, 14690x000017a5,0x00001786,0x000000a6,0x00050051,
14480x00001713,0x00001711,0x000200f9,0x00001716, 14700x00000006,0x000017a6,0x000017a5,0x00000001,
14490x000200f8,0x00001716,0x000900f5,0x00000006, 14710x00050051,0x00000006,0x000017a7,0x000017a5,
14500x00003245,0x00001651,0x000016f8,0x00001720, 14720x00000000,0x00050080,0x00000006,0x000017ac,
14510x000016fe,0x00003244,0x00001714,0x00050041, 14730x0000178b,0x000017a6,0x00050050,0x00000007,
14520x000000fe,0x0000176a,0x000000fc,0x00000250, 14740x000017ad,0x000017a7,0x000017ac,0x0004007c,
14530x0004003d,0x00000006,0x0000176b,0x0000176a, 14750x00000014,0x0000179d,0x000017ad,0x00060041,
14540x00050084,0x00000006,0x0000176c,0x00003245, 14760x000000db,0x00001794,0x0000179d,0x000000da,
14550x0000176b,0x00050041,0x00000156,0x0000176d, 14770x000000da,0x0006003d,0x00000006,0x00001795,
14560x000000fc,0x00000205,0x0004003d,0x00000007, 14780x00001794,0x00000002,0x00000004,0x0004007c,
14570x0000176e,0x0000176d,0x00050051,0x00000006, 14790x00000027,0x0000176b,0x00001795,0x00050095,
14580x00001789,0x0000176e,0x00000000,0x00050095, 14800x000000ab,0x000017c6,0x00001786,0x0000010a,
14590x000000ab,0x0000178b,0x00001789,0x0000176c, 14810x00050051,0x00000006,0x000017c7,0x000017c6,
14600x00050051,0x00000006,0x0000178c,0x0000178b, 14820x00000001,0x00050051,0x00000006,0x000017c8,
14610x00000001,0x00050051,0x00000006,0x0000178d, 14830x000017c6,0x00000000,0x00050080,0x00000006,
14620x0000178b,0x00000000,0x00050051,0x00000006, 14840x000017cd,0x0000178b,0x000017c7,0x00050050,
14630x00001790,0x0000176e,0x00000001,0x00050080, 14850x00000007,0x000017ce,0x000017c8,0x000017cd,
14640x00000006,0x00001792,0x00001790,0x0000178c, 14860x0004007c,0x00000014,0x000017be,0x000017ce,
14650x00050095,0x000000ab,0x000017ac,0x0000178d, 14870x00060041,0x000000db,0x000017b5,0x000017be,
14660x000000a6,0x00050051,0x00000006,0x000017ad, 14880x000000da,0x000000da,0x0006003d,0x00000006,
14670x000017ac,0x00000001,0x00050051,0x00000006, 14890x000017b6,0x000017b5,0x00000002,0x00000004,
14680x000017ae,0x000017ac,0x00000000,0x00050080, 14900x0004007c,0x00000027,0x0000176e,0x000017b6,
14690x00000006,0x000017b3,0x00001792,0x000017ad, 14910x00050041,0x000000fe,0x0000176f,0x000000fc,
14700x00050050,0x00000007,0x000017b4,0x000017ae, 14920x00000266,0x0004003d,0x00000006,0x00001770,
14710x000017b3,0x0004007c,0x00000014,0x000017a4, 14930x0000176f,0x000500aa,0x0000002f,0x00001771,
14720x000017b4,0x00060041,0x000000db,0x0000179b, 14940x00001770,0x000000b0,0x000300f7,0x00001777,
14730x000017a4,0x000000da,0x000000da,0x0006003d, 14950x00000000,0x000400fa,0x00001771,0x00001772,
14740x00000006,0x0000179c,0x0000179b,0x00000002, 14960x00001773,0x000200f8,0x00001772,0x000200f9,
14750x00000004,0x0004007c,0x00000027,0x00001772, 14970x00001777,0x000200f8,0x00001773,0x00050095,
14760x0000179c,0x00050095,0x000000ab,0x000017cd, 14980x000000ab,0x000017e7,0x00001786,0x00000111,
14770x0000178d,0x0000010a,0x00050051,0x00000006, 14990x00050051,0x00000006,0x000017e8,0x000017e7,
14780x000017ce,0x000017cd,0x00000001,0x00050051, 15000x00000001,0x00050051,0x00000006,0x000017e9,
14790x00000006,0x000017cf,0x000017cd,0x00000000, 15010x000017e7,0x00000000,0x00050080,0x00000006,
14800x00050080,0x00000006,0x000017d4,0x00001792, 15020x000017ee,0x0000178b,0x000017e8,0x00050050,
14810x000017ce,0x00050050,0x00000007,0x000017d5, 15030x00000007,0x000017ef,0x000017e9,0x000017ee,
14820x000017cf,0x000017d4,0x0004007c,0x00000014, 15040x0004007c,0x00000014,0x000017df,0x000017ef,
14830x000017c5,0x000017d5,0x00060041,0x000000db, 15050x00060041,0x000000db,0x000017d6,0x000017df,
14840x000017bc,0x000017c5,0x000000da,0x000000da,
14850x0006003d,0x00000006,0x000017bd,0x000017bc,
14860x00000002,0x00000004,0x0004007c,0x00000027,
14870x00001775,0x000017bd,0x00050041,0x000000fe,
14880x00001776,0x000000fc,0x00000266,0x0004003d,
14890x00000006,0x00001777,0x00001776,0x000500aa,
14900x0000002f,0x00001778,0x00001777,0x000000b0,
14910x000300f7,0x0000177e,0x00000000,0x000400fa,
14920x00001778,0x00001779,0x0000177a,0x000200f8,
14930x00001779,0x000200f9,0x0000177e,0x000200f8,
14940x0000177a,0x00050095,0x000000ab,0x000017ee,
14950x0000178d,0x00000111,0x00050051,0x00000006,
14960x000017ef,0x000017ee,0x00000001,0x00050051,
14970x00000006,0x000017f0,0x000017ee,0x00000000,
14980x00050080,0x00000006,0x000017f5,0x00001792,
14990x000017ef,0x00050050,0x00000007,0x000017f6,
15000x000017f0,0x000017f5,0x0004007c,0x00000014,
15010x000017e6,0x000017f6,0x00060041,0x000000db,
15020x000017dd,0x000017e6,0x000000da,0x000000da,
15030x0006003d,0x00000006,0x000017de,0x000017dd,
15040x00000002,0x00000004,0x0004007c,0x00000027,
15050x0000177d,0x000017de,0x000200f9,0x0000177e,
15060x000200f8,0x0000177e,0x000700f5,0x00000027,
15070x00003246,0x0000026d,0x00001779,0x0000177d,
15080x0000177a,0x00060050,0x0000004b,0x00001783,
15090x00001772,0x00001775,0x00003246,0x000300f7,
15100x0000183c,0x00000000,0x000300fb,0x000000a6,
15110x00001808,0x000200f8,0x00001808,0x00050041,
15120x00000156,0x00001809,0x000000fc,0x00000215,
15130x0004003d,0x00000007,0x0000180a,0x00001809,
15140x00050051,0x00000006,0x00001841,0x0000180a,
15150x00000000,0x000500aa,0x0000002f,0x00001842,
15160x00001841,0x000000a6,0x000300f7,0x00001847,
15170x00000000,0x000400fa,0x00001842,0x00001843,
15180x00001847,0x000200f8,0x00001843,0x00050051,
15190x00000006,0x00001845,0x0000180a,0x00000001,
15200x000500aa,0x0000002f,0x00001846,0x00001845,
15210x000000a6,0x000200f9,0x00001847,0x000200f8,
15220x00001847,0x000700f5,0x0000002f,0x00001848,
15230x00001842,0x00001808,0x00001846,0x00001843,
15240x000300f7,0x0000180e,0x00000000,0x000400fa,
15250x00001848,0x0000180c,0x0000180e,0x000200f8,
15260x0000180c,0x000200f9,0x0000183c,0x000200f8,
15270x0000180e,0x000200f9,0x0000180f,0x000200f8,
15280x0000180f,0x000700f5,0x00000006,0x00003247,
15290x000000a6,0x0000180e,0x00001839,0x00001813,
15300x000500b0,0x0000002f,0x00001812,0x00003247,
15310x000002b7,0x000400f6,0x0000183a,0x00001813,
15320x00000000,0x000400fa,0x00001812,0x00001813,
15330x0000183a,0x000200f8,0x00001813,0x00050084,
15340x00000006,0x00001815,0x0000011f,0x00003247,
15350x00050095,0x000000ab,0x00001861,0x00001841,
15360x00001815,0x00050051,0x00000006,0x00001862,
15370x00001861,0x00000001,0x00050051,0x00000006,
15380x00001863,0x00001861,0x00000000,0x00050051,
15390x00000006,0x00001866,0x0000180a,0x00000001,
15400x00050080,0x00000006,0x00001868,0x00001866,
15410x00001862,0x00050050,0x00000007,0x00001869,
15420x00001863,0x00001868,0x0004007c,0x00000014,
15430x00001859,0x00001869,0x00060041,0x000000db,
15440x00001850,0x00001859,0x000000da,0x000000da,
15450x0006003d,0x00000006,0x00001851,0x00001850,
15460x00000002,0x00000004,0x0004007c,0x00000027,
15470x0000181a,0x00001851,0x00050080,0x00000006,
15480x0000181c,0x00001815,0x0000010a,0x00050095,
15490x000000ab,0x00001882,0x00001841,0x0000181c,
15500x00050051,0x00000006,0x00001883,0x00001882,
15510x00000001,0x00050051,0x00000006,0x00001884,
15520x00001882,0x00000000,0x00050080,0x00000006,
15530x00001889,0x00001866,0x00001883,0x00050050,
15540x00000007,0x0000188a,0x00001884,0x00001889,
15550x0004007c,0x00000014,0x0000187a,0x0000188a,
15560x00060041,0x000000db,0x00001871,0x0000187a,
15570x000000da,0x000000da,0x0006003d,0x00000006, 15060x000000da,0x000000da,0x0006003d,0x00000006,
15580x00001872,0x00001871,0x00000002,0x00000004, 15070x000017d7,0x000017d6,0x00000002,0x00000004,
15590x0004007c,0x00000027,0x00001820,0x00001872, 15080x0004007c,0x00000027,0x00001776,0x000017d7,
15600x00050080,0x00000006,0x00001822,0x00001815, 15090x000200f9,0x00001777,0x000200f8,0x00001777,
15610x00000111,0x00050095,0x000000ab,0x000018a3, 15100x000700f5,0x00000027,0x00003237,0x0000026d,
15620x00001841,0x00001822,0x00050051,0x00000006, 15110x00001772,0x00001776,0x00001773,0x00060050,
15630x000018a4,0x000018a3,0x00000001,0x00050051, 15120x0000004b,0x0000177c,0x0000176b,0x0000176e,
15640x00000006,0x000018a5,0x000018a3,0x00000000, 15130x00003237,0x000300f7,0x00001835,0x00000000,
15650x00050080,0x00000006,0x000018aa,0x00001866, 15140x000300fb,0x000000a6,0x00001801,0x000200f8,
15660x000018a4,0x00050050,0x00000007,0x000018ab, 15150x00001801,0x00050041,0x00000156,0x00001802,
15670x000018a5,0x000018aa,0x0004007c,0x00000014, 15160x000000fc,0x00000215,0x0004003d,0x00000007,
15680x0000189b,0x000018ab,0x00060041,0x000000db, 15170x00001803,0x00001802,0x00050051,0x00000006,
15690x00001892,0x0000189b,0x000000da,0x000000da, 15180x0000183a,0x00001803,0x00000000,0x000500aa,
15700x0006003d,0x00000006,0x00001893,0x00001892, 15190x0000002f,0x0000183b,0x0000183a,0x000000a6,
15200x000300f7,0x00001840,0x00000000,0x000400fa,
15210x0000183b,0x0000183c,0x00001840,0x000200f8,
15220x0000183c,0x00050051,0x00000006,0x0000183e,
15230x00001803,0x00000001,0x000500aa,0x0000002f,
15240x0000183f,0x0000183e,0x000000a6,0x000200f9,
15250x00001840,0x000200f8,0x00001840,0x000700f5,
15260x0000002f,0x00001841,0x0000183b,0x00001801,
15270x0000183f,0x0000183c,0x000300f7,0x00001807,
15280x00000000,0x000400fa,0x00001841,0x00001805,
15290x00001807,0x000200f8,0x00001805,0x000200f9,
15300x00001835,0x000200f8,0x00001807,0x000200f9,
15310x00001808,0x000200f8,0x00001808,0x000700f5,
15320x00000006,0x00003238,0x000000a6,0x00001807,
15330x00001832,0x0000180c,0x000500b0,0x0000002f,
15340x0000180b,0x00003238,0x000002b7,0x000400f6,
15350x00001833,0x0000180c,0x00000000,0x000400fa,
15360x0000180b,0x0000180c,0x00001833,0x000200f8,
15370x0000180c,0x00050084,0x00000006,0x0000180e,
15380x0000011f,0x00003238,0x00050095,0x000000ab,
15390x0000185a,0x0000183a,0x0000180e,0x00050051,
15400x00000006,0x0000185b,0x0000185a,0x00000001,
15410x00050051,0x00000006,0x0000185c,0x0000185a,
15420x00000000,0x00050051,0x00000006,0x0000185f,
15430x00001803,0x00000001,0x00050080,0x00000006,
15440x00001861,0x0000185f,0x0000185b,0x00050050,
15450x00000007,0x00001862,0x0000185c,0x00001861,
15460x0004007c,0x00000014,0x00001852,0x00001862,
15470x00060041,0x000000db,0x00001849,0x00001852,
15480x000000da,0x000000da,0x0006003d,0x00000006,
15490x0000184a,0x00001849,0x00000002,0x00000004,
15500x0004007c,0x00000027,0x00001813,0x0000184a,
15510x00050080,0x00000006,0x00001815,0x0000180e,
15520x0000010a,0x00050095,0x000000ab,0x0000187b,
15530x0000183a,0x00001815,0x00050051,0x00000006,
15540x0000187c,0x0000187b,0x00000001,0x00050051,
15550x00000006,0x0000187d,0x0000187b,0x00000000,
15560x00050080,0x00000006,0x00001882,0x0000185f,
15570x0000187c,0x00050050,0x00000007,0x00001883,
15580x0000187d,0x00001882,0x0004007c,0x00000014,
15590x00001873,0x00001883,0x00060041,0x000000db,
15600x0000186a,0x00001873,0x000000da,0x000000da,
15610x0006003d,0x00000006,0x0000186b,0x0000186a,
15710x00000002,0x00000004,0x0004007c,0x00000027, 15620x00000002,0x00000004,0x0004007c,0x00000027,
15720x00001826,0x00001893,0x00050080,0x00000006, 15630x00001819,0x0000186b,0x00050080,0x00000006,
15730x00001828,0x00001815,0x00000118,0x00050095, 15640x0000181b,0x0000180e,0x00000111,0x00050095,
15740x000000ab,0x000018c4,0x00001841,0x00001828, 15650x000000ab,0x0000189c,0x0000183a,0x0000181b,
15750x00050051,0x00000006,0x000018c5,0x000018c4, 15660x00050051,0x00000006,0x0000189d,0x0000189c,
15760x00000001,0x00050051,0x00000006,0x000018c6, 15670x00000001,0x00050051,0x00000006,0x0000189e,
15770x000018c4,0x00000000,0x00050080,0x00000006, 15680x0000189c,0x00000000,0x00050080,0x00000006,
15780x000018cb,0x00001866,0x000018c5,0x00050050, 15690x000018a3,0x0000185f,0x0000189d,0x00050050,
15790x00000007,0x000018cc,0x000018c6,0x000018cb, 15700x00000007,0x000018a4,0x0000189e,0x000018a3,
15800x0004007c,0x00000014,0x000018bc,0x000018cc, 15710x0004007c,0x00000014,0x00001894,0x000018a4,
15810x00060041,0x000000db,0x000018b3,0x000018bc, 15720x00060041,0x000000db,0x0000188b,0x00001894,
15820x000000da,0x000000da,0x0006003d,0x00000006, 15730x000000da,0x000000da,0x0006003d,0x00000006,
15830x000018b4,0x000018b3,0x00000002,0x00000004, 15740x0000188c,0x0000188b,0x00000002,0x00000004,
15840x0004007c,0x00000027,0x0000182c,0x000018b4, 15750x0004007c,0x00000027,0x0000181f,0x0000188c,
15850x00070050,0x000002bc,0x0000182d,0x0000181a, 15760x00050080,0x00000006,0x00001821,0x0000180e,
15860x00001820,0x00001826,0x0000182c,0x0008004f, 15770x00000118,0x00050095,0x000000ab,0x000018bd,
15870x0000004b,0x00001830,0x0000182d,0x0000182d, 15780x0000183a,0x00001821,0x00050051,0x00000006,
15880x00000000,0x00000001,0x00000002,0x00050094, 15790x000018be,0x000018bd,0x00000001,0x00050051,
15890x00000027,0x00001832,0x00001830,0x00001783, 15800x00000006,0x000018bf,0x000018bd,0x00000000,
15900x00050081,0x00000027,0x00001835,0x00001832, 15810x00050080,0x00000006,0x000018c4,0x0000185f,
15910x0000182c,0x00050041,0x00000028,0x00001836, 15820x000018be,0x00050050,0x00000007,0x000018c5,
15920x00001805,0x00003247,0x0003003e,0x00001836, 15830x000018bf,0x000018c4,0x0004007c,0x00000014,
15930x00001835,0x00050080,0x00000006,0x00001839, 15840x000018b5,0x000018c5,0x00060041,0x000000db,
15940x00003247,0x00000154,0x000200f9,0x0000180f, 15850x000018ac,0x000018b5,0x000000da,0x000000da,
15950x000200f8,0x0000183a,0x0004003d,0x0000004b, 15860x0006003d,0x00000006,0x000018ad,0x000018ac,
15960x0000183b,0x00001805,0x000200f9,0x0000183c, 15870x00000002,0x00000004,0x0004007c,0x00000027,
15970x000200f8,0x0000183c,0x000700f5,0x0000004b, 15880x00001825,0x000018ad,0x00070050,0x000002bc,
15980x00003248,0x00001783,0x0000180c,0x0000183b, 15890x00001826,0x00001813,0x00001819,0x0000181f,
15990x0000183a,0x00050041,0x0000004c,0x00001655, 15900x00001825,0x0008004f,0x0000004b,0x00001829,
16000x0000161a,0x0000323a,0x0003003e,0x00001655, 15910x00001826,0x00001826,0x00000000,0x00000001,
16010x00003248,0x000200f9,0x00001656,0x000200f8, 15920x00000002,0x00050094,0x00000027,0x0000182b,
16020x00001656,0x00050080,0x00000006,0x00001658, 15930x00001829,0x0000177c,0x00050081,0x00000027,
16030x0000323a,0x00000154,0x000200f9,0x00001648, 15940x0000182e,0x0000182b,0x00001825,0x00050041,
16040x000200f8,0x00001659,0x00050041,0x000000fe, 15950x00000028,0x0000182f,0x000017fe,0x00003238,
16050x0000165a,0x000000fc,0x00000308,0x0004003d, 15960x0003003e,0x0000182f,0x0000182e,0x00050080,
16060x00000006,0x0000165b,0x0000165a,0x00050080, 15970x00000006,0x00001832,0x00003238,0x00000154,
16070x00000006,0x0000165d,0x0000165b,0x00000b11, 15980x000200f9,0x00001808,0x000200f8,0x00001833,
16080x00050041,0x000000fe,0x0000165e,0x000000fc, 15990x0004003d,0x0000004b,0x00001834,0x000017fe,
16090x0000022c,0x0004003d,0x00000006,0x0000165f, 16000x000200f9,0x00001835,0x000200f8,0x00001835,
16100x0000165e,0x00050084,0x00000006,0x00001661, 16010x000700f5,0x0000004b,0x00003239,0x0000177c,
16110x00000107,0x0000165d,0x00050080,0x00000006, 16020x00001805,0x00001834,0x00001833,0x00050041,
16120x00001662,0x0000165f,0x00001661,0x000200f9, 16030x0000004c,0x00001650,0x00001615,0x0000322b,
16130x00001663,0x000200f8,0x00001663,0x000700f5, 16040x0003003e,0x00001650,0x00003239,0x000200f9,
16140x00000006,0x0000323b,0x000000a6,0x00001659, 16050x00001651,0x000200f8,0x00001651,0x00050080,
16150x0000168a,0x00001667,0x000500b0,0x0000002f, 16060x00000006,0x00001653,0x0000322b,0x00000154,
16160x00001666,0x0000323b,0x000002b7,0x000400f6, 16070x000200f9,0x00001643,0x000200f8,0x00001654,
16170x0000168b,0x00001667,0x00000000,0x000400fa, 16080x00050041,0x000000fe,0x00001655,0x000000fc,
16180x00001666,0x00001667,0x0000168b,0x000200f8, 16090x00000308,0x0004003d,0x00000006,0x00001656,
16190x00001667,0x00050084,0x00000006,0x0000166a, 16100x00001655,0x00050080,0x00000006,0x00001658,
16200x00000118,0x0000323b,0x00050080,0x00000006, 16110x00001656,0x00000b09,0x00050041,0x000000fe,
16210x0000166b,0x00001662,0x0000166a,0x00050041, 16120x00001659,0x000000fc,0x0000022c,0x0004003d,
16220x00000156,0x0000166d,0x000000fc,0x000000da, 16130x00000006,0x0000165a,0x00001659,0x00050084,
16230x0004003d,0x00000007,0x0000166e,0x0000166d, 16140x00000006,0x0000165c,0x00000107,0x00001658,
16240x00060041,0x00000028,0x0000166f,0x0000161a, 16150x00050080,0x00000006,0x0000165d,0x0000165a,
16250x0000323b,0x000000a6,0x0004003d,0x00000027, 16160x0000165c,0x000200f9,0x0000165e,0x000200f8,
16260x00001670,0x0000166f,0x0004007c,0x00000006, 16170x0000165e,0x000700f5,0x00000006,0x0000322c,
16270x000018d2,0x00001670,0x00050051,0x00000006, 16180x000000a6,0x00001654,0x00001685,0x00001662,
16280x000018eb,0x0000166e,0x00000000,0x00050095, 16190x000500b0,0x0000002f,0x00001661,0x0000322c,
16290x000000ab,0x000018ed,0x000018eb,0x0000166b, 16200x000002b7,0x000400f6,0x00001686,0x00001662,
16300x00050051,0x00000006,0x000018ee,0x000018ed, 16210x00000000,0x000400fa,0x00001661,0x00001662,
16310x00000001,0x00050051,0x00000006,0x000018ef, 16220x00001686,0x000200f8,0x00001662,0x00050084,
16320x000018ed,0x00000000,0x00050051,0x00000006, 16230x00000006,0x00001665,0x00000118,0x0000322c,
16330x000018f2,0x0000166e,0x00000001,0x00050080, 16240x00050080,0x00000006,0x00001666,0x0000165d,
16340x00000006,0x000018f4,0x000018f2,0x000018ee, 16250x00001665,0x00050041,0x00000156,0x00001668,
16350x00050050,0x00000007,0x000018f5,0x000018ef, 16260x000000fc,0x000000da,0x0004003d,0x00000007,
16360x000018f4,0x0004007c,0x00000014,0x000018e5, 16270x00001669,0x00001668,0x00060041,0x00000028,
16370x000018f5,0x00060041,0x000000db,0x000018dd, 16280x0000166a,0x00001615,0x0000322c,0x000000a6,
16380x000018e5,0x000000da,0x000000da,0x0005003e, 16290x0004003d,0x00000027,0x0000166b,0x0000166a,
16390x000018dd,0x000018d2,0x00000002,0x00000004, 16300x0004007c,0x00000006,0x000018cb,0x0000166b,
16400x00050080,0x00000006,0x00001676,0x0000166b, 16310x00050051,0x00000006,0x000018e4,0x00001669,
16410x0000010a,0x00060041,0x00000028,0x0000167a, 16320x00000000,0x00050095,0x000000ab,0x000018e6,
16420x0000161a,0x0000323b,0x000000b0,0x0004003d, 16330x000018e4,0x00001666,0x00050051,0x00000006,
16430x00000027,0x0000167b,0x0000167a,0x0004007c, 16340x000018e7,0x000018e6,0x00000001,0x00050051,
16440x00000006,0x000018fb,0x0000167b,0x00050095, 16350x00000006,0x000018e8,0x000018e6,0x00000000,
16450x000000ab,0x00001916,0x000018eb,0x00001676, 16360x00050051,0x00000006,0x000018eb,0x00001669,
16460x00050051,0x00000006,0x00001917,0x00001916, 16370x00000001,0x00050080,0x00000006,0x000018ed,
16470x00000001,0x00050051,0x00000006,0x00001918, 16380x000018eb,0x000018e7,0x00050050,0x00000007,
16480x00001916,0x00000000,0x00050080,0x00000006, 16390x000018ee,0x000018e8,0x000018ed,0x0004007c,
16490x0000191d,0x000018f2,0x00001917,0x00050050, 16400x00000014,0x000018de,0x000018ee,0x00060041,
16500x00000007,0x0000191e,0x00001918,0x0000191d, 16410x000000db,0x000018d6,0x000018de,0x000000da,
16510x0004007c,0x00000014,0x0000190e,0x0000191e, 16420x000000da,0x0005003e,0x000018d6,0x000018cb,
16520x00060041,0x000000db,0x00001906,0x0000190e,
16530x000000da,0x000000da,0x0005003e,0x00001906,
16540x000018fb,0x00000002,0x00000004,0x00050080,
16550x00000006,0x00001681,0x0000166b,0x00000111,
16560x00060041,0x00000028,0x00001685,0x0000161a,
16570x0000323b,0x00000170,0x0004003d,0x00000027,
16580x00001686,0x00001685,0x0004007c,0x00000006,
16590x00001924,0x00001686,0x00050095,0x000000ab,
16600x0000193f,0x000018eb,0x00001681,0x00050051,
16610x00000006,0x00001940,0x0000193f,0x00000001,
16620x00050051,0x00000006,0x00001941,0x0000193f,
16630x00000000,0x00050080,0x00000006,0x00001946,
16640x000018f2,0x00001940,0x00050050,0x00000007,
16650x00001947,0x00001941,0x00001946,0x0004007c,
16660x00000014,0x00001937,0x00001947,0x00060041,
16670x000000db,0x0000192f,0x00001937,0x000000da,
16680x000000da,0x0005003e,0x0000192f,0x00001924,
16690x00000002,0x00000004,0x00050080,0x00000006, 16430x00000002,0x00000004,0x00050080,0x00000006,
16700x0000168a,0x0000323b,0x00000154,0x000200f9, 16440x00001671,0x00001666,0x0000010a,0x00060041,
16710x00001663,0x000200f8,0x0000168b,0x00050080, 16450x00000028,0x00001675,0x00001615,0x0000322c,
16720x00000006,0x0000168d,0x00001662,0x00000347, 16460x000000b0,0x0004003d,0x00000027,0x00001676,
16730x00050041,0x00000156,0x0000168e,0x000000fc, 16470x00001675,0x0004007c,0x00000006,0x000018f4,
16740x000000da,0x0004003d,0x00000007,0x0000168f, 16480x00001676,0x00050095,0x000000ab,0x0000190f,
16750x0000168e,0x00060041,0x00000028,0x00001690, 16490x000018e4,0x00001671,0x00050051,0x00000006,
16760x0000161a,0x00000205,0x000000a6,0x0004003d, 16500x00001910,0x0000190f,0x00000001,0x00050051,
16770x00000027,0x00001691,0x00001690,0x0004007c, 16510x00000006,0x00001911,0x0000190f,0x00000000,
16780x00000006,0x0000194d,0x00001691,0x00050051, 16520x00050080,0x00000006,0x00001916,0x000018eb,
16790x00000006,0x00001966,0x0000168f,0x00000000, 16530x00001910,0x00050050,0x00000007,0x00001917,
16800x00050095,0x000000ab,0x00001968,0x00001966, 16540x00001911,0x00001916,0x0004007c,0x00000014,
16810x0000168d,0x00050051,0x00000006,0x00001969, 16550x00001907,0x00001917,0x00060041,0x000000db,
16820x00001968,0x00000001,0x00050051,0x00000006, 16560x000018ff,0x00001907,0x000000da,0x000000da,
16830x0000196a,0x00001968,0x00000000,0x00050051, 16570x0005003e,0x000018ff,0x000018f4,0x00000002,
16840x00000006,0x0000196d,0x0000168f,0x00000001, 16580x00000004,0x00050080,0x00000006,0x0000167c,
16850x00050080,0x00000006,0x0000196f,0x0000196d, 16590x00001666,0x00000111,0x00060041,0x00000028,
16860x00001969,0x00050050,0x00000007,0x00001970, 16600x00001680,0x00001615,0x0000322c,0x00000170,
16870x0000196a,0x0000196f,0x0004007c,0x00000014, 16610x0004003d,0x00000027,0x00001681,0x00001680,
16880x00001960,0x00001970,0x00060041,0x000000db, 16620x0004007c,0x00000006,0x0000191d,0x00001681,
16890x00001958,0x00001960,0x000000da,0x000000da, 16630x00050095,0x000000ab,0x00001938,0x000018e4,
16900x0005003e,0x00001958,0x0000194d,0x00000002, 16640x0000167c,0x00050051,0x00000006,0x00001939,
16910x00000004,0x00050080,0x00000006,0x00001694, 16650x00001938,0x00000001,0x00050051,0x00000006,
16920x00001662,0x00000352,0x00060041,0x00000028, 16660x0000193a,0x00001938,0x00000000,0x00050080,
16930x00001697,0x0000161a,0x00000205,0x000000b0, 16670x00000006,0x0000193f,0x000018eb,0x00001939,
16940x0004003d,0x00000027,0x00001698,0x00001697, 16680x00050050,0x00000007,0x00001940,0x0000193a,
16950x0004007c,0x00000006,0x00001976,0x00001698, 16690x0000193f,0x0004007c,0x00000014,0x00001930,
16960x00050095,0x000000ab,0x00001991,0x00001966, 16700x00001940,0x00060041,0x000000db,0x00001928,
16970x00001694,0x00050051,0x00000006,0x00001992, 16710x00001930,0x000000da,0x000000da,0x0005003e,
16980x00001991,0x00000001,0x00050051,0x00000006, 16720x00001928,0x0000191d,0x00000002,0x00000004,
16990x00001993,0x00001991,0x00000000,0x00050080, 16730x00050080,0x00000006,0x00001685,0x0000322c,
17000x00000006,0x00001998,0x0000196d,0x00001992, 16740x00000154,0x000200f9,0x0000165e,0x000200f8,
17010x00050050,0x00000007,0x00001999,0x00001993, 16750x00001686,0x00050080,0x00000006,0x00001688,
17020x00001998,0x0004007c,0x00000014,0x00001989, 16760x0000165d,0x00000347,0x00050041,0x00000156,
17030x00001999,0x00060041,0x000000db,0x00001981, 16770x00001689,0x000000fc,0x000000da,0x0004003d,
17040x00001989,0x000000da,0x000000da,0x0005003e, 16780x00000007,0x0000168a,0x00001689,0x00060041,
17050x00001981,0x00001976,0x00000002,0x00000004, 16790x00000028,0x0000168b,0x00001615,0x00000205,
17060x00050080,0x00000006,0x0000169b,0x00001662, 16800x000000a6,0x0004003d,0x00000027,0x0000168c,
17070x0000035d,0x00060041,0x00000028,0x0000169e, 16810x0000168b,0x0004007c,0x00000006,0x00001946,
17080x0000161a,0x00000205,0x00000170,0x0004003d, 16820x0000168c,0x00050051,0x00000006,0x0000195f,
17090x00000027,0x0000169f,0x0000169e,0x0004007c, 16830x0000168a,0x00000000,0x00050095,0x000000ab,
17100x00000006,0x0000199f,0x0000169f,0x00050095, 16840x00001961,0x0000195f,0x00001688,0x00050051,
17110x000000ab,0x000019ba,0x00001966,0x0000169b, 16850x00000006,0x00001962,0x00001961,0x00000001,
17120x00050051,0x00000006,0x000019bb,0x000019ba, 16860x00050051,0x00000006,0x00001963,0x00001961,
17130x00000001,0x00050051,0x00000006,0x000019bc, 16870x00000000,0x00050051,0x00000006,0x00001966,
17140x000019ba,0x00000000,0x00050080,0x00000006, 16880x0000168a,0x00000001,0x00050080,0x00000006,
17150x000019c1,0x0000196d,0x000019bb,0x00050050, 16890x00001968,0x00001966,0x00001962,0x00050050,
17160x00000007,0x000019c2,0x000019bc,0x000019c1, 16900x00000007,0x00001969,0x00001963,0x00001968,
17170x0004007c,0x00000014,0x000019b2,0x000019c2, 16910x0004007c,0x00000014,0x00001959,0x00001969,
17180x00060041,0x000000db,0x000019aa,0x000019b2, 16920x00060041,0x000000db,0x00001951,0x00001959,
17190x000000da,0x000000da,0x0005003e,0x000019aa, 16930x000000da,0x000000da,0x0005003e,0x00001951,
17200x0000199f,0x00000002,0x00000004,0x00050080, 16940x00001946,0x00000002,0x00000004,0x00050080,
17210x00000006,0x000016a2,0x00001662,0x00000368, 16950x00000006,0x0000168f,0x0000165d,0x00000352,
17220x00050041,0x000000fe,0x000016a5,0x000000fc, 16960x00060041,0x00000028,0x00001692,0x00001615,
17230x0000036a,0x0004003d,0x00000006,0x000016a6, 16970x00000205,0x000000b0,0x0004003d,0x00000027,
17240x000016a5,0x00050095,0x000000ab,0x000019da, 16980x00001693,0x00001692,0x0004007c,0x00000006,
17250x00001966,0x000016a2,0x00050051,0x00000006, 16990x0000196f,0x00001693,0x00050095,0x000000ab,
17260x000019db,0x000019da,0x00000001,0x00050051, 17000x0000198a,0x0000195f,0x0000168f,0x00050051,
17270x00000006,0x000019dc,0x000019da,0x00000000, 17010x00000006,0x0000198b,0x0000198a,0x00000001,
17280x00050080,0x00000006,0x000019e1,0x0000196d, 17020x00050051,0x00000006,0x0000198c,0x0000198a,
17290x000019db,0x00050050,0x00000007,0x000019e2, 17030x00000000,0x00050080,0x00000006,0x00001991,
17300x000019dc,0x000019e1,0x0004007c,0x00000014, 17040x00001966,0x0000198b,0x00050050,0x00000007,
17310x000019d2,0x000019e2,0x00060041,0x000000db, 17050x00001992,0x0000198c,0x00001991,0x0004007c,
17320x000019ca,0x000019d2,0x000000da,0x000000da, 17060x00000014,0x00001982,0x00001992,0x00060041,
17330x0005003e,0x000019ca,0x000016a6,0x00000002, 17070x000000db,0x0000197a,0x00001982,0x000000da,
17340x00000004,0x00050080,0x00000006,0x000016a9, 17080x000000da,0x0005003e,0x0000197a,0x0000196f,
17350x00001662,0x00000374,0x00050095,0x000000ab,
17360x000019fa,0x00001966,0x000016a9,0x00050051,
17370x00000006,0x000019fb,0x000019fa,0x00000001,
17380x00050051,0x00000006,0x000019fc,0x000019fa,
17390x00000000,0x00050080,0x00000006,0x00001a01,
17400x0000196d,0x000019fb,0x00050050,0x00000007,
17410x00001a02,0x000019fc,0x00001a01,0x0004007c,
17420x00000014,0x000019f2,0x00001a02,0x00060041,
17430x000000db,0x000019ea,0x000019f2,0x000000da,
17440x000000da,0x0005003e,0x000019ea,0x00000b11,
17450x00000002,0x00000004,0x00050080,0x00000006, 17090x00000002,0x00000004,0x00050080,0x00000006,
17460x000016af,0x00001662,0x0000037e,0x00050095, 17100x00001696,0x0000165d,0x0000035d,0x00060041,
17470x000000ab,0x00001a1a,0x00001966,0x000016af, 17110x00000028,0x00001699,0x00001615,0x00000205,
17480x00050051,0x00000006,0x00001a1b,0x00001a1a, 17120x00000170,0x0004003d,0x00000027,0x0000169a,
17490x00000001,0x00050051,0x00000006,0x00001a1c, 17130x00001699,0x0004007c,0x00000006,0x00001998,
17500x00001a1a,0x00000000,0x00050080,0x00000006, 17140x0000169a,0x00050095,0x000000ab,0x000019b3,
17510x00001a21,0x0000196d,0x00001a1b,0x00050050, 17150x0000195f,0x00001696,0x00050051,0x00000006,
17520x00000007,0x00001a22,0x00001a1c,0x00001a21, 17160x000019b4,0x000019b3,0x00000001,0x00050051,
17530x0004007c,0x00000014,0x00001a12,0x00001a22, 17170x00000006,0x000019b5,0x000019b3,0x00000000,
17540x00060041,0x000000db,0x00001a0a,0x00001a12, 17180x00050080,0x00000006,0x000019ba,0x00001966,
17550x000000da,0x000000da,0x0005003e,0x00001a0a, 17190x000019b4,0x00050050,0x00000007,0x000019bb,
17560x00000380,0x00000002,0x00000004,0x00050080, 17200x000019b5,0x000019ba,0x0004007c,0x00000014,
17570x00000006,0x000016b4,0x00001662,0x00000388, 17210x000019ab,0x000019bb,0x00060041,0x000000db,
17580x00050095,0x000000ab,0x00001a3a,0x00001966, 17220x000019a3,0x000019ab,0x000000da,0x000000da,
17590x000016b4,0x00050051,0x00000006,0x00001a3b, 17230x0005003e,0x000019a3,0x00001998,0x00000002,
17600x00001a3a,0x00000001,0x00050051,0x00000006, 17240x00000004,0x00050080,0x00000006,0x0000169d,
17610x00001a3c,0x00001a3a,0x00000000,0x00050080, 17250x0000165d,0x00000368,0x00050041,0x000000fe,
17620x00000006,0x00001a41,0x0000196d,0x00001a3b, 17260x000016a0,0x000000fc,0x0000036a,0x0004003d,
17630x00050050,0x00000007,0x00001a42,0x00001a3c, 17270x00000006,0x000016a1,0x000016a0,0x00050095,
17640x00001a41,0x0004007c,0x00000014,0x00001a32, 17280x000000ab,0x000019d3,0x0000195f,0x0000169d,
17650x00001a42,0x00060041,0x000000db,0x00001a2a, 17290x00050051,0x00000006,0x000019d4,0x000019d3,
17660x00001a32,0x000000da,0x000000da,0x0005003e, 17300x00000001,0x00050051,0x00000006,0x000019d5,
17670x00001a2a,0x0000038a,0x00000002,0x00000004, 17310x000019d3,0x00000000,0x00050080,0x00000006,
17680x00050041,0x0000004c,0x000016b8,0x0000161a, 17320x000019da,0x00001966,0x000019d4,0x00050050,
17690x000000da,0x0004003d,0x0000004b,0x000016b9, 17330x00000007,0x000019db,0x000019d5,0x000019da,
17700x000016b8,0x0004009c,0x00000395,0x000016ba, 17340x0004007c,0x00000014,0x000019cb,0x000019db,
17710x000016b9,0x0004009a,0x0000002f,0x000016bb, 17350x00060041,0x000000db,0x000019c3,0x000019cb,
17720x000016ba,0x000400a8,0x0000002f,0x000016bc, 17360x000000da,0x000000da,0x0005003e,0x000019c3,
17730x000016bb,0x000300f7,0x000016c2,0x00000000, 17370x000016a1,0x00000002,0x00000004,0x00050080,
17740x000400fa,0x000016bc,0x000016bd,0x000016c2, 17380x00000006,0x000016a4,0x0000165d,0x00000374,
17750x000200f8,0x000016bd,0x00050041,0x0000004c, 17390x00050095,0x000000ab,0x000019f3,0x0000195f,
17760x000016be,0x0000161a,0x00000154,0x0004003d, 17400x000016a4,0x00050051,0x00000006,0x000019f4,
17770x0000004b,0x000016bf,0x000016be,0x0004009c, 17410x000019f3,0x00000001,0x00050051,0x00000006,
17780x00000395,0x000016c0,0x000016bf,0x0004009a, 17420x000019f5,0x000019f3,0x00000000,0x00050080,
17790x0000002f,0x000016c1,0x000016c0,0x000200f9, 17430x00000006,0x000019fa,0x00001966,0x000019f4,
17800x000016c2,0x000200f8,0x000016c2,0x000700f5, 17440x00050050,0x00000007,0x000019fb,0x000019f5,
17810x0000002f,0x000016c3,0x000016bb,0x0000168b, 17450x000019fa,0x0004007c,0x00000014,0x000019eb,
17820x000016c1,0x000016bd,0x000400a8,0x0000002f, 17460x000019fb,0x00060041,0x000000db,0x000019e3,
17830x000016c4,0x000016c3,0x000300f7,0x000016ca, 17470x000019eb,0x000000da,0x000000da,0x0005003e,
17840x00000000,0x000400fa,0x000016c4,0x000016c5, 17480x000019e3,0x00000b09,0x00000002,0x00000004,
17850x000016ca,0x000200f8,0x000016c5,0x00050041, 17490x00050080,0x00000006,0x000016aa,0x0000165d,
17860x0000004c,0x000016c6,0x0000161a,0x00000205, 17500x0000037e,0x00050095,0x000000ab,0x00001a13,
17870x0004003d,0x0000004b,0x000016c7,0x000016c6, 17510x0000195f,0x000016aa,0x00050051,0x00000006,
17880x0004009c,0x00000395,0x000016c8,0x000016c7, 17520x00001a14,0x00001a13,0x00000001,0x00050051,
17890x0004009a,0x0000002f,0x000016c9,0x000016c8, 17530x00000006,0x00001a15,0x00001a13,0x00000000,
17900x000200f9,0x000016ca,0x000200f8,0x000016ca, 17540x00050080,0x00000006,0x00001a1a,0x00001966,
17910x000700f5,0x0000002f,0x000016cb,0x000016c3, 17550x00001a14,0x00050050,0x00000007,0x00001a1b,
17920x000016c2,0x000016c9,0x000016c5,0x0004003d, 17560x00001a15,0x00001a1a,0x0004007c,0x00000014,
17930x0000004b,0x000016cd,0x000016b8,0x00050041, 17570x00001a0b,0x00001a1b,0x00060041,0x000000db,
17940x0000004c,0x000016ce,0x0000161a,0x00000154, 17580x00001a03,0x00001a0b,0x000000da,0x000000da,
17950x0004003d,0x0000004b,0x000016cf,0x000016ce, 17590x0005003e,0x00001a03,0x00000380,0x00000002,
17960x0007000c,0x0000004b,0x000016d0,0x00000001, 17600x00000004,0x00050080,0x00000006,0x000016af,
17970x00000025,0x000016cd,0x000016cf,0x00050041, 17610x0000165d,0x00000388,0x00050095,0x000000ab,
17980x0000004c,0x000016d1,0x0000161a,0x00000205, 17620x00001a33,0x0000195f,0x000016af,0x00050051,
17990x0004003d,0x0000004b,0x000016d2,0x000016d1, 17630x00000006,0x00001a34,0x00001a33,0x00000001,
18000x0007000c,0x0000004b,0x000016d3,0x00000001, 17640x00050051,0x00000006,0x00001a35,0x00001a33,
18010x00000025,0x000016d0,0x000016d2,0x0004003d, 17650x00000000,0x00050080,0x00000006,0x00001a3a,
18020x0000004b,0x000016d5,0x000016b8,0x0004003d, 17660x00001966,0x00001a34,0x00050050,0x00000007,
18030x0000004b,0x000016d7,0x000016ce,0x0007000c, 17670x00001a3b,0x00001a35,0x00001a3a,0x0004007c,
18040x0000004b,0x000016d8,0x00000001,0x00000028, 17680x00000014,0x00001a2b,0x00001a3b,0x00060041,
18050x000016d5,0x000016d7,0x0004003d,0x0000004b, 17690x000000db,0x00001a23,0x00001a2b,0x000000da,
18060x000016da,0x000016d1,0x0007000c,0x0000004b, 17700x000000da,0x0005003e,0x00001a23,0x0000038a,
18070x000016db,0x00000001,0x00000028,0x000016d8, 17710x00000002,0x00000004,0x00050041,0x0000004c,
18080x000016da,0x00060050,0x00000395,0x000032a9, 17720x000016b3,0x00001615,0x000000da,0x0004003d,
18090x000016cb,0x000016cb,0x000016cb,0x000600a9, 17730x0000004b,0x000016b4,0x000016b3,0x0004009c,
18100x0000004b,0x000032aa,0x000032a9,0x000032a7, 17740x00000395,0x000016b5,0x000016b4,0x0004009a,
18110x000016db,0x000600a9,0x0000004b,0x000032ac, 17750x0000002f,0x000016b6,0x000016b5,0x000400a8,
18120x000032a9,0x000032a5,0x000016d3,0x00050041, 17760x0000002f,0x000016b7,0x000016b6,0x000300f7,
18130x000000fe,0x00001a8c,0x000000fc,0x000000fd, 17770x000016bd,0x00000000,0x000400fa,0x000016b7,
18140x0004003d,0x00000006,0x00001a8d,0x00001a8c, 17780x000016b8,0x000016bd,0x000200f8,0x000016b8,
18150x00050084,0x00000006,0x00001a8e,0x0000011f, 17790x00050041,0x0000004c,0x000016b9,0x00001615,
18160x00001a8d,0x00050080,0x00000006,0x00001a8f, 17800x00000154,0x0004003d,0x0000004b,0x000016ba,
18170x00000107,0x00001a8e,0x00050080,0x00000006, 17810x000016b9,0x0004009c,0x00000395,0x000016bb,
18180x00001a95,0x00001a8d,0x000032a8,0x00050086, 17820x000016ba,0x0004009a,0x0000002f,0x000016bc,
18190x00000006,0x00001a96,0x00001a95,0x00000101, 17830x000016bb,0x000200f9,0x000016bd,0x000200f8,
18200x00050084,0x00000006,0x00001a88,0x00000107, 17840x000016bd,0x000700f5,0x0000002f,0x000016be,
18210x00001a96,0x00050080,0x00000006,0x00001a89, 17850x000016b6,0x00001686,0x000016bc,0x000016b8,
18220x00001a8f,0x00001a88,0x00050084,0x00000006, 17860x000400a8,0x0000002f,0x000016bf,0x000016be,
18230x00001a59,0x00000150,0x0000165d,0x00050080, 17870x000300f7,0x000016c5,0x00000000,0x000400fa,
18240x00000006,0x00001a5a,0x00001a89,0x00001a59, 17880x000016bf,0x000016c0,0x000016c5,0x000200f8,
18250x00050041,0x00000156,0x00001a5b,0x000000fc, 17890x000016c0,0x00050041,0x0000004c,0x000016c1,
18260x00000154,0x0004003d,0x00000007,0x00001a5c, 17900x00001615,0x00000205,0x0004003d,0x0000004b,
18270x00001a5b,0x00050051,0x00000027,0x00001a5f, 17910x000016c2,0x000016c1,0x0004009c,0x00000395,
18280x000032ac,0x00000000,0x0004007c,0x00000006, 17920x000016c3,0x000016c2,0x0004009a,0x0000002f,
18290x00001a9c,0x00001a5f,0x00050051,0x00000006, 17930x000016c4,0x000016c3,0x000200f9,0x000016c5,
18300x00001ab5,0x00001a5c,0x00000000,0x00050095, 17940x000200f8,0x000016c5,0x000700f5,0x0000002f,
18310x000000ab,0x00001ab7,0x00001ab5,0x00001a5a, 17950x000016c6,0x000016be,0x000016bd,0x000016c4,
18320x00050051,0x00000006,0x00001ab8,0x00001ab7, 17960x000016c0,0x0004003d,0x0000004b,0x000016c8,
18330x00000001,0x00050051,0x00000006,0x00001ab9, 17970x000016b3,0x00050041,0x0000004c,0x000016c9,
18340x00001ab7,0x00000000,0x00050051,0x00000006, 17980x00001615,0x00000154,0x0004003d,0x0000004b,
18350x00001abc,0x00001a5c,0x00000001,0x00050080, 17990x000016ca,0x000016c9,0x0007000c,0x0000004b,
18360x00000006,0x00001abe,0x00001abc,0x00001ab8, 18000x000016cb,0x00000001,0x00000025,0x000016c8,
18370x00050050,0x00000007,0x00001abf,0x00001ab9, 18010x000016ca,0x00050041,0x0000004c,0x000016cc,
18380x00001abe,0x0004007c,0x00000014,0x00001aaf, 18020x00001615,0x00000205,0x0004003d,0x0000004b,
18390x00001abf,0x00060041,0x000000db,0x00001aa7, 18030x000016cd,0x000016cc,0x0007000c,0x0000004b,
18400x00001aaf,0x000000da,0x000000da,0x0005003e, 18040x000016ce,0x00000001,0x00000025,0x000016cb,
18410x00001aa7,0x00001a9c,0x00000002,0x00000004, 18050x000016cd,0x0004003d,0x0000004b,0x000016d0,
18420x00050080,0x00000006,0x00001a62,0x00001a5a, 18060x000016b3,0x0004003d,0x0000004b,0x000016d2,
18430x0000010a,0x00050051,0x00000027,0x00001a66, 18070x000016c9,0x0007000c,0x0000004b,0x000016d3,
18440x000032ac,0x00000001,0x0004007c,0x00000006, 18080x00000001,0x00000028,0x000016d0,0x000016d2,
18450x00001ac5,0x00001a66,0x00050095,0x000000ab, 18090x0004003d,0x0000004b,0x000016d5,0x000016cc,
18460x00001ae0,0x00001ab5,0x00001a62,0x00050051, 18100x0007000c,0x0000004b,0x000016d6,0x00000001,
18470x00000006,0x00001ae1,0x00001ae0,0x00000001, 18110x00000028,0x000016d3,0x000016d5,0x00060050,
18480x00050051,0x00000006,0x00001ae2,0x00001ae0, 18120x00000395,0x0000329b,0x000016c6,0x000016c6,
18490x00000000,0x00050080,0x00000006,0x00001ae7, 18130x000016c6,0x000600a9,0x0000004b,0x0000329c,
18500x00001abc,0x00001ae1,0x00050050,0x00000007, 18140x0000329b,0x00003294,0x000016d6,0x000600a9,
18510x00001ae8,0x00001ae2,0x00001ae7,0x0004007c, 18150x0000004b,0x0000329e,0x0000329b,0x000003be,
18520x00000014,0x00001ad8,0x00001ae8,0x00060041, 18160x000016ce,0x00050041,0x000000fe,0x00001a85,
18530x000000db,0x00001ad0,0x00001ad8,0x000000da, 18170x000000fc,0x000000fd,0x0004003d,0x00000006,
18540x000000da,0x0005003e,0x00001ad0,0x00001ac5, 18180x00001a86,0x00001a85,0x00050084,0x00000006,
18190x00001a87,0x0000011f,0x00001a86,0x00050080,
18200x00000006,0x00001a88,0x00000107,0x00001a87,
18210x00050080,0x00000006,0x00001a8e,0x00001a86,
18220x00003297,0x00050086,0x00000006,0x00001a8f,
18230x00001a8e,0x00000101,0x00050084,0x00000006,
18240x00001a81,0x00000107,0x00001a8f,0x00050080,
18250x00000006,0x00001a82,0x00001a88,0x00001a81,
18260x00050084,0x00000006,0x00001a52,0x00000150,
18270x00001658,0x00050080,0x00000006,0x00001a53,
18280x00001a82,0x00001a52,0x00050041,0x00000156,
18290x00001a54,0x000000fc,0x00000154,0x0004003d,
18300x00000007,0x00001a55,0x00001a54,0x00050051,
18310x00000027,0x00001a58,0x0000329e,0x00000000,
18320x0004007c,0x00000006,0x00001a95,0x00001a58,
18330x00050051,0x00000006,0x00001aae,0x00001a55,
18340x00000000,0x00050095,0x000000ab,0x00001ab0,
18350x00001aae,0x00001a53,0x00050051,0x00000006,
18360x00001ab1,0x00001ab0,0x00000001,0x00050051,
18370x00000006,0x00001ab2,0x00001ab0,0x00000000,
18380x00050051,0x00000006,0x00001ab5,0x00001a55,
18390x00000001,0x00050080,0x00000006,0x00001ab7,
18400x00001ab5,0x00001ab1,0x00050050,0x00000007,
18410x00001ab8,0x00001ab2,0x00001ab7,0x0004007c,
18420x00000014,0x00001aa8,0x00001ab8,0x00060041,
18430x000000db,0x00001aa0,0x00001aa8,0x000000da,
18440x000000da,0x0005003e,0x00001aa0,0x00001a95,
18450x00000002,0x00000004,0x00050080,0x00000006,
18460x00001a5b,0x00001a53,0x0000010a,0x00050051,
18470x00000027,0x00001a5f,0x0000329e,0x00000001,
18480x0004007c,0x00000006,0x00001abe,0x00001a5f,
18490x00050095,0x000000ab,0x00001ad9,0x00001aae,
18500x00001a5b,0x00050051,0x00000006,0x00001ada,
18510x00001ad9,0x00000001,0x00050051,0x00000006,
18520x00001adb,0x00001ad9,0x00000000,0x00050080,
18530x00000006,0x00001ae0,0x00001ab5,0x00001ada,
18540x00050050,0x00000007,0x00001ae1,0x00001adb,
18550x00001ae0,0x0004007c,0x00000014,0x00001ad1,
18560x00001ae1,0x00060041,0x000000db,0x00001ac9,
18570x00001ad1,0x000000da,0x000000da,0x0005003e,
18580x00001ac9,0x00001abe,0x00000002,0x00000004,
18590x00050080,0x00000006,0x00001a62,0x00001a53,
18600x00000111,0x00050051,0x00000027,0x00001a66,
18610x0000329e,0x00000002,0x0004007c,0x00000006,
18620x00001ae7,0x00001a66,0x00050095,0x000000ab,
18630x00001b02,0x00001aae,0x00001a62,0x00050051,
18640x00000006,0x00001b03,0x00001b02,0x00000001,
18650x00050051,0x00000006,0x00001b04,0x00001b02,
18660x00000000,0x00050080,0x00000006,0x00001b09,
18670x00001ab5,0x00001b03,0x00050050,0x00000007,
18680x00001b0a,0x00001b04,0x00001b09,0x0004007c,
18690x00000014,0x00001afa,0x00001b0a,0x00060041,
18700x000000db,0x00001af2,0x00001afa,0x000000da,
18710x000000da,0x0005003e,0x00001af2,0x00001ae7,
18550x00000002,0x00000004,0x00050080,0x00000006, 18720x00000002,0x00000004,0x00050080,0x00000006,
18560x00001a69,0x00001a5a,0x00000111,0x00050051, 18730x00001a69,0x00001a53,0x00000118,0x00050051,
18570x00000027,0x00001a6d,0x000032ac,0x00000002, 18740x00000027,0x00001a6d,0x0000329c,0x00000000,
18580x0004007c,0x00000006,0x00001aee,0x00001a6d, 18750x0004007c,0x00000006,0x00001b10,0x00001a6d,
18590x00050095,0x000000ab,0x00001b09,0x00001ab5, 18760x00050095,0x000000ab,0x00001b2b,0x00001aae,
18600x00001a69,0x00050051,0x00000006,0x00001b0a, 18770x00001a69,0x00050051,0x00000006,0x00001b2c,
18610x00001b09,0x00000001,0x00050051,0x00000006, 18780x00001b2b,0x00000001,0x00050051,0x00000006,
18620x00001b0b,0x00001b09,0x00000000,0x00050080, 18790x00001b2d,0x00001b2b,0x00000000,0x00050080,
18630x00000006,0x00001b10,0x00001abc,0x00001b0a, 18800x00000006,0x00001b32,0x00001ab5,0x00001b2c,
18640x00050050,0x00000007,0x00001b11,0x00001b0b, 18810x00050050,0x00000007,0x00001b33,0x00001b2d,
18650x00001b10,0x0004007c,0x00000014,0x00001b01, 18820x00001b32,0x0004007c,0x00000014,0x00001b23,
18660x00001b11,0x00060041,0x000000db,0x00001af9, 18830x00001b33,0x00060041,0x000000db,0x00001b1b,
18670x00001b01,0x000000da,0x000000da,0x0005003e, 18840x00001b23,0x000000da,0x000000da,0x0005003e,
18680x00001af9,0x00001aee,0x00000002,0x00000004, 18850x00001b1b,0x00001b10,0x00000002,0x00000004,
18690x00050080,0x00000006,0x00001a70,0x00001a5a, 18860x00050080,0x00000006,0x00001a70,0x00001a53,
18700x00000118,0x00050051,0x00000027,0x00001a74, 18870x0000011f,0x00050051,0x00000027,0x00001a74,
18710x000032aa,0x00000000,0x0004007c,0x00000006, 18880x0000329c,0x00000001,0x0004007c,0x00000006,
18720x00001b17,0x00001a74,0x00050095,0x000000ab, 18890x00001b39,0x00001a74,0x00050095,0x000000ab,
18730x00001b32,0x00001ab5,0x00001a70,0x00050051, 18900x00001b54,0x00001aae,0x00001a70,0x00050051,
18740x00000006,0x00001b33,0x00001b32,0x00000001, 18910x00000006,0x00001b55,0x00001b54,0x00000001,
18750x00050051,0x00000006,0x00001b34,0x00001b32, 18920x00050051,0x00000006,0x00001b56,0x00001b54,
18760x00000000,0x00050080,0x00000006,0x00001b39, 18930x00000000,0x00050080,0x00000006,0x00001b5b,
18770x00001abc,0x00001b33,0x00050050,0x00000007, 18940x00001ab5,0x00001b55,0x00050050,0x00000007,
18780x00001b3a,0x00001b34,0x00001b39,0x0004007c, 18950x00001b5c,0x00001b56,0x00001b5b,0x0004007c,
18790x00000014,0x00001b2a,0x00001b3a,0x00060041, 18960x00000014,0x00001b4c,0x00001b5c,0x00060041,
18800x000000db,0x00001b22,0x00001b2a,0x000000da, 18970x000000db,0x00001b44,0x00001b4c,0x000000da,
18810x000000da,0x0005003e,0x00001b22,0x00001b17, 18980x000000da,0x0005003e,0x00001b44,0x00001b39,
18820x00000002,0x00000004,0x00050080,0x00000006, 18990x00000002,0x00000004,0x00050080,0x00000006,
18830x00001a77,0x00001a5a,0x0000011f,0x00050051, 19000x00001a77,0x00001a53,0x00000189,0x00050051,
18840x00000027,0x00001a7b,0x000032aa,0x00000001, 19010x00000027,0x00001a7b,0x0000329c,0x00000002,
18850x0004007c,0x00000006,0x00001b40,0x00001a7b, 19020x0004007c,0x00000006,0x00001b62,0x00001a7b,
18860x00050095,0x000000ab,0x00001b5b,0x00001ab5, 19030x00050095,0x000000ab,0x00001b7d,0x00001aae,
18870x00001a77,0x00050051,0x00000006,0x00001b5c, 19040x00001a77,0x00050051,0x00000006,0x00001b7e,
18880x00001b5b,0x00000001,0x00050051,0x00000006, 19050x00001b7d,0x00000001,0x00050051,0x00000006,
18890x00001b5d,0x00001b5b,0x00000000,0x00050080, 19060x00001b7f,0x00001b7d,0x00000000,0x00050080,
18900x00000006,0x00001b62,0x00001abc,0x00001b5c, 19070x00000006,0x00001b84,0x00001ab5,0x00001b7e,
18910x00050050,0x00000007,0x00001b63,0x00001b5d, 19080x00050050,0x00000007,0x00001b85,0x00001b7f,
18920x00001b62,0x0004007c,0x00000014,0x00001b53, 19090x00001b84,0x0004007c,0x00000014,0x00001b75,
18930x00001b63,0x00060041,0x000000db,0x00001b4b, 19100x00001b85,0x00060041,0x000000db,0x00001b6d,
18940x00001b53,0x000000da,0x000000da,0x0005003e, 19110x00001b75,0x000000da,0x000000da,0x0005003e,
18950x00001b4b,0x00001b40,0x00000002,0x00000004, 19120x00001b6d,0x00001b62,0x00000002,0x00000004,
18960x00050080,0x00000006,0x00001a7e,0x00001a5a, 19130x000300f7,0x00001bc5,0x00000000,0x000300fb,
18970x00000189,0x00050051,0x00000027,0x00001a82, 19140x000000a6,0x00001b94,0x000200f8,0x00001b94,
18980x000032aa,0x00000002,0x0004007c,0x00000006, 19150x000500bc,0x0000002f,0x00001bcc,0x00001a58,
18990x00001b69,0x00001a82,0x00050095,0x000000ab, 19160x00001a6d,0x000300f7,0x00001bd3,0x00000000,
19000x00001b84,0x00001ab5,0x00001a7e,0x00050051, 19170x000400fa,0x00001bcc,0x00001bcd,0x00001bd3,
19010x00000006,0x00001b85,0x00001b84,0x00000001, 19180x000200f8,0x00001bcd,0x000500bc,0x0000002f,
19020x00050051,0x00000006,0x00001b86,0x00001b84, 19190x00001bd2,0x00001a5f,0x00001a74,0x000200f9,
19030x00000000,0x00050080,0x00000006,0x00001b8b, 19200x00001bd3,0x000200f8,0x00001bd3,0x000700f5,
19040x00001abc,0x00001b85,0x00050050,0x00000007, 19210x0000002f,0x00001bd4,0x00001bcc,0x00001b94,
19050x00001b8c,0x00001b86,0x00001b8b,0x0004007c, 19220x00001bd2,0x00001bcd,0x000300f7,0x00001bdb,
19060x00000014,0x00001b7c,0x00001b8c,0x00060041, 19230x00000000,0x000400fa,0x00001bd4,0x00001bd5,
19070x000000db,0x00001b74,0x00001b7c,0x000000da, 19240x00001bdb,0x000200f8,0x00001bd5,0x000500bc,
19080x000000da,0x0005003e,0x00001b74,0x00001b69, 19250x0000002f,0x00001bda,0x00001a66,0x00001a7b,
19090x00000002,0x00000004,0x000300f7,0x00001bcc, 19260x000200f9,0x00001bdb,0x000200f8,0x00001bdb,
19100x00000000,0x000300fb,0x000000a6,0x00001b9b, 19270x000700f5,0x0000002f,0x00001bdc,0x00001bd4,
19110x000200f8,0x00001b9b,0x000500bc,0x0000002f, 19280x00001bd3,0x00001bda,0x00001bd5,0x000400a8,
19120x00001bd3,0x00001a5f,0x00001a74,0x000300f7, 19290x0000002f,0x00001bdd,0x00001bdc,0x000300f7,
19130x00001bda,0x00000000,0x000400fa,0x00001bd3, 19300x00001b99,0x00000000,0x000400fa,0x00001bdd,
19140x00001bd4,0x00001bda,0x000200f8,0x00001bd4, 19310x00001b98,0x00001b99,0x000200f8,0x00001b98,
19150x000500bc,0x0000002f,0x00001bd9,0x00001a66, 19320x000200f9,0x00001bc5,0x000200f8,0x00001b99,
19160x00001a7b,0x000200f9,0x00001bda,0x000200f8, 19330x00050081,0x0000004b,0x00001b9c,0x0000329e,
19170x00001bda,0x000700f5,0x0000002f,0x00001bdb, 19340x0000329c,0x0005008e,0x0000004b,0x00001b9d,
19180x00001bd3,0x00001b9b,0x00001bd9,0x00001bd4, 19350x00001b9c,0x000001ed,0x00050095,0x000000ab,
19190x000300f7,0x00001be2,0x00000000,0x000400fa, 19360x00001bed,0x00001aae,0x000000a6,0x00050051,
19200x00001bdb,0x00001bdc,0x00001be2,0x000200f8, 19370x00000006,0x00001bee,0x00001bed,0x00000001,
19210x00001bdc,0x000500bc,0x0000002f,0x00001be1, 19380x00050051,0x00000006,0x00001bef,0x00001bed,
19220x00001a6d,0x00001a82,0x000200f9,0x00001be2, 19390x00000000,0x00050080,0x00000006,0x00001bf4,
19230x000200f8,0x00001be2,0x000700f5,0x0000002f, 19400x00001ab5,0x00001bee,0x00050050,0x00000007,
19240x00001be3,0x00001bdb,0x00001bda,0x00001be1, 19410x00001bf5,0x00001bef,0x00001bf4,0x0004007c,
19250x00001bdc,0x000400a8,0x0000002f,0x00001be4, 19420x00000014,0x00001be5,0x00001bf5,0x00060041,
19260x00001be3,0x000300f7,0x00001ba0,0x00000000, 19430x000000db,0x00001ba2,0x00001be5,0x000000da,
19270x000400fa,0x00001be4,0x00001b9f,0x00001ba0, 19440x000000da,0x00050051,0x00000027,0x00001ba4,
19280x000200f8,0x00001b9f,0x000200f9,0x00001bcc, 19450x00001b9d,0x00000000,0x0004007c,0x00000006,
19290x000200f8,0x00001ba0,0x00050081,0x0000004b, 19460x00001bfb,0x00001ba4,0x000500c7,0x00000006,
19300x00001ba3,0x000032ac,0x000032aa,0x0005008e, 19470x00001bfd,0x00001bfb,0x00000130,0x000500ab,
19310x0000004b,0x00001ba4,0x00001ba3,0x000001ed, 19480x0000002f,0x00001bfe,0x00001bfd,0x000000a6,
19320x00050095,0x000000ab,0x00001bf4,0x00001ab5, 19490x000300f7,0x00001c05,0x00000000,0x000400fa,
19330x000000a6,0x00050051,0x00000006,0x00001bf5, 19500x00001bfe,0x00001bff,0x00001c02,0x000200f8,
19340x00001bf4,0x00000001,0x00050051,0x00000006, 19510x00001bff,0x000400c8,0x00000006,0x00001c01,
19350x00001bf6,0x00001bf4,0x00000000,0x00050080, 19520x00001bfb,0x000200f9,0x00001c05,0x000200f8,
19360x00000006,0x00001bfb,0x00001abc,0x00001bf5, 19530x00001c02,0x000500c5,0x00000006,0x00001c04,
19370x00050050,0x00000007,0x00001bfc,0x00001bf6, 19540x00001bfb,0x00000130,0x000200f9,0x00001c05,
19380x00001bfb,0x0004007c,0x00000014,0x00001bec, 19550x000200f8,0x00001c05,0x000700f5,0x00000006,
19390x00001bfc,0x00060041,0x000000db,0x00001ba9, 19560x0000322f,0x00001c01,0x00001bff,0x00001c04,
19400x00001bec,0x000000da,0x000000da,0x00050051, 19570x00001c02,0x000700ed,0x00000006,0x00001ba6,
19410x00000027,0x00001bab,0x00001ba4,0x00000000, 19580x00001ba2,0x000000b0,0x000000a6,0x0000322f,
19420x0004007c,0x00000006,0x00001c02,0x00001bab, 19590x00060041,0x000000db,0x00001ba8,0x00001be5,
19430x000500c7,0x00000006,0x00001c04,0x00001c02, 19600x000000da,0x00000154,0x00050051,0x00000027,
19440x00000130,0x000500ab,0x0000002f,0x00001c05, 19610x00001baa,0x00001b9d,0x00000001,0x0004007c,
19450x00001c04,0x000000a6,0x000300f7,0x00001c0c, 19620x00000006,0x00001c0c,0x00001baa,0x000500c7,
19460x00000000,0x000400fa,0x00001c05,0x00001c06, 19630x00000006,0x00001c0e,0x00001c0c,0x00000130,
19470x00001c09,0x000200f8,0x00001c06,0x000400c8, 19640x000500ab,0x0000002f,0x00001c0f,0x00001c0e,
19480x00000006,0x00001c08,0x00001c02,0x000200f9, 19650x000000a6,0x000300f7,0x00001c16,0x00000000,
19490x00001c0c,0x000200f8,0x00001c09,0x000500c5, 19660x000400fa,0x00001c0f,0x00001c10,0x00001c13,
19500x00000006,0x00001c0b,0x00001c02,0x00000130, 19670x000200f8,0x00001c10,0x000400c8,0x00000006,
19510x000200f9,0x00001c0c,0x000200f8,0x00001c0c, 19680x00001c12,0x00001c0c,0x000200f9,0x00001c16,
19520x000700f5,0x00000006,0x0000323e,0x00001c08, 19690x000200f8,0x00001c13,0x000500c5,0x00000006,
19530x00001c06,0x00001c0b,0x00001c09,0x000700ed, 19700x00001c15,0x00001c0c,0x00000130,0x000200f9,
19540x00000006,0x00001bad,0x00001ba9,0x000000b0, 19710x00001c16,0x000200f8,0x00001c16,0x000700f5,
19550x000000a6,0x0000323e,0x00060041,0x000000db, 19720x00000006,0x00003230,0x00001c12,0x00001c10,
19560x00001baf,0x00001bec,0x000000da,0x00000154, 19730x00001c15,0x00001c13,0x000700ed,0x00000006,
19570x00050051,0x00000027,0x00001bb1,0x00001ba4, 19740x00001bac,0x00001ba8,0x000000b0,0x000000a6,
19580x00000001,0x0004007c,0x00000006,0x00001c13, 19750x00003230,0x00060041,0x000000db,0x00001bae,
19590x00001bb1,0x000500c7,0x00000006,0x00001c15, 19760x00001be5,0x000000da,0x00000205,0x00050051,
19600x00001c13,0x00000130,0x000500ab,0x0000002f, 19770x00000027,0x00001bb0,0x00001b9d,0x00000002,
19610x00001c16,0x00001c15,0x000000a6,0x000300f7, 19780x0004007c,0x00000006,0x00001c1d,0x00001bb0,
19620x00001c1d,0x00000000,0x000400fa,0x00001c16, 19790x000500c7,0x00000006,0x00001c1f,0x00001c1d,
19630x00001c17,0x00001c1a,0x000200f8,0x00001c17, 19800x00000130,0x000500ab,0x0000002f,0x00001c20,
19640x000400c8,0x00000006,0x00001c19,0x00001c13, 19810x00001c1f,0x000000a6,0x000300f7,0x00001c27,
19650x000200f9,0x00001c1d,0x000200f8,0x00001c1a, 19820x00000000,0x000400fa,0x00001c20,0x00001c21,
19660x000500c5,0x00000006,0x00001c1c,0x00001c13, 19830x00001c24,0x000200f8,0x00001c21,0x000400c8,
19670x00000130,0x000200f9,0x00001c1d,0x000200f8, 19840x00000006,0x00001c23,0x00001c1d,0x000200f9,
19680x00001c1d,0x000700f5,0x00000006,0x0000323f, 19850x00001c27,0x000200f8,0x00001c24,0x000500c5,
19690x00001c19,0x00001c17,0x00001c1c,0x00001c1a, 19860x00000006,0x00001c26,0x00001c1d,0x00000130,
19700x000700ed,0x00000006,0x00001bb3,0x00001baf, 19870x000200f9,0x00001c27,0x000200f8,0x00001c27,
19710x000000b0,0x000000a6,0x0000323f,0x00060041, 19880x000700f5,0x00000006,0x00003231,0x00001c23,
19720x000000db,0x00001bb5,0x00001bec,0x000000da, 19890x00001c21,0x00001c26,0x00001c24,0x000700ed,
19730x00000205,0x00050051,0x00000027,0x00001bb7, 19900x00000006,0x00001bb2,0x00001bae,0x000000b0,
19740x00001ba4,0x00000002,0x0004007c,0x00000006, 19910x000000a6,0x00003231,0x00060041,0x000000db,
19750x00001c24,0x00001bb7,0x000500c7,0x00000006, 19920x00001bb4,0x00001be5,0x000000da,0x0000020d,
19760x00001c26,0x00001c24,0x00000130,0x000500ab, 19930x000300f7,0x00001c38,0x00000000,0x000400fa,
19770x0000002f,0x00001c27,0x00001c26,0x000000a6, 19940x00001bfe,0x00001c32,0x00001c35,0x000200f8,
19780x000300f7,0x00001c2e,0x00000000,0x000400fa, 19950x00001c32,0x000400c8,0x00000006,0x00001c34,
19790x00001c27,0x00001c28,0x00001c2b,0x000200f8, 19960x00001bfb,0x000200f9,0x00001c38,0x000200f8,
19800x00001c28,0x000400c8,0x00000006,0x00001c2a, 19970x00001c35,0x000500c5,0x00000006,0x00001c37,
19810x00001c24,0x000200f9,0x00001c2e,0x000200f8, 19980x00001bfb,0x00000130,0x000200f9,0x00001c38,
19820x00001c2b,0x000500c5,0x00000006,0x00001c2d, 19990x000200f8,0x00001c38,0x000700f5,0x00000006,
19830x00001c24,0x00000130,0x000200f9,0x00001c2e, 20000x00003232,0x00001c34,0x00001c32,0x00001c37,
19840x000200f8,0x00001c2e,0x000700f5,0x00000006, 20010x00001c35,0x000700ef,0x00000006,0x00001bb8,
19850x00003240,0x00001c2a,0x00001c28,0x00001c2d, 20020x00001bb4,0x000000b0,0x000000a6,0x00003232,
19860x00001c2b,0x000700ed,0x00000006,0x00001bb9, 20030x00060041,0x000000db,0x00001bba,0x00001be5,
19870x00001bb5,0x000000b0,0x000000a6,0x00003240, 20040x000000da,0x00000215,0x000300f7,0x00001c49,
19880x00060041,0x000000db,0x00001bbb,0x00001bec, 20050x00000000,0x000400fa,0x00001c0f,0x00001c43,
19890x000000da,0x0000020d,0x000300f7,0x00001c3f, 20060x00001c46,0x000200f8,0x00001c43,0x000400c8,
19900x00000000,0x000400fa,0x00001c05,0x00001c39, 20070x00000006,0x00001c45,0x00001c0c,0x000200f9,
19910x00001c3c,0x000200f8,0x00001c39,0x000400c8, 20080x00001c49,0x000200f8,0x00001c46,0x000500c5,
19920x00000006,0x00001c3b,0x00001c02,0x000200f9, 20090x00000006,0x00001c48,0x00001c0c,0x00000130,
19930x00001c3f,0x000200f8,0x00001c3c,0x000500c5, 20100x000200f9,0x00001c49,0x000200f8,0x00001c49,
19940x00000006,0x00001c3e,0x00001c02,0x00000130, 20110x000700f5,0x00000006,0x00003233,0x00001c45,
19950x000200f9,0x00001c3f,0x000200f8,0x00001c3f, 20120x00001c43,0x00001c48,0x00001c46,0x000700ef,
19960x000700f5,0x00000006,0x00003241,0x00001c3b, 20130x00000006,0x00001bbe,0x00001bba,0x000000b0,
19970x00001c39,0x00001c3e,0x00001c3c,0x000700ef, 20140x000000a6,0x00003233,0x00060041,0x000000db,
19980x00000006,0x00001bbf,0x00001bbb,0x000000b0, 20150x00001bc0,0x00001be5,0x000000da,0x0000021d,
19990x000000a6,0x00003241,0x00060041,0x000000db, 20160x000300f7,0x00001c5a,0x00000000,0x000400fa,
20000x00001bc1,0x00001bec,0x000000da,0x00000215, 20170x00001c20,0x00001c54,0x00001c57,0x000200f8,
20010x000300f7,0x00001c50,0x00000000,0x000400fa, 20180x00001c54,0x000400c8,0x00000006,0x00001c56,
20020x00001c16,0x00001c4a,0x00001c4d,0x000200f8, 20190x00001c1d,0x000200f9,0x00001c5a,0x000200f8,
20030x00001c4a,0x000400c8,0x00000006,0x00001c4c, 20200x00001c57,0x000500c5,0x00000006,0x00001c59,
20040x00001c13,0x000200f9,0x00001c50,0x000200f8, 20210x00001c1d,0x00000130,0x000200f9,0x00001c5a,
20050x00001c4d,0x000500c5,0x00000006,0x00001c4f, 20220x000200f8,0x00001c5a,0x000700f5,0x00000006,
20060x00001c13,0x00000130,0x000200f9,0x00001c50, 20230x00003234,0x00001c56,0x00001c54,0x00001c59,
20070x000200f8,0x00001c50,0x000700f5,0x00000006, 20240x00001c57,0x000700ef,0x00000006,0x00001bc4,
20080x00003242,0x00001c4c,0x00001c4a,0x00001c4f, 20250x00001bc0,0x000000b0,0x000000a6,0x00003234,
20090x00001c4d,0x000700ef,0x00000006,0x00001bc5, 20260x000200f9,0x00001bc5,0x000200f8,0x00001bc5,
20100x00001bc1,0x000000b0,0x000000a6,0x00003242, 20270x000200f9,0x00000bcc,0x000200f8,0x00000bd0,
20110x00060041,0x000000db,0x00001bc7,0x00001bec, 20280x000500aa,0x0000002f,0x00000bd3,0x00000b0b,
20120x000000da,0x0000021d,0x000300f7,0x00001c61, 20290x00000170,0x000300f7,0x00000bd5,0x00000000,
20130x00000000,0x000400fa,0x00001c27,0x00001c5b, 20300x000400fa,0x00000bd3,0x00000bd4,0x00000bd9,
20140x00001c5e,0x000200f8,0x00001c5b,0x000400c8, 20310x000200f8,0x00000bd4,0x00050084,0x00000006,
20150x00000006,0x00001c5d,0x00001c24,0x000200f9, 20320x00001cc3,0x00000107,0x00000b09,0x000200f9,
20160x00001c61,0x000200f8,0x00001c5e,0x000500c5, 20330x00001cc4,0x000200f8,0x00001cc4,0x000700f5,
20170x00000006,0x00001c60,0x00001c24,0x00000130, 20340x00000006,0x000031e1,0x000000a6,0x00000bd4,
20180x000200f9,0x00001c61,0x000200f8,0x00001c61, 20350x00001cd5,0x00001cc8,0x000500b0,0x0000002f,
20190x000700f5,0x00000006,0x00003243,0x00001c5d, 20360x00001cc7,0x000031e1,0x00000118,0x000400f6,
20200x00001c5b,0x00001c60,0x00001c5e,0x000700ef, 20370x00001cd6,0x00001cc8,0x00000000,0x000400fa,
20210x00000006,0x00001bcb,0x00001bc7,0x000000b0, 20380x00001cc7,0x00001cc8,0x00001cd6,0x000200f8,
20220x000000a6,0x00003243,0x000200f9,0x00001bcc, 20390x00001cc8,0x00050084,0x00000006,0x00001ccc,
20230x000200f8,0x00001bcc,0x000200f9,0x00000bd2, 20400x0000010a,0x000031e1,0x00050080,0x00000006,
20240x000200f8,0x00000bd6,0x000500aa,0x0000002f, 20410x00001ccd,0x00001cc3,0x00001ccc,0x00050041,
20250x00000bd9,0x00000b13,0x00000170,0x000300f7, 20420x00000156,0x00001cce,0x000000fc,0x00000205,
20260x00000bdb,0x00000000,0x000400fa,0x00000bd9, 20430x0004003d,0x00000007,0x00001ccf,0x00001cce,
20270x00000bda,0x00000bdf,0x000200f8,0x00000bda, 20440x00050051,0x00000006,0x00001e8c,0x00001ccf,
20280x00050084,0x00000006,0x00001cca,0x00000107, 20450x00000000,0x00050095,0x000000ab,0x00001e8e,
20290x00000b11,0x000200f9,0x00001ccb,0x000200f8, 20460x00001e8c,0x00001ccd,0x00050051,0x00000006,
20300x00001ccb,0x000700f5,0x00000006,0x000031f0, 20470x00001e8f,0x00001e8e,0x00000001,0x00050051,
20310x000000a6,0x00000bda,0x00001cdc,0x00001ccf, 20480x00000006,0x00001e90,0x00001e8e,0x00000000,
20320x000500b0,0x0000002f,0x00001cce,0x000031f0, 20490x00050051,0x00000006,0x00001e93,0x00001ccf,
20330x00000118,0x000400f6,0x00001cdd,0x00001ccf, 20500x00000001,0x00050080,0x00000006,0x00001e95,
20340x00000000,0x000400fa,0x00001cce,0x00001ccf, 20510x00001e93,0x00001e8f,0x00050050,0x00000007,
20350x00001cdd,0x000200f8,0x00001ccf,0x00050084, 20520x00001e96,0x00001e90,0x00001e95,0x0004007c,
20360x00000006,0x00001cd3,0x0000010a,0x000031f0, 20530x00000014,0x00001e86,0x00001e96,0x00060041,
20370x00050080,0x00000006,0x00001cd4,0x00001cca, 20540x000000db,0x00001e7d,0x00001e86,0x000000da,
20380x00001cd3,0x00050041,0x00000156,0x00001cd5, 20550x000000da,0x0006003d,0x00000006,0x00001e7e,
20560x00001e7d,0x00000002,0x00000004,0x0004007c,
20570x00000027,0x00001cd1,0x00001e7e,0x00050041,
20580x00000028,0x00001cd2,0x00001c5e,0x000031e1,
20590x0003003e,0x00001cd2,0x00001cd1,0x00050080,
20600x00000006,0x00001cd5,0x000031e1,0x00000154,
20610x000200f9,0x00001cc4,0x000200f8,0x00001cd6,
20620x00050080,0x00000006,0x00001cd8,0x00001cc3,
20630x00000368,0x00050041,0x00000156,0x00001cd9,
20390x000000fc,0x00000205,0x0004003d,0x00000007, 20640x000000fc,0x00000205,0x0004003d,0x00000007,
20400x00001cd6,0x00001cd5,0x00050051,0x00000006, 20650x00001cda,0x00001cd9,0x00050051,0x00000006,
20410x00001e97,0x00001cd6,0x00000000,0x00050095, 20660x00001ead,0x00001cda,0x00000000,0x00050095,
20420x000000ab,0x00001e99,0x00001e97,0x00001cd4, 20670x000000ab,0x00001eaf,0x00001ead,0x00001cd8,
20430x00050051,0x00000006,0x00001e9a,0x00001e99, 20680x00050051,0x00000006,0x00001eb0,0x00001eaf,
20440x00000001,0x00050051,0x00000006,0x00001e9b, 20690x00000001,0x00050051,0x00000006,0x00001eb1,
20450x00001e99,0x00000000,0x00050051,0x00000006, 20700x00001eaf,0x00000000,0x00050051,0x00000006,
20460x00001e9e,0x00001cd6,0x00000001,0x00050080, 20710x00001eb4,0x00001cda,0x00000001,0x00050080,
20470x00000006,0x00001ea0,0x00001e9e,0x00001e9a, 20720x00000006,0x00001eb6,0x00001eb4,0x00001eb0,
20480x00050050,0x00000007,0x00001ea1,0x00001e9b, 20730x00050050,0x00000007,0x00001eb7,0x00001eb1,
20490x00001ea0,0x0004007c,0x00000014,0x00001e91, 20740x00001eb6,0x0004007c,0x00000014,0x00001ea7,
20500x00001ea1,0x00060041,0x000000db,0x00001e88, 20750x00001eb7,0x00060041,0x000000db,0x00001e9e,
20510x00001e91,0x000000da,0x000000da,0x0006003d, 20760x00001ea7,0x000000da,0x000000da,0x0006003d,
20520x00000006,0x00001e89,0x00001e88,0x00000002, 20770x00000006,0x00001e9f,0x00001e9e,0x00000002,
20530x00000004,0x0004007c,0x00000027,0x00001cd8, 20780x00000004,0x00050080,0x00000006,0x00001cdd,
20540x00001e89,0x00050041,0x00000028,0x00001cd9, 20790x00001cc3,0x00000374,0x00050095,0x000000ab,
20550x00001c65,0x000031f0,0x0003003e,0x00001cd9, 20800x00001ed0,0x00001ead,0x00001cdd,0x00050051,
20560x00001cd8,0x00050080,0x00000006,0x00001cdc, 20810x00000006,0x00001ed1,0x00001ed0,0x00000001,
20570x000031f0,0x00000154,0x000200f9,0x00001ccb, 20820x00050051,0x00000006,0x00001ed2,0x00001ed0,
20580x000200f8,0x00001cdd,0x00050080,0x00000006, 20830x00000000,0x00050080,0x00000006,0x00001ed7,
20590x00001cdf,0x00001cca,0x00000368,0x00050041, 20840x00001eb4,0x00001ed1,0x00050050,0x00000007,
20600x00000156,0x00001ce0,0x000000fc,0x00000205, 20850x00001ed8,0x00001ed2,0x00001ed7,0x0004007c,
20610x0004003d,0x00000007,0x00001ce1,0x00001ce0, 20860x00000014,0x00001ec8,0x00001ed8,0x00060041,
20620x00050051,0x00000006,0x00001eb8,0x00001ce1, 20870x000000db,0x00001ebf,0x00001ec8,0x000000da,
20630x00000000,0x00050095,0x000000ab,0x00001eba, 20880x000000da,0x0006003d,0x00000006,0x00001ec0,
20640x00001eb8,0x00001cdf,0x00050051,0x00000006, 20890x00001ebf,0x00000002,0x00000004,0x00050080,
20650x00001ebb,0x00001eba,0x00000001,0x00050051, 20900x00000006,0x00001ce2,0x00001cc3,0x0000037e,
20660x00000006,0x00001ebc,0x00001eba,0x00000000, 20910x00050095,0x000000ab,0x00001ef1,0x00001ead,
20670x00050051,0x00000006,0x00001ebf,0x00001ce1, 20920x00001ce2,0x00050051,0x00000006,0x00001ef2,
20680x00000001,0x00050080,0x00000006,0x00001ec1, 20930x00001ef1,0x00000001,0x00050051,0x00000006,
20690x00001ebf,0x00001ebb,0x00050050,0x00000007, 20940x00001ef3,0x00001ef1,0x00000000,0x00050080,
20700x00001ec2,0x00001ebc,0x00001ec1,0x0004007c, 20950x00000006,0x00001ef8,0x00001eb4,0x00001ef2,
20710x00000014,0x00001eb2,0x00001ec2,0x00060041, 20960x00050050,0x00000007,0x00001ef9,0x00001ef3,
20720x000000db,0x00001ea9,0x00001eb2,0x000000da, 20970x00001ef8,0x0004007c,0x00000014,0x00001ee9,
20730x000000da,0x0006003d,0x00000006,0x00001eaa, 20980x00001ef9,0x00060041,0x000000db,0x00001ee0,
20740x00001ea9,0x00000002,0x00000004,0x00050080, 20990x00001ee9,0x000000da,0x000000da,0x0006003d,
20750x00000006,0x00001ce4,0x00001cca,0x00000374, 21000x00000006,0x00001ee1,0x00001ee0,0x00000002,
20760x00050095,0x000000ab,0x00001edb,0x00001eb8, 21010x00000004,0x00050080,0x00000006,0x00001ce7,
20770x00001ce4,0x00050051,0x00000006,0x00001edc, 21020x00001cc3,0x00000388,0x00050095,0x000000ab,
20780x00001edb,0x00000001,0x00050051,0x00000006, 21030x00001f12,0x00001ead,0x00001ce7,0x00050051,
20790x00001edd,0x00001edb,0x00000000,0x00050080, 21040x00000006,0x00001f13,0x00001f12,0x00000001,
20800x00000006,0x00001ee2,0x00001ebf,0x00001edc, 21050x00050051,0x00000006,0x00001f14,0x00001f12,
20810x00050050,0x00000007,0x00001ee3,0x00001edd, 21060x00000000,0x00050080,0x00000006,0x00001f19,
20820x00001ee2,0x0004007c,0x00000014,0x00001ed3, 21070x00001eb4,0x00001f13,0x00050050,0x00000007,
20830x00001ee3,0x00060041,0x000000db,0x00001eca, 21080x00001f1a,0x00001f14,0x00001f19,0x0004007c,
20840x00001ed3,0x000000da,0x000000da,0x0006003d, 21090x00000014,0x00001f0a,0x00001f1a,0x00060041,
20850x00000006,0x00001ecb,0x00001eca,0x00000002, 21100x000000db,0x00001f01,0x00001f0a,0x000000da,
20860x00000004,0x00050080,0x00000006,0x00001ce9, 21110x000000da,0x0006003d,0x00000006,0x00001f02,
20870x00001cca,0x0000037e,0x00050095,0x000000ab, 21120x00001f01,0x00000002,0x00000004,0x00050041,
20880x00001efc,0x00001eb8,0x00001ce9,0x00050051, 21130x000000fe,0x00001cec,0x000000fc,0x0000022c,
20890x00000006,0x00001efd,0x00001efc,0x00000001, 21140x0004003d,0x00000006,0x00001ced,0x00001cec,
20900x00050051,0x00000006,0x00001efe,0x00001efc, 21150x00050084,0x00000006,0x00001cef,0x00000228,
20910x00000000,0x00050080,0x00000006,0x00001f03, 21160x00000b09,0x00050080,0x00000006,0x00001cf0,
20920x00001ebf,0x00001efd,0x00050050,0x00000007, 21170x00001ced,0x00001cef,0x000200f9,0x00001cf1,
20930x00001f04,0x00001efe,0x00001f03,0x0004007c, 21180x000200f8,0x00001cf1,0x000700f5,0x00000006,
20940x00000014,0x00001ef4,0x00001f04,0x00060041, 21190x000031e2,0x000000a6,0x00001cd6,0x00001d02,
20950x000000db,0x00001eeb,0x00001ef4,0x000000da, 21200x00001cf5,0x000500b0,0x0000002f,0x00001cf4,
20960x000000da,0x0006003d,0x00000006,0x00001eec, 21210x000031e2,0x00000118,0x000400f6,0x00001d03,
20970x00001eeb,0x00000002,0x00000004,0x00050080, 21220x00001cf5,0x00000000,0x000400fa,0x00001cf4,
20980x00000006,0x00001cee,0x00001cca,0x00000388, 21230x00001cf5,0x00001d03,0x000200f8,0x00001cf5,
20990x00050095,0x000000ab,0x00001f1d,0x00001eb8, 21240x00050084,0x00000006,0x00001cf8,0x0000010a,
21000x00001cee,0x00050051,0x00000006,0x00001f1e, 21250x000031e2,0x00050080,0x00000006,0x00001cf9,
21010x00001f1d,0x00000001,0x00050051,0x00000006, 21260x00001cf0,0x00001cf8,0x00050041,0x00000156,
21020x00001f1f,0x00001f1d,0x00000000,0x00050080, 21270x00001cfb,0x000000fc,0x000000da,0x0004003d,
21030x00000006,0x00001f24,0x00001ebf,0x00001f1e, 21280x00000007,0x00001cfc,0x00001cfb,0x00050041,
21040x00050050,0x00000007,0x00001f25,0x00001f1f, 21290x00000028,0x00001cfd,0x00001c5e,0x000031e2,
21050x00001f24,0x0004007c,0x00000014,0x00001f15, 21300x0004003d,0x00000027,0x00001cfe,0x00001cfd,
21060x00001f25,0x00060041,0x000000db,0x00001f0c, 21310x0004007c,0x00000006,0x00001f20,0x00001cfe,
21070x00001f15,0x000000da,0x000000da,0x0006003d, 21320x00050051,0x00000006,0x00001f39,0x00001cfc,
21080x00000006,0x00001f0d,0x00001f0c,0x00000002, 21330x00000000,0x00050095,0x000000ab,0x00001f3b,
21090x00000004,0x00050041,0x000000fe,0x00001cf3, 21340x00001f39,0x00001cf9,0x00050051,0x00000006,
21100x000000fc,0x0000022c,0x0004003d,0x00000006, 21350x00001f3c,0x00001f3b,0x00000001,0x00050051,
21110x00001cf4,0x00001cf3,0x00050084,0x00000006, 21360x00000006,0x00001f3d,0x00001f3b,0x00000000,
21120x00001cf6,0x00000228,0x00000b11,0x00050080, 21370x00050051,0x00000006,0x00001f40,0x00001cfc,
21130x00000006,0x00001cf7,0x00001cf4,0x00001cf6, 21380x00000001,0x00050080,0x00000006,0x00001f42,
21140x000200f9,0x00001cf8,0x000200f8,0x00001cf8, 21390x00001f40,0x00001f3c,0x00050050,0x00000007,
21150x000700f5,0x00000006,0x000031f1,0x000000a6, 21400x00001f43,0x00001f3d,0x00001f42,0x0004007c,
21160x00001cdd,0x00001d09,0x00001cfc,0x000500b0, 21410x00000014,0x00001f33,0x00001f43,0x00060041,
21170x0000002f,0x00001cfb,0x000031f1,0x00000118, 21420x000000db,0x00001f2b,0x00001f33,0x000000da,
21180x000400f6,0x00001d0a,0x00001cfc,0x00000000, 21430x000000da,0x0005003e,0x00001f2b,0x00001f20,
21190x000400fa,0x00001cfb,0x00001cfc,0x00001d0a, 21440x00000002,0x00000004,0x00050080,0x00000006,
21200x000200f8,0x00001cfc,0x00050084,0x00000006, 21450x00001d02,0x000031e2,0x00000154,0x000200f9,
21210x00001cff,0x0000010a,0x000031f1,0x00050080, 21460x00001cf1,0x000200f8,0x00001d03,0x00050080,
21220x00000006,0x00001d00,0x00001cf7,0x00001cff, 21470x00000006,0x00001d05,0x00001cf0,0x00000368,
21230x00050041,0x00000156,0x00001d02,0x000000fc, 21480x00050041,0x00000156,0x00001d06,0x000000fc,
21240x000000da,0x0004003d,0x00000007,0x00001d03, 21490x000000da,0x0004003d,0x00000007,0x00001d07,
21250x00001d02,0x00050041,0x00000028,0x00001d04, 21500x00001d06,0x00050051,0x00000006,0x00001f59,
21260x00001c65,0x000031f1,0x0004003d,0x00000027, 21510x00001d07,0x00000000,0x00050095,0x000000ab,
21270x00001d05,0x00001d04,0x0004007c,0x00000006, 21520x00001f5b,0x00001f59,0x00001d05,0x00050051,
21280x00001f2b,0x00001d05,0x00050051,0x00000006, 21530x00000006,0x00001f5c,0x00001f5b,0x00000001,
21290x00001f44,0x00001d03,0x00000000,0x00050095, 21540x00050051,0x00000006,0x00001f5d,0x00001f5b,
21300x000000ab,0x00001f46,0x00001f44,0x00001d00, 21550x00000000,0x00050051,0x00000006,0x00001f60,
21310x00050051,0x00000006,0x00001f47,0x00001f46, 21560x00001d07,0x00000001,0x00050080,0x00000006,
21320x00000001,0x00050051,0x00000006,0x00001f48, 21570x00001f62,0x00001f60,0x00001f5c,0x00050050,
21330x00001f46,0x00000000,0x00050051,0x00000006, 21580x00000007,0x00001f63,0x00001f5d,0x00001f62,
21340x00001f4b,0x00001d03,0x00000001,0x00050080, 21590x0004007c,0x00000014,0x00001f53,0x00001f63,
21350x00000006,0x00001f4d,0x00001f4b,0x00001f47, 21600x00060041,0x000000db,0x00001f4b,0x00001f53,
21360x00050050,0x00000007,0x00001f4e,0x00001f48, 21610x000000da,0x000000da,0x0005003e,0x00001f4b,
21370x00001f4d,0x0004007c,0x00000014,0x00001f3e, 21620x00001e9f,0x00000002,0x00000004,0x00050080,
21380x00001f4e,0x00060041,0x000000db,0x00001f36, 21630x00000006,0x00001d0b,0x00001cf0,0x00000374,
21390x00001f3e,0x000000da,0x000000da,0x0005003e, 21640x00050095,0x000000ab,0x00001f7b,0x00001f59,
21400x00001f36,0x00001f2b,0x00000002,0x00000004, 21650x00001d0b,0x00050051,0x00000006,0x00001f7c,
21410x00050080,0x00000006,0x00001d09,0x000031f1, 21660x00001f7b,0x00000001,0x00050051,0x00000006,
21420x00000154,0x000200f9,0x00001cf8,0x000200f8, 21670x00001f7d,0x00001f7b,0x00000000,0x00050080,
21430x00001d0a,0x00050080,0x00000006,0x00001d0c, 21680x00000006,0x00001f82,0x00001f60,0x00001f7c,
21440x00001cf7,0x00000368,0x00050041,0x00000156, 21690x00050050,0x00000007,0x00001f83,0x00001f7d,
21450x00001d0d,0x000000fc,0x000000da,0x0004003d, 21700x00001f82,0x0004007c,0x00000014,0x00001f73,
21460x00000007,0x00001d0e,0x00001d0d,0x00050051, 21710x00001f83,0x00060041,0x000000db,0x00001f6b,
21470x00000006,0x00001f64,0x00001d0e,0x00000000, 21720x00001f73,0x000000da,0x000000da,0x0005003e,
21480x00050095,0x000000ab,0x00001f66,0x00001f64, 21730x00001f6b,0x00001ec0,0x00000002,0x00000004,
21490x00001d0c,0x00050051,0x00000006,0x00001f67, 21740x000500aa,0x0000002f,0x00001f88,0x00001ee1,
21500x00001f66,0x00000001,0x00050051,0x00000006, 21750x000000a6,0x000300f7,0x00001f8d,0x00000000,
21510x00001f68,0x00001f66,0x00000000,0x00050051, 21760x000400fa,0x00001f88,0x00001f89,0x00001f8d,
21520x00000006,0x00001f6b,0x00001d0e,0x00000001, 21770x000200f8,0x00001f89,0x000500aa,0x0000002f,
21530x00050080,0x00000006,0x00001f6d,0x00001f6b, 21780x00001f8c,0x00001f02,0x000000a6,0x000200f9,
21540x00001f67,0x00050050,0x00000007,0x00001f6e, 21790x00001f8d,0x000200f8,0x00001f8d,0x000700f5,
21550x00001f68,0x00001f6d,0x0004007c,0x00000014, 21800x0000002f,0x00001f8e,0x00001f88,0x00001d03,
21560x00001f5e,0x00001f6e,0x00060041,0x000000db, 21810x00001f8c,0x00001f89,0x000400a8,0x0000002f,
21570x00001f56,0x00001f5e,0x000000da,0x000000da, 21820x00001d14,0x00001f8e,0x000300f7,0x00001daa,
21580x0005003e,0x00001f56,0x00001eaa,0x00000002, 21830x00000000,0x000400fa,0x00001d14,0x00001d15,
21590x00000004,0x00050080,0x00000006,0x00001d12, 21840x00001daa,0x000200f8,0x00001d15,0x00050041,
21600x00001cf7,0x00000374,0x00050095,0x000000ab, 21850x00000156,0x00001d17,0x000000fc,0x0000021d,
21610x00001f86,0x00001f64,0x00001d12,0x00050051, 21860x0004003d,0x00000007,0x00001d18,0x00001d17,
21620x00000006,0x00001f87,0x00001f86,0x00000001, 21870x00050051,0x00000006,0x00001f96,0x00001d18,
21630x00050051,0x00000006,0x00001f88,0x00001f86, 21880x00000000,0x00050095,0x000000ab,0x00001f97,
21640x00000000,0x00050080,0x00000006,0x00001f8d, 21890x00001ee1,0x00001f96,0x00050051,0x00000006,
21650x00001f6b,0x00001f87,0x00050050,0x00000007, 21900x00001f98,0x00001f97,0x00000001,0x00050051,
21660x00001f8e,0x00001f88,0x00001f8d,0x0004007c, 21910x00000006,0x00001f99,0x00001f97,0x00000000,
21670x00000014,0x00001f7e,0x00001f8e,0x00060041, 21920x00050051,0x00000006,0x00001f9e,0x00001d18,
21680x000000db,0x00001f76,0x00001f7e,0x000000da, 21930x00000001,0x00050080,0x00000006,0x00001f9f,
21690x000000da,0x0005003e,0x00001f76,0x00001ecb, 21940x00001f02,0x00001f9e,0x00050080,0x00000006,
21700x00000002,0x00000004,0x000500aa,0x0000002f, 21950x00001fa1,0x00001f9f,0x00001f98,0x00050095,
21710x00001f93,0x00001eec,0x000000a6,0x000300f7, 21960x000000ab,0x00001fbb,0x00001f99,0x00000368,
21720x00001f98,0x00000000,0x000400fa,0x00001f93, 21970x00050051,0x00000006,0x00001fbc,0x00001fbb,
21730x00001f94,0x00001f98,0x000200f8,0x00001f94, 21980x00000001,0x00050051,0x00000006,0x00001fbd,
21740x000500aa,0x0000002f,0x00001f97,0x00001f0d, 21990x00001fbb,0x00000000,0x00050080,0x00000006,
21750x000000a6,0x000200f9,0x00001f98,0x000200f8, 22000x00001fc2,0x00001fa1,0x00001fbc,0x00050050,
21760x00001f98,0x000700f5,0x0000002f,0x00001f99, 22010x00000007,0x00001fc3,0x00001fbd,0x00001fc2,
21770x00001f93,0x00001d0a,0x00001f97,0x00001f94, 22020x0004007c,0x00000014,0x00001fb3,0x00001fc3,
21780x000400a8,0x0000002f,0x00001d1d,0x00001f99, 22030x00060041,0x000000db,0x00001faa,0x00001fb3,
21790x000300f7,0x00001db3,0x00000000,0x000400fa,
21800x00001d1d,0x00001d1e,0x00001db3,0x000200f8,
21810x00001d1e,0x00050041,0x00000156,0x00001d20,
21820x000000fc,0x0000021d,0x0004003d,0x00000007,
21830x00001d21,0x00001d20,0x00050051,0x00000006,
21840x00001fa1,0x00001d21,0x00000000,0x00050095,
21850x000000ab,0x00001fa2,0x00001eec,0x00001fa1,
21860x00050051,0x00000006,0x00001fa3,0x00001fa2,
21870x00000001,0x00050051,0x00000006,0x00001fa4,
21880x00001fa2,0x00000000,0x00050051,0x00000006,
21890x00001fa9,0x00001d21,0x00000001,0x00050080,
21900x00000006,0x00001faa,0x00001f0d,0x00001fa9,
21910x00050080,0x00000006,0x00001fac,0x00001faa,
21920x00001fa3,0x00050095,0x000000ab,0x00001fc6,
21930x00001fa4,0x00000368,0x00050051,0x00000006,
21940x00001fc7,0x00001fc6,0x00000001,0x00050051,
21950x00000006,0x00001fc8,0x00001fc6,0x00000000,
21960x00050080,0x00000006,0x00001fcd,0x00001fac,
21970x00001fc7,0x00050050,0x00000007,0x00001fce,
21980x00001fc8,0x00001fcd,0x0004007c,0x00000014,
21990x00001fbe,0x00001fce,0x00060041,0x000000db,
22000x00001fb5,0x00001fbe,0x000000da,0x000000da,
22010x0006003d,0x00000006,0x00001fb6,0x00001fb5,
22020x00000002,0x00000004,0x00050095,0x000000ab,
22030x00001fe7,0x00001fa4,0x0000011f,0x00050051,
22040x00000006,0x00001fe8,0x00001fe7,0x00000001,
22050x00050051,0x00000006,0x00001fe9,0x00001fe7,
22060x00000000,0x00050080,0x00000006,0x00001fee,
22070x00001fac,0x00001fe8,0x00050050,0x00000007,
22080x00001fef,0x00001fe9,0x00001fee,0x0004007c,
22090x00000014,0x00001fdf,0x00001fef,0x00060041,
22100x000000db,0x00001fd6,0x00001fdf,0x000000da,
22110x000000da,0x0006003d,0x00000006,0x00001fd7,
22120x00001fd6,0x00000002,0x00000004,0x0004007c,
22130x00000027,0x00001d27,0x00001fd7,0x00050095,
22140x000000ab,0x00002008,0x00001fa4,0x00000189,
22150x00050051,0x00000006,0x00002009,0x00002008,
22160x00000001,0x00050051,0x00000006,0x0000200a,
22170x00002008,0x00000000,0x00050080,0x00000006,
22180x0000200f,0x00001fac,0x00002009,0x00050050,
22190x00000007,0x00002010,0x0000200a,0x0000200f,
22200x0004007c,0x00000014,0x00002000,0x00002010,
22210x00060041,0x000000db,0x00001ff7,0x00002000,
22220x000000da,0x000000da,0x0006003d,0x00000006, 22040x000000da,0x000000da,0x0006003d,0x00000006,
22230x00001ff8,0x00001ff7,0x00000002,0x00000004, 22050x00001fab,0x00001faa,0x00000002,0x00000004,
22240x0004007c,0x00000027,0x00001d2a,0x00001ff8, 22060x00050095,0x000000ab,0x00001fdc,0x00001f99,
22250x00050095,0x000000ab,0x00002029,0x00001fa4, 22070x0000011f,0x00050051,0x00000006,0x00001fdd,
22260x00000150,0x00050051,0x00000006,0x0000202a, 22080x00001fdc,0x00000001,0x00050051,0x00000006,
22270x00002029,0x00000001,0x00050051,0x00000006, 22090x00001fde,0x00001fdc,0x00000000,0x00050080,
22280x0000202b,0x00002029,0x00000000,0x00050080, 22100x00000006,0x00001fe3,0x00001fa1,0x00001fdd,
22290x00000006,0x00002030,0x00001fac,0x0000202a, 22110x00050050,0x00000007,0x00001fe4,0x00001fde,
22300x00050050,0x00000007,0x00002031,0x0000202b, 22120x00001fe3,0x0004007c,0x00000014,0x00001fd4,
22310x00002030,0x0004007c,0x00000014,0x00002021, 22130x00001fe4,0x00060041,0x000000db,0x00001fcb,
22320x00002031,0x00060041,0x000000db,0x00002018, 22140x00001fd4,0x000000da,0x000000da,0x0006003d,
22330x00002021,0x000000da,0x000000da,0x0006003d, 22150x00000006,0x00001fcc,0x00001fcb,0x00000002,
22340x00000006,0x00002019,0x00002018,0x00000002, 22160x00000004,0x0004007c,0x00000027,0x00001d1e,
22350x00000004,0x0004007c,0x00000027,0x00001d2d, 22170x00001fcc,0x00050095,0x000000ab,0x00001ffd,
22360x00002019,0x00050095,0x000000ab,0x0000204a, 22180x00001f99,0x00000189,0x00050051,0x00000006,
22370x00001fa4,0x00000463,0x00050051,0x00000006, 22190x00001ffe,0x00001ffd,0x00000001,0x00050051,
22380x0000204b,0x0000204a,0x00000001,0x00050051, 22200x00000006,0x00001fff,0x00001ffd,0x00000000,
22390x00000006,0x0000204c,0x0000204a,0x00000000, 22210x00050080,0x00000006,0x00002004,0x00001fa1,
22400x00050080,0x00000006,0x00002051,0x00001fac, 22220x00001ffe,0x00050050,0x00000007,0x00002005,
22410x0000204b,0x00050050,0x00000007,0x00002052, 22230x00001fff,0x00002004,0x0004007c,0x00000014,
22420x0000204c,0x00002051,0x0004007c,0x00000014, 22240x00001ff5,0x00002005,0x00060041,0x000000db,
22430x00002042,0x00002052,0x00060041,0x000000db, 22250x00001fec,0x00001ff5,0x000000da,0x000000da,
22440x00002039,0x00002042,0x000000da,0x000000da, 22260x0006003d,0x00000006,0x00001fed,0x00001fec,
22450x0006003d,0x00000006,0x0000203a,0x00002039,
22460x00000002,0x00000004,0x0004007c,0x00000027, 22270x00000002,0x00000004,0x0004007c,0x00000027,
22470x00001d31,0x0000203a,0x00050095,0x000000ab, 22280x00001d21,0x00001fed,0x00050095,0x000000ab,
22480x0000206b,0x00001fa4,0x00000469,0x00050051, 22290x0000201e,0x00001f99,0x00000150,0x00050051,
22490x00000006,0x0000206c,0x0000206b,0x00000001, 22300x00000006,0x0000201f,0x0000201e,0x00000001,
22500x00050051,0x00000006,0x0000206d,0x0000206b, 22310x00050051,0x00000006,0x00002020,0x0000201e,
22510x00000000,0x00050080,0x00000006,0x00002072, 22320x00000000,0x00050080,0x00000006,0x00002025,
22520x00001fac,0x0000206c,0x00050050,0x00000007, 22330x00001fa1,0x0000201f,0x00050050,0x00000007,
22530x00002073,0x0000206d,0x00002072,0x0004007c, 22340x00002026,0x00002020,0x00002025,0x0004007c,
22540x00000014,0x00002063,0x00002073,0x00060041, 22350x00000014,0x00002016,0x00002026,0x00060041,
22550x000000db,0x0000205a,0x00002063,0x000000da, 22360x000000db,0x0000200d,0x00002016,0x000000da,
22560x000000da,0x0006003d,0x00000006,0x0000205b, 22370x000000da,0x0006003d,0x00000006,0x0000200e,
22570x0000205a,0x00000002,0x00000004,0x0004007c, 22380x0000200d,0x00000002,0x00000004,0x0004007c,
22580x00000027,0x00001d34,0x0000205b,0x00050095, 22390x00000027,0x00001d24,0x0000200e,0x00050095,
22590x000000ab,0x0000208c,0x00001fa4,0x00000347, 22400x000000ab,0x0000203f,0x00001f99,0x00000460,
22600x00050051,0x00000006,0x0000208d,0x0000208c, 22410x00050051,0x00000006,0x00002040,0x0000203f,
22610x00000001,0x00050051,0x00000006,0x0000208e, 22420x00000001,0x00050051,0x00000006,0x00002041,
22620x0000208c,0x00000000,0x00050080,0x00000006, 22430x0000203f,0x00000000,0x00050080,0x00000006,
22630x00002093,0x00001fac,0x0000208d,0x00050050, 22440x00002046,0x00001fa1,0x00002040,0x00050050,
22640x00000007,0x00002094,0x0000208e,0x00002093, 22450x00000007,0x00002047,0x00002041,0x00002046,
22650x0004007c,0x00000014,0x00002084,0x00002094, 22460x0004007c,0x00000014,0x00002037,0x00002047,
22660x00060041,0x000000db,0x0000207b,0x00002084, 22470x00060041,0x000000db,0x0000202e,0x00002037,
22670x000000da,0x000000da,0x0006003d,0x00000006, 22480x000000da,0x000000da,0x0006003d,0x00000006,
22680x0000207c,0x0000207b,0x00000002,0x00000004, 22490x0000202f,0x0000202e,0x00000002,0x00000004,
22690x0004007c,0x00000027,0x00001d37,0x0000207c, 22500x0004007c,0x00000027,0x00001d28,0x0000202f,
22700x000500bc,0x0000002f,0x0000209b,0x00001d27, 22510x00050095,0x000000ab,0x00002060,0x00001f99,
22710x00001d31,0x000300f7,0x000020a2,0x00000000, 22520x00000466,0x00050051,0x00000006,0x00002061,
22720x000400fa,0x0000209b,0x0000209c,0x000020a2, 22530x00002060,0x00000001,0x00050051,0x00000006,
22730x000200f8,0x0000209c,0x000500bc,0x0000002f, 22540x00002062,0x00002060,0x00000000,0x00050080,
22740x000020a1,0x00001d2a,0x00001d34,0x000200f9, 22550x00000006,0x00002067,0x00001fa1,0x00002061,
22750x000020a2,0x000200f8,0x000020a2,0x000700f5, 22560x00050050,0x00000007,0x00002068,0x00002062,
22760x0000002f,0x000020a3,0x0000209b,0x00001d1e, 22570x00002067,0x0004007c,0x00000014,0x00002058,
22770x000020a1,0x0000209c,0x000300f7,0x000020aa, 22580x00002068,0x00060041,0x000000db,0x0000204f,
22780x00000000,0x000400fa,0x000020a3,0x000020a4, 22590x00002058,0x000000da,0x000000da,0x0006003d,
22790x000020aa,0x000200f8,0x000020a4,0x000500bc, 22600x00000006,0x00002050,0x0000204f,0x00000002,
22800x0000002f,0x000020a9,0x00001d2d,0x00001d37, 22610x00000004,0x0004007c,0x00000027,0x00001d2b,
22810x000200f9,0x000020aa,0x000200f8,0x000020aa, 22620x00002050,0x00050095,0x000000ab,0x00002081,
22820x000700f5,0x0000002f,0x000020ab,0x000020a3, 22630x00001f99,0x00000347,0x00050051,0x00000006,
22830x000020a2,0x000020a9,0x000020a4,0x000300f7, 22640x00002082,0x00002081,0x00000001,0x00050051,
22840x00001d41,0x00000000,0x000400fa,0x000020ab, 22650x00000006,0x00002083,0x00002081,0x00000000,
22850x00001d3d,0x00001d41,0x000200f8,0x00001d3d, 22660x00050080,0x00000006,0x00002088,0x00001fa1,
22860x000500c2,0x00000006,0x00001d3f,0x00001eaa, 22670x00002082,0x00050050,0x00000007,0x00002089,
22870x0000047e,0x000500ab,0x0000002f,0x00001d40, 22680x00002083,0x00002088,0x0004007c,0x00000014,
22880x00001d3f,0x000000a6,0x000200f9,0x00001d41, 22690x00002079,0x00002089,0x00060041,0x000000db,
22890x000200f8,0x00001d41,0x000700f5,0x0000002f, 22700x00002070,0x00002079,0x000000da,0x000000da,
22900x00001d42,0x000020ab,0x000020aa,0x00001d40, 22710x0006003d,0x00000006,0x00002071,0x00002070,
22910x00001d3d,0x000300f7,0x00001db2,0x00000000, 22720x00000002,0x00000004,0x0004007c,0x00000027,
22920x000400fa,0x00001d42,0x00001d43,0x00001db2, 22730x00001d2e,0x00002071,0x000500bc,0x0000002f,
22930x000200f8,0x00001d43,0x000200f9,0x00001d44, 22740x00002090,0x00001d1e,0x00001d28,0x000300f7,
22940x000200f8,0x00001d44,0x000700f5,0x0000004b, 22750x00002097,0x00000000,0x000400fa,0x00002090,
22950x00003227,0x000032a7,0x00001d43,0x00001dad, 22760x00002091,0x00002097,0x000200f8,0x00002091,
22960x00001d48,0x000700f5,0x0000004b,0x00003215, 22770x000500bc,0x0000002f,0x00002096,0x00001d21,
22970x000032a5,0x00001d43,0x00001daa,0x00001d48, 22780x00001d2b,0x000200f9,0x00002097,0x000200f8,
22980x000700f5,0x00000006,0x000031f2,0x000000a6, 22790x00002097,0x000700f5,0x0000002f,0x00002098,
22990x00001d43,0x00001db0,0x00001d48,0x000500b0, 22800x00002090,0x00001d15,0x00002096,0x00002091,
23000x0000002f,0x00001d47,0x000031f2,0x00000111, 22810x000300f7,0x0000209f,0x00000000,0x000400fa,
23010x000400f6,0x00001db1,0x00001d48,0x00000000, 22820x00002098,0x00002099,0x0000209f,0x000200f8,
23020x000400fa,0x00001d47,0x00001d48,0x00001db1, 22830x00002099,0x000500bc,0x0000002f,0x0000209e,
23030x000200f8,0x00001d48,0x000500c7,0x00000006, 22840x00001d24,0x00001d2e,0x000200f9,0x0000209f,
23040x00001d4a,0x000031f2,0x000000b0,0x000500ab, 22850x000200f8,0x0000209f,0x000700f5,0x0000002f,
23050x0000002f,0x00001d4b,0x00001d4a,0x000000a6, 22860x000020a0,0x00002098,0x00002097,0x0000209e,
23060x000600a9,0x00000027,0x000032ad,0x00001d4b, 22870x00002099,0x000300f7,0x00001d38,0x00000000,
23070x00001d31,0x00001d27,0x000500c7,0x00000006, 22880x000400fa,0x000020a0,0x00001d34,0x00001d38,
23080x00001d55,0x000031f2,0x00000170,0x000500ab, 22890x000200f8,0x00001d34,0x000500c2,0x00000006,
23090x0000002f,0x00001d56,0x00001d55,0x000000a6, 22900x00001d36,0x00001e9f,0x0000047b,0x000500ab,
23100x000600a9,0x00000027,0x000032ae,0x00001d56, 22910x0000002f,0x00001d37,0x00001d36,0x000000a6,
23110x00001d34,0x00001d2a,0x000500c7,0x00000006, 22920x000200f9,0x00001d38,0x000200f8,0x00001d38,
23120x00001d60,0x000031f2,0x0000010a,0x000500ab, 22930x000700f5,0x0000002f,0x00001d39,0x000020a0,
23130x0000002f,0x00001d61,0x00001d60,0x000000a6, 22940x0000209f,0x00001d37,0x00001d34,0x000300f7,
23140x000600a9,0x00000027,0x000032af,0x00001d61, 22950x00001da9,0x00000000,0x000400fa,0x00001d39,
23150x00001d37,0x00001d2d,0x00050041,0x00000028, 22960x00001d3a,0x00001da9,0x000200f8,0x00001d3a,
23160x00001d6b,0x00001c65,0x000000da,0x0004003d, 22970x000200f9,0x00001d3b,0x000200f8,0x00001d3b,
23170x00000027,0x00001d6c,0x00001d6b,0x00050085, 22980x000700f5,0x0000004b,0x00003218,0x00003294,
23180x00000027,0x00001d6f,0x00001d6c,0x000032ad, 22990x00001d3a,0x00001da4,0x00001d3f,0x000700f5,
23190x00050041,0x00000028,0x00001d70,0x00001c65, 23000x0000004b,0x00003206,0x000003be,0x00001d3a,
23200x00000154,0x0004003d,0x00000027,0x00001d71, 23010x00001da1,0x00001d3f,0x000700f5,0x00000006,
23210x00001d70,0x00050085,0x00000027,0x00001d74, 23020x000031e3,0x000000a6,0x00001d3a,0x00001da7,
23220x00001d71,0x000032ae,0x00050081,0x00000027, 23030x00001d3f,0x000500b0,0x0000002f,0x00001d3e,
23230x00001d75,0x00001d6f,0x00001d74,0x00050041, 23040x000031e3,0x00000111,0x000400f6,0x00001da8,
23240x00000028,0x00001d76,0x00001c65,0x00000205, 23050x00001d3f,0x00000000,0x000400fa,0x00001d3e,
23250x0004003d,0x00000027,0x00001d77,0x00001d76, 23060x00001d3f,0x00001da8,0x000200f8,0x00001d3f,
23260x00050085,0x00000027,0x00001d7a,0x00001d77, 23070x000500c7,0x00000006,0x00001d41,0x000031e3,
23270x000032af,0x00050081,0x00000027,0x00001d7b, 23080x000000b0,0x000500ab,0x0000002f,0x00001d42,
23280x00001d75,0x00001d7a,0x00050041,0x00000028, 23090x00001d41,0x000000a6,0x000600a9,0x00000027,
23290x00001d7c,0x00001c65,0x0000020d,0x0004003d, 23100x0000329f,0x00001d42,0x00001d28,0x00001d1e,
23300x00000027,0x00001d7d,0x00001d7c,0x00050081, 23110x000500c7,0x00000006,0x00001d4c,0x000031e3,
23310x00000027,0x00001d7e,0x00001d7b,0x00001d7d, 23120x00000170,0x000500ab,0x0000002f,0x00001d4d,
23320x00050041,0x00000028,0x00001d7f,0x00001c65, 23130x00001d4c,0x000000a6,0x000600a9,0x00000027,
23330x00000215,0x0004003d,0x00000027,0x00001d80, 23140x000032a0,0x00001d4d,0x00001d2b,0x00001d21,
23340x00001d7f,0x00050085,0x00000027,0x00001d83, 23150x000500c7,0x00000006,0x00001d57,0x000031e3,
23350x00001d80,0x000032ad,0x00050041,0x00000028, 23160x0000010a,0x000500ab,0x0000002f,0x00001d58,
23360x00001d84,0x00001c65,0x0000021d,0x0004003d, 23170x00001d57,0x000000a6,0x000600a9,0x00000027,
23370x00000027,0x00001d85,0x00001d84,0x00050085, 23180x000032a1,0x00001d58,0x00001d2e,0x00001d24,
23380x00000027,0x00001d88,0x00001d85,0x000032ae, 23190x00050041,0x00000028,0x00001d62,0x00001c5e,
23390x00050081,0x00000027,0x00001d89,0x00001d83, 23200x000000da,0x0004003d,0x00000027,0x00001d63,
23400x00001d88,0x00050041,0x00000028,0x00001d8a, 23210x00001d62,0x00050085,0x00000027,0x00001d66,
23410x00001c65,0x00000233,0x0004003d,0x00000027, 23220x00001d63,0x0000329f,0x00050041,0x00000028,
23420x00001d8b,0x00001d8a,0x00050085,0x00000027, 23230x00001d67,0x00001c5e,0x00000154,0x0004003d,
23430x00001d8e,0x00001d8b,0x000032af,0x00050081, 23240x00000027,0x00001d68,0x00001d67,0x00050085,
23440x00000027,0x00001d8f,0x00001d89,0x00001d8e, 23250x00000027,0x00001d6b,0x00001d68,0x000032a0,
23450x00050041,0x00000028,0x00001d90,0x00001c65, 23260x00050081,0x00000027,0x00001d6c,0x00001d66,
23460x000004d8,0x0004003d,0x00000027,0x00001d91, 23270x00001d6b,0x00050041,0x00000028,0x00001d6d,
23470x00001d90,0x00050081,0x00000027,0x00001d92, 23280x00001c5e,0x00000205,0x0004003d,0x00000027,
23480x00001d8f,0x00001d91,0x00050041,0x00000028, 23290x00001d6e,0x00001d6d,0x00050085,0x00000027,
23490x00001d93,0x00001c65,0x00000308,0x0004003d, 23300x00001d71,0x00001d6e,0x000032a1,0x00050081,
23500x00000027,0x00001d94,0x00001d93,0x00050085, 23310x00000027,0x00001d72,0x00001d6c,0x00001d71,
23510x00000027,0x00001d97,0x00001d94,0x000032ad, 23320x00050041,0x00000028,0x00001d73,0x00001c5e,
23520x00050041,0x00000028,0x00001d98,0x00001c65, 23330x0000020d,0x0004003d,0x00000027,0x00001d74,
23530x00000250,0x0004003d,0x00000027,0x00001d99, 23340x00001d73,0x00050081,0x00000027,0x00001d75,
23540x00001d98,0x00050085,0x00000027,0x00001d9c, 23350x00001d72,0x00001d74,0x00050041,0x00000028,
23550x00001d99,0x000032ae,0x00050081,0x00000027, 23360x00001d76,0x00001c5e,0x00000215,0x0004003d,
23560x00001d9d,0x00001d97,0x00001d9c,0x00050041, 23370x00000027,0x00001d77,0x00001d76,0x00050085,
23570x00000028,0x00001d9e,0x00001c65,0x00000266, 23380x00000027,0x00001d7a,0x00001d77,0x0000329f,
23580x0004003d,0x00000027,0x00001d9f,0x00001d9e, 23390x00050041,0x00000028,0x00001d7b,0x00001c5e,
23590x00050085,0x00000027,0x00001da2,0x00001d9f, 23400x0000021d,0x0004003d,0x00000027,0x00001d7c,
23600x000032af,0x00050081,0x00000027,0x00001da3, 23410x00001d7b,0x00050085,0x00000027,0x00001d7f,
23610x00001d9d,0x00001da2,0x00050041,0x00000028, 23420x00001d7c,0x000032a0,0x00050081,0x00000027,
23620x00001da4,0x00001c65,0x0000027b,0x0004003d, 23430x00001d80,0x00001d7a,0x00001d7f,0x00050041,
23630x00000027,0x00001da5,0x00001da4,0x00050081, 23440x00000028,0x00001d81,0x00001c5e,0x00000233,
23640x00000027,0x00001da6,0x00001da3,0x00001da5, 23450x0004003d,0x00000027,0x00001d82,0x00001d81,
23650x00060050,0x0000004b,0x00001da7,0x00001d7e, 23460x00050085,0x00000027,0x00001d85,0x00001d82,
23660x00001d92,0x00001da6,0x0007000c,0x0000004b, 23470x000032a1,0x00050081,0x00000027,0x00001d86,
23670x00001daa,0x00000001,0x00000025,0x00003215, 23480x00001d80,0x00001d85,0x00050041,0x00000028,
23680x00001da7,0x0007000c,0x0000004b,0x00001dad, 23490x00001d87,0x00001c5e,0x000004d5,0x0004003d,
23690x00000001,0x00000028,0x00003227,0x00001da7, 23500x00000027,0x00001d88,0x00001d87,0x00050081,
23700x00050080,0x00000006,0x00001db0,0x000031f2, 23510x00000027,0x00001d89,0x00001d86,0x00001d88,
23710x00000154,0x000200f9,0x00001d44,0x000200f8, 23520x00050041,0x00000028,0x00001d8a,0x00001c5e,
23720x00001db1,0x000200f9,0x00001db2,0x000200f8, 23530x00000308,0x0004003d,0x00000027,0x00001d8b,
23730x00001db2,0x000700f5,0x0000004b,0x00003223, 23540x00001d8a,0x00050085,0x00000027,0x00001d8e,
23740x000032a7,0x00001d41,0x00003227,0x00001db1, 23550x00001d8b,0x0000329f,0x00050041,0x00000028,
23750x000700f5,0x0000004b,0x00003211,0x000032a5, 23560x00001d8f,0x00001c5e,0x00000250,0x0004003d,
23760x00001d41,0x00003215,0x00001db1,0x000200f9, 23570x00000027,0x00001d90,0x00001d8f,0x00050085,
23770x00001db3,0x000200f8,0x00001db3,0x000700f5, 23580x00000027,0x00001d93,0x00001d90,0x000032a0,
23780x0000004b,0x00003221,0x000032a7,0x00001f98, 23590x00050081,0x00000027,0x00001d94,0x00001d8e,
23790x00003223,0x00001db2,0x000700f5,0x0000004b, 23600x00001d93,0x00050041,0x00000028,0x00001d95,
23800x0000320f,0x000032a5,0x00001f98,0x00003211, 23610x00001c5e,0x00000266,0x0004003d,0x00000027,
23810x00001db2,0x000700f5,0x00000006,0x000031fb, 23620x00001d96,0x00001d95,0x00050085,0x00000027,
23820x00000380,0x00001f98,0x00001fb6,0x00001db2, 23630x00001d99,0x00001d96,0x000032a1,0x00050081,
23830x00050041,0x00000028,0x00001db4,0x00001c65, 23640x00000027,0x00001d9a,0x00001d94,0x00001d99,
23840x000000da,0x0004003d,0x00000027,0x00001db5, 23650x00050041,0x00000028,0x00001d9b,0x00001c5e,
23850x00001db4,0x000500b4,0x0000002f,0x00001db6, 23660x0000027b,0x0004003d,0x00000027,0x00001d9c,
23860x00001db5,0x000004fc,0x000300f7,0x00001dbb, 23670x00001d9b,0x00050081,0x00000027,0x00001d9d,
23870x00000000,0x000400fa,0x00001db6,0x00001db7, 23680x00001d9a,0x00001d9c,0x00060050,0x0000004b,
23880x00001dbb,0x000200f8,0x00001db7,0x00050041, 23690x00001d9e,0x00001d75,0x00001d89,0x00001d9d,
23890x00000028,0x00001db8,0x00001c65,0x00000154, 23700x0007000c,0x0000004b,0x00001da1,0x00000001,
23900x0004003d,0x00000027,0x00001db9,0x00001db8, 23710x00000025,0x00003206,0x00001d9e,0x0007000c,
23910x000500b4,0x0000002f,0x00001dba,0x00001db9, 23720x0000004b,0x00001da4,0x00000001,0x00000028,
23920x0000026d,0x000200f9,0x00001dbb,0x000200f8, 23730x00003218,0x00001d9e,0x00050080,0x00000006,
23930x00001dbb,0x000700f5,0x0000002f,0x00001dbc, 23740x00001da7,0x000031e3,0x00000154,0x000200f9,
23940x00001db6,0x00001db3,0x00001dba,0x00001db7, 23750x00001d3b,0x000200f8,0x00001da8,0x000200f9,
23950x000300f7,0x00001dc1,0x00000000,0x000400fa, 23760x00001da9,0x000200f8,0x00001da9,0x000700f5,
23960x00001dbc,0x00001dbd,0x00001dc1,0x000200f8, 23770x0000004b,0x00003214,0x00003294,0x00001d38,
23970x00001dbd,0x00050041,0x00000028,0x00001dbe, 23780x00003218,0x00001da8,0x000700f5,0x0000004b,
23980x00001c65,0x00000205,0x0004003d,0x00000027, 23790x00003202,0x000003be,0x00001d38,0x00003206,
23990x00001dbf,0x00001dbe,0x000500b4,0x0000002f, 23800x00001da8,0x000200f9,0x00001daa,0x000200f8,
24000x00001dc0,0x00001dbf,0x0000026d,0x000200f9, 23810x00001daa,0x000700f5,0x0000004b,0x00003212,
24010x00001dc1,0x000200f8,0x00001dc1,0x000700f5, 23820x00003294,0x00001f8d,0x00003214,0x00001da9,
24020x0000002f,0x00001dc2,0x00001dbc,0x00001dbb, 23830x000700f5,0x0000004b,0x00003200,0x000003be,
24030x00001dc0,0x00001dbd,0x000300f7,0x00001dc7, 23840x00001f8d,0x00003202,0x00001da9,0x000700f5,
24040x00000000,0x000400fa,0x00001dc2,0x00001dc3, 23850x00000006,0x000031ec,0x00000380,0x00001f8d,
24050x00001dc7,0x000200f8,0x00001dc3,0x00050041, 23860x00001fab,0x00001da9,0x00050041,0x00000028,
24060x00000028,0x00001dc4,0x00001c65,0x00000215, 23870x00001dab,0x00001c5e,0x000000da,0x0004003d,
24070x0004003d,0x00000027,0x00001dc5,0x00001dc4, 23880x00000027,0x00001dac,0x00001dab,0x000500b4,
24080x000500b4,0x0000002f,0x00001dc6,0x00001dc5, 23890x0000002f,0x00001dad,0x00001dac,0x000004f9,
24090x0000026d,0x000200f9,0x00001dc7,0x000200f8, 23900x000300f7,0x00001db2,0x00000000,0x000400fa,
24100x00001dc7,0x000700f5,0x0000002f,0x00001dc8, 23910x00001dad,0x00001dae,0x00001db2,0x000200f8,
24110x00001dc2,0x00001dc1,0x00001dc6,0x00001dc3, 23920x00001dae,0x00050041,0x00000028,0x00001daf,
24120x000300f7,0x00001dcd,0x00000000,0x000400fa, 23930x00001c5e,0x00000154,0x0004003d,0x00000027,
24130x00001dc8,0x00001dc9,0x00001dcd,0x000200f8, 23940x00001db0,0x00001daf,0x000500b4,0x0000002f,
24140x00001dc9,0x00050041,0x00000028,0x00001dca, 23950x00001db1,0x00001db0,0x0000026d,0x000200f9,
24150x00001c65,0x0000021d,0x0004003d,0x00000027, 23960x00001db2,0x000200f8,0x00001db2,0x000700f5,
24160x00001dcb,0x00001dca,0x000500b4,0x0000002f, 23970x0000002f,0x00001db3,0x00001dad,0x00001daa,
24170x00001dcc,0x00001dcb,0x000004fc,0x000200f9, 23980x00001db1,0x00001dae,0x000300f7,0x00001db8,
24180x00001dcd,0x000200f8,0x00001dcd,0x000700f5, 23990x00000000,0x000400fa,0x00001db3,0x00001db4,
24190x0000002f,0x00001dce,0x00001dc8,0x00001dc7, 24000x00001db8,0x000200f8,0x00001db4,0x00050041,
24200x00001dcc,0x00001dc9,0x000300f7,0x00001dd3, 24010x00000028,0x00001db5,0x00001c5e,0x00000205,
24210x00000000,0x000400fa,0x00001dce,0x00001dcf, 24020x0004003d,0x00000027,0x00001db6,0x00001db5,
24220x00001dd3,0x000200f8,0x00001dcf,0x00050041, 24030x000500b4,0x0000002f,0x00001db7,0x00001db6,
24230x00000028,0x00001dd0,0x00001c65,0x00000233, 24040x0000026d,0x000200f9,0x00001db8,0x000200f8,
24240x0004003d,0x00000027,0x00001dd1,0x00001dd0, 24050x00001db8,0x000700f5,0x0000002f,0x00001db9,
24250x000500b4,0x0000002f,0x00001dd2,0x00001dd1, 24060x00001db3,0x00001db2,0x00001db7,0x00001db4,
24260x0000026d,0x000200f9,0x00001dd3,0x000200f8, 24070x000300f7,0x00001dbe,0x00000000,0x000400fa,
24270x00001dd3,0x000700f5,0x0000002f,0x00001dd4, 24080x00001db9,0x00001dba,0x00001dbe,0x000200f8,
24280x00001dce,0x00001dcd,0x00001dd2,0x00001dcf, 24090x00001dba,0x00050041,0x00000028,0x00001dbb,
24290x000300f7,0x00001dd9,0x00000000,0x000400fa, 24100x00001c5e,0x00000215,0x0004003d,0x00000027,
24300x00001dd4,0x00001dd5,0x00001dd9,0x000200f8, 24110x00001dbc,0x00001dbb,0x000500b4,0x0000002f,
24310x00001dd5,0x00050041,0x00000028,0x00001dd6, 24120x00001dbd,0x00001dbc,0x0000026d,0x000200f9,
24320x00001c65,0x00000308,0x0004003d,0x00000027, 24130x00001dbe,0x000200f8,0x00001dbe,0x000700f5,
24330x00001dd7,0x00001dd6,0x000500b4,0x0000002f, 24140x0000002f,0x00001dbf,0x00001db9,0x00001db8,
24340x00001dd8,0x00001dd7,0x0000026d,0x000200f9, 24150x00001dbd,0x00001dba,0x000300f7,0x00001dc4,
24350x00001dd9,0x000200f8,0x00001dd9,0x000700f5, 24160x00000000,0x000400fa,0x00001dbf,0x00001dc0,
24360x0000002f,0x00001dda,0x00001dd4,0x00001dd3, 24170x00001dc4,0x000200f8,0x00001dc0,0x00050041,
24370x00001dd8,0x00001dd5,0x000300f7,0x00001ddf, 24180x00000028,0x00001dc1,0x00001c5e,0x0000021d,
24380x00000000,0x000400fa,0x00001dda,0x00001ddb, 24190x0004003d,0x00000027,0x00001dc2,0x00001dc1,
24390x00001ddf,0x000200f8,0x00001ddb,0x00050041, 24200x000500b4,0x0000002f,0x00001dc3,0x00001dc2,
24400x00000028,0x00001ddc,0x00001c65,0x00000250, 24210x000004f9,0x000200f9,0x00001dc4,0x000200f8,
24410x0004003d,0x00000027,0x00001ddd,0x00001ddc, 24220x00001dc4,0x000700f5,0x0000002f,0x00001dc5,
24420x000500b4,0x0000002f,0x00001dde,0x00001ddd, 24230x00001dbf,0x00001dbe,0x00001dc3,0x00001dc0,
24430x0000026d,0x000200f9,0x00001ddf,0x000200f8, 24240x000300f7,0x00001dca,0x00000000,0x000400fa,
24440x00001ddf,0x000700f5,0x0000002f,0x00001de0, 24250x00001dc5,0x00001dc6,0x00001dca,0x000200f8,
24450x00001dda,0x00001dd9,0x00001dde,0x00001ddb, 24260x00001dc6,0x00050041,0x00000028,0x00001dc7,
24460x000300f7,0x00001de5,0x00000000,0x000400fa, 24270x00001c5e,0x00000233,0x0004003d,0x00000027,
24470x00001de0,0x00001de1,0x00001de5,0x000200f8, 24280x00001dc8,0x00001dc7,0x000500b4,0x0000002f,
24480x00001de1,0x00050041,0x00000028,0x00001de2, 24290x00001dc9,0x00001dc8,0x0000026d,0x000200f9,
24490x00001c65,0x00000266,0x0004003d,0x00000027, 24300x00001dca,0x000200f8,0x00001dca,0x000700f5,
24500x00001de3,0x00001de2,0x000500b4,0x0000002f, 24310x0000002f,0x00001dcb,0x00001dc5,0x00001dc4,
24510x00001de4,0x00001de3,0x000004fc,0x000200f9, 24320x00001dc9,0x00001dc6,0x000300f7,0x00001dd0,
24520x00001de5,0x000200f8,0x00001de5,0x000700f5, 24330x00000000,0x000400fa,0x00001dcb,0x00001dcc,
24530x0000002f,0x00001de6,0x00001de0,0x00001ddf, 24340x00001dd0,0x000200f8,0x00001dcc,0x00050041,
24540x00001de4,0x00001de1,0x00050080,0x00000006, 24350x00000028,0x00001dcd,0x00001c5e,0x00000308,
24550x00001de8,0x00001cf7,0x0000037e,0x000500c7, 24360x0004003d,0x00000027,0x00001dce,0x00001dcd,
24560x00000006,0x00001dea,0x000031fb,0x00000531, 24370x000500b4,0x0000002f,0x00001dcf,0x00001dce,
24570x000600a9,0x00000006,0x00001dec,0x00001de6, 24380x0000026d,0x000200f9,0x00001dd0,0x000200f8,
24580x00000130,0x000000a6,0x000500c5,0x00000006, 24390x00001dd0,0x000700f5,0x0000002f,0x00001dd1,
24590x00001ded,0x00001dea,0x00001dec,0x00050095, 24400x00001dcb,0x00001dca,0x00001dcf,0x00001dcc,
24600x000000ab,0x000020c4,0x00001f64,0x00001de8, 24410x000300f7,0x00001dd6,0x00000000,0x000400fa,
24610x00050051,0x00000006,0x000020c5,0x000020c4, 24420x00001dd1,0x00001dd2,0x00001dd6,0x000200f8,
24620x00000001,0x00050051,0x00000006,0x000020c6, 24430x00001dd2,0x00050041,0x00000028,0x00001dd3,
24630x000020c4,0x00000000,0x00050080,0x00000006, 24440x00001c5e,0x00000250,0x0004003d,0x00000027,
24640x000020cb,0x00001f6b,0x000020c5,0x00050050, 24450x00001dd4,0x00001dd3,0x000500b4,0x0000002f,
24650x00000007,0x000020cc,0x000020c6,0x000020cb, 24460x00001dd5,0x00001dd4,0x0000026d,0x000200f9,
24660x0004007c,0x00000014,0x000020bc,0x000020cc, 24470x00001dd6,0x000200f8,0x00001dd6,0x000700f5,
24670x00060041,0x000000db,0x000020b4,0x000020bc, 24480x0000002f,0x00001dd7,0x00001dd1,0x00001dd0,
24680x000000da,0x000000da,0x0005003e,0x000020b4, 24490x00001dd5,0x00001dd2,0x000300f7,0x00001ddc,
24690x00001ded,0x00000002,0x00000004,0x00050080, 24500x00000000,0x000400fa,0x00001dd7,0x00001dd8,
24700x00000006,0x00001df2,0x00001cf7,0x00000388, 24510x00001ddc,0x000200f8,0x00001dd8,0x00050041,
24710x000500c2,0x00000006,0x00001df5,0x00001eec, 24520x00000028,0x00001dd9,0x00001c5e,0x00000266,
24720x00000308,0x000500c4,0x00000006,0x00001df8, 24530x0004003d,0x00000027,0x00001dda,0x00001dd9,
24730x00001f0d,0x0000047e,0x000500c5,0x00000006, 24540x000500b4,0x0000002f,0x00001ddb,0x00001dda,
24740x00001df9,0x00001df5,0x00001df8,0x00050095, 24550x000004f9,0x000200f9,0x00001ddc,0x000200f8,
24750x000000ab,0x000020e4,0x00001f64,0x00001df2, 24560x00001ddc,0x000700f5,0x0000002f,0x00001ddd,
24760x00050051,0x00000006,0x000020e5,0x000020e4, 24570x00001dd7,0x00001dd6,0x00001ddb,0x00001dd8,
24770x00000001,0x00050051,0x00000006,0x000020e6, 24580x00050080,0x00000006,0x00001ddf,0x00001cf0,
24780x000020e4,0x00000000,0x00050080,0x00000006, 24590x0000037e,0x000500c7,0x00000006,0x00001de1,
24790x000020eb,0x00001f6b,0x000020e5,0x00050050, 24600x000031ec,0x0000052e,0x000600a9,0x00000006,
24800x00000007,0x000020ec,0x000020e6,0x000020eb, 24610x00001de3,0x00001ddd,0x00000130,0x000000a6,
24810x0004007c,0x00000014,0x000020dc,0x000020ec, 24620x000500c5,0x00000006,0x00001de4,0x00001de1,
24820x00060041,0x000000db,0x000020d4,0x000020dc, 24630x00001de3,0x00050095,0x000000ab,0x000020b9,
24830x000000da,0x000000da,0x0005003e,0x000020d4, 24640x00001f59,0x00001ddf,0x00050051,0x00000006,
24840x00001df9,0x00000002,0x00000004,0x0004003d, 24650x000020ba,0x000020b9,0x00000001,0x00050051,
24850x00000027,0x00001dfe,0x00001db4,0x00050041, 24660x00000006,0x000020bb,0x000020b9,0x00000000,
24860x00000028,0x00001dff,0x00001c65,0x00000215, 24670x00050080,0x00000006,0x000020c0,0x00001f60,
24870x0004003d,0x00000027,0x00001e00,0x00001dff, 24680x000020ba,0x00050050,0x00000007,0x000020c1,
24880x00050041,0x00000028,0x00001e01,0x00001c65, 24690x000020bb,0x000020c0,0x0004007c,0x00000014,
24890x00000308,0x0004003d,0x00000027,0x00001e02, 24700x000020b1,0x000020c1,0x00060041,0x000000db,
24900x00001e01,0x00050041,0x00000028,0x00001e03, 24710x000020a9,0x000020b1,0x000000da,0x000000da,
24910x00001c65,0x00000154,0x0004003d,0x00000027, 24720x0005003e,0x000020a9,0x00001de4,0x00000002,
24920x00001e04,0x00001e03,0x00050041,0x00000028, 24730x00000004,0x00050080,0x00000006,0x00001de9,
24930x00001e05,0x00001c65,0x0000021d,0x0004003d, 24740x00001cf0,0x00000388,0x000500c2,0x00000006,
24940x00000027,0x00001e06,0x00001e05,0x00050041, 24750x00001dec,0x00001ee1,0x00000308,0x000500c4,
24950x00000028,0x00001e07,0x00001c65,0x00000250, 24760x00000006,0x00001def,0x00001f02,0x0000047b,
24960x0004003d,0x00000027,0x00001e08,0x00001e07, 24770x000500c5,0x00000006,0x00001df0,0x00001dec,
24970x00050041,0x00000028,0x00001e09,0x00001c65, 24780x00001def,0x00050095,0x000000ab,0x000020d9,
24980x00000205,0x0004003d,0x00000027,0x00001e0a, 24790x00001f59,0x00001de9,0x00050051,0x00000006,
24990x00001e09,0x00050041,0x00000028,0x00001e0b, 24800x000020da,0x000020d9,0x00000001,0x00050051,
25000x00001c65,0x00000233,0x0004003d,0x00000027, 24810x00000006,0x000020db,0x000020d9,0x00000000,
25010x00001e0c,0x00001e0b,0x00050041,0x00000028, 24820x00050080,0x00000006,0x000020e0,0x00001f60,
25020x00001e0d,0x00001c65,0x00000266,0x0004003d, 24830x000020da,0x00050050,0x00000007,0x000020e1,
25030x00000027,0x00001e0e,0x00001e0d,0x00060050, 24840x000020db,0x000020e0,0x0004007c,0x00000014,
25040x0000004b,0x00001e0f,0x00001dfe,0x00001e00, 24850x000020d1,0x000020e1,0x00060041,0x000000db,
25050x00001e02,0x00060050,0x0000004b,0x00001e10, 24860x000020c9,0x000020d1,0x000000da,0x000000da,
25060x00001e04,0x00001e06,0x00001e08,0x00060050, 24870x0005003e,0x000020c9,0x00001df0,0x00000002,
25070x0000004b,0x00001e11,0x00001e0a,0x00001e0c, 24880x00000004,0x0004003d,0x00000027,0x00001df5,
25080x00001e0e,0x00060050,0x0000054b,0x00001e12, 24890x00001dab,0x00050041,0x00000028,0x00001df6,
25090x00001e0f,0x00001e10,0x00001e11,0x0006000c, 24900x00001c5e,0x00000215,0x0004003d,0x00000027,
25100x00000027,0x00001e14,0x00000001,0x00000021, 24910x00001df7,0x00001df6,0x00050041,0x00000028,
25110x00001e12,0x000500b7,0x0000002f,0x00001e16, 24920x00001df8,0x00001c5e,0x00000308,0x0004003d,
25120x00001e14,0x0000026d,0x000300f7,0x00001e1b, 24930x00000027,0x00001df9,0x00001df8,0x00050041,
25130x00000000,0x000400fa,0x00001e16,0x00001e17, 24940x00000028,0x00001dfa,0x00001c5e,0x00000154,
25140x00001e1a,0x000200f8,0x00001e17,0x0006000c, 24950x0004003d,0x00000027,0x00001dfb,0x00001dfa,
25150x0000054b,0x00001e19,0x00000001,0x00000022, 24960x00050041,0x00000028,0x00001dfc,0x00001c5e,
25160x00001e12,0x000200f9,0x00001e1b,0x000200f8, 24970x0000021d,0x0004003d,0x00000027,0x00001dfd,
25170x00001e1a,0x000200f9,0x00001e1b,0x000200f8, 24980x00001dfc,0x00050041,0x00000028,0x00001dfe,
25180x00001e1b,0x000700f5,0x0000054b,0x00003202, 24990x00001c5e,0x00000250,0x0004003d,0x00000027,
25190x00001e19,0x00001e17,0x00000571,0x00001e1a, 25000x00001dff,0x00001dfe,0x00050041,0x00000028,
25200x0003003e,0x00001ca6,0x00003202,0x00050041, 25010x00001e00,0x00001c5e,0x00000205,0x0004003d,
25210x00000028,0x00001e1d,0x00001c65,0x0000020d, 25020x00000027,0x00001e01,0x00001e00,0x00050041,
25220x0004003d,0x00000027,0x00001e1e,0x00001e1d, 25030x00000028,0x00001e02,0x00001c5e,0x00000233,
25230x00050041,0x00000028,0x00001e1f,0x00001c65, 25040x0004003d,0x00000027,0x00001e03,0x00001e02,
25240x000004d8,0x0004003d,0x00000027,0x00001e20, 25050x00050041,0x00000028,0x00001e04,0x00001c5e,
25250x00001e1f,0x00050041,0x00000028,0x00001e21, 25060x00000266,0x0004003d,0x00000027,0x00001e05,
25260x00001c65,0x0000027b,0x0004003d,0x00000027, 25070x00001e04,0x00060050,0x0000004b,0x00001e06,
25270x00001e22,0x00001e21,0x00060050,0x0000004b, 25080x00001df5,0x00001df7,0x00001df9,0x00060050,
25280x00001e23,0x00001e1e,0x00001e20,0x00001e22, 25090x0000004b,0x00001e07,0x00001dfb,0x00001dfd,
25290x00050091,0x0000004b,0x00001e26,0x00003202, 25100x00001dff,0x00060050,0x0000004b,0x00001e08,
25300x00001e23,0x0004007f,0x0000004b,0x00001e27, 25110x00001e01,0x00001e03,0x00001e05,0x00060050,
25310x00001e26,0x0003003e,0x00001ca9,0x00001e27, 25120x00000548,0x00001e09,0x00001e06,0x00001e07,
25320x000200f9,0x00001e28,0x000200f8,0x00001e28, 25130x00001e08,0x0006000c,0x00000027,0x00001e0b,
25330x000700f5,0x00000006,0x00003203,0x000000a6, 25140x00000001,0x00000021,0x00001e09,0x000500b7,
25340x00001e1b,0x00001e5b,0x00001e2c,0x000500b0, 25150x0000002f,0x00001e0d,0x00001e0b,0x0000026d,
25350x0000002f,0x00001e2b,0x00003203,0x000002b7, 25160x000300f7,0x00001e12,0x00000000,0x000400fa,
25360x000400f6,0x00001e5c,0x00001e2c,0x00000000, 25170x00001e0d,0x00001e0e,0x00001e11,0x000200f8,
25370x000400fa,0x00001e2b,0x00001e2c,0x00001e5c, 25180x00001e0e,0x0006000c,0x00000548,0x00001e10,
25380x000200f8,0x00001e2c,0x00050080,0x00000006, 25190x00000001,0x00000022,0x00001e09,0x000200f9,
25390x00001e2e,0x00001cf7,0x00000107,0x00050084, 25200x00001e12,0x000200f8,0x00001e11,0x000200f9,
25400x00000006,0x00001e30,0x0000011f,0x00003203, 25210x00001e12,0x000200f8,0x00001e12,0x000700f5,
25410x00050080,0x00000006,0x00001e31,0x00001e2e, 25220x00000548,0x000031f3,0x00001e10,0x00001e0e,
25420x00001e30,0x00060041,0x00000028,0x00001e35, 25230x0000056e,0x00001e11,0x0003003e,0x00001c9f,
25430x00001ca6,0x000000da,0x00003203,0x0004003d, 25240x000031f3,0x00050041,0x00000028,0x00001e14,
25440x00000027,0x00001e36,0x00001e35,0x0004007c, 25250x00001c5e,0x0000020d,0x0004003d,0x00000027,
25450x00000006,0x000020f2,0x00001e36,0x00050095, 25260x00001e15,0x00001e14,0x00050041,0x00000028,
25460x000000ab,0x0000210d,0x00001f64,0x00001e31, 25270x00001e16,0x00001c5e,0x000004d5,0x0004003d,
25470x00050051,0x00000006,0x0000210e,0x0000210d, 25280x00000027,0x00001e17,0x00001e16,0x00050041,
25480x00000001,0x00050051,0x00000006,0x0000210f, 25290x00000028,0x00001e18,0x00001c5e,0x0000027b,
25490x0000210d,0x00000000,0x00050080,0x00000006, 25300x0004003d,0x00000027,0x00001e19,0x00001e18,
25500x00002114,0x00001f6b,0x0000210e,0x00050050, 25310x00060050,0x0000004b,0x00001e1a,0x00001e15,
25510x00000007,0x00002115,0x0000210f,0x00002114, 25320x00001e17,0x00001e19,0x00050091,0x0000004b,
25520x0004007c,0x00000014,0x00002105,0x00002115, 25330x00001e1d,0x000031f3,0x00001e1a,0x0004007f,
25530x00060041,0x000000db,0x000020fd,0x00002105, 25340x0000004b,0x00001e1e,0x00001e1d,0x0003003e,
25540x000000da,0x000000da,0x0005003e,0x000020fd, 25350x00001ca2,0x00001e1e,0x000200f9,0x00001e1f,
25550x000020f2,0x00000002,0x00000004,0x00050080, 25360x000200f8,0x00001e1f,0x000700f5,0x00000006,
25560x00000006,0x00001e39,0x00001cf7,0x00000597, 25370x000031f4,0x000000a6,0x00001e12,0x00001e52,
25570x00050080,0x00000006,0x00001e3c,0x00001e39, 25380x00001e23,0x000500b0,0x0000002f,0x00001e22,
25580x00001e30,0x00060041,0x00000028,0x00001e40, 25390x000031f4,0x000002b7,0x000400f6,0x00001e53,
25590x00001ca6,0x00000154,0x00003203,0x0004003d, 25400x00001e23,0x00000000,0x000400fa,0x00001e22,
25600x00000027,0x00001e41,0x00001e40,0x0004007c, 25410x00001e23,0x00001e53,0x000200f8,0x00001e23,
25610x00000006,0x0000211b,0x00001e41,0x00050095, 25420x00050080,0x00000006,0x00001e25,0x00001cf0,
25620x000000ab,0x00002136,0x00001f64,0x00001e3c, 25430x00000107,0x00050084,0x00000006,0x00001e27,
25630x00050051,0x00000006,0x00002137,0x00002136, 25440x0000011f,0x000031f4,0x00050080,0x00000006,
25640x00000001,0x00050051,0x00000006,0x00002138, 25450x00001e28,0x00001e25,0x00001e27,0x00060041,
25650x00002136,0x00000000,0x00050080,0x00000006, 25460x00000028,0x00001e2c,0x00001c9f,0x000000da,
25660x0000213d,0x00001f6b,0x00002137,0x00050050, 25470x000031f4,0x0004003d,0x00000027,0x00001e2d,
25670x00000007,0x0000213e,0x00002138,0x0000213d, 25480x00001e2c,0x0004007c,0x00000006,0x000020e7,
25680x0004007c,0x00000014,0x0000212e,0x0000213e, 25490x00001e2d,0x00050095,0x000000ab,0x00002102,
25690x00060041,0x000000db,0x00002126,0x0000212e, 25500x00001f59,0x00001e28,0x00050051,0x00000006,
25700x000000da,0x000000da,0x0005003e,0x00002126, 25510x00002103,0x00002102,0x00000001,0x00050051,
25710x0000211b,0x00000002,0x00000004,0x00050080, 25520x00000006,0x00002104,0x00002102,0x00000000,
25720x00000006,0x00001e44,0x00001cf7,0x000005a6, 25530x00050080,0x00000006,0x00002109,0x00001f60,
25730x00050080,0x00000006,0x00001e47,0x00001e44, 25540x00002103,0x00050050,0x00000007,0x0000210a,
25740x00001e30,0x00060041,0x00000028,0x00001e4b, 25550x00002104,0x00002109,0x0004007c,0x00000014,
25750x00001ca6,0x00000205,0x00003203,0x0004003d, 25560x000020fa,0x0000210a,0x00060041,0x000000db,
25760x00000027,0x00001e4c,0x00001e4b,0x0004007c, 25570x000020f2,0x000020fa,0x000000da,0x000000da,
25770x00000006,0x00002144,0x00001e4c,0x00050095, 25580x0005003e,0x000020f2,0x000020e7,0x00000002,
25780x000000ab,0x0000215f,0x00001f64,0x00001e47, 25590x00000004,0x00050080,0x00000006,0x00001e30,
25790x00050051,0x00000006,0x00002160,0x0000215f, 25600x00001cf0,0x00000594,0x00050080,0x00000006,
25800x00000001,0x00050051,0x00000006,0x00002161, 25610x00001e33,0x00001e30,0x00001e27,0x00060041,
25810x0000215f,0x00000000,0x00050080,0x00000006, 25620x00000028,0x00001e37,0x00001c9f,0x00000154,
25820x00002166,0x00001f6b,0x00002160,0x00050050, 25630x000031f4,0x0004003d,0x00000027,0x00001e38,
25830x00000007,0x00002167,0x00002161,0x00002166, 25640x00001e37,0x0004007c,0x00000006,0x00002110,
25840x0004007c,0x00000014,0x00002157,0x00002167, 25650x00001e38,0x00050095,0x000000ab,0x0000212b,
25850x00060041,0x000000db,0x0000214f,0x00002157, 25660x00001f59,0x00001e33,0x00050051,0x00000006,
25860x000000da,0x000000da,0x0005003e,0x0000214f, 25670x0000212c,0x0000212b,0x00000001,0x00050051,
25870x00002144,0x00000002,0x00000004,0x00050080, 25680x00000006,0x0000212d,0x0000212b,0x00000000,
25880x00000006,0x00001e4f,0x00001cf7,0x000005b5, 25690x00050080,0x00000006,0x00002132,0x00001f60,
25890x00050080,0x00000006,0x00001e52,0x00001e4f, 25700x0000212c,0x00050050,0x00000007,0x00002133,
25900x00001e30,0x00050041,0x00000028,0x00001e56, 25710x0000212d,0x00002132,0x0004007c,0x00000014,
25910x00001ca9,0x00003203,0x0004003d,0x00000027, 25720x00002123,0x00002133,0x00060041,0x000000db,
25920x00001e57,0x00001e56,0x0004007c,0x00000006, 25730x0000211b,0x00002123,0x000000da,0x000000da,
25930x0000216d,0x00001e57,0x00050095,0x000000ab, 25740x0005003e,0x0000211b,0x00002110,0x00000002,
25940x00002188,0x00001f64,0x00001e52,0x00050051, 25750x00000004,0x00050080,0x00000006,0x00001e3b,
25950x00000006,0x00002189,0x00002188,0x00000001, 25760x00001cf0,0x000005a3,0x00050080,0x00000006,
25960x00050051,0x00000006,0x0000218a,0x00002188, 25770x00001e3e,0x00001e3b,0x00001e27,0x00060041,
25970x00000000,0x00050080,0x00000006,0x0000218f, 25780x00000028,0x00001e42,0x00001c9f,0x00000205,
25980x00001f6b,0x00002189,0x00050050,0x00000007, 25790x000031f4,0x0004003d,0x00000027,0x00001e43,
25990x00002190,0x0000218a,0x0000218f,0x0004007c, 25800x00001e42,0x0004007c,0x00000006,0x00002139,
26000x00000014,0x00002180,0x00002190,0x00060041, 25810x00001e43,0x00050095,0x000000ab,0x00002154,
26010x000000db,0x00002178,0x00002180,0x000000da, 25820x00001f59,0x00001e3e,0x00050051,0x00000006,
26020x000000da,0x0005003e,0x00002178,0x0000216d, 25830x00002155,0x00002154,0x00000001,0x00050051,
26030x00000002,0x00000004,0x00050080,0x00000006, 25840x00000006,0x00002156,0x00002154,0x00000000,
26040x00001e5b,0x00003203,0x00000154,0x000200f9, 25850x00050080,0x00000006,0x0000215b,0x00001f60,
26050x00001e28,0x000200f8,0x00001e5c,0x00050080, 25860x00002155,0x00050050,0x00000007,0x0000215c,
26060x00000006,0x00001e5e,0x00001cf7,0x000005c6, 25870x00002156,0x0000215b,0x0004007c,0x00000014,
26070x00050095,0x000000ab,0x000021a8,0x00001f64, 25880x0000214c,0x0000215c,0x00060041,0x000000db,
26080x00001e5e,0x00050051,0x00000006,0x000021a9, 25890x00002144,0x0000214c,0x000000da,0x000000da,
26090x000021a8,0x00000001,0x00050051,0x00000006, 25900x0005003e,0x00002144,0x00002139,0x00000002,
26100x000021aa,0x000021a8,0x00000000,0x00050080, 25910x00000004,0x00050080,0x00000006,0x00001e46,
26110x00000006,0x000021af,0x00001f6b,0x000021a9, 25920x00001cf0,0x000005b2,0x00050080,0x00000006,
26120x00050050,0x00000007,0x000021b0,0x000021aa, 25930x00001e49,0x00001e46,0x00001e27,0x00050041,
26130x000021af,0x0004007c,0x00000014,0x000021a0, 25940x00000028,0x00001e4d,0x00001ca2,0x000031f4,
26140x000021b0,0x00060041,0x000000db,0x00002198, 25950x0004003d,0x00000027,0x00001e4e,0x00001e4d,
26150x000021a0,0x000000da,0x000000da,0x0005003e, 25960x0004007c,0x00000006,0x00002162,0x00001e4e,
26160x00002198,0x00000b11,0x00000002,0x00000004, 25970x00050095,0x000000ab,0x0000217d,0x00001f59,
26170x00050080,0x00000006,0x00001e64,0x00001cf7, 25980x00001e49,0x00050051,0x00000006,0x0000217e,
26180x000005d0,0x00050095,0x000000ab,0x000021c8, 25990x0000217d,0x00000001,0x00050051,0x00000006,
26190x00001f64,0x00001e64,0x00050051,0x00000006, 26000x0000217f,0x0000217d,0x00000000,0x00050080,
26200x000021c9,0x000021c8,0x00000001,0x00050051, 26010x00000006,0x00002184,0x00001f60,0x0000217e,
26210x00000006,0x000021ca,0x000021c8,0x00000000, 26020x00050050,0x00000007,0x00002185,0x0000217f,
26220x00050080,0x00000006,0x000021cf,0x00001f6b, 26030x00002184,0x0004007c,0x00000014,0x00002175,
26230x000021c9,0x00050050,0x00000007,0x000021d0, 26040x00002185,0x00060041,0x000000db,0x0000216d,
26240x000021ca,0x000021cf,0x0004007c,0x00000014, 26050x00002175,0x000000da,0x000000da,0x0005003e,
26250x000021c0,0x000021d0,0x00060041,0x000000db, 26060x0000216d,0x00002162,0x00000002,0x00000004,
26260x000021b8,0x000021c0,0x000000da,0x000000da, 26070x00050080,0x00000006,0x00001e52,0x000031f4,
26270x0005003e,0x000021b8,0x00000380,0x00000002, 26080x00000154,0x000200f9,0x00001e1f,0x000200f8,
26280x00000004,0x00050080,0x00000006,0x00001e69, 26090x00001e53,0x00050080,0x00000006,0x00001e55,
26290x00001cf7,0x000005d9,0x00050095,0x000000ab, 26100x00001cf0,0x000005c3,0x00050095,0x000000ab,
26300x000021e8,0x00001f64,0x00001e69,0x00050051, 26110x0000219d,0x00001f59,0x00001e55,0x00050051,
26310x00000006,0x000021e9,0x000021e8,0x00000001, 26120x00000006,0x0000219e,0x0000219d,0x00000001,
26320x00050051,0x00000006,0x000021ea,0x000021e8, 26130x00050051,0x00000006,0x0000219f,0x0000219d,
26330x00000000,0x00050080,0x00000006,0x000021ef, 26140x00000000,0x00050080,0x00000006,0x000021a4,
26340x00001f6b,0x000021e9,0x00050050,0x00000007, 26150x00001f60,0x0000219e,0x00050050,0x00000007,
26350x000021f0,0x000021ea,0x000021ef,0x0004007c, 26160x000021a5,0x0000219f,0x000021a4,0x0004007c,
26360x00000014,0x000021e0,0x000021f0,0x00060041, 26170x00000014,0x00002195,0x000021a5,0x00060041,
26370x000000db,0x000021d8,0x000021e0,0x000000da, 26180x000000db,0x0000218d,0x00002195,0x000000da,
26380x000000da,0x0005003e,0x000021d8,0x000000a6, 26190x000000da,0x0005003e,0x0000218d,0x00000b09,
26390x00000002,0x00000004,0x00050080,0x00000006, 26200x00000002,0x00000004,0x00050080,0x00000006,
26400x00001e6e,0x00001cf7,0x000005e2,0x00050095, 26210x00001e5b,0x00001cf0,0x000005cd,0x00050095,
26410x000000ab,0x00002208,0x00001f64,0x00001e6e, 26220x000000ab,0x000021bd,0x00001f59,0x00001e5b,
26420x00050051,0x00000006,0x00002209,0x00002208, 26230x00050051,0x00000006,0x000021be,0x000021bd,
26430x00000001,0x00050051,0x00000006,0x0000220a, 26240x00000001,0x00050051,0x00000006,0x000021bf,
26440x00002208,0x00000000,0x00050080,0x00000006, 26250x000021bd,0x00000000,0x00050080,0x00000006,
26450x0000220f,0x00001f6b,0x00002209,0x00050050, 26260x000021c4,0x00001f60,0x000021be,0x00050050,
26460x00000007,0x00002210,0x0000220a,0x0000220f, 26270x00000007,0x000021c5,0x000021bf,0x000021c4,
26470x0004007c,0x00000014,0x00002200,0x00002210, 26280x0004007c,0x00000014,0x000021b5,0x000021c5,
26480x00060041,0x000000db,0x000021f8,0x00002200, 26290x00060041,0x000000db,0x000021ad,0x000021b5,
26490x000000da,0x000000da,0x0005003e,0x000021f8, 26300x000000da,0x000000da,0x0005003e,0x000021ad,
26500x000000a6,0x00000002,0x00000004,0x000500b4, 26310x00000380,0x00000002,0x00000004,0x00050080,
26510x0000002f,0x00001e73,0x00001e14,0x0000026d, 26320x00000006,0x00001e60,0x00001cf0,0x000005d6,
26520x00060050,0x00000395,0x000032b0,0x00001e73, 26330x00050095,0x000000ab,0x000021dd,0x00001f59,
26530x00001e73,0x00001e73,0x000600a9,0x0000004b, 26340x00001e60,0x00050051,0x00000006,0x000021de,
26540x000032b1,0x000032b0,0x000032a7,0x00003221, 26350x000021dd,0x00000001,0x00050051,0x00000006,
26550x000600a9,0x0000004b,0x000032b3,0x000032b0, 26360x000021df,0x000021dd,0x00000000,0x00050080,
26560x000032a5,0x0000320f,0x00050041,0x000000fe, 26370x00000006,0x000021e4,0x00001f60,0x000021de,
26570x0000225a,0x000000fc,0x000000fd,0x0004003d, 26380x00050050,0x00000007,0x000021e5,0x000021df,
26580x00000006,0x0000225b,0x0000225a,0x00050084, 26390x000021e4,0x0004007c,0x00000014,0x000021d5,
26590x00000006,0x0000225c,0x0000011f,0x0000225b, 26400x000021e5,0x00060041,0x000000db,0x000021cd,
26600x00050080,0x00000006,0x0000225d,0x00000107, 26410x000021d5,0x000000da,0x000000da,0x0005003e,
26610x0000225c,0x00050080,0x00000006,0x00002263, 26420x000021cd,0x000000a6,0x00000002,0x00000004,
26620x0000225b,0x000032a8,0x00050086,0x00000006, 26430x00050080,0x00000006,0x00001e65,0x00001cf0,
26630x00002264,0x00002263,0x00000101,0x00050084, 26440x000005df,0x00050095,0x000000ab,0x000021fd,
26640x00000006,0x00002256,0x00000107,0x00002264, 26450x00001f59,0x00001e65,0x00050051,0x00000006,
26650x00050080,0x00000006,0x00002257,0x0000225d, 26460x000021fe,0x000021fd,0x00000001,0x00050051,
26660x00002256,0x00050084,0x00000006,0x00002227, 26470x00000006,0x000021ff,0x000021fd,0x00000000,
26670x00000150,0x00000b11,0x00050080,0x00000006, 26480x00050080,0x00000006,0x00002204,0x00001f60,
26680x00002228,0x00002257,0x00002227,0x00050041, 26490x000021fe,0x00050050,0x00000007,0x00002205,
26690x00000156,0x00002229,0x000000fc,0x00000154, 26500x000021ff,0x00002204,0x0004007c,0x00000014,
26700x0004003d,0x00000007,0x0000222a,0x00002229, 26510x000021f5,0x00002205,0x00060041,0x000000db,
26710x00050051,0x00000027,0x0000222d,0x000032b3, 26520x000021ed,0x000021f5,0x000000da,0x000000da,
26720x00000000,0x0004007c,0x00000006,0x0000226a, 26530x0005003e,0x000021ed,0x000000a6,0x00000002,
26730x0000222d,0x00050051,0x00000006,0x00002283, 26540x00000004,0x000500b4,0x0000002f,0x00001e6a,
26740x0000222a,0x00000000,0x00050095,0x000000ab, 26550x00001e0b,0x0000026d,0x00060050,0x00000395,
26750x00002285,0x00002283,0x00002228,0x00050051, 26560x000032a2,0x00001e6a,0x00001e6a,0x00001e6a,
26760x00000006,0x00002286,0x00002285,0x00000001, 26570x000600a9,0x0000004b,0x000032a3,0x000032a2,
26770x00050051,0x00000006,0x00002287,0x00002285, 26580x00003294,0x00003212,0x000600a9,0x0000004b,
26780x00000000,0x00050051,0x00000006,0x0000228a, 26590x000032a5,0x000032a2,0x000003be,0x00003200,
26790x0000222a,0x00000001,0x00050080,0x00000006, 26600x00050041,0x000000fe,0x0000224f,0x000000fc,
26800x0000228c,0x0000228a,0x00002286,0x00050050, 26610x000000fd,0x0004003d,0x00000006,0x00002250,
26810x00000007,0x0000228d,0x00002287,0x0000228c, 26620x0000224f,0x00050084,0x00000006,0x00002251,
26820x0004007c,0x00000014,0x0000227d,0x0000228d, 26630x0000011f,0x00002250,0x00050080,0x00000006,
26830x00060041,0x000000db,0x00002275,0x0000227d, 26640x00002252,0x00000107,0x00002251,0x00050080,
26840x000000da,0x000000da,0x0005003e,0x00002275, 26650x00000006,0x00002258,0x00002250,0x00003297,
26850x0000226a,0x00000002,0x00000004,0x00050080, 26660x00050086,0x00000006,0x00002259,0x00002258,
26860x00000006,0x00002230,0x00002228,0x0000010a, 26670x00000101,0x00050084,0x00000006,0x0000224b,
26870x00050051,0x00000027,0x00002234,0x000032b3, 26680x00000107,0x00002259,0x00050080,0x00000006,
26880x00000001,0x0004007c,0x00000006,0x00002293, 26690x0000224c,0x00002252,0x0000224b,0x00050084,
26890x00002234,0x00050095,0x000000ab,0x000022ae, 26700x00000006,0x0000221c,0x00000150,0x00000b09,
26900x00002283,0x00002230,0x00050051,0x00000006, 26710x00050080,0x00000006,0x0000221d,0x0000224c,
26910x000022af,0x000022ae,0x00000001,0x00050051, 26720x0000221c,0x00050041,0x00000156,0x0000221e,
26920x00000006,0x000022b0,0x000022ae,0x00000000, 26730x000000fc,0x00000154,0x0004003d,0x00000007,
26930x00050080,0x00000006,0x000022b5,0x0000228a, 26740x0000221f,0x0000221e,0x00050051,0x00000027,
26940x000022af,0x00050050,0x00000007,0x000022b6, 26750x00002222,0x000032a5,0x00000000,0x0004007c,
26950x000022b0,0x000022b5,0x0004007c,0x00000014, 26760x00000006,0x0000225f,0x00002222,0x00050051,
26960x000022a6,0x000022b6,0x00060041,0x000000db, 26770x00000006,0x00002278,0x0000221f,0x00000000,
26970x0000229e,0x000022a6,0x000000da,0x000000da, 26780x00050095,0x000000ab,0x0000227a,0x00002278,
26980x0005003e,0x0000229e,0x00002293,0x00000002, 26790x0000221d,0x00050051,0x00000006,0x0000227b,
26990x00000004,0x00050080,0x00000006,0x00002237, 26800x0000227a,0x00000001,0x00050051,0x00000006,
27000x00002228,0x00000111,0x00050051,0x00000027, 26810x0000227c,0x0000227a,0x00000000,0x00050051,
27010x0000223b,0x000032b3,0x00000002,0x0004007c, 26820x00000006,0x0000227f,0x0000221f,0x00000001,
27020x00000006,0x000022bc,0x0000223b,0x00050095, 26830x00050080,0x00000006,0x00002281,0x0000227f,
27030x000000ab,0x000022d7,0x00002283,0x00002237, 26840x0000227b,0x00050050,0x00000007,0x00002282,
27040x00050051,0x00000006,0x000022d8,0x000022d7, 26850x0000227c,0x00002281,0x0004007c,0x00000014,
27050x00000001,0x00050051,0x00000006,0x000022d9, 26860x00002272,0x00002282,0x00060041,0x000000db,
27060x000022d7,0x00000000,0x00050080,0x00000006, 26870x0000226a,0x00002272,0x000000da,0x000000da,
27070x000022de,0x0000228a,0x000022d8,0x00050050, 26880x0005003e,0x0000226a,0x0000225f,0x00000002,
27080x00000007,0x000022df,0x000022d9,0x000022de, 26890x00000004,0x00050080,0x00000006,0x00002225,
27090x0004007c,0x00000014,0x000022cf,0x000022df, 26900x0000221d,0x0000010a,0x00050051,0x00000027,
27100x00060041,0x000000db,0x000022c7,0x000022cf, 26910x00002229,0x000032a5,0x00000001,0x0004007c,
27110x000000da,0x000000da,0x0005003e,0x000022c7, 26920x00000006,0x00002288,0x00002229,0x00050095,
27120x000022bc,0x00000002,0x00000004,0x00050080, 26930x000000ab,0x000022a3,0x00002278,0x00002225,
27130x00000006,0x0000223e,0x00002228,0x00000118, 26940x00050051,0x00000006,0x000022a4,0x000022a3,
27140x00050051,0x00000027,0x00002242,0x000032b1, 26950x00000001,0x00050051,0x00000006,0x000022a5,
27150x00000000,0x0004007c,0x00000006,0x000022e5, 26960x000022a3,0x00000000,0x00050080,0x00000006,
27160x00002242,0x00050095,0x000000ab,0x00002300, 26970x000022aa,0x0000227f,0x000022a4,0x00050050,
27170x00002283,0x0000223e,0x00050051,0x00000006, 26980x00000007,0x000022ab,0x000022a5,0x000022aa,
27180x00002301,0x00002300,0x00000001,0x00050051, 26990x0004007c,0x00000014,0x0000229b,0x000022ab,
27190x00000006,0x00002302,0x00002300,0x00000000, 27000x00060041,0x000000db,0x00002293,0x0000229b,
27200x00050080,0x00000006,0x00002307,0x0000228a, 27010x000000da,0x000000da,0x0005003e,0x00002293,
27210x00002301,0x00050050,0x00000007,0x00002308, 27020x00002288,0x00000002,0x00000004,0x00050080,
27220x00002302,0x00002307,0x0004007c,0x00000014, 27030x00000006,0x0000222c,0x0000221d,0x00000111,
27230x000022f8,0x00002308,0x00060041,0x000000db, 27040x00050051,0x00000027,0x00002230,0x000032a5,
27240x000022f0,0x000022f8,0x000000da,0x000000da, 27050x00000002,0x0004007c,0x00000006,0x000022b1,
27250x0005003e,0x000022f0,0x000022e5,0x00000002, 27060x00002230,0x00050095,0x000000ab,0x000022cc,
27260x00000004,0x00050080,0x00000006,0x00002245, 27070x00002278,0x0000222c,0x00050051,0x00000006,
27270x00002228,0x0000011f,0x00050051,0x00000027, 27080x000022cd,0x000022cc,0x00000001,0x00050051,
27280x00002249,0x000032b1,0x00000001,0x0004007c, 27090x00000006,0x000022ce,0x000022cc,0x00000000,
27290x00000006,0x0000230e,0x00002249,0x00050095, 27100x00050080,0x00000006,0x000022d3,0x0000227f,
27300x000000ab,0x00002329,0x00002283,0x00002245, 27110x000022cd,0x00050050,0x00000007,0x000022d4,
27310x00050051,0x00000006,0x0000232a,0x00002329, 27120x000022ce,0x000022d3,0x0004007c,0x00000014,
27320x00000001,0x00050051,0x00000006,0x0000232b, 27130x000022c4,0x000022d4,0x00060041,0x000000db,
27330x00002329,0x00000000,0x00050080,0x00000006, 27140x000022bc,0x000022c4,0x000000da,0x000000da,
27340x00002330,0x0000228a,0x0000232a,0x00050050, 27150x0005003e,0x000022bc,0x000022b1,0x00000002,
27350x00000007,0x00002331,0x0000232b,0x00002330, 27160x00000004,0x00050080,0x00000006,0x00002233,
27360x0004007c,0x00000014,0x00002321,0x00002331, 27170x0000221d,0x00000118,0x00050051,0x00000027,
27370x00060041,0x000000db,0x00002319,0x00002321, 27180x00002237,0x000032a3,0x00000000,0x0004007c,
27380x000000da,0x000000da,0x0005003e,0x00002319, 27190x00000006,0x000022da,0x00002237,0x00050095,
27390x0000230e,0x00000002,0x00000004,0x00050080, 27200x000000ab,0x000022f5,0x00002278,0x00002233,
27400x00000006,0x0000224c,0x00002228,0x00000189, 27210x00050051,0x00000006,0x000022f6,0x000022f5,
27410x00050051,0x00000027,0x00002250,0x000032b1, 27220x00000001,0x00050051,0x00000006,0x000022f7,
27420x00000002,0x0004007c,0x00000006,0x00002337, 27230x000022f5,0x00000000,0x00050080,0x00000006,
27430x00002250,0x00050095,0x000000ab,0x00002352, 27240x000022fc,0x0000227f,0x000022f6,0x00050050,
27440x00002283,0x0000224c,0x00050051,0x00000006, 27250x00000007,0x000022fd,0x000022f7,0x000022fc,
27450x00002353,0x00002352,0x00000001,0x00050051, 27260x0004007c,0x00000014,0x000022ed,0x000022fd,
27460x00000006,0x00002354,0x00002352,0x00000000, 27270x00060041,0x000000db,0x000022e5,0x000022ed,
27470x00050080,0x00000006,0x00002359,0x0000228a, 27280x000000da,0x000000da,0x0005003e,0x000022e5,
27480x00002353,0x00050050,0x00000007,0x0000235a, 27290x000022da,0x00000002,0x00000004,0x00050080,
27490x00002354,0x00002359,0x0004007c,0x00000014, 27300x00000006,0x0000223a,0x0000221d,0x0000011f,
27500x0000234a,0x0000235a,0x00060041,0x000000db, 27310x00050051,0x00000027,0x0000223e,0x000032a3,
27510x00002342,0x0000234a,0x000000da,0x000000da, 27320x00000001,0x0004007c,0x00000006,0x00002303,
27520x0005003e,0x00002342,0x00002337,0x00000002, 27330x0000223e,0x00050095,0x000000ab,0x0000231e,
27530x00000004,0x000300f7,0x0000239a,0x00000000, 27340x00002278,0x0000223a,0x00050051,0x00000006,
27540x000300fb,0x000000a6,0x00002369,0x000200f8, 27350x0000231f,0x0000231e,0x00000001,0x00050051,
27550x00002369,0x000500bc,0x0000002f,0x000023a1, 27360x00000006,0x00002320,0x0000231e,0x00000000,
27560x0000222d,0x00002242,0x000300f7,0x000023a8, 27370x00050080,0x00000006,0x00002325,0x0000227f,
27570x00000000,0x000400fa,0x000023a1,0x000023a2, 27380x0000231f,0x00050050,0x00000007,0x00002326,
27580x000023a8,0x000200f8,0x000023a2,0x000500bc, 27390x00002320,0x00002325,0x0004007c,0x00000014,
27590x0000002f,0x000023a7,0x00002234,0x00002249, 27400x00002316,0x00002326,0x00060041,0x000000db,
27600x000200f9,0x000023a8,0x000200f8,0x000023a8, 27410x0000230e,0x00002316,0x000000da,0x000000da,
27610x000700f5,0x0000002f,0x000023a9,0x000023a1, 27420x0005003e,0x0000230e,0x00002303,0x00000002,
27620x00002369,0x000023a7,0x000023a2,0x000300f7, 27430x00000004,0x00050080,0x00000006,0x00002241,
27630x000023b0,0x00000000,0x000400fa,0x000023a9, 27440x0000221d,0x00000189,0x00050051,0x00000027,
27640x000023aa,0x000023b0,0x000200f8,0x000023aa, 27450x00002245,0x000032a3,0x00000002,0x0004007c,
27650x000500bc,0x0000002f,0x000023af,0x0000223b, 27460x00000006,0x0000232c,0x00002245,0x00050095,
27660x00002250,0x000200f9,0x000023b0,0x000200f8, 27470x000000ab,0x00002347,0x00002278,0x00002241,
27670x000023b0,0x000700f5,0x0000002f,0x000023b1, 27480x00050051,0x00000006,0x00002348,0x00002347,
27680x000023a9,0x000023a8,0x000023af,0x000023aa, 27490x00000001,0x00050051,0x00000006,0x00002349,
27690x000400a8,0x0000002f,0x000023b2,0x000023b1, 27500x00002347,0x00000000,0x00050080,0x00000006,
27700x000300f7,0x0000236e,0x00000000,0x000400fa, 27510x0000234e,0x0000227f,0x00002348,0x00050050,
27710x000023b2,0x0000236d,0x0000236e,0x000200f8, 27520x00000007,0x0000234f,0x00002349,0x0000234e,
27720x0000236d,0x000200f9,0x0000239a,0x000200f8, 27530x0004007c,0x00000014,0x0000233f,0x0000234f,
27730x0000236e,0x00050081,0x0000004b,0x00002371, 27540x00060041,0x000000db,0x00002337,0x0000233f,
27740x000032b3,0x000032b1,0x0005008e,0x0000004b, 27550x000000da,0x000000da,0x0005003e,0x00002337,
27750x00002372,0x00002371,0x000001ed,0x00050095, 27560x0000232c,0x00000002,0x00000004,0x000300f7,
27760x000000ab,0x000023c2,0x00002283,0x000000a6, 27570x0000238f,0x00000000,0x000300fb,0x000000a6,
27770x00050051,0x00000006,0x000023c3,0x000023c2, 27580x0000235e,0x000200f8,0x0000235e,0x000500bc,
27780x00000001,0x00050051,0x00000006,0x000023c4, 27590x0000002f,0x00002396,0x00002222,0x00002237,
27790x000023c2,0x00000000,0x00050080,0x00000006, 27600x000300f7,0x0000239d,0x00000000,0x000400fa,
27800x000023c9,0x0000228a,0x000023c3,0x00050050, 27610x00002396,0x00002397,0x0000239d,0x000200f8,
27810x00000007,0x000023ca,0x000023c4,0x000023c9, 27620x00002397,0x000500bc,0x0000002f,0x0000239c,
27820x0004007c,0x00000014,0x000023ba,0x000023ca, 27630x00002229,0x0000223e,0x000200f9,0x0000239d,
27830x00060041,0x000000db,0x00002377,0x000023ba, 27640x000200f8,0x0000239d,0x000700f5,0x0000002f,
27840x000000da,0x000000da,0x00050051,0x00000027, 27650x0000239e,0x00002396,0x0000235e,0x0000239c,
27850x00002379,0x00002372,0x00000000,0x0004007c, 27660x00002397,0x000300f7,0x000023a5,0x00000000,
27860x00000006,0x000023d0,0x00002379,0x000500c7, 27670x000400fa,0x0000239e,0x0000239f,0x000023a5,
27870x00000006,0x000023d2,0x000023d0,0x00000130, 27680x000200f8,0x0000239f,0x000500bc,0x0000002f,
27880x000500ab,0x0000002f,0x000023d3,0x000023d2, 27690x000023a4,0x00002230,0x00002245,0x000200f9,
27890x000000a6,0x000300f7,0x000023da,0x00000000, 27700x000023a5,0x000200f8,0x000023a5,0x000700f5,
27900x000400fa,0x000023d3,0x000023d4,0x000023d7, 27710x0000002f,0x000023a6,0x0000239e,0x0000239d,
27910x000200f8,0x000023d4,0x000400c8,0x00000006, 27720x000023a4,0x0000239f,0x000400a8,0x0000002f,
27920x000023d6,0x000023d0,0x000200f9,0x000023da, 27730x000023a7,0x000023a6,0x000300f7,0x00002363,
27930x000200f8,0x000023d7,0x000500c5,0x00000006, 27740x00000000,0x000400fa,0x000023a7,0x00002362,
27940x000023d9,0x000023d0,0x00000130,0x000200f9, 27750x00002363,0x000200f8,0x00002362,0x000200f9,
27950x000023da,0x000200f8,0x000023da,0x000700f5, 27760x0000238f,0x000200f8,0x00002363,0x00050081,
27960x00000006,0x00003228,0x000023d6,0x000023d4, 27770x0000004b,0x00002366,0x000032a5,0x000032a3,
27970x000023d9,0x000023d7,0x000700ed,0x00000006, 27780x0005008e,0x0000004b,0x00002367,0x00002366,
27980x0000237b,0x00002377,0x000000b0,0x000000a6, 27790x000001ed,0x00050095,0x000000ab,0x000023b7,
27990x00003228,0x00060041,0x000000db,0x0000237d, 27800x00002278,0x000000a6,0x00050051,0x00000006,
28000x000023ba,0x000000da,0x00000154,0x00050051, 27810x000023b8,0x000023b7,0x00000001,0x00050051,
28010x00000027,0x0000237f,0x00002372,0x00000001, 27820x00000006,0x000023b9,0x000023b7,0x00000000,
28020x0004007c,0x00000006,0x000023e1,0x0000237f, 27830x00050080,0x00000006,0x000023be,0x0000227f,
28030x000500c7,0x00000006,0x000023e3,0x000023e1, 27840x000023b8,0x00050050,0x00000007,0x000023bf,
28040x00000130,0x000500ab,0x0000002f,0x000023e4, 27850x000023b9,0x000023be,0x0004007c,0x00000014,
28050x000023e3,0x000000a6,0x000300f7,0x000023eb, 27860x000023af,0x000023bf,0x00060041,0x000000db,
28060x00000000,0x000400fa,0x000023e4,0x000023e5, 27870x0000236c,0x000023af,0x000000da,0x000000da,
28070x000023e8,0x000200f8,0x000023e5,0x000400c8, 27880x00050051,0x00000027,0x0000236e,0x00002367,
28080x00000006,0x000023e7,0x000023e1,0x000200f9, 27890x00000000,0x0004007c,0x00000006,0x000023c5,
28090x000023eb,0x000200f8,0x000023e8,0x000500c5, 27900x0000236e,0x000500c7,0x00000006,0x000023c7,
28100x00000006,0x000023ea,0x000023e1,0x00000130, 27910x000023c5,0x00000130,0x000500ab,0x0000002f,
28110x000200f9,0x000023eb,0x000200f8,0x000023eb, 27920x000023c8,0x000023c7,0x000000a6,0x000300f7,
28120x000700f5,0x00000006,0x00003229,0x000023e7, 27930x000023cf,0x00000000,0x000400fa,0x000023c8,
28130x000023e5,0x000023ea,0x000023e8,0x000700ed, 27940x000023c9,0x000023cc,0x000200f8,0x000023c9,
28140x00000006,0x00002381,0x0000237d,0x000000b0, 27950x000400c8,0x00000006,0x000023cb,0x000023c5,
28150x000000a6,0x00003229,0x00060041,0x000000db, 27960x000200f9,0x000023cf,0x000200f8,0x000023cc,
28160x00002383,0x000023ba,0x000000da,0x00000205, 27970x000500c5,0x00000006,0x000023ce,0x000023c5,
28170x00050051,0x00000027,0x00002385,0x00002372, 27980x00000130,0x000200f9,0x000023cf,0x000200f8,
28180x00000002,0x0004007c,0x00000006,0x000023f2, 27990x000023cf,0x000700f5,0x00000006,0x00003219,
28190x00002385,0x000500c7,0x00000006,0x000023f4, 28000x000023cb,0x000023c9,0x000023ce,0x000023cc,
28200x000023f2,0x00000130,0x000500ab,0x0000002f, 28010x000700ed,0x00000006,0x00002370,0x0000236c,
28210x000023f5,0x000023f4,0x000000a6,0x000300f7, 28020x000000b0,0x000000a6,0x00003219,0x00060041,
28220x000023fc,0x00000000,0x000400fa,0x000023f5, 28030x000000db,0x00002372,0x000023af,0x000000da,
28230x000023f6,0x000023f9,0x000200f8,0x000023f6, 28040x00000154,0x00050051,0x00000027,0x00002374,
28240x000400c8,0x00000006,0x000023f8,0x000023f2, 28050x00002367,0x00000001,0x0004007c,0x00000006,
28250x000200f9,0x000023fc,0x000200f8,0x000023f9, 28060x000023d6,0x00002374,0x000500c7,0x00000006,
28260x000500c5,0x00000006,0x000023fb,0x000023f2, 28070x000023d8,0x000023d6,0x00000130,0x000500ab,
28270x00000130,0x000200f9,0x000023fc,0x000200f8, 28080x0000002f,0x000023d9,0x000023d8,0x000000a6,
28280x000023fc,0x000700f5,0x00000006,0x0000322a, 28090x000300f7,0x000023e0,0x00000000,0x000400fa,
28290x000023f8,0x000023f6,0x000023fb,0x000023f9, 28100x000023d9,0x000023da,0x000023dd,0x000200f8,
28300x000700ed,0x00000006,0x00002387,0x00002383, 28110x000023da,0x000400c8,0x00000006,0x000023dc,
28310x000000b0,0x000000a6,0x0000322a,0x00060041, 28120x000023d6,0x000200f9,0x000023e0,0x000200f8,
28320x000000db,0x00002389,0x000023ba,0x000000da, 28130x000023dd,0x000500c5,0x00000006,0x000023df,
28330x0000020d,0x000300f7,0x0000240d,0x00000000, 28140x000023d6,0x00000130,0x000200f9,0x000023e0,
28340x000400fa,0x000023d3,0x00002407,0x0000240a, 28150x000200f8,0x000023e0,0x000700f5,0x00000006,
28350x000200f8,0x00002407,0x000400c8,0x00000006, 28160x0000321a,0x000023dc,0x000023da,0x000023df,
28360x00002409,0x000023d0,0x000200f9,0x0000240d, 28170x000023dd,0x000700ed,0x00000006,0x00002376,
28370x000200f8,0x0000240a,0x000500c5,0x00000006, 28180x00002372,0x000000b0,0x000000a6,0x0000321a,
28380x0000240c,0x000023d0,0x00000130,0x000200f9, 28190x00060041,0x000000db,0x00002378,0x000023af,
28390x0000240d,0x000200f8,0x0000240d,0x000700f5, 28200x000000da,0x00000205,0x00050051,0x00000027,
28400x00000006,0x0000322b,0x00002409,0x00002407, 28210x0000237a,0x00002367,0x00000002,0x0004007c,
28410x0000240c,0x0000240a,0x000700ef,0x00000006, 28220x00000006,0x000023e7,0x0000237a,0x000500c7,
28420x0000238d,0x00002389,0x000000b0,0x000000a6, 28230x00000006,0x000023e9,0x000023e7,0x00000130,
28430x0000322b,0x00060041,0x000000db,0x0000238f, 28240x000500ab,0x0000002f,0x000023ea,0x000023e9,
28440x000023ba,0x000000da,0x00000215,0x000300f7, 28250x000000a6,0x000300f7,0x000023f1,0x00000000,
28450x0000241e,0x00000000,0x000400fa,0x000023e4, 28260x000400fa,0x000023ea,0x000023eb,0x000023ee,
28460x00002418,0x0000241b,0x000200f8,0x00002418, 28270x000200f8,0x000023eb,0x000400c8,0x00000006,
28470x000400c8,0x00000006,0x0000241a,0x000023e1, 28280x000023ed,0x000023e7,0x000200f9,0x000023f1,
28480x000200f9,0x0000241e,0x000200f8,0x0000241b, 28290x000200f8,0x000023ee,0x000500c5,0x00000006,
28490x000500c5,0x00000006,0x0000241d,0x000023e1, 28300x000023f0,0x000023e7,0x00000130,0x000200f9,
28500x00000130,0x000200f9,0x0000241e,0x000200f8, 28310x000023f1,0x000200f8,0x000023f1,0x000700f5,
28510x0000241e,0x000700f5,0x00000006,0x0000322c, 28320x00000006,0x0000321b,0x000023ed,0x000023eb,
28520x0000241a,0x00002418,0x0000241d,0x0000241b, 28330x000023f0,0x000023ee,0x000700ed,0x00000006,
28530x000700ef,0x00000006,0x00002393,0x0000238f, 28340x0000237c,0x00002378,0x000000b0,0x000000a6,
28540x000000b0,0x000000a6,0x0000322c,0x00060041, 28350x0000321b,0x00060041,0x000000db,0x0000237e,
28550x000000db,0x00002395,0x000023ba,0x000000da, 28360x000023af,0x000000da,0x0000020d,0x000300f7,
28560x0000021d,0x000300f7,0x0000242f,0x00000000, 28370x00002402,0x00000000,0x000400fa,0x000023c8,
28570x000400fa,0x000023f5,0x00002429,0x0000242c, 28380x000023fc,0x000023ff,0x000200f8,0x000023fc,
28580x000200f8,0x00002429,0x000400c8,0x00000006, 28390x000400c8,0x00000006,0x000023fe,0x000023c5,
28590x0000242b,0x000023f2,0x000200f9,0x0000242f, 28400x000200f9,0x00002402,0x000200f8,0x000023ff,
28600x000200f8,0x0000242c,0x000500c5,0x00000006, 28410x000500c5,0x00000006,0x00002401,0x000023c5,
28610x0000242e,0x000023f2,0x00000130,0x000200f9, 28420x00000130,0x000200f9,0x00002402,0x000200f8,
28620x0000242f,0x000200f8,0x0000242f,0x000700f5, 28430x00002402,0x000700f5,0x00000006,0x0000321c,
28630x00000006,0x0000322d,0x0000242b,0x00002429, 28440x000023fe,0x000023fc,0x00002401,0x000023ff,
28640x0000242e,0x0000242c,0x000700ef,0x00000006, 28450x000700ef,0x00000006,0x00002382,0x0000237e,
28650x00002399,0x00002395,0x000000b0,0x000000a6, 28460x000000b0,0x000000a6,0x0000321c,0x00060041,
28660x0000322d,0x000200f9,0x0000239a,0x000200f8, 28470x000000db,0x00002384,0x000023af,0x000000da,
28670x0000239a,0x000200f9,0x00000bdb,0x000200f8, 28480x00000215,0x000300f7,0x00002413,0x00000000,
28680x00000bdf,0x000500aa,0x0000002f,0x00000be2, 28490x000400fa,0x000023d9,0x0000240d,0x00002410,
28690x00000b13,0x000002b7,0x000300f7,0x00000be4, 28500x000200f8,0x0000240d,0x000400c8,0x00000006,
28700x00000000,0x000400fa,0x00000be2,0x00000be3, 28510x0000240f,0x000023d6,0x000200f9,0x00002413,
28710x00000be8,0x000200f8,0x00000be3,0x00050041, 28520x000200f8,0x00002410,0x000500c5,0x00000006,
28720x000000fe,0x000024e4,0x000000fc,0x000000fd, 28530x00002412,0x000023d6,0x00000130,0x000200f9,
28730x0004003d,0x00000006,0x000024e5,0x000024e4, 28540x00002413,0x000200f8,0x00002413,0x000700f5,
28740x00050084,0x00000006,0x000024e6,0x0000011f, 28550x00000006,0x0000321d,0x0000240f,0x0000240d,
28750x000024e5,0x00050080,0x00000006,0x000024e7, 28560x00002412,0x00002410,0x000700ef,0x00000006,
28760x00000107,0x000024e6,0x00050080,0x00000006, 28570x00002388,0x00002384,0x000000b0,0x000000a6,
28770x000024ed,0x000024e5,0x000032a8,0x00050086, 28580x0000321d,0x00060041,0x000000db,0x0000238a,
28780x00000006,0x000024ee,0x000024ed,0x00000101, 28590x000023af,0x000000da,0x0000021d,0x000300f7,
28790x00050084,0x00000006,0x000024e0,0x00000107, 28600x00002424,0x00000000,0x000400fa,0x000023ea,
28800x000024ee,0x00050080,0x00000006,0x000024e1, 28610x0000241e,0x00002421,0x000200f8,0x0000241e,
28810x000024e7,0x000024e0,0x00050084,0x00000006, 28620x000400c8,0x00000006,0x00002420,0x000023e7,
28820x000024b5,0x00000150,0x00000b11,0x00050080, 28630x000200f9,0x00002424,0x000200f8,0x00002421,
28830x00000006,0x000024b6,0x000024e1,0x000024b5, 28640x000500c5,0x00000006,0x00002423,0x000023e7,
28840x00050041,0x00000156,0x000024b7,0x000000fc, 28650x00000130,0x000200f9,0x00002424,0x000200f8,
28850x00000154,0x0004003d,0x00000007,0x000024b8, 28660x00002424,0x000700f5,0x00000006,0x0000321e,
28860x000024b7,0x00050051,0x00000006,0x00002505, 28670x00002420,0x0000241e,0x00002423,0x00002421,
28870x000024b8,0x00000000,0x00050095,0x000000ab, 28680x000700ef,0x00000006,0x0000238e,0x0000238a,
28880x00002507,0x00002505,0x000024b6,0x00050051, 28690x000000b0,0x000000a6,0x0000321e,0x000200f9,
28890x00000006,0x00002508,0x00002507,0x00000001, 28700x0000238f,0x000200f8,0x0000238f,0x000200f9,
28900x00050051,0x00000006,0x00002509,0x00002507, 28710x00000bd5,0x000200f8,0x00000bd9,0x000500aa,
28910x00000000,0x00050051,0x00000006,0x0000250c, 28720x0000002f,0x00000bdc,0x00000b0b,0x000002b7,
28920x000024b8,0x00000001,0x00050080,0x00000006, 28730x000300f7,0x00000bde,0x00000000,0x000400fa,
28930x0000250e,0x0000250c,0x00002508,0x00050050, 28740x00000bdc,0x00000bdd,0x00000be2,0x000200f8,
28940x00000007,0x0000250f,0x00002509,0x0000250e, 28750x00000bdd,0x00050041,0x000000fe,0x000024d9,
28950x0004007c,0x00000014,0x000024ff,0x0000250f, 28760x000000fc,0x000000fd,0x0004003d,0x00000006,
28960x00060041,0x000000db,0x000024f6,0x000024ff, 28770x000024da,0x000024d9,0x00050084,0x00000006,
28970x000000da,0x000000da,0x0006003d,0x00000006, 28780x000024db,0x0000011f,0x000024da,0x00050080,
28980x000024f7,0x000024f6,0x00000002,0x00000004, 28790x00000006,0x000024dc,0x00000107,0x000024db,
28990x0004007c,0x00000027,0x000024bb,0x000024f7, 28800x00050080,0x00000006,0x000024e2,0x000024da,
29000x00050080,0x00000006,0x000024bd,0x000024b6, 28810x00003297,0x00050086,0x00000006,0x000024e3,
29010x0000010a,0x00050095,0x000000ab,0x00002528, 28820x000024e2,0x00000101,0x00050084,0x00000006,
29020x00002505,0x000024bd,0x00050051,0x00000006, 28830x000024d5,0x00000107,0x000024e3,0x00050080,
29030x00002529,0x00002528,0x00000001,0x00050051, 28840x00000006,0x000024d6,0x000024dc,0x000024d5,
29040x00000006,0x0000252a,0x00002528,0x00000000, 28850x00050084,0x00000006,0x000024aa,0x00000150,
29050x00050080,0x00000006,0x0000252f,0x0000250c, 28860x00000b09,0x00050080,0x00000006,0x000024ab,
29060x00002529,0x00050050,0x00000007,0x00002530, 28870x000024d6,0x000024aa,0x00050041,0x00000156,
29070x0000252a,0x0000252f,0x0004007c,0x00000014, 28880x000024ac,0x000000fc,0x00000154,0x0004003d,
29080x00002520,0x00002530,0x00060041,0x000000db, 28890x00000007,0x000024ad,0x000024ac,0x00050051,
29090x00002517,0x00002520,0x000000da,0x000000da, 28900x00000006,0x000024fa,0x000024ad,0x00000000,
29100x0006003d,0x00000006,0x00002518,0x00002517, 28910x00050095,0x000000ab,0x000024fc,0x000024fa,
28920x000024ab,0x00050051,0x00000006,0x000024fd,
28930x000024fc,0x00000001,0x00050051,0x00000006,
28940x000024fe,0x000024fc,0x00000000,0x00050051,
28950x00000006,0x00002501,0x000024ad,0x00000001,
28960x00050080,0x00000006,0x00002503,0x00002501,
28970x000024fd,0x00050050,0x00000007,0x00002504,
28980x000024fe,0x00002503,0x0004007c,0x00000014,
28990x000024f4,0x00002504,0x00060041,0x000000db,
29000x000024eb,0x000024f4,0x000000da,0x000000da,
29010x0006003d,0x00000006,0x000024ec,0x000024eb,
29110x00000002,0x00000004,0x0004007c,0x00000027, 29020x00000002,0x00000004,0x0004007c,0x00000027,
29120x000024c1,0x00002518,0x00050080,0x00000006, 29030x000024b0,0x000024ec,0x00050080,0x00000006,
29130x000024c3,0x000024b6,0x00000111,0x00050095, 29040x000024b2,0x000024ab,0x0000010a,0x00050095,
29140x000000ab,0x00002549,0x00002505,0x000024c3, 29050x000000ab,0x0000251d,0x000024fa,0x000024b2,
29150x00050051,0x00000006,0x0000254a,0x00002549, 29060x00050051,0x00000006,0x0000251e,0x0000251d,
29160x00000001,0x00050051,0x00000006,0x0000254b, 29070x00000001,0x00050051,0x00000006,0x0000251f,
29170x00002549,0x00000000,0x00050080,0x00000006, 29080x0000251d,0x00000000,0x00050080,0x00000006,
29180x00002550,0x0000250c,0x0000254a,0x00050050, 29090x00002524,0x00002501,0x0000251e,0x00050050,
29190x00000007,0x00002551,0x0000254b,0x00002550, 29100x00000007,0x00002525,0x0000251f,0x00002524,
29200x0004007c,0x00000014,0x00002541,0x00002551, 29110x0004007c,0x00000014,0x00002515,0x00002525,
29210x00060041,0x000000db,0x00002538,0x00002541, 29120x00060041,0x000000db,0x0000250c,0x00002515,
29220x000000da,0x000000da,0x0006003d,0x00000006, 29130x000000da,0x000000da,0x0006003d,0x00000006,
29230x00002539,0x00002538,0x00000002,0x00000004, 29140x0000250d,0x0000250c,0x00000002,0x00000004,
29240x0004007c,0x00000027,0x000024c7,0x00002539, 29150x0004007c,0x00000027,0x000024b6,0x0000250d,
29250x00060050,0x0000004b,0x000024c8,0x000024bb, 29160x00050080,0x00000006,0x000024b8,0x000024ab,
29260x000024c1,0x000024c7,0x00050080,0x00000006, 29170x00000111,0x00050095,0x000000ab,0x0000253e,
29270x000024ca,0x000024b6,0x00000118,0x00050095, 29180x000024fa,0x000024b8,0x00050051,0x00000006,
29280x000000ab,0x0000256a,0x00002505,0x000024ca, 29190x0000253f,0x0000253e,0x00000001,0x00050051,
29290x00050051,0x00000006,0x0000256b,0x0000256a, 29200x00000006,0x00002540,0x0000253e,0x00000000,
29300x00000001,0x00050051,0x00000006,0x0000256c, 29210x00050080,0x00000006,0x00002545,0x00002501,
29310x0000256a,0x00000000,0x00050080,0x00000006, 29220x0000253f,0x00050050,0x00000007,0x00002546,
29320x00002571,0x0000250c,0x0000256b,0x00050050, 29230x00002540,0x00002545,0x0004007c,0x00000014,
29330x00000007,0x00002572,0x0000256c,0x00002571, 29240x00002536,0x00002546,0x00060041,0x000000db,
29340x0004007c,0x00000014,0x00002562,0x00002572, 29250x0000252d,0x00002536,0x000000da,0x000000da,
29350x00060041,0x000000db,0x00002559,0x00002562, 29260x0006003d,0x00000006,0x0000252e,0x0000252d,
29360x000000da,0x000000da,0x0006003d,0x00000006, 29270x00000002,0x00000004,0x0004007c,0x00000027,
29370x0000255a,0x00002559,0x00000002,0x00000004, 29280x000024bc,0x0000252e,0x00060050,0x0000004b,
29380x0004007c,0x00000027,0x000024ce,0x0000255a, 29290x000024bd,0x000024b0,0x000024b6,0x000024bc,
29390x00050080,0x00000006,0x000024d0,0x000024b6, 29300x00050080,0x00000006,0x000024bf,0x000024ab,
29400x0000011f,0x00050095,0x000000ab,0x0000258b, 29310x00000118,0x00050095,0x000000ab,0x0000255f,
29410x00002505,0x000024d0,0x00050051,0x00000006, 29320x000024fa,0x000024bf,0x00050051,0x00000006,
29420x0000258c,0x0000258b,0x00000001,0x00050051, 29330x00002560,0x0000255f,0x00000001,0x00050051,
29430x00000006,0x0000258d,0x0000258b,0x00000000, 29340x00000006,0x00002561,0x0000255f,0x00000000,
29440x00050080,0x00000006,0x00002592,0x0000250c, 29350x00050080,0x00000006,0x00002566,0x00002501,
29450x0000258c,0x00050050,0x00000007,0x00002593, 29360x00002560,0x00050050,0x00000007,0x00002567,
29460x0000258d,0x00002592,0x0004007c,0x00000014, 29370x00002561,0x00002566,0x0004007c,0x00000014,
29470x00002583,0x00002593,0x00060041,0x000000db, 29380x00002557,0x00002567,0x00060041,0x000000db,
29480x0000257a,0x00002583,0x000000da,0x000000da, 29390x0000254e,0x00002557,0x000000da,0x000000da,
29490x0006003d,0x00000006,0x0000257b,0x0000257a, 29400x0006003d,0x00000006,0x0000254f,0x0000254e,
29500x00000002,0x00000004,0x0004007c,0x00000027, 29410x00000002,0x00000004,0x0004007c,0x00000027,
29510x000024d4,0x0000257b,0x00050080,0x00000006, 29420x000024c3,0x0000254f,0x00050080,0x00000006,
29520x000024d6,0x000024b6,0x00000189,0x00050095, 29430x000024c5,0x000024ab,0x0000011f,0x00050095,
29530x000000ab,0x000025ac,0x00002505,0x000024d6, 29440x000000ab,0x00002580,0x000024fa,0x000024c5,
29540x00050051,0x00000006,0x000025ad,0x000025ac, 29450x00050051,0x00000006,0x00002581,0x00002580,
29550x00000001,0x00050051,0x00000006,0x000025ae, 29460x00000001,0x00050051,0x00000006,0x00002582,
29560x000025ac,0x00000000,0x00050080,0x00000006, 29470x00002580,0x00000000,0x00050080,0x00000006,
29570x000025b3,0x0000250c,0x000025ad,0x00050050, 29480x00002587,0x00002501,0x00002581,0x00050050,
29580x00000007,0x000025b4,0x000025ae,0x000025b3, 29490x00000007,0x00002588,0x00002582,0x00002587,
29590x0004007c,0x00000014,0x000025a4,0x000025b4, 29500x0004007c,0x00000014,0x00002578,0x00002588,
29600x00060041,0x000000db,0x0000259b,0x000025a4, 29510x00060041,0x000000db,0x0000256f,0x00002578,
29610x000000da,0x000000da,0x0006003d,0x00000006, 29520x000000da,0x000000da,0x0006003d,0x00000006,
29620x0000259c,0x0000259b,0x00000002,0x00000004, 29530x00002570,0x0000256f,0x00000002,0x00000004,
29630x0004007c,0x00000027,0x000024da,0x0000259c, 29540x0004007c,0x00000027,0x000024c9,0x00002570,
29640x00060050,0x0000004b,0x000024db,0x000024ce, 29550x00050080,0x00000006,0x000024cb,0x000024ab,
29650x000024d4,0x000024da,0x000500bc,0x0000002f, 29560x00000189,0x00050095,0x000000ab,0x000025a1,
29660x000025bb,0x000024bb,0x000024ce,0x000300f7, 29570x000024fa,0x000024cb,0x00050051,0x00000006,
29670x000025c2,0x00000000,0x000400fa,0x000025bb, 29580x000025a2,0x000025a1,0x00000001,0x00050051,
29680x000025bc,0x000025c2,0x000200f8,0x000025bc, 29590x00000006,0x000025a3,0x000025a1,0x00000000,
29690x000500bc,0x0000002f,0x000025c1,0x000024c1, 29600x00050080,0x00000006,0x000025a8,0x00002501,
29700x000024d4,0x000200f9,0x000025c2,0x000200f8, 29610x000025a2,0x00050050,0x00000007,0x000025a9,
29710x000025c2,0x000700f5,0x0000002f,0x000025c3, 29620x000025a3,0x000025a8,0x0004007c,0x00000014,
29720x000025bb,0x00000be3,0x000025c1,0x000025bc, 29630x00002599,0x000025a9,0x00060041,0x000000db,
29730x000300f7,0x000025ca,0x00000000,0x000400fa, 29640x00002590,0x00002599,0x000000da,0x000000da,
29740x000025c3,0x000025c4,0x000025ca,0x000200f8, 29650x0006003d,0x00000006,0x00002591,0x00002590,
29750x000025c4,0x000500bc,0x0000002f,0x000025c9, 29660x00000002,0x00000004,0x0004007c,0x00000027,
29760x000024c7,0x000024da,0x000200f9,0x000025ca, 29670x000024cf,0x00002591,0x00060050,0x0000004b,
29770x000200f8,0x000025ca,0x000700f5,0x0000002f, 29680x000024d0,0x000024c3,0x000024c9,0x000024cf,
29780x000025cb,0x000025c3,0x000025c2,0x000025c9, 29690x000500bc,0x0000002f,0x000025b0,0x000024b0,
29790x000025c4,0x000300f7,0x00002494,0x00000000, 29700x000024c3,0x000300f7,0x000025b7,0x00000000,
29800x000400fa,0x000025cb,0x00002458,0x00002494, 29710x000400fa,0x000025b0,0x000025b1,0x000025b7,
29810x000200f8,0x00002458,0x00050095,0x000000ab, 29720x000200f8,0x000025b1,0x000500bc,0x0000002f,
29820x000025dc,0x00002505,0x000000a6,0x00050051, 29730x000025b6,0x000024b6,0x000024c9,0x000200f9,
29830x00000006,0x000025dd,0x000025dc,0x00000001, 29740x000025b7,0x000200f8,0x000025b7,0x000700f5,
29840x00050051,0x00000006,0x000025de,0x000025dc, 29750x0000002f,0x000025b8,0x000025b0,0x00000bdd,
29850x00000000,0x00050080,0x00000006,0x000025e3, 29760x000025b6,0x000025b1,0x000300f7,0x000025bf,
29860x0000250c,0x000025dd,0x00050050,0x00000007, 29770x00000000,0x000400fa,0x000025b8,0x000025b9,
29870x000025e4,0x000025de,0x000025e3,0x0004007c, 29780x000025bf,0x000200f8,0x000025b9,0x000500bc,
29880x00000014,0x000025d4,0x000025e4,0x00060041, 29790x0000002f,0x000025be,0x000024bc,0x000024cf,
29890x000000db,0x0000245d,0x000025d4,0x000000da, 29800x000200f9,0x000025bf,0x000200f8,0x000025bf,
29900x000000da,0x0006003d,0x00000006,0x0000245e, 29810x000700f5,0x0000002f,0x000025c0,0x000025b8,
29910x0000245d,0x00000002,0x00000004,0x000500c7, 29820x000025b7,0x000025be,0x000025b9,0x000300f7,
29920x00000006,0x000025e9,0x0000245e,0x00000130, 29830x00002489,0x00000000,0x000400fa,0x000025c0,
29930x000500ab,0x0000002f,0x000025ea,0x000025e9, 29840x0000244d,0x00002489,0x000200f8,0x0000244d,
29940x000000a6,0x000300f7,0x000025f1,0x00000000, 29850x00050095,0x000000ab,0x000025d1,0x000024fa,
29950x000400fa,0x000025ea,0x000025eb,0x000025ee, 29860x000000a6,0x00050051,0x00000006,0x000025d2,
29960x000200f8,0x000025eb,0x000500c7,0x00000006, 29870x000025d1,0x00000001,0x00050051,0x00000006,
29970x000025ed,0x0000245e,0x00000145,0x000200f9, 29880x000025d3,0x000025d1,0x00000000,0x00050080,
29980x000025f1,0x000200f8,0x000025ee,0x000400c8, 29890x00000006,0x000025d8,0x00002501,0x000025d2,
29990x00000006,0x000025f0,0x0000245e,0x000200f9, 29900x00050050,0x00000007,0x000025d9,0x000025d3,
30000x000025f1,0x000200f8,0x000025f1,0x000700f5, 29910x000025d8,0x0004007c,0x00000014,0x000025c9,
30010x00000006,0x000031e7,0x000025ed,0x000025eb, 29920x000025d9,0x00060041,0x000000db,0x00002452,
30020x000025f0,0x000025ee,0x0004007c,0x00000027, 29930x000025c9,0x000000da,0x000000da,0x0006003d,
30030x000025f3,0x000031e7,0x00060041,0x000000db, 29940x00000006,0x00002453,0x00002452,0x00000002,
30040x00002461,0x000025d4,0x000000da,0x00000154, 29950x00000004,0x000500c7,0x00000006,0x000025de,
30050x0006003d,0x00000006,0x00002462,0x00002461, 29960x00002453,0x00000130,0x000500ab,0x0000002f,
30060x00000002,0x00000004,0x000500c7,0x00000006, 29970x000025df,0x000025de,0x000000a6,0x000300f7,
30070x000025f8,0x00002462,0x00000130,0x000500ab, 29980x000025e6,0x00000000,0x000400fa,0x000025df,
30080x0000002f,0x000025f9,0x000025f8,0x000000a6, 29990x000025e0,0x000025e3,0x000200f8,0x000025e0,
30090x000300f7,0x00002600,0x00000000,0x000400fa, 30000x000500c7,0x00000006,0x000025e2,0x00002453,
30100x000025f9,0x000025fa,0x000025fd,0x000200f8, 30010x00000145,0x000200f9,0x000025e6,0x000200f8,
30110x000025fa,0x000500c7,0x00000006,0x000025fc, 30020x000025e3,0x000400c8,0x00000006,0x000025e5,
30120x00002462,0x00000145,0x000200f9,0x00002600, 30030x00002453,0x000200f9,0x000025e6,0x000200f8,
30130x000200f8,0x000025fd,0x000400c8,0x00000006, 30040x000025e6,0x000700f5,0x00000006,0x000031d8,
30140x000025ff,0x00002462,0x000200f9,0x00002600, 30050x000025e2,0x000025e0,0x000025e5,0x000025e3,
30150x000200f8,0x00002600,0x000700f5,0x00000006, 30060x0004007c,0x00000027,0x000025e8,0x000031d8,
30160x000031e8,0x000025fc,0x000025fa,0x000025ff, 30070x00060041,0x000000db,0x00002456,0x000025c9,
30170x000025fd,0x0004007c,0x00000027,0x00002602, 30080x000000da,0x00000154,0x0006003d,0x00000006,
30180x000031e8,0x00060041,0x000000db,0x00002465, 30090x00002457,0x00002456,0x00000002,0x00000004,
30190x000025d4,0x000000da,0x00000205,0x0006003d, 30100x000500c7,0x00000006,0x000025ed,0x00002457,
30200x00000006,0x00002466,0x00002465,0x00000002, 30110x00000130,0x000500ab,0x0000002f,0x000025ee,
30210x00000004,0x000500c7,0x00000006,0x00002607, 30120x000025ed,0x000000a6,0x000300f7,0x000025f5,
30220x00002466,0x00000130,0x000500ab,0x0000002f, 30130x00000000,0x000400fa,0x000025ee,0x000025ef,
30230x00002608,0x00002607,0x000000a6,0x000300f7, 30140x000025f2,0x000200f8,0x000025ef,0x000500c7,
30240x0000260f,0x00000000,0x000400fa,0x00002608, 30150x00000006,0x000025f1,0x00002457,0x00000145,
30250x00002609,0x0000260c,0x000200f8,0x00002609, 30160x000200f9,0x000025f5,0x000200f8,0x000025f2,
30260x000500c7,0x00000006,0x0000260b,0x00002466, 30170x000400c8,0x00000006,0x000025f4,0x00002457,
30270x00000145,0x000200f9,0x0000260f,0x000200f8, 30180x000200f9,0x000025f5,0x000200f8,0x000025f5,
30280x0000260c,0x000400c8,0x00000006,0x0000260e, 30190x000700f5,0x00000006,0x000031d9,0x000025f1,
30290x00002466,0x000200f9,0x0000260f,0x000200f8, 30200x000025ef,0x000025f4,0x000025f2,0x0004007c,
30300x0000260f,0x000700f5,0x00000006,0x000031e9, 30210x00000027,0x000025f7,0x000031d9,0x00060041,
30310x0000260b,0x00002609,0x0000260e,0x0000260c, 30220x000000db,0x0000245a,0x000025c9,0x000000da,
30320x0004007c,0x00000027,0x00002611,0x000031e9, 30230x00000205,0x0006003d,0x00000006,0x0000245b,
30330x00060050,0x0000004b,0x00002468,0x000025f3, 30240x0000245a,0x00000002,0x00000004,0x000500c7,
30340x00002602,0x00002611,0x00060041,0x000000db, 30250x00000006,0x000025fc,0x0000245b,0x00000130,
30350x0000246a,0x000025d4,0x000000da,0x0000020d, 30260x000500ab,0x0000002f,0x000025fd,0x000025fc,
30360x0006003d,0x00000006,0x0000246b,0x0000246a, 30270x000000a6,0x000300f7,0x00002604,0x00000000,
30280x000400fa,0x000025fd,0x000025fe,0x00002601,
30290x000200f8,0x000025fe,0x000500c7,0x00000006,
30300x00002600,0x0000245b,0x00000145,0x000200f9,
30310x00002604,0x000200f8,0x00002601,0x000400c8,
30320x00000006,0x00002603,0x0000245b,0x000200f9,
30330x00002604,0x000200f8,0x00002604,0x000700f5,
30340x00000006,0x000031da,0x00002600,0x000025fe,
30350x00002603,0x00002601,0x0004007c,0x00000027,
30360x00002606,0x000031da,0x00060050,0x0000004b,
30370x0000245d,0x000025e8,0x000025f7,0x00002606,
30380x00060041,0x000000db,0x0000245f,0x000025c9,
30390x000000da,0x0000020d,0x0006003d,0x00000006,
30400x00002460,0x0000245f,0x00000002,0x00000004,
30410x000500c7,0x00000006,0x0000260b,0x00002460,
30420x00000130,0x000500ab,0x0000002f,0x0000260c,
30430x0000260b,0x000000a6,0x000300f7,0x00002613,
30440x00000000,0x000400fa,0x0000260c,0x0000260d,
30450x00002610,0x000200f8,0x0000260d,0x000500c7,
30460x00000006,0x0000260f,0x00002460,0x00000145,
30470x000200f9,0x00002613,0x000200f8,0x00002610,
30480x000400c8,0x00000006,0x00002612,0x00002460,
30490x000200f9,0x00002613,0x000200f8,0x00002613,
30500x000700f5,0x00000006,0x000031db,0x0000260f,
30510x0000260d,0x00002612,0x00002610,0x0004007c,
30520x00000027,0x00002615,0x000031db,0x00060041,
30530x000000db,0x00002463,0x000025c9,0x000000da,
30540x00000215,0x0006003d,0x00000006,0x00002464,
30550x00002463,0x00000002,0x00000004,0x000500c7,
30560x00000006,0x0000261a,0x00002464,0x00000130,
30570x000500ab,0x0000002f,0x0000261b,0x0000261a,
30580x000000a6,0x000300f7,0x00002622,0x00000000,
30590x000400fa,0x0000261b,0x0000261c,0x0000261f,
30600x000200f8,0x0000261c,0x000500c7,0x00000006,
30610x0000261e,0x00002464,0x00000145,0x000200f9,
30620x00002622,0x000200f8,0x0000261f,0x000400c8,
30630x00000006,0x00002621,0x00002464,0x000200f9,
30640x00002622,0x000200f8,0x00002622,0x000700f5,
30650x00000006,0x000031dc,0x0000261e,0x0000261c,
30660x00002621,0x0000261f,0x0004007c,0x00000027,
30670x00002624,0x000031dc,0x00060041,0x000000db,
30680x00002467,0x000025c9,0x000000da,0x0000021d,
30690x0006003d,0x00000006,0x00002468,0x00002467,
30370x00000002,0x00000004,0x000500c7,0x00000006, 30700x00000002,0x00000004,0x000500c7,0x00000006,
30380x00002616,0x0000246b,0x00000130,0x000500ab, 30710x00002629,0x00002468,0x00000130,0x000500ab,
30390x0000002f,0x00002617,0x00002616,0x000000a6, 30720x0000002f,0x0000262a,0x00002629,0x000000a6,
30400x000300f7,0x0000261e,0x00000000,0x000400fa, 30730x000300f7,0x00002631,0x00000000,0x000400fa,
30410x00002617,0x00002618,0x0000261b,0x000200f8, 30740x0000262a,0x0000262b,0x0000262e,0x000200f8,
30420x00002618,0x000500c7,0x00000006,0x0000261a, 30750x0000262b,0x000500c7,0x00000006,0x0000262d,
30430x0000246b,0x00000145,0x000200f9,0x0000261e, 30760x00002468,0x00000145,0x000200f9,0x00002631,
30440x000200f8,0x0000261b,0x000400c8,0x00000006, 30770x000200f8,0x0000262e,0x000400c8,0x00000006,
30450x0000261d,0x0000246b,0x000200f9,0x0000261e, 30780x00002630,0x00002468,0x000200f9,0x00002631,
30460x000200f8,0x0000261e,0x000700f5,0x00000006, 30790x000200f8,0x00002631,0x000700f5,0x00000006,
30470x000031ea,0x0000261a,0x00002618,0x0000261d, 30800x000031dd,0x0000262d,0x0000262b,0x00002630,
30480x0000261b,0x0004007c,0x00000027,0x00002620, 30810x0000262e,0x0004007c,0x00000027,0x00002633,
30490x000031ea,0x00060041,0x000000db,0x0000246e, 30820x000031dd,0x00060050,0x0000004b,0x0000246a,
30500x000025d4,0x000000da,0x00000215,0x0006003d, 30830x00002615,0x00002624,0x00002633,0x00050083,
30510x00000006,0x0000246f,0x0000246e,0x00000002, 30840x0000004b,0x0000246d,0x0000246a,0x0000245d,
30520x00000004,0x000500c7,0x00000006,0x00002625, 30850x0007000c,0x0000004b,0x0000246e,0x00000001,
30530x0000246f,0x00000130,0x000500ab,0x0000002f, 30860x00000028,0x0000246d,0x00000656,0x00050081,
30540x00002626,0x00002625,0x000000a6,0x000300f7, 30870x0000004b,0x00002471,0x000024bd,0x000024d0,
30550x0000262d,0x00000000,0x000400fa,0x00002626, 30880x0005008e,0x0000004b,0x00002472,0x00002471,
30560x00002627,0x0000262a,0x000200f8,0x00002627, 30890x000001ed,0x00050083,0x0000004b,0x00002474,
30570x000500c7,0x00000006,0x00002629,0x0000246f, 30900x00002472,0x0000245d,0x00050088,0x0000004b,
30580x00000145,0x000200f9,0x0000262d,0x000200f8, 30910x00002476,0x00002474,0x0000246e,0x0008000c,
30590x0000262a,0x000400c8,0x00000006,0x0000262c, 30920x0000004b,0x00002479,0x00000001,0x0000002b,
30600x0000246f,0x000200f9,0x0000262d,0x000200f8, 30930x00002476,0x0000056d,0x00003295,0x0005008e,
30610x0000262d,0x000700f5,0x00000006,0x000031eb, 30940x0000004b,0x0000247a,0x00002479,0x00000666,
30620x00002629,0x00002627,0x0000262c,0x0000262a, 30950x0004006d,0x00000658,0x0000247b,0x0000247a,
30630x0004007c,0x00000027,0x0000262f,0x000031eb, 30960x00050051,0x00000006,0x0000247d,0x0000247b,
30640x00060041,0x000000db,0x00002472,0x000025d4, 30970x00000000,0x000500c7,0x00000006,0x00002637,
30650x000000da,0x0000021d,0x0006003d,0x00000006, 30980x0000247d,0x000005f9,0x000500c4,0x00000006,
30660x00002473,0x00002472,0x00000002,0x00000004, 30990x0000263a,0x00002637,0x0000023e,0x000500c5,
30670x000500c7,0x00000006,0x00002634,0x00002473, 31000x00000006,0x0000263b,0x00002637,0x0000263a,
30680x00000130,0x000500ab,0x0000002f,0x00002635, 31010x000500c7,0x00000006,0x0000263c,0x0000263b,
30690x00002634,0x000000a6,0x000300f7,0x0000263c, 31020x00000600,0x000500c4,0x00000006,0x0000263f,
30700x00000000,0x000400fa,0x00002635,0x00002636, 31030x0000263c,0x00000308,0x000500c5,0x00000006,
30710x00002639,0x000200f8,0x00002636,0x000500c7, 31040x00002640,0x0000263c,0x0000263f,0x000500c7,
30720x00000006,0x00002638,0x00002473,0x00000145, 31050x00000006,0x00002641,0x00002640,0x00000606,
30730x000200f9,0x0000263c,0x000200f8,0x00002639, 31060x000500c4,0x00000006,0x00002644,0x00002641,
30740x000400c8,0x00000006,0x0000263b,0x00002473, 31070x00000215,0x000500c5,0x00000006,0x00002645,
30750x000200f9,0x0000263c,0x000200f8,0x0000263c, 31080x00002641,0x00002644,0x000500c7,0x00000006,
30760x000700f5,0x00000006,0x000031ec,0x00002638, 31090x00002646,0x00002645,0x0000060c,0x000500c4,
30770x00002636,0x0000263b,0x00002639,0x0004007c, 31100x00000006,0x00002649,0x00002646,0x00000205,
30780x00000027,0x0000263e,0x000031ec,0x00060050, 31110x000500c5,0x00000006,0x0000264a,0x00002646,
30790x0000004b,0x00002475,0x00002620,0x0000262f, 31120x00002649,0x000500c7,0x00000006,0x0000264b,
30800x0000263e,0x00050083,0x0000004b,0x00002478, 31130x0000264a,0x00000612,0x000500c4,0x00000006,
30810x00002475,0x00002468,0x0007000c,0x0000004b, 31140x0000247f,0x0000264b,0x00000205,0x00050051,
30820x00002479,0x00000001,0x00000028,0x00002478, 31150x00000006,0x00002481,0x0000247b,0x00000001,
30830x0000065b,0x00050081,0x0000004b,0x0000247c, 31160x000500c7,0x00000006,0x00002650,0x00002481,
30840x000024c8,0x000024db,0x0005008e,0x0000004b, 31170x000005f9,0x000500c4,0x00000006,0x00002653,
30850x0000247d,0x0000247c,0x000001ed,0x00050083, 31180x00002650,0x0000023e,0x000500c5,0x00000006,
30860x0000004b,0x0000247f,0x0000247d,0x00002468, 31190x00002654,0x00002650,0x00002653,0x000500c7,
30870x00050088,0x0000004b,0x00002481,0x0000247f, 31200x00000006,0x00002655,0x00002654,0x00000600,
30880x00002479,0x0008000c,0x0000004b,0x00002484, 31210x000500c4,0x00000006,0x00002658,0x00002655,
30890x00000001,0x0000002b,0x00002481,0x00000570, 31220x00000308,0x000500c5,0x00000006,0x00002659,
30900x000032a2,0x0005008e,0x0000004b,0x00002485, 31230x00002655,0x00002658,0x000500c7,0x00000006,
30910x00002484,0x0000066b,0x0004006d,0x0000065d, 31240x0000265a,0x00002659,0x00000606,0x000500c4,
30920x00002486,0x00002485,0x00050051,0x00000006, 31250x00000006,0x0000265d,0x0000265a,0x00000215,
30930x00002488,0x00002486,0x00000000,0x000500c7, 31260x000500c5,0x00000006,0x0000265e,0x0000265a,
30940x00000006,0x00002642,0x00002488,0x000005fe, 31270x0000265d,0x000500c7,0x00000006,0x0000265f,
30950x000500c4,0x00000006,0x00002645,0x00002642, 31280x0000265e,0x0000060c,0x000500c4,0x00000006,
30960x0000023e,0x000500c5,0x00000006,0x00002646, 31290x00002662,0x0000265f,0x00000205,0x000500c5,
30970x00002642,0x00002645,0x000500c7,0x00000006, 31300x00000006,0x00002663,0x0000265f,0x00002662,
30980x00002647,0x00002646,0x00000605,0x000500c4, 31310x000500c7,0x00000006,0x00002664,0x00002663,
30990x00000006,0x0000264a,0x00002647,0x00000308, 31320x00000612,0x000500c4,0x00000006,0x00002483,
31000x000500c5,0x00000006,0x0000264b,0x00002647, 31330x00002664,0x00000154,0x000500c5,0x00000006,
31010x0000264a,0x000500c7,0x00000006,0x0000264c, 31340x00002484,0x0000247f,0x00002483,0x00050051,
31020x0000264b,0x0000060b,0x000500c4,0x00000006, 31350x00000006,0x00002486,0x0000247b,0x00000002,
31030x0000264f,0x0000264c,0x00000215,0x000500c5, 31360x000500c7,0x00000006,0x00002669,0x00002486,
31040x00000006,0x00002650,0x0000264c,0x0000264f, 31370x000005f9,0x000500c4,0x00000006,0x0000266c,
31050x000500c7,0x00000006,0x00002651,0x00002650, 31380x00002669,0x0000023e,0x000500c5,0x00000006,
31060x00000611,0x000500c4,0x00000006,0x00002654, 31390x0000266d,0x00002669,0x0000266c,0x000500c7,
31070x00002651,0x00000205,0x000500c5,0x00000006, 31400x00000006,0x0000266e,0x0000266d,0x00000600,
31080x00002655,0x00002651,0x00002654,0x000500c7, 31410x000500c4,0x00000006,0x00002671,0x0000266e,
31090x00000006,0x00002656,0x00002655,0x00000617, 31420x00000308,0x000500c5,0x00000006,0x00002672,
31100x000500c4,0x00000006,0x0000248a,0x00002656, 31430x0000266e,0x00002671,0x000500c7,0x00000006,
31110x00000205,0x00050051,0x00000006,0x0000248c, 31440x00002673,0x00002672,0x00000606,0x000500c4,
31120x00002486,0x00000001,0x000500c7,0x00000006, 31450x00000006,0x00002676,0x00002673,0x00000215,
31130x0000265b,0x0000248c,0x000005fe,0x000500c4, 31460x000500c5,0x00000006,0x00002677,0x00002673,
31140x00000006,0x0000265e,0x0000265b,0x0000023e, 31470x00002676,0x000500c7,0x00000006,0x00002678,
31150x000500c5,0x00000006,0x0000265f,0x0000265b, 31480x00002677,0x0000060c,0x000500c4,0x00000006,
31160x0000265e,0x000500c7,0x00000006,0x00002660, 31490x0000267b,0x00002678,0x00000205,0x000500c5,
31170x0000265f,0x00000605,0x000500c4,0x00000006, 31500x00000006,0x0000267c,0x00002678,0x0000267b,
31180x00002663,0x00002660,0x00000308,0x000500c5, 31510x000500c7,0x00000006,0x0000267d,0x0000267c,
31190x00000006,0x00002664,0x00002660,0x00002663, 31520x00000612,0x000500c5,0x00000006,0x00002488,
31200x000500c7,0x00000006,0x00002665,0x00002664, 31530x00002484,0x0000267d,0x000200f9,0x00002489,
31210x0000060b,0x000500c4,0x00000006,0x00002668, 31540x000200f8,0x00002489,0x000700f5,0x00000006,
31220x00002665,0x00000215,0x000500c5,0x00000006, 31550x000031de,0x0000052e,0x000025bf,0x00002488,
31230x00002669,0x00002665,0x00002668,0x000500c7, 31560x00002631,0x00050084,0x00000006,0x0000248c,
31240x00000006,0x0000266a,0x00002669,0x00000611, 31570x0000010a,0x00000b09,0x00050080,0x00000006,
31250x000500c4,0x00000006,0x0000266d,0x0000266a, 31580x0000248d,0x00000107,0x0000248c,0x00050095,
31260x00000205,0x000500c5,0x00000006,0x0000266e, 31590x000000ab,0x00002698,0x000024fa,0x0000248d,
31270x0000266a,0x0000266d,0x000500c7,0x00000006, 31600x00050051,0x00000006,0x00002699,0x00002698,
31280x0000266f,0x0000266e,0x00000617,0x000500c4, 31610x00000001,0x00050051,0x00000006,0x0000269a,
31290x00000006,0x0000248e,0x0000266f,0x00000154, 31620x00002698,0x00000000,0x00050080,0x00000006,
31300x000500c5,0x00000006,0x0000248f,0x0000248a, 31630x0000269f,0x00002501,0x00002699,0x00050050,
31310x0000248e,0x00050051,0x00000006,0x00002491, 31640x00000007,0x000026a0,0x0000269a,0x0000269f,
31320x00002486,0x00000002,0x000500c7,0x00000006, 31650x0004007c,0x00000014,0x00002690,0x000026a0,
31330x00002674,0x00002491,0x000005fe,0x000500c4, 31660x00060041,0x000000db,0x00002688,0x00002690,
31340x00000006,0x00002677,0x00002674,0x0000023e, 31670x000000da,0x000000da,0x0005003e,0x00002688,
31350x000500c5,0x00000006,0x00002678,0x00002674, 31680x000031de,0x00000002,0x00000004,0x00050084,
31360x00002677,0x000500c7,0x00000006,0x00002679, 31690x00000006,0x000026a5,0x0000010a,0x000024da,
31370x00002678,0x00000605,0x000500c4,0x00000006, 31700x00050080,0x00000006,0x000026a6,0x00000107,
31380x0000267c,0x00002679,0x00000308,0x000500c5, 31710x000026a5,0x00050080,0x00000006,0x00002495,
31390x00000006,0x0000267d,0x00002679,0x0000267c, 31720x000026a6,0x0000248c,0x00050095,0x000000ab,
31400x000500c7,0x00000006,0x0000267e,0x0000267d, 31730x000026be,0x000024fa,0x00002495,0x00050051,
31410x0000060b,0x000500c4,0x00000006,0x00002681, 31740x00000006,0x000026bf,0x000026be,0x00000001,
31420x0000267e,0x00000215,0x000500c5,0x00000006, 31750x00050051,0x00000006,0x000026c0,0x000026be,
31430x00002682,0x0000267e,0x00002681,0x000500c7, 31760x00000000,0x00050080,0x00000006,0x000026c5,
31440x00000006,0x00002683,0x00002682,0x00000611, 31770x00002501,0x000026bf,0x00050050,0x00000007,
31450x000500c4,0x00000006,0x00002686,0x00002683, 31780x000026c6,0x000026c0,0x000026c5,0x0004007c,
31460x00000205,0x000500c5,0x00000006,0x00002687, 31790x00000014,0x000026b6,0x000026c6,0x00060041,
31470x00002683,0x00002686,0x000500c7,0x00000006, 31800x000000db,0x000026ae,0x000026b6,0x000000da,
31480x00002688,0x00002687,0x00000617,0x000500c5, 31810x000000da,0x0005003e,0x000026ae,0x00000b09,
31490x00000006,0x00002493,0x0000248f,0x00002688, 31820x00000002,0x00000004,0x000200f9,0x00000bde,
31500x000200f9,0x00002494,0x000200f8,0x00002494, 31830x000200f8,0x00000be2,0x000500aa,0x0000002f,
31510x000700f5,0x00000006,0x000031ed,0x00000531, 31840x00000be5,0x00000b0b,0x00000246,0x000300f7,
31520x000025ca,0x00002493,0x0000263c,0x00050084, 31850x00000be7,0x00000000,0x000400fa,0x00000be5,
31530x00000006,0x00002497,0x0000010a,0x00000b11, 31860x00000be6,0x00000be7,0x000200f8,0x00000be6,
31540x00050080,0x00000006,0x00002498,0x00000107, 31870x00050041,0x000000fe,0x00002715,0x000000fc,
31550x00002497,0x00050095,0x000000ab,0x000026a3, 31880x00000308,0x0004003d,0x00000006,0x00002716,
31560x00002505,0x00002498,0x00050051,0x00000006, 31890x00002715,0x00050080,0x00000006,0x00002718,
31570x000026a4,0x000026a3,0x00000001,0x00050051, 31900x00002716,0x00000b09,0x00050041,0x000000fe,
31580x00000006,0x000026a5,0x000026a3,0x00000000, 31910x0000281a,0x000000fc,0x0000023e,0x0004003d,
31590x00050080,0x00000006,0x000026aa,0x0000250c, 31920x00000006,0x0000281b,0x0000281a,0x00050084,
31600x000026a4,0x00050050,0x00000007,0x000026ab, 31930x00000006,0x0000281d,0x00002718,0x00000228,
31610x000026a5,0x000026aa,0x0004007c,0x00000014, 31940x00050080,0x00000006,0x0000281e,0x0000281b,
31620x0000269b,0x000026ab,0x00060041,0x000000db, 31950x0000281d,0x000500c2,0x00000006,0x0000281f,
31630x00002693,0x0000269b,0x000000da,0x000000da, 31960x0000281e,0x00000233,0x000500c4,0x00000006,
31640x0005003e,0x00002693,0x000031ed,0x00000002, 31970x00002820,0x0000281f,0x0000020d,0x000500c5,
31650x00000004,0x00050084,0x00000006,0x000026b0, 31980x00000006,0x00002821,0x00002820,0x00000246,
31660x0000010a,0x000024e5,0x00050080,0x00000006, 31990x000200f9,0x00002722,0x000200f8,0x00002722,
31670x000026b1,0x00000107,0x000026b0,0x00050080, 32000x000700f5,0x0000004b,0x00003193,0x00003294,
31680x00000006,0x000024a0,0x000026b1,0x00002497, 32010x00000be6,0x0000327c,0x000027fc,0x000700f5,
31690x00050095,0x000000ab,0x000026c9,0x00002505, 32020x0000004b,0x00003191,0x000003be,0x00000be6,
31700x000024a0,0x00050051,0x00000006,0x000026ca, 32030x00003277,0x000027fc,0x000700f5,0x00000006,
31710x000026c9,0x00000001,0x00050051,0x00000006, 32040x0000318e,0x000000a6,0x00000be6,0x000027fe,
31720x000026cb,0x000026c9,0x00000000,0x00050080, 32050x000027fc,0x000500b0,0x0000002f,0x00002725,
31730x00000006,0x000026d0,0x0000250c,0x000026ca, 32060x0000318e,0x0000010a,0x000400f6,0x000027ff,
31740x00050050,0x00000007,0x000026d1,0x000026cb, 32070x000027fc,0x00000000,0x000400fa,0x00002725,
31750x000026d0,0x0004007c,0x00000014,0x000026c1, 32080x00002726,0x000027ff,0x000200f8,0x00002726,
31760x000026d1,0x00060041,0x000000db,0x000026b9, 32090x00050084,0x00000006,0x00002728,0x0000010a,
31770x000026c1,0x000000da,0x000000da,0x0005003e, 32100x00000b09,0x00050080,0x00000006,0x0000272a,
31780x000026b9,0x00000b11,0x00000002,0x00000004, 32110x00002728,0x0000318e,0x00050041,0x000000fe,
31790x000200f9,0x00000be4,0x000200f8,0x00000be8, 32120x0000272d,0x000000fc,0x0000027b,0x0004003d,
31800x000500aa,0x0000002f,0x00000beb,0x00000b13, 32130x00000006,0x0000272e,0x0000272d,0x000500aa,
31810x00000246,0x000300f7,0x00000bed,0x00000000, 32140x0000002f,0x0000272f,0x0000272e,0x000000b0,
31820x000400fa,0x00000beb,0x00000bec,0x00000bed, 32150x000300f7,0x000027c5,0x00000000,0x000400fa,
31830x000200f8,0x00000bec,0x00050041,0x000000fe, 32160x0000272f,0x00002730,0x00002775,0x000200f8,
31840x00002720,0x000000fc,0x00000308,0x0004003d, 32170x00002730,0x00050084,0x00000006,0x00002733,
31850x00000006,0x00002721,0x00002720,0x00050080, 32180x0000010a,0x0000318e,0x00050080,0x00000006,
31860x00000006,0x00002723,0x00002721,0x00000b11, 32190x00002734,0x0000281e,0x00002733,0x00050041,
31870x00050041,0x000000fe,0x00002829,0x000000fc, 32200x00000156,0x00002735,0x000000fc,0x000000da,
31880x0000023e,0x0004003d,0x00000006,0x0000282a, 32210x0004003d,0x00000007,0x00002736,0x00002735,
31890x00002829,0x00050084,0x00000006,0x0000282c, 32220x00050051,0x00000006,0x00002838,0x00002736,
31900x00002723,0x00000228,0x00050080,0x00000006, 32230x00000000,0x00050095,0x000000ab,0x0000283a,
31910x0000282d,0x0000282a,0x0000282c,0x000500c2, 32240x00002838,0x00002734,0x00050051,0x00000006,
31920x00000006,0x0000282e,0x0000282d,0x00000233, 32250x0000283b,0x0000283a,0x00000001,0x00050051,
31930x000500c4,0x00000006,0x0000282f,0x0000282e, 32260x00000006,0x0000283c,0x0000283a,0x00000000,
31940x0000020d,0x000500c5,0x00000006,0x00002830, 32270x00050051,0x00000006,0x0000283f,0x00002736,
31950x0000282f,0x00000246,0x000200f9,0x0000272f, 32280x00000001,0x00050080,0x00000006,0x00002841,
31960x000200f8,0x0000272f,0x000700f5,0x0000004b, 32290x0000283f,0x0000283b,0x00050050,0x00000007,
31970x000031a2,0x000032a7,0x00000bec,0x0000328b, 32300x00002842,0x0000283c,0x00002841,0x0004007c,
31980x0000280b,0x000700f5,0x0000004b,0x000031a0, 32310x00000014,0x00002832,0x00002842,0x00060041,
31990x000032a5,0x00000bec,0x00003286,0x0000280b, 32320x000000db,0x00002829,0x00002832,0x000000da,
32000x000700f5,0x00000006,0x0000319d,0x000000a6, 32330x000000da,0x0006003d,0x00000006,0x0000282a,
32010x00000bec,0x0000280d,0x0000280b,0x000500b0, 32340x00002829,0x00000002,0x00000004,0x000500ab,
32020x0000002f,0x00002732,0x0000319d,0x0000010a, 32350x0000002f,0x00002739,0x0000282a,0x00000380,
32030x000400f6,0x0000280e,0x0000280b,0x00000000, 32360x000300f7,0x00002774,0x00000000,0x000400fa,
32040x000400fa,0x00002732,0x00002733,0x0000280e, 32370x00002739,0x0000273a,0x00002774,0x000200f8,
32050x000200f8,0x00002733,0x00050084,0x00000006, 32380x0000273a,0x000500c2,0x00000006,0x00002846,
32060x00002735,0x0000010a,0x00000b11,0x00050080, 32390x0000282a,0x0000020d,0x00050084,0x00000006,
32070x00000006,0x00002737,0x00002735,0x0000319d, 32400x0000273d,0x00002846,0x00000107,0x000500c7,
32080x00050041,0x000000fe,0x0000273c,0x000000fc, 32410x00000006,0x0000273f,0x0000282a,0x0000095e,
32090x0000027b,0x0004003d,0x00000006,0x0000273d, 32420x000500aa,0x0000002f,0x00002740,0x0000273f,
32100x0000273c,0x000500aa,0x0000002f,0x0000273e, 32430x00000246,0x000300f7,0x00002767,0x00000000,
32110x0000273d,0x000000b0,0x000300f7,0x000027d4, 32440x000400fa,0x00002740,0x00002741,0x0000274d,
32120x00000000,0x000400fa,0x0000273e,0x0000273f, 32450x000200f8,0x00002741,0x00050041,0x000000fe,
32130x00002784,0x000200f8,0x0000273f,0x00050084, 32460x00002742,0x000000fc,0x00000963,0x0004003d,
32140x00000006,0x00002742,0x0000010a,0x0000319d, 32470x00000006,0x00002743,0x00002742,0x00050082,
32150x00050080,0x00000006,0x00002743,0x0000282d, 32480x00000006,0x00002747,0x0000273d,0x0000281b,
32160x00002742,0x00050041,0x00000156,0x00002744, 32490x00050086,0x00000006,0x00002748,0x00002747,
32170x000000fc,0x000000da,0x0004003d,0x00000007, 32500x00000228,0x00050080,0x00000006,0x00002749,
32180x00002745,0x00002744,0x00050051,0x00000006, 32510x00002743,0x00002748,0x00050041,0x000000fe,
32190x00002847,0x00002745,0x00000000,0x00050095, 32520x00002886,0x000000fc,0x000000fd,0x0004003d,
32200x000000ab,0x00002849,0x00002847,0x00002743, 32530x00000006,0x00002887,0x00002886,0x00050084,
32210x00050051,0x00000006,0x0000284a,0x00002849, 32540x00000006,0x00002888,0x0000011f,0x00002887,
32220x00000001,0x00050051,0x00000006,0x0000284b, 32550x00050080,0x00000006,0x00002889,0x00000107,
32230x00002849,0x00000000,0x00050051,0x00000006, 32560x00002888,0x00050080,0x00000006,0x0000288f,
32240x0000284e,0x00002745,0x00000001,0x00050080, 32570x00002887,0x00003297,0x00050086,0x00000006,
32250x00000006,0x00002850,0x0000284e,0x0000284a, 32580x00002890,0x0000288f,0x00000101,0x00050084,
32260x00050050,0x00000007,0x00002851,0x0000284b, 32590x00000006,0x00002882,0x00000107,0x00002890,
32270x00002850,0x0004007c,0x00000014,0x00002841, 32600x00050080,0x00000006,0x00002883,0x00002889,
32280x00002851,0x00060041,0x000000db,0x00002838, 32610x00002882,0x00050084,0x00000006,0x00002857,
32290x00002841,0x000000da,0x000000da,0x0006003d, 32620x00000150,0x00002749,0x00050080,0x00000006,
32300x00000006,0x00002839,0x00002838,0x00000002, 32630x00002858,0x00002883,0x00002857,0x00050041,
32310x00000004,0x000500ab,0x0000002f,0x00002748, 32640x00000156,0x00002859,0x000000fc,0x00000154,
32320x00002839,0x00000380,0x000300f7,0x00002783, 32650x0004003d,0x00000007,0x0000285a,0x00002859,
32330x00000000,0x000400fa,0x00002748,0x00002749, 32660x00050051,0x00000006,0x000028a7,0x0000285a,
32340x00002783,0x000200f8,0x00002749,0x000500c2, 32670x00000000,0x00050095,0x000000ab,0x000028a9,
32350x00000006,0x00002855,0x00002839,0x0000020d, 32680x000028a7,0x00002858,0x00050051,0x00000006,
32360x00050084,0x00000006,0x0000274c,0x00002855, 32690x000028aa,0x000028a9,0x00000001,0x00050051,
32370x00000107,0x000500c7,0x00000006,0x0000274e, 32700x00000006,0x000028ab,0x000028a9,0x00000000,
32380x00002839,0x00000967,0x000500aa,0x0000002f, 32710x00050051,0x00000006,0x000028ae,0x0000285a,
32390x0000274f,0x0000274e,0x00000246,0x000300f7, 32720x00000001,0x00050080,0x00000006,0x000028b0,
32400x00002776,0x00000000,0x000400fa,0x0000274f, 32730x000028ae,0x000028aa,0x00050050,0x00000007,
32410x00002750,0x0000275c,0x000200f8,0x00002750, 32740x000028b1,0x000028ab,0x000028b0,0x0004007c,
32420x00050041,0x000000fe,0x00002751,0x000000fc, 32750x00000014,0x000028a1,0x000028b1,0x00060041,
32430x0000096c,0x0004003d,0x00000006,0x00002752, 32760x000000db,0x00002898,0x000028a1,0x000000da,
32440x00002751,0x00050082,0x00000006,0x00002756, 32770x000000da,0x0006003d,0x00000006,0x00002899,
32450x0000274c,0x0000282a,0x00050086,0x00000006, 32780x00002898,0x00000002,0x00000004,0x0004007c,
32460x00002757,0x00002756,0x00000228,0x00050080, 32790x00000027,0x0000285d,0x00002899,0x00050080,
32470x00000006,0x00002758,0x00002752,0x00002757, 32800x00000006,0x0000285f,0x00002858,0x0000010a,
32480x00050041,0x000000fe,0x00002895,0x000000fc, 32810x00050095,0x000000ab,0x000028ca,0x000028a7,
32490x000000fd,0x0004003d,0x00000006,0x00002896, 32820x0000285f,0x00050051,0x00000006,0x000028cb,
32500x00002895,0x00050084,0x00000006,0x00002897, 32830x000028ca,0x00000001,0x00050051,0x00000006,
32510x0000011f,0x00002896,0x00050080,0x00000006, 32840x000028cc,0x000028ca,0x00000000,0x00050080,
32520x00002898,0x00000107,0x00002897,0x00050080, 32850x00000006,0x000028d1,0x000028ae,0x000028cb,
32530x00000006,0x0000289e,0x00002896,0x000032a8, 32860x00050050,0x00000007,0x000028d2,0x000028cc,
32540x00050086,0x00000006,0x0000289f,0x0000289e, 32870x000028d1,0x0004007c,0x00000014,0x000028c2,
32550x00000101,0x00050084,0x00000006,0x00002891, 32880x000028d2,0x00060041,0x000000db,0x000028b9,
32560x00000107,0x0000289f,0x00050080,0x00000006, 32890x000028c2,0x000000da,0x000000da,0x0006003d,
32570x00002892,0x00002898,0x00002891,0x00050084, 32900x00000006,0x000028ba,0x000028b9,0x00000002,
32580x00000006,0x00002866,0x00000150,0x00002758, 32910x00000004,0x0004007c,0x00000027,0x00002863,
32590x00050080,0x00000006,0x00002867,0x00002892, 32920x000028ba,0x00050080,0x00000006,0x00002865,
32600x00002866,0x00050041,0x00000156,0x00002868, 32930x00002858,0x00000111,0x00050095,0x000000ab,
32940x000028eb,0x000028a7,0x00002865,0x00050051,
32950x00000006,0x000028ec,0x000028eb,0x00000001,
32960x00050051,0x00000006,0x000028ed,0x000028eb,
32970x00000000,0x00050080,0x00000006,0x000028f2,
32980x000028ae,0x000028ec,0x00050050,0x00000007,
32990x000028f3,0x000028ed,0x000028f2,0x0004007c,
33000x00000014,0x000028e3,0x000028f3,0x00060041,
33010x000000db,0x000028da,0x000028e3,0x000000da,
33020x000000da,0x0006003d,0x00000006,0x000028db,
33030x000028da,0x00000002,0x00000004,0x0004007c,
33040x00000027,0x00002869,0x000028db,0x00060050,
33050x0000004b,0x0000286a,0x0000285d,0x00002863,
33060x00002869,0x00050080,0x00000006,0x0000286c,
33070x00002858,0x00000118,0x00050095,0x000000ab,
33080x0000290c,0x000028a7,0x0000286c,0x00050051,
33090x00000006,0x0000290d,0x0000290c,0x00000001,
33100x00050051,0x00000006,0x0000290e,0x0000290c,
33110x00000000,0x00050080,0x00000006,0x00002913,
33120x000028ae,0x0000290d,0x00050050,0x00000007,
33130x00002914,0x0000290e,0x00002913,0x0004007c,
33140x00000014,0x00002904,0x00002914,0x00060041,
33150x000000db,0x000028fb,0x00002904,0x000000da,
33160x000000da,0x0006003d,0x00000006,0x000028fc,
33170x000028fb,0x00000002,0x00000004,0x0004007c,
33180x00000027,0x00002870,0x000028fc,0x00050080,
33190x00000006,0x00002872,0x00002858,0x0000011f,
33200x00050095,0x000000ab,0x0000292d,0x000028a7,
33210x00002872,0x00050051,0x00000006,0x0000292e,
33220x0000292d,0x00000001,0x00050051,0x00000006,
33230x0000292f,0x0000292d,0x00000000,0x00050080,
33240x00000006,0x00002934,0x000028ae,0x0000292e,
33250x00050050,0x00000007,0x00002935,0x0000292f,
33260x00002934,0x0004007c,0x00000014,0x00002925,
33270x00002935,0x00060041,0x000000db,0x0000291c,
33280x00002925,0x000000da,0x000000da,0x0006003d,
33290x00000006,0x0000291d,0x0000291c,0x00000002,
33300x00000004,0x0004007c,0x00000027,0x00002876,
33310x0000291d,0x00050080,0x00000006,0x00002878,
33320x00002858,0x00000189,0x00050095,0x000000ab,
33330x0000294e,0x000028a7,0x00002878,0x00050051,
33340x00000006,0x0000294f,0x0000294e,0x00000001,
33350x00050051,0x00000006,0x00002950,0x0000294e,
33360x00000000,0x00050080,0x00000006,0x00002955,
33370x000028ae,0x0000294f,0x00050050,0x00000007,
33380x00002956,0x00002950,0x00002955,0x0004007c,
33390x00000014,0x00002946,0x00002956,0x00060041,
33400x000000db,0x0000293d,0x00002946,0x000000da,
33410x000000da,0x0006003d,0x00000006,0x0000293e,
33420x0000293d,0x00000002,0x00000004,0x0004007c,
33430x00000027,0x0000287c,0x0000293e,0x00060050,
33440x0000004b,0x0000287d,0x00002870,0x00002876,
33450x0000287c,0x000200f9,0x00002767,0x000200f8,
33460x0000274d,0x00050041,0x000000fe,0x0000274f,
33470x000000fc,0x0000022c,0x0004003d,0x00000006,
33480x00002750,0x0000274f,0x00050082,0x00000006,
33490x00002751,0x0000273d,0x00002750,0x00050041,
33500x000000fe,0x00002959,0x000000fc,0x00000224,
33510x0004003d,0x00000006,0x0000295a,0x00002959,
33520x000500ab,0x0000002f,0x0000295b,0x0000295a,
33530x000000a6,0x000600a9,0x00000006,0x0000295c,
33540x0000295b,0x00000228,0x00000107,0x00050086,
33550x00000006,0x00002753,0x00002751,0x0000295c,
33560x00050041,0x000000fe,0x0000299c,0x000000fc,
33570x000000fd,0x0004003d,0x00000006,0x0000299d,
33580x0000299c,0x00050084,0x00000006,0x0000299e,
33590x0000011f,0x0000299d,0x00050080,0x00000006,
33600x0000299f,0x00000107,0x0000299e,0x00050080,
33610x00000006,0x000029a5,0x0000299d,0x00003297,
33620x00050086,0x00000006,0x000029a6,0x000029a5,
33630x00000101,0x00050084,0x00000006,0x00002998,
33640x00000107,0x000029a6,0x00050080,0x00000006,
33650x00002999,0x0000299f,0x00002998,0x00050084,
33660x00000006,0x0000296d,0x00000150,0x00002753,
33670x00050080,0x00000006,0x0000296e,0x00002999,
33680x0000296d,0x00050041,0x00000156,0x0000296f,
32610x000000fc,0x00000154,0x0004003d,0x00000007, 33690x000000fc,0x00000154,0x0004003d,0x00000007,
32620x00002869,0x00002868,0x00050051,0x00000006, 33700x00002970,0x0000296f,0x00050051,0x00000006,
32630x000028b6,0x00002869,0x00000000,0x00050095, 33710x000029bd,0x00002970,0x00000000,0x00050095,
32640x000000ab,0x000028b8,0x000028b6,0x00002867, 33720x000000ab,0x000029bf,0x000029bd,0x0000296e,
32650x00050051,0x00000006,0x000028b9,0x000028b8, 33730x00050051,0x00000006,0x000029c0,0x000029bf,
32660x00000001,0x00050051,0x00000006,0x000028ba, 33740x00000001,0x00050051,0x00000006,0x000029c1,
32670x000028b8,0x00000000,0x00050051,0x00000006, 33750x000029bf,0x00000000,0x00050051,0x00000006,
32680x000028bd,0x00002869,0x00000001,0x00050080, 33760x000029c4,0x00002970,0x00000001,0x00050080,
32690x00000006,0x000028bf,0x000028bd,0x000028b9, 33770x00000006,0x000029c6,0x000029c4,0x000029c0,
32700x00050050,0x00000007,0x000028c0,0x000028ba, 33780x00050050,0x00000007,0x000029c7,0x000029c1,
32710x000028bf,0x0004007c,0x00000014,0x000028b0, 33790x000029c6,0x0004007c,0x00000014,0x000029b7,
32720x000028c0,0x00060041,0x000000db,0x000028a7, 33800x000029c7,0x00060041,0x000000db,0x000029ae,
32730x000028b0,0x000000da,0x000000da,0x0006003d, 33810x000029b7,0x000000da,0x000000da,0x0006003d,
32740x00000006,0x000028a8,0x000028a7,0x00000002, 33820x00000006,0x000029af,0x000029ae,0x00000002,
32750x00000004,0x0004007c,0x00000027,0x0000286c, 33830x00000004,0x0004007c,0x00000027,0x00002973,
32760x000028a8,0x00050080,0x00000006,0x0000286e, 33840x000029af,0x00050080,0x00000006,0x00002975,
32770x00002867,0x0000010a,0x00050095,0x000000ab, 33850x0000296e,0x0000010a,0x00050095,0x000000ab,
32780x000028d9,0x000028b6,0x0000286e,0x00050051, 33860x000029e0,0x000029bd,0x00002975,0x00050051,
32790x00000006,0x000028da,0x000028d9,0x00000001, 33870x00000006,0x000029e1,0x000029e0,0x00000001,
32800x00050051,0x00000006,0x000028db,0x000028d9, 33880x00050051,0x00000006,0x000029e2,0x000029e0,
32810x00000000,0x00050080,0x00000006,0x000028e0, 33890x00000000,0x00050080,0x00000006,0x000029e7,
32820x000028bd,0x000028da,0x00050050,0x00000007, 33900x000029c4,0x000029e1,0x00050050,0x00000007,
32830x000028e1,0x000028db,0x000028e0,0x0004007c, 33910x000029e8,0x000029e2,0x000029e7,0x0004007c,
32840x00000014,0x000028d1,0x000028e1,0x00060041, 33920x00000014,0x000029d8,0x000029e8,0x00060041,
32850x000000db,0x000028c8,0x000028d1,0x000000da, 33930x000000db,0x000029cf,0x000029d8,0x000000da,
32860x000000da,0x0006003d,0x00000006,0x000028c9, 33940x000000da,0x0006003d,0x00000006,0x000029d0,
32870x000028c8,0x00000002,0x00000004,0x0004007c, 33950x000029cf,0x00000002,0x00000004,0x0004007c,
32880x00000027,0x00002872,0x000028c9,0x00050080, 33960x00000027,0x00002979,0x000029d0,0x00050080,
32890x00000006,0x00002874,0x00002867,0x00000111, 33970x00000006,0x0000297b,0x0000296e,0x00000111,
32900x00050095,0x000000ab,0x000028fa,0x000028b6, 33980x00050095,0x000000ab,0x00002a01,0x000029bd,
32910x00002874,0x00050051,0x00000006,0x000028fb, 33990x0000297b,0x00050051,0x00000006,0x00002a02,
32920x000028fa,0x00000001,0x00050051,0x00000006, 34000x00002a01,0x00000001,0x00050051,0x00000006,
32930x000028fc,0x000028fa,0x00000000,0x00050080, 34010x00002a03,0x00002a01,0x00000000,0x00050080,
32940x00000006,0x00002901,0x000028bd,0x000028fb, 34020x00000006,0x00002a08,0x000029c4,0x00002a02,
32950x00050050,0x00000007,0x00002902,0x000028fc, 34030x00050050,0x00000007,0x00002a09,0x00002a03,
32960x00002901,0x0004007c,0x00000014,0x000028f2, 34040x00002a08,0x0004007c,0x00000014,0x000029f9,
32970x00002902,0x00060041,0x000000db,0x000028e9, 34050x00002a09,0x00060041,0x000000db,0x000029f0,
32980x000028f2,0x000000da,0x000000da,0x0006003d, 34060x000029f9,0x000000da,0x000000da,0x0006003d,
32990x00000006,0x000028ea,0x000028e9,0x00000002, 34070x00000006,0x000029f1,0x000029f0,0x00000002,
33000x00000004,0x0004007c,0x00000027,0x00002878, 34080x00000004,0x0004007c,0x00000027,0x0000297f,
33010x000028ea,0x00060050,0x0000004b,0x00002879, 34090x000029f1,0x00060050,0x0000004b,0x00002980,
33020x0000286c,0x00002872,0x00002878,0x00050080, 34100x00002973,0x00002979,0x0000297f,0x00050080,
33030x00000006,0x0000287b,0x00002867,0x00000118, 34110x00000006,0x00002982,0x0000296e,0x00000118,
33040x00050095,0x000000ab,0x0000291b,0x000028b6, 34120x00050095,0x000000ab,0x00002a22,0x000029bd,
33050x0000287b,0x00050051,0x00000006,0x0000291c, 34130x00002982,0x00050051,0x00000006,0x00002a23,
33060x0000291b,0x00000001,0x00050051,0x00000006, 34140x00002a22,0x00000001,0x00050051,0x00000006,
33070x0000291d,0x0000291b,0x00000000,0x00050080, 34150x00002a24,0x00002a22,0x00000000,0x00050080,
33080x00000006,0x00002922,0x000028bd,0x0000291c, 34160x00000006,0x00002a29,0x000029c4,0x00002a23,
33090x00050050,0x00000007,0x00002923,0x0000291d, 34170x00050050,0x00000007,0x00002a2a,0x00002a24,
33100x00002922,0x0004007c,0x00000014,0x00002913, 34180x00002a29,0x0004007c,0x00000014,0x00002a1a,
33110x00002923,0x00060041,0x000000db,0x0000290a, 34190x00002a2a,0x00060041,0x000000db,0x00002a11,
33120x00002913,0x000000da,0x000000da,0x0006003d, 34200x00002a1a,0x000000da,0x000000da,0x0006003d,
33130x00000006,0x0000290b,0x0000290a,0x00000002, 34210x00000006,0x00002a12,0x00002a11,0x00000002,
33140x00000004,0x0004007c,0x00000027,0x0000287f, 34220x00000004,0x0004007c,0x00000027,0x00002986,
33150x0000290b,0x00050080,0x00000006,0x00002881, 34230x00002a12,0x00050080,0x00000006,0x00002988,
33160x00002867,0x0000011f,0x00050095,0x000000ab, 34240x0000296e,0x0000011f,0x00050095,0x000000ab,
33170x0000293c,0x000028b6,0x00002881,0x00050051, 34250x00002a43,0x000029bd,0x00002988,0x00050051,
33180x00000006,0x0000293d,0x0000293c,0x00000001, 34260x00000006,0x00002a44,0x00002a43,0x00000001,
33190x00050051,0x00000006,0x0000293e,0x0000293c, 34270x00050051,0x00000006,0x00002a45,0x00002a43,
33200x00000000,0x00050080,0x00000006,0x00002943, 34280x00000000,0x00050080,0x00000006,0x00002a4a,
33210x000028bd,0x0000293d,0x00050050,0x00000007, 34290x000029c4,0x00002a44,0x00050050,0x00000007,
33220x00002944,0x0000293e,0x00002943,0x0004007c, 34300x00002a4b,0x00002a45,0x00002a4a,0x0004007c,
33230x00000014,0x00002934,0x00002944,0x00060041, 34310x00000014,0x00002a3b,0x00002a4b,0x00060041,
33240x000000db,0x0000292b,0x00002934,0x000000da, 34320x000000db,0x00002a32,0x00002a3b,0x000000da,
33250x000000da,0x0006003d,0x00000006,0x0000292c, 34330x000000da,0x0006003d,0x00000006,0x00002a33,
33260x0000292b,0x00000002,0x00000004,0x0004007c, 34340x00002a32,0x00000002,0x00000004,0x0004007c,
33270x00000027,0x00002885,0x0000292c,0x00050080, 34350x00000027,0x0000298c,0x00002a33,0x00050080,
33280x00000006,0x00002887,0x00002867,0x00000189, 34360x00000006,0x0000298e,0x0000296e,0x00000189,
33290x00050095,0x000000ab,0x0000295d,0x000028b6, 34370x00050095,0x000000ab,0x00002a64,0x000029bd,
33300x00002887,0x00050051,0x00000006,0x0000295e, 34380x0000298e,0x00050051,0x00000006,0x00002a65,
33310x0000295d,0x00000001,0x00050051,0x00000006, 34390x00002a64,0x00000001,0x00050051,0x00000006,
33320x0000295f,0x0000295d,0x00000000,0x00050080, 34400x00002a66,0x00002a64,0x00000000,0x00050080,
33330x00000006,0x00002964,0x000028bd,0x0000295e, 34410x00000006,0x00002a6b,0x000029c4,0x00002a65,
33340x00050050,0x00000007,0x00002965,0x0000295f, 34420x00050050,0x00000007,0x00002a6c,0x00002a66,
33350x00002964,0x0004007c,0x00000014,0x00002955, 34430x00002a6b,0x0004007c,0x00000014,0x00002a5c,
33360x00002965,0x00060041,0x000000db,0x0000294c, 34440x00002a6c,0x00060041,0x000000db,0x00002a53,
33370x00002955,0x000000da,0x000000da,0x0006003d, 34450x00002a5c,0x000000da,0x000000da,0x0006003d,
33380x00000006,0x0000294d,0x0000294c,0x00000002, 34460x00000006,0x00002a54,0x00002a53,0x00000002,
33390x00000004,0x0004007c,0x00000027,0x0000288b, 34470x00000004,0x0004007c,0x00000027,0x00002992,
33400x0000294d,0x00060050,0x0000004b,0x0000288c, 34480x00002a54,0x00060050,0x0000004b,0x00002993,
33410x0000287f,0x00002885,0x0000288b,0x000200f9, 34490x00002986,0x0000298c,0x00002992,0x000300f7,
33420x00002776,0x000200f8,0x0000275c,0x00050041, 34500x00002766,0x00000000,0x000400fa,0x0000295b,
33430x000000fe,0x0000275e,0x000000fc,0x0000022c, 34510x0000275b,0x00002766,0x000200f8,0x0000275b,
33440x0004003d,0x00000006,0x0000275f,0x0000275e, 34520x00050084,0x00000006,0x0000275f,0x00000228,
33450x00050082,0x00000006,0x00002760,0x0000274c, 34530x00002753,0x00050080,0x00000006,0x00002760,
33460x0000275f,0x00050041,0x000000fe,0x00002968, 34540x00002750,0x0000275f,0x00050080,0x00000006,
33470x000000fc,0x00000224,0x0004003d,0x00000006, 34550x00002761,0x00002760,0x000005cd,0x00050095,
33480x00002969,0x00002968,0x000500ab,0x0000002f, 34560x000000ab,0x00002a84,0x00002838,0x00002761,
33490x0000296a,0x00002969,0x000000a6,0x000600a9, 34570x00050051,0x00000006,0x00002a85,0x00002a84,
33500x00000006,0x0000296b,0x0000296a,0x00000228, 34580x00000001,0x00050051,0x00000006,0x00002a86,
33510x00000107,0x00050086,0x00000006,0x00002762, 34590x00002a84,0x00000000,0x00050080,0x00000006,
33520x00002760,0x0000296b,0x00050041,0x000000fe, 34600x00002a8b,0x0000283f,0x00002a85,0x00050050,
33530x000029ab,0x000000fc,0x000000fd,0x0004003d, 34610x00000007,0x00002a8c,0x00002a86,0x00002a8b,
33540x00000006,0x000029ac,0x000029ab,0x00050084, 34620x0004007c,0x00000014,0x00002a7c,0x00002a8c,
33550x00000006,0x000029ad,0x0000011f,0x000029ac, 34630x00060041,0x000000db,0x00002a74,0x00002a7c,
33560x00050080,0x00000006,0x000029ae,0x00000107, 34640x000000da,0x000000da,0x0005003e,0x00002a74,
33570x000029ad,0x00050080,0x00000006,0x000029b4, 34650x00002821,0x00000002,0x00000004,0x000200f9,
33580x000029ac,0x000032a8,0x00050086,0x00000006, 34660x00002766,0x000200f8,0x00002766,0x000200f9,
33590x000029b5,0x000029b4,0x00000101,0x00050084, 34670x00002767,0x000200f8,0x00002767,0x000700f5,
33600x00000006,0x000029a7,0x00000107,0x000029b5, 34680x0000004b,0x000031a8,0x0000287d,0x00002741,
33610x00050080,0x00000006,0x000029a8,0x000029ae, 34690x00002993,0x00002766,0x000700f5,0x0000004b,
33620x000029a7,0x00050084,0x00000006,0x0000297c, 34700x000031a6,0x0000286a,0x00002741,0x00002980,
33630x00000150,0x00002762,0x00050080,0x00000006, 34710x00002766,0x00050051,0x00000027,0x00002a90,
33640x0000297d,0x000029a8,0x0000297c,0x00050041, 34720x000031a6,0x00000000,0x00050051,0x00000027,
33650x00000156,0x0000297e,0x000000fc,0x00000154, 34730x00002a92,0x000031a8,0x00000000,0x000500bc,
33660x0004003d,0x00000007,0x0000297f,0x0000297e, 34740x0000002f,0x00002a93,0x00002a90,0x00002a92,
33670x00050051,0x00000006,0x000029cc,0x0000297f, 34750x000300f7,0x00002a9a,0x00000000,0x000400fa,
33680x00000000,0x00050095,0x000000ab,0x000029ce, 34760x00002a93,0x00002a94,0x00002a9a,0x000200f8,
33690x000029cc,0x0000297d,0x00050051,0x00000006, 34770x00002a94,0x00050051,0x00000027,0x00002a96,
33700x000029cf,0x000029ce,0x00000001,0x00050051, 34780x000031a6,0x00000001,0x00050051,0x00000027,
33710x00000006,0x000029d0,0x000029ce,0x00000000, 34790x00002a98,0x000031a8,0x00000001,0x000500bc,
33720x00050051,0x00000006,0x000029d3,0x0000297f, 34800x0000002f,0x00002a99,0x00002a96,0x00002a98,
33730x00000001,0x00050080,0x00000006,0x000029d5, 34810x000200f9,0x00002a9a,0x000200f8,0x00002a9a,
33740x000029d3,0x000029cf,0x00050050,0x00000007, 34820x000700f5,0x0000002f,0x00002a9b,0x00002a93,
33750x000029d6,0x000029d0,0x000029d5,0x0004007c, 34830x00002767,0x00002a99,0x00002a94,0x000300f7,
33760x00000014,0x000029c6,0x000029d6,0x00060041, 34840x00002aa2,0x00000000,0x000400fa,0x00002a9b,
33770x000000db,0x000029bd,0x000029c6,0x000000da, 34850x00002a9c,0x00002aa2,0x000200f8,0x00002a9c,
33780x000000da,0x0006003d,0x00000006,0x000029be, 34860x00050051,0x00000027,0x00002a9e,0x000031a6,
33790x000029bd,0x00000002,0x00000004,0x0004007c, 34870x00000002,0x00050051,0x00000027,0x00002aa0,
33800x00000027,0x00002982,0x000029be,0x00050080, 34880x000031a8,0x00000002,0x000500bc,0x0000002f,
33810x00000006,0x00002984,0x0000297d,0x0000010a, 34890x00002aa1,0x00002a9e,0x00002aa0,0x000200f9,
33820x00050095,0x000000ab,0x000029ef,0x000029cc, 34900x00002aa2,0x000200f8,0x00002aa2,0x000700f5,
33830x00002984,0x00050051,0x00000006,0x000029f0, 34910x0000002f,0x00002aa3,0x00002a9b,0x00002a9a,
33840x000029ef,0x00000001,0x00050051,0x00000006, 34920x00002aa1,0x00002a9c,0x000300f7,0x00002773,
33850x000029f1,0x000029ef,0x00000000,0x00050080, 34930x00000000,0x000400fa,0x00002aa3,0x0000276c,
33860x00000006,0x000029f6,0x000029d3,0x000029f0, 34940x00002773,0x000200f8,0x0000276c,0x0007000c,
33870x00050050,0x00000007,0x000029f7,0x000029f1, 34950x0000004b,0x0000276f,0x00000001,0x00000025,
33880x000029f6,0x0004007c,0x00000014,0x000029e7, 34960x00003191,0x000031a6,0x0007000c,0x0000004b,
33890x000029f7,0x00060041,0x000000db,0x000029de, 34970x00002772,0x00000001,0x00000028,0x00003193,
33900x000029e7,0x000000da,0x000000da,0x0006003d, 34980x000031a8,0x000200f9,0x00002773,0x000200f8,
33910x00000006,0x000029df,0x000029de,0x00000002, 34990x00002773,0x000700f5,0x0000004b,0x0000327e,
33920x00000004,0x0004007c,0x00000027,0x00002988, 35000x00003193,0x00002aa2,0x00002772,0x0000276c,
33930x000029df,0x00050080,0x00000006,0x0000298a, 35010x000700f5,0x0000004b,0x00003279,0x00003191,
33940x0000297d,0x00000111,0x00050095,0x000000ab, 35020x00002aa2,0x0000276f,0x0000276c,0x000200f9,
33950x00002a10,0x000029cc,0x0000298a,0x00050051, 35030x00002774,0x000200f8,0x00002774,0x000700f5,
33960x00000006,0x00002a11,0x00002a10,0x00000001, 35040x0000004b,0x0000327d,0x00003193,0x00002730,
33970x00050051,0x00000006,0x00002a12,0x00002a10, 35050x0000327e,0x00002773,0x000700f5,0x0000004b,
33980x00000000,0x00050080,0x00000006,0x00002a17, 35060x00003278,0x00003191,0x00002730,0x00003279,
33990x000029d3,0x00002a11,0x00050050,0x00000007, 35070x00002773,0x000700f5,0x0000004b,0x000031d4,
34000x00002a18,0x00002a12,0x00002a17,0x0004007c, 35080x00003294,0x00002730,0x000031a8,0x00002773,
34010x00000014,0x00002a08,0x00002a18,0x00060041, 35090x000700f5,0x0000004b,0x000031cf,0x000003be,
34020x000000db,0x000029ff,0x00002a08,0x000000da, 35100x00002730,0x000031a6,0x00002773,0x000200f9,
34030x000000da,0x0006003d,0x00000006,0x00002a00, 35110x000027c5,0x000200f8,0x00002775,0x00050041,
34040x000029ff,0x00000002,0x00000004,0x0004007c, 35120x000000fe,0x00002777,0x000000fc,0x00000250,
34050x00000027,0x0000298e,0x00002a00,0x00060050, 35130x0004003d,0x00000006,0x00002778,0x00002777,
34060x0000004b,0x0000298f,0x00002982,0x00002988, 35140x000500b0,0x0000002f,0x00002779,0x0000272a,
34070x0000298e,0x00050080,0x00000006,0x00002991, 35150x00002778,0x000300f7,0x000027c4,0x00000000,
34080x0000297d,0x00000118,0x00050095,0x000000ab, 35160x000400fa,0x00002779,0x0000277a,0x000027c4,
34090x00002a31,0x000029cc,0x00002991,0x00050051, 35170x000200f8,0x0000277a,0x00050041,0x000000fe,
34100x00000006,0x00002a32,0x00002a31,0x00000001, 35180x0000277b,0x000000fc,0x00000266,0x0004003d,
34110x00050051,0x00000006,0x00002a33,0x00002a31, 35190x00000006,0x0000277c,0x0000277b,0x000500aa,
34120x00000000,0x00050080,0x00000006,0x00002a38, 35200x0000002f,0x0000277d,0x0000277c,0x00000380,
34130x000029d3,0x00002a32,0x00050050,0x00000007, 35210x000300f7,0x000027a9,0x00000000,0x000400fa,
34140x00002a39,0x00002a33,0x00002a38,0x0004007c, 35220x0000277d,0x0000277e,0x0000279b,0x000200f8,
34150x00000014,0x00002a29,0x00002a39,0x00060041, 35230x0000277e,0x00050041,0x000000fe,0x00002aa7,
34160x000000db,0x00002a20,0x00002a29,0x000000da, 35240x000000fc,0x000000fd,0x0004003d,0x00000006,
34170x000000da,0x0006003d,0x00000006,0x00002a21, 35250x00002aa8,0x00002aa7,0x00050084,0x00000006,
34180x00002a20,0x00000002,0x00000004,0x0004007c, 35260x00002aa9,0x0000010a,0x00002aa8,0x00050080,
34190x00000027,0x00002995,0x00002a21,0x00050080, 35270x00000006,0x00002aaa,0x00000107,0x00002aa9,
34200x00000006,0x00002997,0x0000297d,0x0000011f, 35280x00050084,0x00000006,0x00002781,0x0000010a,
34210x00050095,0x000000ab,0x00002a52,0x000029cc, 35290x0000272a,0x00050080,0x00000006,0x00002782,
34220x00002997,0x00050051,0x00000006,0x00002a53, 35300x00002aaa,0x00002781,0x00050041,0x00000156,
34230x00002a52,0x00000001,0x00050051,0x00000006, 35310x00002783,0x000000fc,0x00000154,0x0004003d,
34240x00002a54,0x00002a52,0x00000000,0x00050080, 35320x00000007,0x00002784,0x00002783,0x00050051,
34250x00000006,0x00002a59,0x000029d3,0x00002a53, 35330x00000006,0x00002ac1,0x00002784,0x00000000,
34260x00050050,0x00000007,0x00002a5a,0x00002a54, 35340x00050095,0x000000ab,0x00002ac3,0x00002ac1,
34270x00002a59,0x0004007c,0x00000014,0x00002a4a, 35350x00002782,0x00050051,0x00000006,0x00002ac4,
34280x00002a5a,0x00060041,0x000000db,0x00002a41, 35360x00002ac3,0x00000001,0x00050051,0x00000006,
34290x00002a4a,0x000000da,0x000000da,0x0006003d, 35370x00002ac5,0x00002ac3,0x00000000,0x00050051,
34300x00000006,0x00002a42,0x00002a41,0x00000002, 35380x00000006,0x00002ac8,0x00002784,0x00000001,
34310x00000004,0x0004007c,0x00000027,0x0000299b, 35390x00050080,0x00000006,0x00002aca,0x00002ac8,
34320x00002a42,0x00050080,0x00000006,0x0000299d, 35400x00002ac4,0x00050050,0x00000007,0x00002acb,
34330x0000297d,0x00000189,0x00050095,0x000000ab, 35410x00002ac5,0x00002aca,0x0004007c,0x00000014,
34340x00002a73,0x000029cc,0x0000299d,0x00050051, 35420x00002abb,0x00002acb,0x00060041,0x000000db,
34350x00000006,0x00002a74,0x00002a73,0x00000001, 35430x00002ab2,0x00002abb,0x000000da,0x000000da,
34360x00050051,0x00000006,0x00002a75,0x00002a73, 35440x0006003d,0x00000006,0x00002ab3,0x00002ab2,
34370x00000000,0x00050080,0x00000006,0x00002a7a, 35450x00000002,0x00000004,0x00050041,0x000000fe,
34380x000029d3,0x00002a74,0x00050050,0x00000007, 35460x00002ace,0x000000fc,0x0000022c,0x0004003d,
34390x00002a7b,0x00002a75,0x00002a7a,0x0004007c, 35470x00000006,0x00002acf,0x00002ace,0x00050041,
34400x00000014,0x00002a6b,0x00002a7b,0x00060041, 35480x000000fe,0x00002add,0x000000fc,0x00000224,
34410x000000db,0x00002a62,0x00002a6b,0x000000da, 35490x0004003d,0x00000006,0x00002ade,0x00002add,
34420x000000da,0x0006003d,0x00000006,0x00002a63, 35500x000500ab,0x0000002f,0x00002adf,0x00002ade,
34430x00002a62,0x00000002,0x00000004,0x0004007c, 35510x000000a6,0x000600a9,0x00000006,0x00002ae0,
34440x00000027,0x000029a1,0x00002a63,0x00060050, 35520x00002adf,0x00000228,0x00000107,0x00050084,
34450x0000004b,0x000029a2,0x00002995,0x0000299b, 35530x00000006,0x00002ad2,0x00002ab3,0x00002ae0,
34460x000029a1,0x000300f7,0x00002775,0x00000000, 35540x00050080,0x00000006,0x00002ad3,0x00002acf,
34470x000400fa,0x0000296a,0x0000276a,0x00002775, 35550x00002ad2,0x000500c2,0x00000006,0x00002ad4,
34480x000200f8,0x0000276a,0x00050084,0x00000006, 35560x00002ad3,0x00000233,0x000500c4,0x00000006,
34490x0000276e,0x00000228,0x00002762,0x00050080, 35570x00002ad5,0x00002ad4,0x0000020d,0x000600a9,
34500x00000006,0x0000276f,0x0000275f,0x0000276e, 35580x00000006,0x00002ad9,0x00002adf,0x00000239,
34510x00050080,0x00000006,0x00002770,0x0000276f, 35590x000000a6,0x000500c5,0x00000006,0x00002ada,
34520x000005d0,0x00050095,0x000000ab,0x00002a93, 35600x00002ad5,0x00002ad9,0x00050084,0x00000006,
34530x00002847,0x00002770,0x00050051,0x00000006, 35610x00002b22,0x0000011f,0x00002aa8,0x00050080,
34540x00002a94,0x00002a93,0x00000001,0x00050051, 35620x00000006,0x00002b23,0x00000107,0x00002b22,
34550x00000006,0x00002a95,0x00002a93,0x00000000, 35630x00050080,0x00000006,0x00002b29,0x00002aa8,
34560x00050080,0x00000006,0x00002a9a,0x0000284e, 35640x00003297,0x00050086,0x00000006,0x00002b2a,
34570x00002a94,0x00050050,0x00000007,0x00002a9b, 35650x00002b29,0x00000101,0x00050084,0x00000006,
34580x00002a95,0x00002a9a,0x0004007c,0x00000014, 35660x00002b1c,0x00000107,0x00002b2a,0x00050080,
34590x00002a8b,0x00002a9b,0x00060041,0x000000db, 35670x00000006,0x00002b1d,0x00002b23,0x00002b1c,
34600x00002a83,0x00002a8b,0x000000da,0x000000da, 35680x00050084,0x00000006,0x00002af1,0x00000150,
34610x0005003e,0x00002a83,0x00002830,0x00000002, 35690x00002ab3,0x00050080,0x00000006,0x00002af2,
34620x00000004,0x000200f9,0x00002775,0x000200f8, 35700x00002b1d,0x00002af1,0x00050095,0x000000ab,
34630x00002775,0x000200f9,0x00002776,0x000200f8, 35710x00002b43,0x00002ac1,0x00002af2,0x00050051,
34640x00002776,0x000700f5,0x0000004b,0x000031b7, 35720x00000006,0x00002b44,0x00002b43,0x00000001,
34650x0000288c,0x00002750,0x000029a2,0x00002775, 35730x00050051,0x00000006,0x00002b45,0x00002b43,
34660x000700f5,0x0000004b,0x000031b5,0x00002879, 35740x00000000,0x00050080,0x00000006,0x00002b4a,
34670x00002750,0x0000298f,0x00002775,0x00050051, 35750x00002ac8,0x00002b44,0x00050050,0x00000007,
34680x00000027,0x00002a9f,0x000031b5,0x00000000, 35760x00002b4b,0x00002b45,0x00002b4a,0x0004007c,
34690x00050051,0x00000027,0x00002aa1,0x000031b7, 35770x00000014,0x00002b3b,0x00002b4b,0x00060041,
34700x00000000,0x000500bc,0x0000002f,0x00002aa2, 35780x000000db,0x00002b32,0x00002b3b,0x000000da,
34710x00002a9f,0x00002aa1,0x000300f7,0x00002aa9, 35790x000000da,0x0006003d,0x00000006,0x00002b33,
34720x00000000,0x000400fa,0x00002aa2,0x00002aa3, 35800x00002b32,0x00000002,0x00000004,0x0004007c,
34730x00002aa9,0x000200f8,0x00002aa3,0x00050051, 35810x00000027,0x00002af7,0x00002b33,0x00050080,
34740x00000027,0x00002aa5,0x000031b5,0x00000001, 35820x00000006,0x00002af9,0x00002af2,0x0000010a,
34750x00050051,0x00000027,0x00002aa7,0x000031b7, 35830x00050095,0x000000ab,0x00002b64,0x00002ac1,
34760x00000001,0x000500bc,0x0000002f,0x00002aa8, 35840x00002af9,0x00050051,0x00000006,0x00002b65,
34770x00002aa5,0x00002aa7,0x000200f9,0x00002aa9, 35850x00002b64,0x00000001,0x00050051,0x00000006,
34780x000200f8,0x00002aa9,0x000700f5,0x0000002f, 35860x00002b66,0x00002b64,0x00000000,0x00050080,
34790x00002aaa,0x00002aa2,0x00002776,0x00002aa8, 35870x00000006,0x00002b6b,0x00002ac8,0x00002b65,
34800x00002aa3,0x000300f7,0x00002ab1,0x00000000, 35880x00050050,0x00000007,0x00002b6c,0x00002b66,
34810x000400fa,0x00002aaa,0x00002aab,0x00002ab1, 35890x00002b6b,0x0004007c,0x00000014,0x00002b5c,
34820x000200f8,0x00002aab,0x00050051,0x00000027, 35900x00002b6c,0x00060041,0x000000db,0x00002b53,
34830x00002aad,0x000031b5,0x00000002,0x00050051, 35910x00002b5c,0x000000da,0x000000da,0x0006003d,
34840x00000027,0x00002aaf,0x000031b7,0x00000002, 35920x00000006,0x00002b54,0x00002b53,0x00000002,
34850x000500bc,0x0000002f,0x00002ab0,0x00002aad, 35930x00000004,0x0004007c,0x00000027,0x00002afd,
34860x00002aaf,0x000200f9,0x00002ab1,0x000200f8, 35940x00002b54,0x00050080,0x00000006,0x00002aff,
34870x00002ab1,0x000700f5,0x0000002f,0x00002ab2, 35950x00002af2,0x00000111,0x00050095,0x000000ab,
34880x00002aaa,0x00002aa9,0x00002ab0,0x00002aab, 35960x00002b85,0x00002ac1,0x00002aff,0x00050051,
34890x000300f7,0x00002782,0x00000000,0x000400fa, 35970x00000006,0x00002b86,0x00002b85,0x00000001,
34900x00002ab2,0x0000277b,0x00002782,0x000200f8, 35980x00050051,0x00000006,0x00002b87,0x00002b85,
34910x0000277b,0x0007000c,0x0000004b,0x0000277e, 35990x00000000,0x00050080,0x00000006,0x00002b8c,
34920x00000001,0x00000025,0x000031a0,0x000031b5, 36000x00002ac8,0x00002b86,0x00050050,0x00000007,
34930x0007000c,0x0000004b,0x00002781,0x00000001, 36010x00002b8d,0x00002b87,0x00002b8c,0x0004007c,
34940x00000028,0x000031a2,0x000031b7,0x000200f9, 36020x00000014,0x00002b7d,0x00002b8d,0x00060041,
34950x00002782,0x000200f8,0x00002782,0x000700f5, 36030x000000db,0x00002b74,0x00002b7d,0x000000da,
34960x0000004b,0x0000328d,0x000031a2,0x00002ab1, 36040x000000da,0x0006003d,0x00000006,0x00002b75,
34970x00002781,0x0000277b,0x000700f5,0x0000004b, 36050x00002b74,0x00000002,0x00000004,0x0004007c,
34980x00003288,0x000031a0,0x00002ab1,0x0000277e, 36060x00000027,0x00002b03,0x00002b75,0x00060050,
34990x0000277b,0x000200f9,0x00002783,0x000200f8, 36070x0000004b,0x00002b04,0x00002af7,0x00002afd,
35000x00002783,0x000700f5,0x0000004b,0x0000328c, 36080x00002b03,0x00050080,0x00000006,0x00002b06,
35010x000031a2,0x0000273f,0x0000328d,0x00002782, 36090x00002af2,0x00000118,0x00050095,0x000000ab,
35020x000700f5,0x0000004b,0x00003287,0x000031a0, 36100x00002ba6,0x00002ac1,0x00002b06,0x00050051,
35030x0000273f,0x00003288,0x00002782,0x000700f5, 36110x00000006,0x00002ba7,0x00002ba6,0x00000001,
35040x0000004b,0x000031e3,0x000032a7,0x0000273f, 36120x00050051,0x00000006,0x00002ba8,0x00002ba6,
35050x000031b7,0x00002782,0x000700f5,0x0000004b, 36130x00000000,0x00050080,0x00000006,0x00002bad,
35060x000031de,0x000032a5,0x0000273f,0x000031b5, 36140x00002ac8,0x00002ba7,0x00050050,0x00000007,
35070x00002782,0x000200f9,0x000027d4,0x000200f8, 36150x00002bae,0x00002ba8,0x00002bad,0x0004007c,
35080x00002784,0x00050041,0x000000fe,0x00002786, 36160x00000014,0x00002b9e,0x00002bae,0x00060041,
35090x000000fc,0x00000250,0x0004003d,0x00000006, 36170x000000db,0x00002b95,0x00002b9e,0x000000da,
35100x00002787,0x00002786,0x000500b0,0x0000002f, 36180x000000da,0x0006003d,0x00000006,0x00002b96,
35110x00002788,0x00002737,0x00002787,0x000300f7, 36190x00002b95,0x00000002,0x00000004,0x0004007c,
35120x000027d3,0x00000000,0x000400fa,0x00002788, 36200x00000027,0x00002b0a,0x00002b96,0x00050080,
35130x00002789,0x000027d3,0x000200f8,0x00002789, 36210x00000006,0x00002b0c,0x00002af2,0x0000011f,
35140x00050041,0x000000fe,0x0000278a,0x000000fc, 36220x00050095,0x000000ab,0x00002bc7,0x00002ac1,
35150x00000266,0x0004003d,0x00000006,0x0000278b, 36230x00002b0c,0x00050051,0x00000006,0x00002bc8,
35160x0000278a,0x000500aa,0x0000002f,0x0000278c, 36240x00002bc7,0x00000001,0x00050051,0x00000006,
35170x0000278b,0x00000380,0x000300f7,0x000027b8, 36250x00002bc9,0x00002bc7,0x00000000,0x00050080,
35180x00000000,0x000400fa,0x0000278c,0x0000278d, 36260x00000006,0x00002bce,0x00002ac8,0x00002bc8,
35190x000027aa,0x000200f8,0x0000278d,0x00050041, 36270x00050050,0x00000007,0x00002bcf,0x00002bc9,
35200x000000fe,0x00002ab6,0x000000fc,0x000000fd, 36280x00002bce,0x0004007c,0x00000014,0x00002bbf,
35210x0004003d,0x00000006,0x00002ab7,0x00002ab6, 36290x00002bcf,0x00060041,0x000000db,0x00002bb6,
35220x00050084,0x00000006,0x00002ab8,0x0000010a, 36300x00002bbf,0x000000da,0x000000da,0x0006003d,
35230x00002ab7,0x00050080,0x00000006,0x00002ab9, 36310x00000006,0x00002bb7,0x00002bb6,0x00000002,
35240x00000107,0x00002ab8,0x00050084,0x00000006, 36320x00000004,0x0004007c,0x00000027,0x00002b10,
35250x00002790,0x0000010a,0x00002737,0x00050080, 36330x00002bb7,0x00050080,0x00000006,0x00002b12,
35260x00000006,0x00002791,0x00002ab9,0x00002790, 36340x00002af2,0x00000189,0x00050095,0x000000ab,
35270x00050041,0x00000156,0x00002792,0x000000fc, 36350x00002be8,0x00002ac1,0x00002b12,0x00050051,
35280x00000154,0x0004003d,0x00000007,0x00002793, 36360x00000006,0x00002be9,0x00002be8,0x00000001,
35290x00002792,0x00050051,0x00000006,0x00002ad0, 36370x00050051,0x00000006,0x00002bea,0x00002be8,
35300x00002793,0x00000000,0x00050095,0x000000ab, 36380x00000000,0x00050080,0x00000006,0x00002bef,
35310x00002ad2,0x00002ad0,0x00002791,0x00050051, 36390x00002ac8,0x00002be9,0x00050050,0x00000007,
35320x00000006,0x00002ad3,0x00002ad2,0x00000001, 36400x00002bf0,0x00002bea,0x00002bef,0x0004007c,
35330x00050051,0x00000006,0x00002ad4,0x00002ad2, 36410x00000014,0x00002be0,0x00002bf0,0x00060041,
35340x00000000,0x00050051,0x00000006,0x00002ad7, 36420x000000db,0x00002bd7,0x00002be0,0x000000da,
35350x00002793,0x00000001,0x00050080,0x00000006, 36430x000000da,0x0006003d,0x00000006,0x00002bd8,
35360x00002ad9,0x00002ad7,0x00002ad3,0x00050050, 36440x00002bd7,0x00000002,0x00000004,0x0004007c,
35370x00000007,0x00002ada,0x00002ad4,0x00002ad9, 36450x00000027,0x00002b16,0x00002bd8,0x00060050,
35380x0004007c,0x00000014,0x00002aca,0x00002ada, 36460x0000004b,0x00002b17,0x00002b0a,0x00002b10,
35390x00060041,0x000000db,0x00002ac1,0x00002aca, 36470x00002b16,0x000300f7,0x0000279a,0x00000000,
35400x000000da,0x000000da,0x0006003d,0x00000006, 36480x000400fa,0x00002adf,0x0000278f,0x0000279a,
35410x00002ac2,0x00002ac1,0x00000002,0x00000004, 36490x000200f8,0x0000278f,0x00050084,0x00000006,
35420x00050041,0x000000fe,0x00002add,0x000000fc, 36500x00002793,0x00000228,0x00002ab3,0x00050080,
35430x0000022c,0x0004003d,0x00000006,0x00002ade, 36510x00000006,0x00002794,0x00002acf,0x00002793,
35440x00002add,0x00050041,0x000000fe,0x00002aec, 36520x00050080,0x00000006,0x00002795,0x00002794,
35450x000000fc,0x00000224,0x0004003d,0x00000006, 36530x000005cd,0x00050041,0x00000156,0x00002796,
35460x00002aed,0x00002aec,0x000500ab,0x0000002f,
35470x00002aee,0x00002aed,0x000000a6,0x000600a9,
35480x00000006,0x00002aef,0x00002aee,0x00000228,
35490x00000107,0x00050084,0x00000006,0x00002ae1,
35500x00002ac2,0x00002aef,0x00050080,0x00000006,
35510x00002ae2,0x00002ade,0x00002ae1,0x000500c2,
35520x00000006,0x00002ae3,0x00002ae2,0x00000233,
35530x000500c4,0x00000006,0x00002ae4,0x00002ae3,
35540x0000020d,0x000600a9,0x00000006,0x00002ae8,
35550x00002aee,0x00000239,0x000000a6,0x000500c5,
35560x00000006,0x00002ae9,0x00002ae4,0x00002ae8,
35570x00050084,0x00000006,0x00002b31,0x0000011f,
35580x00002ab7,0x00050080,0x00000006,0x00002b32,
35590x00000107,0x00002b31,0x00050080,0x00000006,
35600x00002b38,0x00002ab7,0x000032a8,0x00050086,
35610x00000006,0x00002b39,0x00002b38,0x00000101,
35620x00050084,0x00000006,0x00002b2b,0x00000107,
35630x00002b39,0x00050080,0x00000006,0x00002b2c,
35640x00002b32,0x00002b2b,0x00050084,0x00000006,
35650x00002b00,0x00000150,0x00002ac2,0x00050080,
35660x00000006,0x00002b01,0x00002b2c,0x00002b00,
35670x00050095,0x000000ab,0x00002b52,0x00002ad0,
35680x00002b01,0x00050051,0x00000006,0x00002b53,
35690x00002b52,0x00000001,0x00050051,0x00000006,
35700x00002b54,0x00002b52,0x00000000,0x00050080,
35710x00000006,0x00002b59,0x00002ad7,0x00002b53,
35720x00050050,0x00000007,0x00002b5a,0x00002b54,
35730x00002b59,0x0004007c,0x00000014,0x00002b4a,
35740x00002b5a,0x00060041,0x000000db,0x00002b41,
35750x00002b4a,0x000000da,0x000000da,0x0006003d,
35760x00000006,0x00002b42,0x00002b41,0x00000002,
35770x00000004,0x0004007c,0x00000027,0x00002b06,
35780x00002b42,0x00050080,0x00000006,0x00002b08,
35790x00002b01,0x0000010a,0x00050095,0x000000ab,
35800x00002b73,0x00002ad0,0x00002b08,0x00050051,
35810x00000006,0x00002b74,0x00002b73,0x00000001,
35820x00050051,0x00000006,0x00002b75,0x00002b73,
35830x00000000,0x00050080,0x00000006,0x00002b7a,
35840x00002ad7,0x00002b74,0x00050050,0x00000007,
35850x00002b7b,0x00002b75,0x00002b7a,0x0004007c,
35860x00000014,0x00002b6b,0x00002b7b,0x00060041,
35870x000000db,0x00002b62,0x00002b6b,0x000000da,
35880x000000da,0x0006003d,0x00000006,0x00002b63,
35890x00002b62,0x00000002,0x00000004,0x0004007c,
35900x00000027,0x00002b0c,0x00002b63,0x00050080,
35910x00000006,0x00002b0e,0x00002b01,0x00000111,
35920x00050095,0x000000ab,0x00002b94,0x00002ad0,
35930x00002b0e,0x00050051,0x00000006,0x00002b95,
35940x00002b94,0x00000001,0x00050051,0x00000006,
35950x00002b96,0x00002b94,0x00000000,0x00050080,
35960x00000006,0x00002b9b,0x00002ad7,0x00002b95,
35970x00050050,0x00000007,0x00002b9c,0x00002b96,
35980x00002b9b,0x0004007c,0x00000014,0x00002b8c,
35990x00002b9c,0x00060041,0x000000db,0x00002b83,
36000x00002b8c,0x000000da,0x000000da,0x0006003d,
36010x00000006,0x00002b84,0x00002b83,0x00000002,
36020x00000004,0x0004007c,0x00000027,0x00002b12,
36030x00002b84,0x00060050,0x0000004b,0x00002b13,
36040x00002b06,0x00002b0c,0x00002b12,0x00050080,
36050x00000006,0x00002b15,0x00002b01,0x00000118,
36060x00050095,0x000000ab,0x00002bb5,0x00002ad0,
36070x00002b15,0x00050051,0x00000006,0x00002bb6,
36080x00002bb5,0x00000001,0x00050051,0x00000006,
36090x00002bb7,0x00002bb5,0x00000000,0x00050080,
36100x00000006,0x00002bbc,0x00002ad7,0x00002bb6,
36110x00050050,0x00000007,0x00002bbd,0x00002bb7,
36120x00002bbc,0x0004007c,0x00000014,0x00002bad,
36130x00002bbd,0x00060041,0x000000db,0x00002ba4,
36140x00002bad,0x000000da,0x000000da,0x0006003d,
36150x00000006,0x00002ba5,0x00002ba4,0x00000002,
36160x00000004,0x0004007c,0x00000027,0x00002b19,
36170x00002ba5,0x00050080,0x00000006,0x00002b1b,
36180x00002b01,0x0000011f,0x00050095,0x000000ab,
36190x00002bd6,0x00002ad0,0x00002b1b,0x00050051,
36200x00000006,0x00002bd7,0x00002bd6,0x00000001,
36210x00050051,0x00000006,0x00002bd8,0x00002bd6,
36220x00000000,0x00050080,0x00000006,0x00002bdd,
36230x00002ad7,0x00002bd7,0x00050050,0x00000007,
36240x00002bde,0x00002bd8,0x00002bdd,0x0004007c,
36250x00000014,0x00002bce,0x00002bde,0x00060041,
36260x000000db,0x00002bc5,0x00002bce,0x000000da,
36270x000000da,0x0006003d,0x00000006,0x00002bc6,
36280x00002bc5,0x00000002,0x00000004,0x0004007c,
36290x00000027,0x00002b1f,0x00002bc6,0x00050080,
36300x00000006,0x00002b21,0x00002b01,0x00000189,
36310x00050095,0x000000ab,0x00002bf7,0x00002ad0,
36320x00002b21,0x00050051,0x00000006,0x00002bf8,
36330x00002bf7,0x00000001,0x00050051,0x00000006,
36340x00002bf9,0x00002bf7,0x00000000,0x00050080,
36350x00000006,0x00002bfe,0x00002ad7,0x00002bf8,
36360x00050050,0x00000007,0x00002bff,0x00002bf9,
36370x00002bfe,0x0004007c,0x00000014,0x00002bef,
36380x00002bff,0x00060041,0x000000db,0x00002be6,
36390x00002bef,0x000000da,0x000000da,0x0006003d,
36400x00000006,0x00002be7,0x00002be6,0x00000002,
36410x00000004,0x0004007c,0x00000027,0x00002b25,
36420x00002be7,0x00060050,0x0000004b,0x00002b26,
36430x00002b19,0x00002b1f,0x00002b25,0x000300f7,
36440x000027a9,0x00000000,0x000400fa,0x00002aee,
36450x0000279e,0x000027a9,0x000200f8,0x0000279e,
36460x00050084,0x00000006,0x000027a2,0x00000228,
36470x00002ac2,0x00050080,0x00000006,0x000027a3,
36480x00002ade,0x000027a2,0x00050080,0x00000006,
36490x000027a4,0x000027a3,0x000005d0,0x00050041,
36500x00000156,0x000027a5,0x000000fc,0x000000da,
36510x0004003d,0x00000007,0x000027a6,0x000027a5,
36520x00050051,0x00000006,0x00002c15,0x000027a6,
36530x00000000,0x00050095,0x000000ab,0x00002c17,
36540x00002c15,0x000027a4,0x00050051,0x00000006,
36550x00002c18,0x00002c17,0x00000001,0x00050051,
36560x00000006,0x00002c19,0x00002c17,0x00000000,
36570x00050051,0x00000006,0x00002c1c,0x000027a6,
36580x00000001,0x00050080,0x00000006,0x00002c1e,
36590x00002c1c,0x00002c18,0x00050050,0x00000007,
36600x00002c1f,0x00002c19,0x00002c1e,0x0004007c,
36610x00000014,0x00002c0f,0x00002c1f,0x00060041,
36620x000000db,0x00002c07,0x00002c0f,0x000000da,
36630x000000da,0x0005003e,0x00002c07,0x00002830,
36640x00000002,0x00000004,0x000200f9,0x000027a9,
36650x000200f8,0x000027a9,0x000200f9,0x000027b8,
36660x000200f8,0x000027aa,0x00050080,0x00000006,
36670x000027ae,0x0000278b,0x00002737,0x00050084,
36680x00000006,0x00002c25,0x000027ae,0x00000228,
36690x00050080,0x00000006,0x00002c26,0x0000282a,
36700x00002c25,0x000500c2,0x00000006,0x00002c27,
36710x00002c26,0x00000233,0x000500c4,0x00000006,
36720x00002c28,0x00002c27,0x0000020d,0x000500c5,
36730x00000006,0x00002c29,0x00002c28,0x00000246,
36740x00050041,0x000000fe,0x000027b1,0x000000fc,
36750x0000096c,0x0004003d,0x00000006,0x000027b2,
36760x000027b1,0x00050080,0x00000006,0x000027b4,
36770x000027b2,0x000027ae,0x00050041,0x000000fe,
36780x00002c69,0x000000fc,0x000000fd,0x0004003d,
36790x00000006,0x00002c6a,0x00002c69,0x00050084,
36800x00000006,0x00002c6b,0x0000011f,0x00002c6a,
36810x00050080,0x00000006,0x00002c6c,0x00000107,
36820x00002c6b,0x00050080,0x00000006,0x00002c72,
36830x00002c6a,0x000032a8,0x00050086,0x00000006,
36840x00002c73,0x00002c72,0x00000101,0x00050084,
36850x00000006,0x00002c65,0x00000107,0x00002c73,
36860x00050080,0x00000006,0x00002c66,0x00002c6c,
36870x00002c65,0x00050084,0x00000006,0x00002c3a,
36880x00000150,0x000027b4,0x00050080,0x00000006,
36890x00002c3b,0x00002c66,0x00002c3a,0x00050041,
36900x00000156,0x00002c3c,0x000000fc,0x00000154,
36910x0004003d,0x00000007,0x00002c3d,0x00002c3c,
36920x00050051,0x00000006,0x00002c8a,0x00002c3d,
36930x00000000,0x00050095,0x000000ab,0x00002c8c,
36940x00002c8a,0x00002c3b,0x00050051,0x00000006,
36950x00002c8d,0x00002c8c,0x00000001,0x00050051,
36960x00000006,0x00002c8e,0x00002c8c,0x00000000,
36970x00050051,0x00000006,0x00002c91,0x00002c3d,
36980x00000001,0x00050080,0x00000006,0x00002c93,
36990x00002c91,0x00002c8d,0x00050050,0x00000007,
37000x00002c94,0x00002c8e,0x00002c93,0x0004007c,
37010x00000014,0x00002c84,0x00002c94,0x00060041,
37020x000000db,0x00002c7b,0x00002c84,0x000000da,
37030x000000da,0x0006003d,0x00000006,0x00002c7c,
37040x00002c7b,0x00000002,0x00000004,0x0004007c,
37050x00000027,0x00002c40,0x00002c7c,0x00050080,
37060x00000006,0x00002c42,0x00002c3b,0x0000010a,
37070x00050095,0x000000ab,0x00002cad,0x00002c8a,
37080x00002c42,0x00050051,0x00000006,0x00002cae,
37090x00002cad,0x00000001,0x00050051,0x00000006,
37100x00002caf,0x00002cad,0x00000000,0x00050080,
37110x00000006,0x00002cb4,0x00002c91,0x00002cae,
37120x00050050,0x00000007,0x00002cb5,0x00002caf,
37130x00002cb4,0x0004007c,0x00000014,0x00002ca5,
37140x00002cb5,0x00060041,0x000000db,0x00002c9c,
37150x00002ca5,0x000000da,0x000000da,0x0006003d,
37160x00000006,0x00002c9d,0x00002c9c,0x00000002,
37170x00000004,0x0004007c,0x00000027,0x00002c46,
37180x00002c9d,0x00050080,0x00000006,0x00002c48,
37190x00002c3b,0x00000111,0x00050095,0x000000ab,
37200x00002cce,0x00002c8a,0x00002c48,0x00050051,
37210x00000006,0x00002ccf,0x00002cce,0x00000001,
37220x00050051,0x00000006,0x00002cd0,0x00002cce,
37230x00000000,0x00050080,0x00000006,0x00002cd5,
37240x00002c91,0x00002ccf,0x00050050,0x00000007,
37250x00002cd6,0x00002cd0,0x00002cd5,0x0004007c,
37260x00000014,0x00002cc6,0x00002cd6,0x00060041,
37270x000000db,0x00002cbd,0x00002cc6,0x000000da,
37280x000000da,0x0006003d,0x00000006,0x00002cbe,
37290x00002cbd,0x00000002,0x00000004,0x0004007c,
37300x00000027,0x00002c4c,0x00002cbe,0x00060050,
37310x0000004b,0x00002c4d,0x00002c40,0x00002c46,
37320x00002c4c,0x00050080,0x00000006,0x00002c4f,
37330x00002c3b,0x00000118,0x00050095,0x000000ab,
37340x00002cef,0x00002c8a,0x00002c4f,0x00050051,
37350x00000006,0x00002cf0,0x00002cef,0x00000001,
37360x00050051,0x00000006,0x00002cf1,0x00002cef,
37370x00000000,0x00050080,0x00000006,0x00002cf6,
37380x00002c91,0x00002cf0,0x00050050,0x00000007,
37390x00002cf7,0x00002cf1,0x00002cf6,0x0004007c,
37400x00000014,0x00002ce7,0x00002cf7,0x00060041,
37410x000000db,0x00002cde,0x00002ce7,0x000000da,
37420x000000da,0x0006003d,0x00000006,0x00002cdf,
37430x00002cde,0x00000002,0x00000004,0x0004007c,
37440x00000027,0x00002c53,0x00002cdf,0x00050080,
37450x00000006,0x00002c55,0x00002c3b,0x0000011f,
37460x00050095,0x000000ab,0x00002d10,0x00002c8a,
37470x00002c55,0x00050051,0x00000006,0x00002d11,
37480x00002d10,0x00000001,0x00050051,0x00000006,
37490x00002d12,0x00002d10,0x00000000,0x00050080,
37500x00000006,0x00002d17,0x00002c91,0x00002d11,
37510x00050050,0x00000007,0x00002d18,0x00002d12,
37520x00002d17,0x0004007c,0x00000014,0x00002d08,
37530x00002d18,0x00060041,0x000000db,0x00002cff,
37540x00002d08,0x000000da,0x000000da,0x0006003d,
37550x00000006,0x00002d00,0x00002cff,0x00000002,
37560x00000004,0x0004007c,0x00000027,0x00002c59,
37570x00002d00,0x00050080,0x00000006,0x00002c5b,
37580x00002c3b,0x00000189,0x00050095,0x000000ab,
37590x00002d31,0x00002c8a,0x00002c5b,0x00050051,
37600x00000006,0x00002d32,0x00002d31,0x00000001,
37610x00050051,0x00000006,0x00002d33,0x00002d31,
37620x00000000,0x00050080,0x00000006,0x00002d38,
37630x00002c91,0x00002d32,0x00050050,0x00000007,
37640x00002d39,0x00002d33,0x00002d38,0x0004007c,
37650x00000014,0x00002d29,0x00002d39,0x00060041,
37660x000000db,0x00002d20,0x00002d29,0x000000da,
37670x000000da,0x0006003d,0x00000006,0x00002d21,
37680x00002d20,0x00000002,0x00000004,0x0004007c,
37690x00000027,0x00002c5f,0x00002d21,0x00060050,
37700x0000004b,0x00002c60,0x00002c53,0x00002c59,
37710x00002c5f,0x000200f9,0x000027b8,0x000200f8,
37720x000027b8,0x000700f5,0x0000004b,0x000031a7,
37730x00002b26,0x000027a9,0x00002c60,0x000027aa,
37740x000700f5,0x0000004b,0x000031a5,0x00002b13,
37750x000027a9,0x00002c4d,0x000027aa,0x000700f5,
37760x00000006,0x000031a3,0x00002ae9,0x000027a9,
37770x00002c29,0x000027aa,0x00050041,0x000000fe,
37780x000027b9,0x000000fc,0x000009ef,0x0004003d,
37790x00000006,0x000027ba,0x000027b9,0x000500c2,
37800x00000006,0x00002d3d,0x000031a3,0x0000020d,
37810x00050041,0x000000fe,0x000027bd,0x000000fc,
37820x0000022c,0x0004003d,0x00000006,0x000027be,
37830x000027bd,0x00050086,0x00000006,0x000027bf,
37840x000027be,0x00000107,0x00050082,0x00000006,
37850x000027c0,0x00002d3d,0x000027bf,0x00050084,
37860x00000006,0x000027c1,0x0000010a,0x000027c0,
37870x00050080,0x00000006,0x000027c2,0x000027ba,
37880x000027c1,0x00050041,0x00000156,0x000027c3,
37890x000000fc,0x000000da,0x0004003d,0x00000007,
37900x000027c4,0x000027c3,0x00050051,0x00000006,
37910x00002d53,0x000027c4,0x00000000,0x00050095,
37920x000000ab,0x00002d55,0x00002d53,0x000027c2,
37930x00050051,0x00000006,0x00002d56,0x00002d55,
37940x00000001,0x00050051,0x00000006,0x00002d57,
37950x00002d55,0x00000000,0x00050051,0x00000006,
37960x00002d5a,0x000027c4,0x00000001,0x00050080,
37970x00000006,0x00002d5c,0x00002d5a,0x00002d56,
37980x00050050,0x00000007,0x00002d5d,0x00002d57,
37990x00002d5c,0x0004007c,0x00000014,0x00002d4d,
38000x00002d5d,0x00060041,0x000000db,0x00002d45,
38010x00002d4d,0x000000da,0x000000da,0x0005003e,
38020x00002d45,0x00002830,0x00000002,0x00000004,
38030x00050051,0x00000027,0x00002d61,0x000031a5,
38040x00000000,0x00050051,0x00000027,0x00002d63,
38050x000031a7,0x00000000,0x000500bc,0x0000002f,
38060x00002d64,0x00002d61,0x00002d63,0x000300f7,
38070x00002d6b,0x00000000,0x000400fa,0x00002d64,
38080x00002d65,0x00002d6b,0x000200f8,0x00002d65,
38090x00050051,0x00000027,0x00002d67,0x000031a5,
38100x00000001,0x00050051,0x00000027,0x00002d69,
38110x000031a7,0x00000001,0x000500bc,0x0000002f,
38120x00002d6a,0x00002d67,0x00002d69,0x000200f9,
38130x00002d6b,0x000200f8,0x00002d6b,0x000700f5,
38140x0000002f,0x00002d6c,0x00002d64,0x000027b8,
38150x00002d6a,0x00002d65,0x000300f7,0x00002d73,
38160x00000000,0x000400fa,0x00002d6c,0x00002d6d,
38170x00002d73,0x000200f8,0x00002d6d,0x00050051,
38180x00000027,0x00002d6f,0x000031a5,0x00000002,
38190x00050051,0x00000027,0x00002d71,0x000031a7,
38200x00000002,0x000500bc,0x0000002f,0x00002d72,
38210x00002d6f,0x00002d71,0x000200f9,0x00002d73,
38220x000200f8,0x00002d73,0x000700f5,0x0000002f,
38230x00002d74,0x00002d6c,0x00002d6b,0x00002d72,
38240x00002d6d,0x000300f7,0x000027d2,0x00000000,
38250x000400fa,0x00002d74,0x000027cb,0x000027d2,
38260x000200f8,0x000027cb,0x0007000c,0x0000004b,
38270x000027ce,0x00000001,0x00000025,0x000031a0,
38280x000031a5,0x0007000c,0x0000004b,0x000027d1,
38290x00000001,0x00000028,0x000031a2,0x000031a7,
38300x000200f9,0x000027d2,0x000200f8,0x000027d2,
38310x000700f5,0x0000004b,0x0000328f,0x000031a2,
38320x00002d73,0x000027d1,0x000027cb,0x000700f5,
38330x0000004b,0x0000328a,0x000031a0,0x00002d73,
38340x000027ce,0x000027cb,0x000200f9,0x000027d3,
38350x000200f8,0x000027d3,0x000700f5,0x0000004b,
38360x0000328e,0x000031a2,0x00002784,0x0000328f,
38370x000027d2,0x000700f5,0x0000004b,0x00003289,
38380x000031a0,0x00002784,0x0000328a,0x000027d2,
38390x000700f5,0x0000004b,0x000031e5,0x000032a7,
38400x00002784,0x000031a7,0x000027d2,0x000700f5,
38410x0000004b,0x000031e0,0x000032a5,0x00002784,
38420x000031a5,0x000027d2,0x000700f5,0x00000006,
38430x000031d9,0x00000380,0x00002784,0x000031a3,
38440x000027d2,0x000200f9,0x000027d4,0x000200f8,
38450x000027d4,0x000700f5,0x0000004b,0x0000328b,
38460x0000328c,0x00002783,0x0000328e,0x000027d3,
38470x000700f5,0x0000004b,0x00003286,0x00003287,
38480x00002783,0x00003289,0x000027d3,0x000700f5,
38490x0000004b,0x000031e2,0x000031e3,0x00002783,
38500x000031e5,0x000027d3,0x000700f5,0x0000004b,
38510x000031dd,0x000031de,0x00002783,0x000031e0,
38520x000027d3,0x000700f5,0x00000006,0x000031d2,
38530x00002839,0x00002783,0x000031d9,0x000027d3,
38540x00050084,0x00000006,0x000027d7,0x0000010a,
38550x0000319d,0x00050080,0x00000006,0x000027d8,
38560x0000282d,0x000027d7,0x00050041,0x00000156,
38570x000027d9,0x000000fc,0x000000da,0x0004003d,
38580x00000007,0x000027da,0x000027d9,0x00050051,
38590x00000006,0x00002d8b,0x000027da,0x00000000,
38600x00050095,0x000000ab,0x00002d8d,0x00002d8b,
38610x000027d8,0x00050051,0x00000006,0x00002d8e,
38620x00002d8d,0x00000001,0x00050051,0x00000006,
38630x00002d8f,0x00002d8d,0x00000000,0x00050051,
38640x00000006,0x00002d92,0x000027da,0x00000001,
38650x00050080,0x00000006,0x00002d94,0x00002d92,
38660x00002d8e,0x00050050,0x00000007,0x00002d95,
38670x00002d8f,0x00002d94,0x0004007c,0x00000014,
38680x00002d85,0x00002d95,0x00060041,0x000000db,
38690x00002d7d,0x00002d85,0x000000da,0x000000da,
38700x0005003e,0x00002d7d,0x000031d2,0x00000002,
38710x00000004,0x00050080,0x00000006,0x000027de,
38720x0000282d,0x0000011f,0x00050084,0x00000006,
38730x000027e0,0x00000150,0x0000319d,0x00050080,
38740x00000006,0x000027e1,0x000027de,0x000027e0,
38750x00050051,0x00000027,0x000027e6,0x000031dd,
38760x00000000,0x0004007c,0x00000006,0x00002d9b,
38770x000027e6,0x00050095,0x000000ab,0x00002db6,
38780x00002d8b,0x000027e1,0x00050051,0x00000006,
38790x00002db7,0x00002db6,0x00000001,0x00050051,
38800x00000006,0x00002db8,0x00002db6,0x00000000,
38810x00050080,0x00000006,0x00002dbd,0x00002d92,
38820x00002db7,0x00050050,0x00000007,0x00002dbe,
38830x00002db8,0x00002dbd,0x0004007c,0x00000014,
38840x00002dae,0x00002dbe,0x00060041,0x000000db,
38850x00002da6,0x00002dae,0x000000da,0x000000da,
38860x0005003e,0x00002da6,0x00002d9b,0x00000002,
38870x00000004,0x00050080,0x00000006,0x000027e9,
38880x000027e1,0x0000010a,0x00050051,0x00000027,
38890x000027ed,0x000031dd,0x00000001,0x0004007c,
38900x00000006,0x00002dc4,0x000027ed,0x00050095,
38910x000000ab,0x00002ddf,0x00002d8b,0x000027e9,
38920x00050051,0x00000006,0x00002de0,0x00002ddf,
38930x00000001,0x00050051,0x00000006,0x00002de1,
38940x00002ddf,0x00000000,0x00050080,0x00000006,
38950x00002de6,0x00002d92,0x00002de0,0x00050050,
38960x00000007,0x00002de7,0x00002de1,0x00002de6,
38970x0004007c,0x00000014,0x00002dd7,0x00002de7,
38980x00060041,0x000000db,0x00002dcf,0x00002dd7,
38990x000000da,0x000000da,0x0005003e,0x00002dcf,
39000x00002dc4,0x00000002,0x00000004,0x00050080,
39010x00000006,0x000027f0,0x000027e1,0x00000111,
39020x00050051,0x00000027,0x000027f4,0x000031dd,
39030x00000002,0x0004007c,0x00000006,0x00002ded,
39040x000027f4,0x00050095,0x000000ab,0x00002e08,
39050x00002d8b,0x000027f0,0x00050051,0x00000006,
39060x00002e09,0x00002e08,0x00000001,0x00050051,
39070x00000006,0x00002e0a,0x00002e08,0x00000000,
39080x00050080,0x00000006,0x00002e0f,0x00002d92,
39090x00002e09,0x00050050,0x00000007,0x00002e10,
39100x00002e0a,0x00002e0f,0x0004007c,0x00000014,
39110x00002e00,0x00002e10,0x00060041,0x000000db,
39120x00002df8,0x00002e00,0x000000da,0x000000da,
39130x0005003e,0x00002df8,0x00002ded,0x00000002,
39140x00000004,0x00050080,0x00000006,0x000027f7,
39150x000027e1,0x00000118,0x00050051,0x00000027,
39160x000027fb,0x000031e2,0x00000000,0x0004007c,
39170x00000006,0x00002e16,0x000027fb,0x00050095,
39180x000000ab,0x00002e31,0x00002d8b,0x000027f7,
39190x00050051,0x00000006,0x00002e32,0x00002e31,
39200x00000001,0x00050051,0x00000006,0x00002e33,
39210x00002e31,0x00000000,0x00050080,0x00000006,
39220x00002e38,0x00002d92,0x00002e32,0x00050050,
39230x00000007,0x00002e39,0x00002e33,0x00002e38,
39240x0004007c,0x00000014,0x00002e29,0x00002e39,
39250x00060041,0x000000db,0x00002e21,0x00002e29,
39260x000000da,0x000000da,0x0005003e,0x00002e21,
39270x00002e16,0x00000002,0x00000004,0x00050080,
39280x00000006,0x000027fe,0x000027e1,0x0000011f,
39290x00050051,0x00000027,0x00002802,0x000031e2,
39300x00000001,0x0004007c,0x00000006,0x00002e3f,
39310x00002802,0x00050095,0x000000ab,0x00002e5a,
39320x00002d8b,0x000027fe,0x00050051,0x00000006,
39330x00002e5b,0x00002e5a,0x00000001,0x00050051,
39340x00000006,0x00002e5c,0x00002e5a,0x00000000,
39350x00050080,0x00000006,0x00002e61,0x00002d92,
39360x00002e5b,0x00050050,0x00000007,0x00002e62,
39370x00002e5c,0x00002e61,0x0004007c,0x00000014,
39380x00002e52,0x00002e62,0x00060041,0x000000db,
39390x00002e4a,0x00002e52,0x000000da,0x000000da,
39400x0005003e,0x00002e4a,0x00002e3f,0x00000002,
39410x00000004,0x00050080,0x00000006,0x00002805,
39420x000027e1,0x00000189,0x00050051,0x00000027,
39430x00002809,0x000031e2,0x00000002,0x0004007c,
39440x00000006,0x00002e68,0x00002809,0x00050095,
39450x000000ab,0x00002e83,0x00002d8b,0x00002805,
39460x00050051,0x00000006,0x00002e84,0x00002e83,
39470x00000001,0x00050051,0x00000006,0x00002e85,
39480x00002e83,0x00000000,0x00050080,0x00000006,
39490x00002e8a,0x00002d92,0x00002e84,0x00050050,
39500x00000007,0x00002e8b,0x00002e85,0x00002e8a,
39510x0004007c,0x00000014,0x00002e7b,0x00002e8b,
39520x00060041,0x000000db,0x00002e73,0x00002e7b,
39530x000000da,0x000000da,0x0005003e,0x00002e73,
39540x00002e68,0x00000002,0x00000004,0x000200f9,
39550x0000280b,0x000200f8,0x0000280b,0x00050080,
39560x00000006,0x0000280d,0x0000319d,0x00000154,
39570x000200f9,0x0000272f,0x000200f8,0x0000280e,
39580x000200f9,0x0000280f,0x000200f8,0x0000280f,
39590x000700f5,0x00000006,0x0000319e,0x000000a6,
39600x0000280e,0x0000281e,0x00002813,0x000500b0,
39610x0000002f,0x00002812,0x0000319e,0x0000010a,
39620x000400f6,0x0000281f,0x00002813,0x00000000,
39630x000400fa,0x00002812,0x00002813,0x0000281f,
39640x000200f8,0x00002813,0x00050080,0x00000006,
39650x00002815,0x0000282d,0x000005c6,0x00050084,
39660x00000006,0x00002817,0x0000010a,0x0000319e,
39670x00050080,0x00000006,0x00002818,0x00002815,
39680x00002817,0x00050041,0x00000156,0x00002819,
39690x000000fc,0x000000da,0x0004003d,0x00000007, 36540x000000fc,0x000000da,0x0004003d,0x00000007,
39700x0000281a,0x00002819,0x00050051,0x00000006, 36550x00002797,0x00002796,0x00050051,0x00000006,
39710x00002ea1,0x0000281a,0x00000000,0x00050095, 36560x00002c06,0x00002797,0x00000000,0x00050095,
39720x000000ab,0x00002ea3,0x00002ea1,0x00002818, 36570x000000ab,0x00002c08,0x00002c06,0x00002795,
39730x00050051,0x00000006,0x00002ea4,0x00002ea3, 36580x00050051,0x00000006,0x00002c09,0x00002c08,
39740x00000001,0x00050051,0x00000006,0x00002ea5, 36590x00000001,0x00050051,0x00000006,0x00002c0a,
39750x00002ea3,0x00000000,0x00050051,0x00000006, 36600x00002c08,0x00000000,0x00050051,0x00000006,
39760x00002ea8,0x0000281a,0x00000001,0x00050080, 36610x00002c0d,0x00002797,0x00000001,0x00050080,
39770x00000006,0x00002eaa,0x00002ea8,0x00002ea4, 36620x00000006,0x00002c0f,0x00002c0d,0x00002c09,
39780x00050050,0x00000007,0x00002eab,0x00002ea5, 36630x00050050,0x00000007,0x00002c10,0x00002c0a,
39790x00002eaa,0x0004007c,0x00000014,0x00002e9b, 36640x00002c0f,0x0004007c,0x00000014,0x00002c00,
39800x00002eab,0x00060041,0x000000db,0x00002e93, 36650x00002c10,0x00060041,0x000000db,0x00002bf8,
39810x00002e9b,0x000000da,0x000000da,0x0005003e, 36660x00002c00,0x000000da,0x000000da,0x0005003e,
39820x00002e93,0x000000a6,0x00000002,0x00000004, 36670x00002bf8,0x00002821,0x00000002,0x00000004,
39830x00050080,0x00000006,0x0000281e,0x0000319e, 36680x000200f9,0x0000279a,0x000200f8,0x0000279a,
39840x00000154,0x000200f9,0x0000280f,0x000200f8, 36690x000200f9,0x000027a9,0x000200f8,0x0000279b,
39850x0000281f,0x00050041,0x000000fe,0x00002820, 36700x00050080,0x00000006,0x0000279f,0x0000277c,
39860x000000fc,0x0000096c,0x0004003d,0x00000006, 36710x0000272a,0x00050084,0x00000006,0x00002c16,
39870x00002821,0x00002820,0x00050080,0x00000006, 36720x0000279f,0x00000228,0x00050080,0x00000006,
39880x00002823,0x00002821,0x00002723,0x00050041, 36730x00002c17,0x0000281b,0x00002c16,0x000500c2,
39890x000000fe,0x00002ef5,0x000000fc,0x000000fd, 36740x00000006,0x00002c18,0x00002c17,0x00000233,
39900x0004003d,0x00000006,0x00002ef6,0x00002ef5, 36750x000500c4,0x00000006,0x00002c19,0x00002c18,
39910x00050084,0x00000006,0x00002ef7,0x0000011f, 36760x0000020d,0x000500c5,0x00000006,0x00002c1a,
39920x00002ef6,0x00050080,0x00000006,0x00002ef8, 36770x00002c19,0x00000246,0x00050041,0x000000fe,
39930x00000107,0x00002ef7,0x00050080,0x00000006, 36780x000027a2,0x000000fc,0x00000963,0x0004003d,
39940x00002efe,0x00002ef6,0x000032a8,0x00050086, 36790x00000006,0x000027a3,0x000027a2,0x00050080,
39950x00000006,0x00002eff,0x00002efe,0x00000101, 36800x00000006,0x000027a5,0x000027a3,0x0000279f,
39960x00050084,0x00000006,0x00002ef1,0x00000107, 36810x00050041,0x000000fe,0x00002c5a,0x000000fc,
39970x00002eff,0x00050080,0x00000006,0x00002ef2, 36820x000000fd,0x0004003d,0x00000006,0x00002c5b,
39980x00002ef8,0x00002ef1,0x00050084,0x00000006, 36830x00002c5a,0x00050084,0x00000006,0x00002c5c,
39990x00002ec2,0x00000150,0x00002823,0x00050080, 36840x0000011f,0x00002c5b,0x00050080,0x00000006,
40000x00000006,0x00002ec3,0x00002ef2,0x00002ec2, 36850x00002c5d,0x00000107,0x00002c5c,0x00050080,
40010x00050041,0x00000156,0x00002ec4,0x000000fc, 36860x00000006,0x00002c63,0x00002c5b,0x00003297,
40020x00000154,0x0004003d,0x00000007,0x00002ec5, 36870x00050086,0x00000006,0x00002c64,0x00002c63,
40030x00002ec4,0x00050051,0x00000027,0x00002ec8, 36880x00000101,0x00050084,0x00000006,0x00002c56,
40040x000031a0,0x00000000,0x0004007c,0x00000006, 36890x00000107,0x00002c64,0x00050080,0x00000006,
40050x00002f05,0x00002ec8,0x00050051,0x00000006, 36900x00002c57,0x00002c5d,0x00002c56,0x00050084,
40060x00002f1e,0x00002ec5,0x00000000,0x00050095, 36910x00000006,0x00002c2b,0x00000150,0x000027a5,
40070x000000ab,0x00002f20,0x00002f1e,0x00002ec3, 36920x00050080,0x00000006,0x00002c2c,0x00002c57,
40080x00050051,0x00000006,0x00002f21,0x00002f20, 36930x00002c2b,0x00050041,0x00000156,0x00002c2d,
40090x00000001,0x00050051,0x00000006,0x00002f22, 36940x000000fc,0x00000154,0x0004003d,0x00000007,
40100x00002f20,0x00000000,0x00050051,0x00000006, 36950x00002c2e,0x00002c2d,0x00050051,0x00000006,
40110x00002f25,0x00002ec5,0x00000001,0x00050080, 36960x00002c7b,0x00002c2e,0x00000000,0x00050095,
40120x00000006,0x00002f27,0x00002f25,0x00002f21, 36970x000000ab,0x00002c7d,0x00002c7b,0x00002c2c,
40130x00050050,0x00000007,0x00002f28,0x00002f22, 36980x00050051,0x00000006,0x00002c7e,0x00002c7d,
40140x00002f27,0x0004007c,0x00000014,0x00002f18, 36990x00000001,0x00050051,0x00000006,0x00002c7f,
40150x00002f28,0x00060041,0x000000db,0x00002f10, 37000x00002c7d,0x00000000,0x00050051,0x00000006,
40160x00002f18,0x000000da,0x000000da,0x0005003e, 37010x00002c82,0x00002c2e,0x00000001,0x00050080,
40170x00002f10,0x00002f05,0x00000002,0x00000004, 37020x00000006,0x00002c84,0x00002c82,0x00002c7e,
40180x00050080,0x00000006,0x00002ecb,0x00002ec3, 37030x00050050,0x00000007,0x00002c85,0x00002c7f,
40190x0000010a,0x00050051,0x00000027,0x00002ecf, 37040x00002c84,0x0004007c,0x00000014,0x00002c75,
40200x000031a0,0x00000001,0x0004007c,0x00000006, 37050x00002c85,0x00060041,0x000000db,0x00002c6c,
40210x00002f2e,0x00002ecf,0x00050095,0x000000ab, 37060x00002c75,0x000000da,0x000000da,0x0006003d,
40220x00002f49,0x00002f1e,0x00002ecb,0x00050051, 37070x00000006,0x00002c6d,0x00002c6c,0x00000002,
40230x00000006,0x00002f4a,0x00002f49,0x00000001, 37080x00000004,0x0004007c,0x00000027,0x00002c31,
40240x00050051,0x00000006,0x00002f4b,0x00002f49, 37090x00002c6d,0x00050080,0x00000006,0x00002c33,
40250x00000000,0x00050080,0x00000006,0x00002f50, 37100x00002c2c,0x0000010a,0x00050095,0x000000ab,
40260x00002f25,0x00002f4a,0x00050050,0x00000007, 37110x00002c9e,0x00002c7b,0x00002c33,0x00050051,
40270x00002f51,0x00002f4b,0x00002f50,0x0004007c, 37120x00000006,0x00002c9f,0x00002c9e,0x00000001,
40280x00000014,0x00002f41,0x00002f51,0x00060041, 37130x00050051,0x00000006,0x00002ca0,0x00002c9e,
40290x000000db,0x00002f39,0x00002f41,0x000000da, 37140x00000000,0x00050080,0x00000006,0x00002ca5,
40300x000000da,0x0005003e,0x00002f39,0x00002f2e, 37150x00002c82,0x00002c9f,0x00050050,0x00000007,
37160x00002ca6,0x00002ca0,0x00002ca5,0x0004007c,
37170x00000014,0x00002c96,0x00002ca6,0x00060041,
37180x000000db,0x00002c8d,0x00002c96,0x000000da,
37190x000000da,0x0006003d,0x00000006,0x00002c8e,
37200x00002c8d,0x00000002,0x00000004,0x0004007c,
37210x00000027,0x00002c37,0x00002c8e,0x00050080,
37220x00000006,0x00002c39,0x00002c2c,0x00000111,
37230x00050095,0x000000ab,0x00002cbf,0x00002c7b,
37240x00002c39,0x00050051,0x00000006,0x00002cc0,
37250x00002cbf,0x00000001,0x00050051,0x00000006,
37260x00002cc1,0x00002cbf,0x00000000,0x00050080,
37270x00000006,0x00002cc6,0x00002c82,0x00002cc0,
37280x00050050,0x00000007,0x00002cc7,0x00002cc1,
37290x00002cc6,0x0004007c,0x00000014,0x00002cb7,
37300x00002cc7,0x00060041,0x000000db,0x00002cae,
37310x00002cb7,0x000000da,0x000000da,0x0006003d,
37320x00000006,0x00002caf,0x00002cae,0x00000002,
37330x00000004,0x0004007c,0x00000027,0x00002c3d,
37340x00002caf,0x00060050,0x0000004b,0x00002c3e,
37350x00002c31,0x00002c37,0x00002c3d,0x00050080,
37360x00000006,0x00002c40,0x00002c2c,0x00000118,
37370x00050095,0x000000ab,0x00002ce0,0x00002c7b,
37380x00002c40,0x00050051,0x00000006,0x00002ce1,
37390x00002ce0,0x00000001,0x00050051,0x00000006,
37400x00002ce2,0x00002ce0,0x00000000,0x00050080,
37410x00000006,0x00002ce7,0x00002c82,0x00002ce1,
37420x00050050,0x00000007,0x00002ce8,0x00002ce2,
37430x00002ce7,0x0004007c,0x00000014,0x00002cd8,
37440x00002ce8,0x00060041,0x000000db,0x00002ccf,
37450x00002cd8,0x000000da,0x000000da,0x0006003d,
37460x00000006,0x00002cd0,0x00002ccf,0x00000002,
37470x00000004,0x0004007c,0x00000027,0x00002c44,
37480x00002cd0,0x00050080,0x00000006,0x00002c46,
37490x00002c2c,0x0000011f,0x00050095,0x000000ab,
37500x00002d01,0x00002c7b,0x00002c46,0x00050051,
37510x00000006,0x00002d02,0x00002d01,0x00000001,
37520x00050051,0x00000006,0x00002d03,0x00002d01,
37530x00000000,0x00050080,0x00000006,0x00002d08,
37540x00002c82,0x00002d02,0x00050050,0x00000007,
37550x00002d09,0x00002d03,0x00002d08,0x0004007c,
37560x00000014,0x00002cf9,0x00002d09,0x00060041,
37570x000000db,0x00002cf0,0x00002cf9,0x000000da,
37580x000000da,0x0006003d,0x00000006,0x00002cf1,
37590x00002cf0,0x00000002,0x00000004,0x0004007c,
37600x00000027,0x00002c4a,0x00002cf1,0x00050080,
37610x00000006,0x00002c4c,0x00002c2c,0x00000189,
37620x00050095,0x000000ab,0x00002d22,0x00002c7b,
37630x00002c4c,0x00050051,0x00000006,0x00002d23,
37640x00002d22,0x00000001,0x00050051,0x00000006,
37650x00002d24,0x00002d22,0x00000000,0x00050080,
37660x00000006,0x00002d29,0x00002c82,0x00002d23,
37670x00050050,0x00000007,0x00002d2a,0x00002d24,
37680x00002d29,0x0004007c,0x00000014,0x00002d1a,
37690x00002d2a,0x00060041,0x000000db,0x00002d11,
37700x00002d1a,0x000000da,0x000000da,0x0006003d,
37710x00000006,0x00002d12,0x00002d11,0x00000002,
37720x00000004,0x0004007c,0x00000027,0x00002c50,
37730x00002d12,0x00060050,0x0000004b,0x00002c51,
37740x00002c44,0x00002c4a,0x00002c50,0x000200f9,
37750x000027a9,0x000200f8,0x000027a9,0x000700f5,
37760x0000004b,0x00003198,0x00002b17,0x0000279a,
37770x00002c51,0x0000279b,0x000700f5,0x0000004b,
37780x00003196,0x00002b04,0x0000279a,0x00002c3e,
37790x0000279b,0x000700f5,0x00000006,0x00003194,
37800x00002ada,0x0000279a,0x00002c1a,0x0000279b,
37810x00050041,0x000000fe,0x000027aa,0x000000fc,
37820x000009e6,0x0004003d,0x00000006,0x000027ab,
37830x000027aa,0x000500c2,0x00000006,0x00002d2e,
37840x00003194,0x0000020d,0x00050041,0x000000fe,
37850x000027ae,0x000000fc,0x0000022c,0x0004003d,
37860x00000006,0x000027af,0x000027ae,0x00050086,
37870x00000006,0x000027b0,0x000027af,0x00000107,
37880x00050082,0x00000006,0x000027b1,0x00002d2e,
37890x000027b0,0x00050084,0x00000006,0x000027b2,
37900x0000010a,0x000027b1,0x00050080,0x00000006,
37910x000027b3,0x000027ab,0x000027b2,0x00050041,
37920x00000156,0x000027b4,0x000000fc,0x000000da,
37930x0004003d,0x00000007,0x000027b5,0x000027b4,
37940x00050051,0x00000006,0x00002d44,0x000027b5,
37950x00000000,0x00050095,0x000000ab,0x00002d46,
37960x00002d44,0x000027b3,0x00050051,0x00000006,
37970x00002d47,0x00002d46,0x00000001,0x00050051,
37980x00000006,0x00002d48,0x00002d46,0x00000000,
37990x00050051,0x00000006,0x00002d4b,0x000027b5,
38000x00000001,0x00050080,0x00000006,0x00002d4d,
38010x00002d4b,0x00002d47,0x00050050,0x00000007,
38020x00002d4e,0x00002d48,0x00002d4d,0x0004007c,
38030x00000014,0x00002d3e,0x00002d4e,0x00060041,
38040x000000db,0x00002d36,0x00002d3e,0x000000da,
38050x000000da,0x0005003e,0x00002d36,0x00002821,
38060x00000002,0x00000004,0x00050051,0x00000027,
38070x00002d52,0x00003196,0x00000000,0x00050051,
38080x00000027,0x00002d54,0x00003198,0x00000000,
38090x000500bc,0x0000002f,0x00002d55,0x00002d52,
38100x00002d54,0x000300f7,0x00002d5c,0x00000000,
38110x000400fa,0x00002d55,0x00002d56,0x00002d5c,
38120x000200f8,0x00002d56,0x00050051,0x00000027,
38130x00002d58,0x00003196,0x00000001,0x00050051,
38140x00000027,0x00002d5a,0x00003198,0x00000001,
38150x000500bc,0x0000002f,0x00002d5b,0x00002d58,
38160x00002d5a,0x000200f9,0x00002d5c,0x000200f8,
38170x00002d5c,0x000700f5,0x0000002f,0x00002d5d,
38180x00002d55,0x000027a9,0x00002d5b,0x00002d56,
38190x000300f7,0x00002d64,0x00000000,0x000400fa,
38200x00002d5d,0x00002d5e,0x00002d64,0x000200f8,
38210x00002d5e,0x00050051,0x00000027,0x00002d60,
38220x00003196,0x00000002,0x00050051,0x00000027,
38230x00002d62,0x00003198,0x00000002,0x000500bc,
38240x0000002f,0x00002d63,0x00002d60,0x00002d62,
38250x000200f9,0x00002d64,0x000200f8,0x00002d64,
38260x000700f5,0x0000002f,0x00002d65,0x00002d5d,
38270x00002d5c,0x00002d63,0x00002d5e,0x000300f7,
38280x000027c3,0x00000000,0x000400fa,0x00002d65,
38290x000027bc,0x000027c3,0x000200f8,0x000027bc,
38300x0007000c,0x0000004b,0x000027bf,0x00000001,
38310x00000025,0x00003191,0x00003196,0x0007000c,
38320x0000004b,0x000027c2,0x00000001,0x00000028,
38330x00003193,0x00003198,0x000200f9,0x000027c3,
38340x000200f8,0x000027c3,0x000700f5,0x0000004b,
38350x00003280,0x00003193,0x00002d64,0x000027c2,
38360x000027bc,0x000700f5,0x0000004b,0x0000327b,
38370x00003191,0x00002d64,0x000027bf,0x000027bc,
38380x000200f9,0x000027c4,0x000200f8,0x000027c4,
38390x000700f5,0x0000004b,0x0000327f,0x00003193,
38400x00002775,0x00003280,0x000027c3,0x000700f5,
38410x0000004b,0x0000327a,0x00003191,0x00002775,
38420x0000327b,0x000027c3,0x000700f5,0x0000004b,
38430x000031d6,0x00003294,0x00002775,0x00003198,
38440x000027c3,0x000700f5,0x0000004b,0x000031d1,
38450x000003be,0x00002775,0x00003196,0x000027c3,
38460x000700f5,0x00000006,0x000031ca,0x00000380,
38470x00002775,0x00003194,0x000027c3,0x000200f9,
38480x000027c5,0x000200f8,0x000027c5,0x000700f5,
38490x0000004b,0x0000327c,0x0000327d,0x00002774,
38500x0000327f,0x000027c4,0x000700f5,0x0000004b,
38510x00003277,0x00003278,0x00002774,0x0000327a,
38520x000027c4,0x000700f5,0x0000004b,0x000031d3,
38530x000031d4,0x00002774,0x000031d6,0x000027c4,
38540x000700f5,0x0000004b,0x000031ce,0x000031cf,
38550x00002774,0x000031d1,0x000027c4,0x000700f5,
38560x00000006,0x000031c3,0x0000282a,0x00002774,
38570x000031ca,0x000027c4,0x00050084,0x00000006,
38580x000027c8,0x0000010a,0x0000318e,0x00050080,
38590x00000006,0x000027c9,0x0000281e,0x000027c8,
38600x00050041,0x00000156,0x000027ca,0x000000fc,
38610x000000da,0x0004003d,0x00000007,0x000027cb,
38620x000027ca,0x00050051,0x00000006,0x00002d7c,
38630x000027cb,0x00000000,0x00050095,0x000000ab,
38640x00002d7e,0x00002d7c,0x000027c9,0x00050051,
38650x00000006,0x00002d7f,0x00002d7e,0x00000001,
38660x00050051,0x00000006,0x00002d80,0x00002d7e,
38670x00000000,0x00050051,0x00000006,0x00002d83,
38680x000027cb,0x00000001,0x00050080,0x00000006,
38690x00002d85,0x00002d83,0x00002d7f,0x00050050,
38700x00000007,0x00002d86,0x00002d80,0x00002d85,
38710x0004007c,0x00000014,0x00002d76,0x00002d86,
38720x00060041,0x000000db,0x00002d6e,0x00002d76,
38730x000000da,0x000000da,0x0005003e,0x00002d6e,
38740x000031c3,0x00000002,0x00000004,0x00050080,
38750x00000006,0x000027cf,0x0000281e,0x0000011f,
38760x00050084,0x00000006,0x000027d1,0x00000150,
38770x0000318e,0x00050080,0x00000006,0x000027d2,
38780x000027cf,0x000027d1,0x00050051,0x00000027,
38790x000027d7,0x000031ce,0x00000000,0x0004007c,
38800x00000006,0x00002d8c,0x000027d7,0x00050095,
38810x000000ab,0x00002da7,0x00002d7c,0x000027d2,
38820x00050051,0x00000006,0x00002da8,0x00002da7,
38830x00000001,0x00050051,0x00000006,0x00002da9,
38840x00002da7,0x00000000,0x00050080,0x00000006,
38850x00002dae,0x00002d83,0x00002da8,0x00050050,
38860x00000007,0x00002daf,0x00002da9,0x00002dae,
38870x0004007c,0x00000014,0x00002d9f,0x00002daf,
38880x00060041,0x000000db,0x00002d97,0x00002d9f,
38890x000000da,0x000000da,0x0005003e,0x00002d97,
38900x00002d8c,0x00000002,0x00000004,0x00050080,
38910x00000006,0x000027da,0x000027d2,0x0000010a,
38920x00050051,0x00000027,0x000027de,0x000031ce,
38930x00000001,0x0004007c,0x00000006,0x00002db5,
38940x000027de,0x00050095,0x000000ab,0x00002dd0,
38950x00002d7c,0x000027da,0x00050051,0x00000006,
38960x00002dd1,0x00002dd0,0x00000001,0x00050051,
38970x00000006,0x00002dd2,0x00002dd0,0x00000000,
38980x00050080,0x00000006,0x00002dd7,0x00002d83,
38990x00002dd1,0x00050050,0x00000007,0x00002dd8,
39000x00002dd2,0x00002dd7,0x0004007c,0x00000014,
39010x00002dc8,0x00002dd8,0x00060041,0x000000db,
39020x00002dc0,0x00002dc8,0x000000da,0x000000da,
39030x0005003e,0x00002dc0,0x00002db5,0x00000002,
39040x00000004,0x00050080,0x00000006,0x000027e1,
39050x000027d2,0x00000111,0x00050051,0x00000027,
39060x000027e5,0x000031ce,0x00000002,0x0004007c,
39070x00000006,0x00002dde,0x000027e5,0x00050095,
39080x000000ab,0x00002df9,0x00002d7c,0x000027e1,
39090x00050051,0x00000006,0x00002dfa,0x00002df9,
39100x00000001,0x00050051,0x00000006,0x00002dfb,
39110x00002df9,0x00000000,0x00050080,0x00000006,
39120x00002e00,0x00002d83,0x00002dfa,0x00050050,
39130x00000007,0x00002e01,0x00002dfb,0x00002e00,
39140x0004007c,0x00000014,0x00002df1,0x00002e01,
39150x00060041,0x000000db,0x00002de9,0x00002df1,
39160x000000da,0x000000da,0x0005003e,0x00002de9,
39170x00002dde,0x00000002,0x00000004,0x00050080,
39180x00000006,0x000027e8,0x000027d2,0x00000118,
39190x00050051,0x00000027,0x000027ec,0x000031d3,
39200x00000000,0x0004007c,0x00000006,0x00002e07,
39210x000027ec,0x00050095,0x000000ab,0x00002e22,
39220x00002d7c,0x000027e8,0x00050051,0x00000006,
39230x00002e23,0x00002e22,0x00000001,0x00050051,
39240x00000006,0x00002e24,0x00002e22,0x00000000,
39250x00050080,0x00000006,0x00002e29,0x00002d83,
39260x00002e23,0x00050050,0x00000007,0x00002e2a,
39270x00002e24,0x00002e29,0x0004007c,0x00000014,
39280x00002e1a,0x00002e2a,0x00060041,0x000000db,
39290x00002e12,0x00002e1a,0x000000da,0x000000da,
39300x0005003e,0x00002e12,0x00002e07,0x00000002,
39310x00000004,0x00050080,0x00000006,0x000027ef,
39320x000027d2,0x0000011f,0x00050051,0x00000027,
39330x000027f3,0x000031d3,0x00000001,0x0004007c,
39340x00000006,0x00002e30,0x000027f3,0x00050095,
39350x000000ab,0x00002e4b,0x00002d7c,0x000027ef,
39360x00050051,0x00000006,0x00002e4c,0x00002e4b,
39370x00000001,0x00050051,0x00000006,0x00002e4d,
39380x00002e4b,0x00000000,0x00050080,0x00000006,
39390x00002e52,0x00002d83,0x00002e4c,0x00050050,
39400x00000007,0x00002e53,0x00002e4d,0x00002e52,
39410x0004007c,0x00000014,0x00002e43,0x00002e53,
39420x00060041,0x000000db,0x00002e3b,0x00002e43,
39430x000000da,0x000000da,0x0005003e,0x00002e3b,
39440x00002e30,0x00000002,0x00000004,0x00050080,
39450x00000006,0x000027f6,0x000027d2,0x00000189,
39460x00050051,0x00000027,0x000027fa,0x000031d3,
39470x00000002,0x0004007c,0x00000006,0x00002e59,
39480x000027fa,0x00050095,0x000000ab,0x00002e74,
39490x00002d7c,0x000027f6,0x00050051,0x00000006,
39500x00002e75,0x00002e74,0x00000001,0x00050051,
39510x00000006,0x00002e76,0x00002e74,0x00000000,
39520x00050080,0x00000006,0x00002e7b,0x00002d83,
39530x00002e75,0x00050050,0x00000007,0x00002e7c,
39540x00002e76,0x00002e7b,0x0004007c,0x00000014,
39550x00002e6c,0x00002e7c,0x00060041,0x000000db,
39560x00002e64,0x00002e6c,0x000000da,0x000000da,
39570x0005003e,0x00002e64,0x00002e59,0x00000002,
39580x00000004,0x000200f9,0x000027fc,0x000200f8,
39590x000027fc,0x00050080,0x00000006,0x000027fe,
39600x0000318e,0x00000154,0x000200f9,0x00002722,
39610x000200f8,0x000027ff,0x000200f9,0x00002800,
39620x000200f8,0x00002800,0x000700f5,0x00000006,
39630x0000318f,0x000000a6,0x000027ff,0x0000280f,
39640x00002804,0x000500b0,0x0000002f,0x00002803,
39650x0000318f,0x0000010a,0x000400f6,0x00002810,
39660x00002804,0x00000000,0x000400fa,0x00002803,
39670x00002804,0x00002810,0x000200f8,0x00002804,
39680x00050080,0x00000006,0x00002806,0x0000281e,
39690x000005c3,0x00050084,0x00000006,0x00002808,
39700x0000010a,0x0000318f,0x00050080,0x00000006,
39710x00002809,0x00002806,0x00002808,0x00050041,
39720x00000156,0x0000280a,0x000000fc,0x000000da,
39730x0004003d,0x00000007,0x0000280b,0x0000280a,
39740x00050051,0x00000006,0x00002e92,0x0000280b,
39750x00000000,0x00050095,0x000000ab,0x00002e94,
39760x00002e92,0x00002809,0x00050051,0x00000006,
39770x00002e95,0x00002e94,0x00000001,0x00050051,
39780x00000006,0x00002e96,0x00002e94,0x00000000,
39790x00050051,0x00000006,0x00002e99,0x0000280b,
39800x00000001,0x00050080,0x00000006,0x00002e9b,
39810x00002e99,0x00002e95,0x00050050,0x00000007,
39820x00002e9c,0x00002e96,0x00002e9b,0x0004007c,
39830x00000014,0x00002e8c,0x00002e9c,0x00060041,
39840x000000db,0x00002e84,0x00002e8c,0x000000da,
39850x000000da,0x0005003e,0x00002e84,0x000000a6,
39860x00000002,0x00000004,0x00050080,0x00000006,
39870x0000280f,0x0000318f,0x00000154,0x000200f9,
39880x00002800,0x000200f8,0x00002810,0x00050041,
39890x000000fe,0x00002811,0x000000fc,0x00000963,
39900x0004003d,0x00000006,0x00002812,0x00002811,
39910x00050080,0x00000006,0x00002814,0x00002812,
39920x00002718,0x00050041,0x000000fe,0x00002ee6,
39930x000000fc,0x000000fd,0x0004003d,0x00000006,
39940x00002ee7,0x00002ee6,0x00050084,0x00000006,
39950x00002ee8,0x0000011f,0x00002ee7,0x00050080,
39960x00000006,0x00002ee9,0x00000107,0x00002ee8,
39970x00050080,0x00000006,0x00002eef,0x00002ee7,
39980x00003297,0x00050086,0x00000006,0x00002ef0,
39990x00002eef,0x00000101,0x00050084,0x00000006,
40000x00002ee2,0x00000107,0x00002ef0,0x00050080,
40010x00000006,0x00002ee3,0x00002ee9,0x00002ee2,
40020x00050084,0x00000006,0x00002eb3,0x00000150,
40030x00002814,0x00050080,0x00000006,0x00002eb4,
40040x00002ee3,0x00002eb3,0x00050041,0x00000156,
40050x00002eb5,0x000000fc,0x00000154,0x0004003d,
40060x00000007,0x00002eb6,0x00002eb5,0x00050051,
40070x00000027,0x00002eb9,0x00003191,0x00000000,
40080x0004007c,0x00000006,0x00002ef6,0x00002eb9,
40090x00050051,0x00000006,0x00002f0f,0x00002eb6,
40100x00000000,0x00050095,0x000000ab,0x00002f11,
40110x00002f0f,0x00002eb4,0x00050051,0x00000006,
40120x00002f12,0x00002f11,0x00000001,0x00050051,
40130x00000006,0x00002f13,0x00002f11,0x00000000,
40140x00050051,0x00000006,0x00002f16,0x00002eb6,
40150x00000001,0x00050080,0x00000006,0x00002f18,
40160x00002f16,0x00002f12,0x00050050,0x00000007,
40170x00002f19,0x00002f13,0x00002f18,0x0004007c,
40180x00000014,0x00002f09,0x00002f19,0x00060041,
40190x000000db,0x00002f01,0x00002f09,0x000000da,
40200x000000da,0x0005003e,0x00002f01,0x00002ef6,
40210x00000002,0x00000004,0x00050080,0x00000006,
40220x00002ebc,0x00002eb4,0x0000010a,0x00050051,
40230x00000027,0x00002ec0,0x00003191,0x00000001,
40240x0004007c,0x00000006,0x00002f1f,0x00002ec0,
40250x00050095,0x000000ab,0x00002f3a,0x00002f0f,
40260x00002ebc,0x00050051,0x00000006,0x00002f3b,
40270x00002f3a,0x00000001,0x00050051,0x00000006,
40280x00002f3c,0x00002f3a,0x00000000,0x00050080,
40290x00000006,0x00002f41,0x00002f16,0x00002f3b,
40300x00050050,0x00000007,0x00002f42,0x00002f3c,
40310x00002f41,0x0004007c,0x00000014,0x00002f32,
40320x00002f42,0x00060041,0x000000db,0x00002f2a,
40330x00002f32,0x000000da,0x000000da,0x0005003e,
40340x00002f2a,0x00002f1f,0x00000002,0x00000004,
40350x00050080,0x00000006,0x00002ec3,0x00002eb4,
40360x00000111,0x00050051,0x00000027,0x00002ec7,
40370x00003191,0x00000002,0x0004007c,0x00000006,
40380x00002f48,0x00002ec7,0x00050095,0x000000ab,
40390x00002f63,0x00002f0f,0x00002ec3,0x00050051,
40400x00000006,0x00002f64,0x00002f63,0x00000001,
40410x00050051,0x00000006,0x00002f65,0x00002f63,
40420x00000000,0x00050080,0x00000006,0x00002f6a,
40430x00002f16,0x00002f64,0x00050050,0x00000007,
40440x00002f6b,0x00002f65,0x00002f6a,0x0004007c,
40450x00000014,0x00002f5b,0x00002f6b,0x00060041,
40460x000000db,0x00002f53,0x00002f5b,0x000000da,
40470x000000da,0x0005003e,0x00002f53,0x00002f48,
40310x00000002,0x00000004,0x00050080,0x00000006, 40480x00000002,0x00000004,0x00050080,0x00000006,
40320x00002ed2,0x00002ec3,0x00000111,0x00050051, 40490x00002eca,0x00002eb4,0x00000118,0x00050051,
40330x00000027,0x00002ed6,0x000031a0,0x00000002, 40500x00000027,0x00002ece,0x00003193,0x00000000,
40340x0004007c,0x00000006,0x00002f57,0x00002ed6, 40510x0004007c,0x00000006,0x00002f71,0x00002ece,
40350x00050095,0x000000ab,0x00002f72,0x00002f1e, 40520x00050095,0x000000ab,0x00002f8c,0x00002f0f,
40360x00002ed2,0x00050051,0x00000006,0x00002f73, 40530x00002eca,0x00050051,0x00000006,0x00002f8d,
40370x00002f72,0x00000001,0x00050051,0x00000006, 40540x00002f8c,0x00000001,0x00050051,0x00000006,
40380x00002f74,0x00002f72,0x00000000,0x00050080, 40550x00002f8e,0x00002f8c,0x00000000,0x00050080,
40390x00000006,0x00002f79,0x00002f25,0x00002f73, 40560x00000006,0x00002f93,0x00002f16,0x00002f8d,
40400x00050050,0x00000007,0x00002f7a,0x00002f74, 40570x00050050,0x00000007,0x00002f94,0x00002f8e,
40410x00002f79,0x0004007c,0x00000014,0x00002f6a, 40580x00002f93,0x0004007c,0x00000014,0x00002f84,
40420x00002f7a,0x00060041,0x000000db,0x00002f62, 40590x00002f94,0x00060041,0x000000db,0x00002f7c,
40430x00002f6a,0x000000da,0x000000da,0x0005003e, 40600x00002f84,0x000000da,0x000000da,0x0005003e,
40440x00002f62,0x00002f57,0x00000002,0x00000004, 40610x00002f7c,0x00002f71,0x00000002,0x00000004,
40450x00050080,0x00000006,0x00002ed9,0x00002ec3, 40620x00050080,0x00000006,0x00002ed1,0x00002eb4,
40460x00000118,0x00050051,0x00000027,0x00002edd, 40630x0000011f,0x00050051,0x00000027,0x00002ed5,
40470x000031a2,0x00000000,0x0004007c,0x00000006, 40640x00003193,0x00000001,0x0004007c,0x00000006,
40480x00002f80,0x00002edd,0x00050095,0x000000ab, 40650x00002f9a,0x00002ed5,0x00050095,0x000000ab,
40490x00002f9b,0x00002f1e,0x00002ed9,0x00050051, 40660x00002fb5,0x00002f0f,0x00002ed1,0x00050051,
40500x00000006,0x00002f9c,0x00002f9b,0x00000001, 40670x00000006,0x00002fb6,0x00002fb5,0x00000001,
40510x00050051,0x00000006,0x00002f9d,0x00002f9b, 40680x00050051,0x00000006,0x00002fb7,0x00002fb5,
40520x00000000,0x00050080,0x00000006,0x00002fa2, 40690x00000000,0x00050080,0x00000006,0x00002fbc,
40530x00002f25,0x00002f9c,0x00050050,0x00000007, 40700x00002f16,0x00002fb6,0x00050050,0x00000007,
40540x00002fa3,0x00002f9d,0x00002fa2,0x0004007c, 40710x00002fbd,0x00002fb7,0x00002fbc,0x0004007c,
40550x00000014,0x00002f93,0x00002fa3,0x00060041, 40720x00000014,0x00002fad,0x00002fbd,0x00060041,
40560x000000db,0x00002f8b,0x00002f93,0x000000da, 40730x000000db,0x00002fa5,0x00002fad,0x000000da,
40570x000000da,0x0005003e,0x00002f8b,0x00002f80, 40740x000000da,0x0005003e,0x00002fa5,0x00002f9a,
40580x00000002,0x00000004,0x00050080,0x00000006, 40750x00000002,0x00000004,0x00050080,0x00000006,
40590x00002ee0,0x00002ec3,0x0000011f,0x00050051, 40760x00002ed8,0x00002eb4,0x00000189,0x00050051,
40600x00000027,0x00002ee4,0x000031a2,0x00000001, 40770x00000027,0x00002edc,0x00003193,0x00000002,
40610x0004007c,0x00000006,0x00002fa9,0x00002ee4, 40780x0004007c,0x00000006,0x00002fc3,0x00002edc,
40620x00050095,0x000000ab,0x00002fc4,0x00002f1e, 40790x00050095,0x000000ab,0x00002fde,0x00002f0f,
40630x00002ee0,0x00050051,0x00000006,0x00002fc5, 40800x00002ed8,0x00050051,0x00000006,0x00002fdf,
40640x00002fc4,0x00000001,0x00050051,0x00000006, 40810x00002fde,0x00000001,0x00050051,0x00000006,
40650x00002fc6,0x00002fc4,0x00000000,0x00050080, 40820x00002fe0,0x00002fde,0x00000000,0x00050080,
40660x00000006,0x00002fcb,0x00002f25,0x00002fc5, 40830x00000006,0x00002fe5,0x00002f16,0x00002fdf,
40670x00050050,0x00000007,0x00002fcc,0x00002fc6, 40840x00050050,0x00000007,0x00002fe6,0x00002fe0,
40680x00002fcb,0x0004007c,0x00000014,0x00002fbc, 40850x00002fe5,0x0004007c,0x00000014,0x00002fd6,
40690x00002fcc,0x00060041,0x000000db,0x00002fb4, 40860x00002fe6,0x00060041,0x000000db,0x00002fce,
40700x00002fbc,0x000000da,0x000000da,0x0005003e, 40870x00002fd6,0x000000da,0x000000da,0x0005003e,
40710x00002fb4,0x00002fa9,0x00000002,0x00000004, 40880x00002fce,0x00002fc3,0x00000002,0x00000004,
40720x00050080,0x00000006,0x00002ee7,0x00002ec3, 40890x000200f9,0x00000be7,0x000200f8,0x00000be7,
40730x00000189,0x00050051,0x00000027,0x00002eeb, 40900x000200f9,0x00000bde,0x000200f8,0x00000bde,
40740x000031a2,0x00000002,0x0004007c,0x00000006, 40910x000200f9,0x00000bd5,0x000200f8,0x00000bd5,
40750x00002fd2,0x00002eeb,0x00050095,0x000000ab, 40920x000200f9,0x00000bcc,0x000200f8,0x00000bcc,
40760x00002fed,0x00002f1e,0x00002ee7,0x00050051, 40930x000200f9,0x00000ba6,0x000200f8,0x00000ba6,
40770x00000006,0x00002fee,0x00002fed,0x00000001, 40940x000200f9,0x00000b91,0x000200f8,0x00000b91,
40780x00050051,0x00000006,0x00002fef,0x00002fed, 40950x000200f9,0x00000bed,0x000200f8,0x00000bed,
40790x00000000,0x00050080,0x00000006,0x00002ff4, 40960x000100fd,0x00010038}
40800x00002f25,0x00002fee,0x00050050,0x00000007,
40810x00002ff5,0x00002fef,0x00002ff4,0x0004007c,
40820x00000014,0x00002fe5,0x00002ff5,0x00060041,
40830x000000db,0x00002fdd,0x00002fe5,0x000000da,
40840x000000da,0x0005003e,0x00002fdd,0x00002fd2,
40850x00000002,0x00000004,0x000200f9,0x00000bed,
40860x000200f8,0x00000bed,0x000200f9,0x00000be4,
40870x000200f8,0x00000be4,0x000200f9,0x00000bdb,
40880x000200f8,0x00000bdb,0x000200f9,0x00000bd2,
40890x000200f8,0x00000bd2,0x000200f9,0x00000bac,
40900x000200f8,0x00000bac,0x000200f9,0x00000b97,
40910x000200f8,0x00000b97,0x000200f9,0x00000bf3,
40920x000200f8,0x00000bf3,0x000100fd,0x00010038}
diff --git a/runtime/test/bindless_sizing_test.cpp b/runtime/test/bindless_sizing_test.cpp
index 07715f01e..4553f25b6 100644
--- a/runtime/test/bindless_sizing_test.cpp
+++ b/runtime/test/bindless_sizing_test.cpp
@@ -203,6 +203,22 @@ int main() {
203 EXPECT(totals(f).all <= 6159 || (count(f, D::dim_2d) == 4096 && f.counts[bindless::sampler_binding] == 1024)); 203 EXPECT(totals(f).all <= 6159 || (count(f, D::dim_2d) == 4096 && f.counts[bindless::sampler_binding] == 1024));
204 } 204 }
205 205
206 // MoltenVK 1.4.3 on an M3 Max: update-after-bind limits of 1000000 sampled images and 500000 samplers, but
207 // maxPerSetDescriptors 1212 and a vkGetDescriptorSetLayoutSupport that accepts only fewer descriptors than that
208 // (MVKDevice::getDescriptorSetLayoutSupport), though the device creates and samples far larger sets. So the
209 // set keeps the default counts: 1024 samplers, short of a full D3D12 sampler heap (d3d12_descriptor_test).
210 {
211 Device d = uniform(1048576, 1000000);
212 d.v12.maxPerStageDescriptorUpdateAfterBindSamplers = d.v12.maxDescriptorSetUpdateAfterBindSamplers = 500000;
213 d.limits.maxSamplerAllocationCount = 500000;
214 d.v11.maxPerSetDescriptors = 1212;
215 const auto below_1212 = [](const BindlessFeatures& candidate) { return totals(candidate).all < 1212; };
216 BindlessFeatures f = with_ms(true);
217 EXPECT(bindless::size_bindings(f, d.limits, d.v11, d.v12, below_1212));
218 EXPECT(count(f, D::dim_2d) == 4096 && f.counts[bindless::sampler_binding] == 1024 &&
219 storage(f, D::dim_2d) == 256);
220 }
221
206 // The default features are today's counts, which the device-less users (vk_image_fuzz) still get. 222 // The default features are today's counts, which the device-less users (vk_image_fuzz) still get.
207 EXPECT(BindlessFeatures{}.counts == defaults); 223 EXPECT(BindlessFeatures{}.counts == defaults);
208 std::printf("bindless sizing: synthetic limits gave the expected counts\n"); 224 std::printf("bindless sizing: synthetic limits gave the expected counts\n");
diff --git a/runtime/test/command_list_test.cpp b/runtime/test/command_list_test.cpp
index 69fe14679..e459b4cc8 100644
--- a/runtime/test/command_list_test.cpp
+++ b/runtime/test/command_list_test.cpp
@@ -223,6 +223,24 @@ int main() {
223 CHECK(std::get<CopyResource>(parent.commands()[1]).src == 4); 223 CHECK(std::get<CopyResource>(parent.commands()[1]).src == 4);
224 CHECK(!parent.execute_bundle(bundle)); // parent is closed 224 CHECK(!parent.execute_bundle(bundle)); // parent is closed
225 225
226 // The range form: [first, last) of the bundle, with last clamped to its size.
227 {
228 CommandList source, target, other;
229 CHECK(source.copy_resource({1, 2}) && source.copy_resource({3, 4}) && source.copy_resource({5, 6}));
230 CHECK(source.close());
231 CHECK(target.execute_bundle(source, 1, 2)); // the middle command only
232 CHECK(target.commands().size() == 1 && std::get<CopyResource>(target.commands()[0]).src == 4);
233 CHECK(target.execute_bundle(source, 2, 100)); // last beyond the size is clamped
234 CHECK(target.commands().size() == 2 && std::get<CopyResource>(target.commands()[1]).src == 6);
235 CHECK(target.execute_bundle(source, 1, 1) && target.commands().size() == 2); // first == last: nothing
236 CHECK(target.execute_bundle(source, 3, 3) && target.execute_bundle(source, 7, 9)); // first beyond the size
237 CHECK(target.execute_bundle(source, 2, 1) && target.commands().size() == 2); // first after last: nothing
238 CHECK(target.commands().size() == 2);
239 CHECK(other.execute_bundle(source)); // the default arguments copy all of it, as before
240 CHECK(other.commands().size() == 3 && std::get<CopyResource>(other.commands()[0]).src == 2 &&
241 std::get<CopyResource>(other.commands()[2]).src == 6);
242 }
243
226 CommandList open_parent, open_bundle; 244 CommandList open_parent, open_bundle;
227 CHECK(!open_parent.execute_bundle(open_bundle)); // bundle must be closed 245 CHECK(!open_parent.execute_bundle(open_bundle)); // bundle must be closed
228 CHECK(!open_parent.execute_bundle(open_parent)); // a list cannot execute itself 246 CHECK(!open_parent.execute_bundle(open_parent)); // a list cannot execute itself
diff --git a/runtime/test/d3d12_bundle_test.cpp b/runtime/test/d3d12_bundle_test.cpp
new file mode 100644
index 000000000..fd14dc29b
--- /dev/null
+++ b/runtime/test/d3d12_bundle_test.cpp
@@ -0,0 +1,840 @@
1// ExecuteBundle: what a bundle's draws inherit from the list that executes it, and what the bundle hands back.
2// The same scenarios run on the layer (a Vulkan device, shaders written to the translator's contract, the ones
3// d3d12_draw_test uses) and on Windows' own D3D12 (HLSL from D3DCompile, the default adapter and WARP), and each
4// is read back as an 8x8 grid of letters: B blue (the clear), R, G, Y the draw's colour, C a green-only write over
5// the clear, K black. The expected grids are what the host produced when they were measured (docs/d3d12_vulkan.md
6// section 3.2); the default adapter and WARP gave the same grid in every scenario, so the layer is held to the PC
7// runtime's behaviour and each host is checked against the table too.
8// Only valid bundle usage is run: a bundle never calls RSSetViewports, RSSetScissorRects, OMSetRenderTargets or any
9// barrier, clear or copy, sets its root signature before any root argument and sets its topology before a draw
10// (the default adapter inherits the parent's topology when it does not, WARP removes the device, so that is not
11// asserted). The layer alone is also checked for the order of a bundle's commands in its parent, for the trace
12// (one line per call the application made, however often the bundle runs) and for object lifetimes.
13// Both host adapters always run (LEONIDA_HOST_ADAPTER is not read), except under Wine, where the host is skipped.
14// No game data.
15#include "vk_test_device.h"
16#include "d3d12_test_shaders.h"
17#include "host_wine.h"
18#include "../shims/d3d12_com.h"
19#include "../shims/d3d12_trace.h"
20#include "../src/shader_library.h"
21
22#include <d3dcompiler.h>
23#include <dxgi1_4.h>
24#include <io.h>
25
26#include <cstdint>
27#include <cstdio>
28#include <cstring>
29#include <filesystem>
30#include <fstream>
31#include <functional>
32#include <iterator>
33#include <string>
34#include <variant>
35#include <vector>
36
37#if !defined(LEONIDA_TEST_VS_SPV) || !defined(LEONIDA_TEST_PS_SPV)
38#error "LEONIDA_TEST_VS_SPV and LEONIDA_TEST_PS_SPV must name the compiled test shaders"
39#endif
40
41#define CHECK(condition) do { \
42 if (!(condition)) { std::fprintf(stderr, "line %d: %s\n", __LINE__, #condition); return false; } \
43} while (0)
44
45#define REQUIRE(condition) do { \
46 if (!(condition)) { std::fprintf(stderr, "line %d: %s\n", __LINE__, #condition); return 1; } \
47} while (0)
48
49using namespace d3d12test;
50
51namespace {
52
53constexpr UINT target_px = 64;
54constexpr UINT grid_cells = 8;
55
56struct Vertex {
57 float x, y;
58 std::uint8_t r, g, b, a;
59};
60
61// Upload-heap layout, in bytes.
62constexpr UINT64 vb_quad = 0; // the top-left quadrant as a strip: (-1,1) (0,1) (-1,0) (0,0)
63constexpr UINT64 vb_other = 64; // the same shape in the bottom-right quadrant
64constexpr UINT64 ib_quad = 128; // 0 1 2 2 1 3: both triangles of the quad
65constexpr UINT64 ib_half = 144; // 3 2 1: the lower-right half
66constexpr UINT64 tint_red = 256; // (1, 0, 1): the red vertices stay red
67constexpr UINT64 tint_green = 512; // (0, 1, 0)
68constexpr UINT64 tint_yellow = 768; // (1, 1, 1)
69
70// An expected grid: eight rows of eight letters, rows separated by a space.
71#define BLANK4 "BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB"
72#define ROWS4(row) row " " row " " row " " row
73
74using Recorder = std::function<void(struct Rig&, ID3D12GraphicsCommandList*)>;
75
76struct Rig {
77 ID3D12Device* device = nullptr;
78 Ref<ID3D12RootSignature> root1, root2; // root2 adds a third parameter, so it is a different signature
79 Ref<ID3D12PipelineState> pso_a, pso_b, pso_a2; // b writes only green and alpha; a2 is a on root2
80 Ref<ID3D12CommandQueue> queue;
81 Ref<ID3D12Fence> fence;
82 Ref<ID3D12Resource> upload, target, readback;
83 Ref<ID3D12DescriptorHeap> rtv_heap;
84 D3D12_CPU_DESCRIPTOR_HANDLE rtv{};
85 D3D12_GPU_VIRTUAL_ADDRESS upload_va = 0;
86 UINT64 fence_value = 0;
87 bool bundle_failed = false;
88 std::vector<Ref<ID3D12CommandAllocator>> bundle_allocators;
89 std::vector<Ref<ID3D12GraphicsCommandList>> bundles;
90
91 std::vector<std::uint8_t> vs_code, ps_code;
92
93 // A root signature of two parameters (constants s0 s1, a CBV) or three (and one more constant).
94 bool make_root(UINT count, Ref<ID3D12RootSignature>& root) {
95 D3D12_ROOT_PARAMETER params[3] = {};
96 params[0].ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS;
97 params[0].Constants = {0, 0, 2};
98 params[1].ParameterType = D3D12_ROOT_PARAMETER_TYPE_CBV;
99 params[1].Descriptor = {1, 0};
100 params[2].ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS;
101 params[2].Constants = {2, 0, 1};
102 D3D12_VERSIONED_ROOT_SIGNATURE_DESC root_desc{};
103 root_desc.Version = D3D_ROOT_SIGNATURE_VERSION_1_0;
104 root_desc.Desc_1_0 = {count, params, 0, nullptr, D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT};
105 const auto blob = serialize_root_signature(root_desc);
106 CHECK(!blob.empty());
107 CHECK(SUCCEEDED(device->CreateRootSignature(0, blob.data(), blob.size(), IID_PPV_ARGS(&root.p))));
108 return true;
109 }
110
111 bool make_pso(ID3D12RootSignature* root, UINT8 write_mask, Ref<ID3D12PipelineState>& pso) {
112 static const D3D12_INPUT_ELEMENT_DESC elements[2] = {
113 {"POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0},
114 {"COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D12_APPEND_ALIGNED_ELEMENT,
115 D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0}};
116 D3D12_GRAPHICS_PIPELINE_STATE_DESC desc{};
117 desc.pRootSignature = root;
118 desc.VS = {vs_code.data(), vs_code.size()};
119 desc.PS = {ps_code.data(), ps_code.size()};
120 desc.BlendState.RenderTarget[0].RenderTargetWriteMask = write_mask;
121 desc.SampleMask = 0xffffffff;
122 desc.RasterizerState.FillMode = D3D12_FILL_MODE_SOLID;
123 desc.RasterizerState.CullMode = D3D12_CULL_MODE_NONE;
124 desc.RasterizerState.DepthClipEnable = TRUE;
125 desc.InputLayout = {elements, 2};
126 desc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
127 desc.NumRenderTargets = 1;
128 desc.RTVFormats[0] = DXGI_FORMAT_R8G8B8A8_UNORM;
129 desc.SampleDesc.Count = 1;
130 CHECK(SUCCEEDED(device->CreateGraphicsPipelineState(&desc, IID_PPV_ARGS(&pso.p))));
131 return true;
132 }
133
134 bool init(ID3D12Device* d, const std::vector<std::uint8_t>& vs, const std::vector<std::uint8_t>& ps) {
135 device = d;
136 vs_code = vs;
137 ps_code = ps;
138 CHECK(make_root(2, root1) && make_root(3, root2));
139 constexpr UINT8 all = D3D12_COLOR_WRITE_ENABLE_ALL;
140 CHECK(make_pso(root1.p, all, pso_a));
141 CHECK(make_pso(root1.p, D3D12_COLOR_WRITE_ENABLE_GREEN | D3D12_COLOR_WRITE_ENABLE_ALPHA, pso_b));
142 CHECK(make_pso(root2.p, all, pso_a2));
143
144 const D3D12_HEAP_PROPERTIES upload_heap{D3D12_HEAP_TYPE_UPLOAD};
145 const D3D12_HEAP_PROPERTIES default_heap{D3D12_HEAP_TYPE_DEFAULT};
146 const D3D12_HEAP_PROPERTIES readback_heap{D3D12_HEAP_TYPE_READBACK};
147 auto buffer = buffer_desc(4096);
148 CHECK(SUCCEEDED(device->CreateCommittedResource(&upload_heap, D3D12_HEAP_FLAG_NONE, &buffer,
149 D3D12_RESOURCE_STATE_GENERIC_READ, nullptr,
150 IID_PPV_ARGS(&upload.p))));
151 buffer = buffer_desc(target_px * 256);
152 CHECK(SUCCEEDED(device->CreateCommittedResource(&readback_heap, D3D12_HEAP_FLAG_NONE, &buffer,
153 D3D12_RESOURCE_STATE_COPY_DEST, nullptr,
154 IID_PPV_ARGS(&readback.p))));
155 D3D12_RESOURCE_DESC texture{};
156 texture.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
157 texture.Width = texture.Height = target_px;
158 texture.DepthOrArraySize = texture.MipLevels = 1;
159 texture.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
160 texture.SampleDesc.Count = 1;
161 texture.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
162 CHECK(SUCCEEDED(device->CreateCommittedResource(&default_heap, D3D12_HEAP_FLAG_NONE, &texture,
163 D3D12_RESOURCE_STATE_COMMON, nullptr,
164 IID_PPV_ARGS(&target.p))));
165 const Vertex quad[4] = {{-1, 1, 255, 0, 0, 255}, {0, 1, 255, 0, 0, 255}, {-1, 0, 255, 0, 0, 255},
166 {0, 0, 255, 0, 0, 255}};
167 const Vertex other[4] = {{0, 0, 255, 0, 0, 255}, {1, 0, 255, 0, 0, 255}, {0, -1, 255, 0, 0, 255},
168 {1, -1, 255, 0, 0, 255}};
169 const std::uint16_t indices[6] = {0, 1, 2, 2, 1, 3};
170 const float tints[3][3] = {{1, 0, 1}, {0, 1, 0}, {1, 1, 1}};
171 std::uint8_t* up = nullptr;
172 CHECK(SUCCEEDED(upload->Map(0, nullptr, reinterpret_cast<void**>(&up))));
173 std::memset(up, 0, 4096);
174 std::memcpy(up + vb_quad, quad, sizeof(quad));
175 std::memcpy(up + vb_other, other, sizeof(other));
176 std::memcpy(up + ib_quad, indices, sizeof(indices));
177 const std::uint16_t half[3] = {3, 2, 1};
178 std::memcpy(up + ib_half, half, sizeof(half));
179 std::memcpy(up + tint_red, tints[0], sizeof(tints[0]));
180 std::memcpy(up + tint_green, tints[1], sizeof(tints[1]));
181 std::memcpy(up + tint_yellow, tints[2], sizeof(tints[2]));
182 upload->Unmap(0, nullptr);
183 upload_va = upload->GetGPUVirtualAddress();
184
185 const D3D12_DESCRIPTOR_HEAP_DESC heap_desc{D3D12_DESCRIPTOR_HEAP_TYPE_RTV, 1, D3D12_DESCRIPTOR_HEAP_FLAG_NONE, 0};
186 CHECK(SUCCEEDED(device->CreateDescriptorHeap(&heap_desc, IID_PPV_ARGS(&rtv_heap.p))));
187 rtv = rtv_heap->GetCPUDescriptorHandleForHeapStart();
188 device->CreateRenderTargetView(target.p, nullptr, rtv);
189 D3D12_COMMAND_QUEUE_DESC queue_desc{};
190 CHECK(SUCCEEDED(device->CreateCommandQueue(&queue_desc, IID_PPV_ARGS(&queue.p))));
191 CHECK(SUCCEEDED(device->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&fence.p))));
192 return true;
193 }
194
195 // A closed bundle created with `initial` as its pipeline state, kept alive until the rig goes.
196 template<class F>
197 ID3D12GraphicsCommandList* bundle(ID3D12PipelineState* initial, F&& record) {
198 bundle_allocators.emplace_back();
199 bundles.emplace_back();
200 if (FAILED(device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_BUNDLE,
201 IID_PPV_ARGS(&bundle_allocators.back().p))) ||
202 FAILED(device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_BUNDLE, bundle_allocators.back().p, initial,
203 IID_PPV_ARGS(&bundles.back().p))))
204 return nullptr;
205 record(bundles.back().p);
206 if (FAILED(bundles.back()->Close())) return nullptr;
207 return bundles.back().p;
208 }
209
210 // ExecuteBundle, unless the bundle's Close failed (reported in the output, the layer refuses such bundles).
211 void execute(ID3D12GraphicsCommandList* list, ID3D12GraphicsCommandList* b) {
212 if (b)
213 list->ExecuteBundle(b);
214 else
215 bundle_failed = true;
216 }
217
218 // The parent's own targets, viewport and scissor: a bundle may not set them.
219 void targets(ID3D12GraphicsCommandList* list, float x = 0, float y = 0, float w = target_px, float h = target_px) {
220 const D3D12_VIEWPORT viewport{x, y, w, h, 0, 1};
221 const D3D12_RECT scissor{0, 0, LONG(target_px), LONG(target_px)};
222 list->OMSetRenderTargets(1, &rtv, FALSE, nullptr);
223 list->RSSetViewports(1, &viewport);
224 list->RSSetScissorRects(1, &scissor);
225 }
226 void vertices(ID3D12GraphicsCommandList* list, UINT64 offset) {
227 const D3D12_VERTEX_BUFFER_VIEW view{upload_va + offset, 4 * sizeof(Vertex), sizeof(Vertex)};
228 list->IASetVertexBuffers(0, 1, &view);
229 }
230 void indices(ID3D12GraphicsCommandList* list, UINT64 offset) {
231 const D3D12_INDEX_BUFFER_VIEW view{upload_va + offset, 12, DXGI_FORMAT_R16_UINT};
232 list->IASetIndexBuffer(&view);
233 }
234 void offset(ID3D12GraphicsCommandList* list, float x, float y) {
235 const float xy[2] = {x, y};
236 list->SetGraphicsRoot32BitConstants(0, 2, xy, 0);
237 }
238 void tint(ID3D12GraphicsCommandList* list, UINT64 which) {
239 list->SetGraphicsRootConstantBufferView(1, upload_va + which);
240 }
241
242 // Clears the target blue, runs `record` on the parent list and reads the target back as letters.
243 bool render(const Recorder& record, std::string& out, HRESULT& close) {
244 Ref<ID3D12CommandAllocator> allocator;
245 Ref<ID3D12GraphicsCommandList> list;
246 CHECK(SUCCEEDED(device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(&allocator.p))));
247 CHECK(SUCCEEDED(device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, allocator.p, nullptr,
248 IID_PPV_ARGS(&list.p))));
249 D3D12_RESOURCE_BARRIER to_target = transition(target.p, D3D12_RESOURCE_STATE_COMMON,
250 D3D12_RESOURCE_STATE_RENDER_TARGET);
251 list->ResourceBarrier(1, &to_target);
252 const FLOAT blue[4] = {0, 0, 1, 1};
253 list->ClearRenderTargetView(rtv, blue, 0, nullptr);
254 record(*this, list.p);
255 D3D12_RESOURCE_BARRIER to_copy = transition(target.p, D3D12_RESOURCE_STATE_RENDER_TARGET,
256 D3D12_RESOURCE_STATE_COPY_SOURCE);
257 list->ResourceBarrier(1, &to_copy);
258 D3D12_TEXTURE_COPY_LOCATION dst{}, src{};
259 dst.pResource = readback.p;
260 dst.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
261 dst.PlacedFootprint = {0, {DXGI_FORMAT_R8G8B8A8_UNORM, target_px, target_px, 1, 256}};
262 src.pResource = target.p;
263 src.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
264 list->CopyTextureRegion(&dst, 0, 0, 0, &src, nullptr);
265 close = list->Close();
266 if (FAILED(close)) return true; // reported by the caller
267 ID3D12CommandList* lists[] = {list.p};
268 queue->ExecuteCommandLists(1, lists);
269 CHECK(SUCCEEDED(queue->Signal(fence.p, ++fence_value)));
270 CHECK(SUCCEEDED(fence->SetEventOnCompletion(fence_value, nullptr)));
271 const std::uint8_t* pixels = nullptr;
272 const HRESULT mapped = readback->Map(0, nullptr, const_cast<void**>(reinterpret_cast<const void* const*>(&pixels)));
273 if (FAILED(mapped)) {
274 char text[96];
275 std::snprintf(text, sizeof(text), "Map 0x%08lx, device removed 0x%08lx\n", static_cast<unsigned long>(mapped),
276 static_cast<unsigned long>(device->GetDeviceRemovedReason()));
277 out = text;
278 return true;
279 }
280 out = bundle_failed ? "bundle Close failed " : "";
281 for (UINT row = 0; row < grid_cells; ++row) {
282 for (UINT column = 0; column < grid_cells; ++column) {
283 // Away from pixel centres on the quadrant diagonal (x + y = 32).
284 const std::uint8_t* p = pixels + (row * 8 + 3) * 256 + (column * 8 + 3) * 4;
285 char letter = '?';
286 if (p[3] == 255) {
287 if (p[0] == 0 && p[1] == 0 && p[2] == 255) letter = 'B';
288 else if (p[0] == 255 && p[1] == 0 && p[2] == 0) letter = 'R';
289 else if (p[0] == 0 && p[1] == 255 && p[2] == 0) letter = 'G';
290 else if (p[0] == 255 && p[1] == 255 && p[2] == 0) letter = 'Y';
291 else if (p[0] == 0 && p[1] == 255 && p[2] == 255) letter = 'C';
292 else if (p[0] == 0 && p[1] == 0 && p[2] == 0) letter = 'K';
293 }
294 out += letter;
295 }
296 if (row + 1 < grid_cells) out += ' ';
297 }
298 readback->Unmap(0, nullptr);
299 return true;
300 }
301};
302
303struct Scenario {
304 const char* name;
305 Recorder record;
306 const char* expected; // null: print only
307};
308
309constexpr auto strip = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP;
310constexpr auto tlist = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST;
311
312std::vector<Scenario> scenarios() {
313 std::vector<Scenario> s;
314 // The parent's state a bundle must see: targets, viewport and scissor, root signature and arguments, a vertex
315 // buffer and a topology. No pipeline state is set: a bundle starts with its creation one.
316 const auto parent_state = [](Rig& r, ID3D12GraphicsCommandList* l, D3D_PRIMITIVE_TOPOLOGY topology) {
317 r.targets(l);
318 l->SetGraphicsRootSignature(r.root1.p);
319 l->IASetPrimitiveTopology(topology);
320 r.vertices(l, vb_quad);
321 r.offset(l, 0, 0);
322 r.tint(l, tint_red);
323 };
324 s.push_back({"inherit: a draw sees the parent's targets, viewport, root arguments and vertex buffer",
325 [parent_state](Rig& r, ID3D12GraphicsCommandList* l) {
326 auto* b = r.bundle(r.pso_a.p, [](ID3D12GraphicsCommandList* b) {
327 b->IASetPrimitiveTopology(strip);
328 b->DrawInstanced(4, 1, 0, 0);
329 });
330 parent_state(r, l, tlist);
331 r.execute(l, b);
332 }, ROWS4("RRRRBBBB") " " BLANK4});
333 s.push_back({"inherit: an indexed draw sees the parent's index buffer",
334 [parent_state](Rig& r, ID3D12GraphicsCommandList* l) {
335 auto* b = r.bundle(r.pso_a.p, [](ID3D12GraphicsCommandList* b) {
336 b->IASetPrimitiveTopology(tlist);
337 b->DrawIndexedInstanced(6, 1, 0, 0, 0);
338 });
339 parent_state(r, l, strip);
340 r.indices(l, ib_quad);
341 r.execute(l, b);
342 }, ROWS4("RRRRBBBB") " " BLANK4});
343 s.push_back({"inherit: a bundle that sets the same root signature keeps the parent's root arguments",
344 [parent_state](Rig& r, ID3D12GraphicsCommandList* l) {
345 auto* b = r.bundle(r.pso_a.p, [&](ID3D12GraphicsCommandList* b) {
346 b->SetGraphicsRootSignature(r.root1.p);
347 b->IASetPrimitiveTopology(strip);
348 b->DrawInstanced(4, 1, 0, 0);
349 });
350 parent_state(r, l, tlist);
351 r.offset(l, 1, -1);
352 r.tint(l, tint_green);
353 r.execute(l, b);
354 }, BLANK4 " " ROWS4("BBBBGGGG")});
355 s.push_back({"inherit: one bundle, executed twice with other root arguments and viewports in between",
356 [](Rig& r, ID3D12GraphicsCommandList* l) {
357 auto* b = r.bundle(r.pso_a.p, [](ID3D12GraphicsCommandList* b) {
358 b->IASetPrimitiveTopology(strip);
359 b->DrawInstanced(4, 1, 0, 0);
360 });
361 l->SetGraphicsRootSignature(r.root1.p);
362 r.vertices(l, vb_quad);
363 r.offset(l, 0, 0);
364 r.targets(l, 0, 0, target_px / 2, target_px);
365 r.tint(l, tint_red);
366 r.execute(l, b);
367 r.targets(l, target_px / 2, 0, target_px / 2, target_px);
368 r.tint(l, tint_green);
369 r.execute(l, b);
370 }, ROWS4("RRBBGGBB") " " BLANK4});
371 s.push_back({"pipeline state: a bundle starts with its creation one, not the parent's, and hands it back",
372 [parent_state](Rig& r, ID3D12GraphicsCommandList* l) {
373 auto* b = r.bundle(r.pso_a.p, [](ID3D12GraphicsCommandList* b) {
374 b->IASetPrimitiveTopology(strip);
375 b->DrawInstanced(4, 1, 0, 0);
376 });
377 parent_state(r, l, tlist);
378 l->SetPipelineState(r.pso_b.p);
379 r.tint(l, tint_green);
380 r.execute(l, b);
381 r.offset(l, 1, -1);
382 l->DrawInstanced(4, 1, 0, 0);
383 }, ROWS4("GGGGBBBB") " " ROWS4("BBBBGGGG")});
384 s.push_back({"hand back: a pipeline state the bundle sets",
385 [parent_state](Rig& r, ID3D12GraphicsCommandList* l) {
386 auto* b = r.bundle(r.pso_a.p, [&](ID3D12GraphicsCommandList* b) {
387 b->SetPipelineState(r.pso_b.p);
388 b->IASetPrimitiveTopology(strip);
389 });
390 parent_state(r, l, tlist);
391 l->SetPipelineState(r.pso_a.p);
392 r.tint(l, tint_green);
393 r.execute(l, b);
394 l->DrawInstanced(4, 1, 0, 0);
395 }, ROWS4("CCCCBBBB") " " BLANK4});
396 s.push_back({"hand back: topology",
397 [parent_state](Rig& r, ID3D12GraphicsCommandList* l) {
398 auto* b = r.bundle(r.pso_a.p, [](ID3D12GraphicsCommandList* b) { b->IASetPrimitiveTopology(strip); });
399 parent_state(r, l, tlist);
400 r.execute(l, b);
401 l->DrawInstanced(4, 1, 0, 0);
402 }, ROWS4("RRRRBBBB") " " BLANK4});
403 s.push_back({"hand back: root constants and a root CBV, after the same root signature",
404 [parent_state](Rig& r, ID3D12GraphicsCommandList* l) {
405 auto* b = r.bundle(r.pso_a.p, [&](ID3D12GraphicsCommandList* b) {
406 b->SetGraphicsRootSignature(r.root1.p);
407 b->IASetPrimitiveTopology(strip);
408 r.offset(b, 1, -1);
409 r.tint(b, tint_green);
410 });
411 parent_state(r, l, tlist);
412 r.execute(l, b);
413 l->DrawInstanced(4, 1, 0, 0);
414 }, BLANK4 " " ROWS4("BBBBGGGG")});
415 s.push_back({"hand back: vertex and index buffers",
416 [parent_state](Rig& r, ID3D12GraphicsCommandList* l) {
417 auto* b = r.bundle(r.pso_a.p, [&](ID3D12GraphicsCommandList* b) {
418 b->IASetPrimitiveTopology(tlist);
419 r.vertices(b, vb_other);
420 r.indices(b, ib_half);
421 });
422 parent_state(r, l, strip);
423 r.indices(l, ib_quad);
424 r.execute(l, b);
425 l->DrawIndexedInstanced(3, 1, 0, 0, 0);
426 }, BLANK4 " BBBBBBBB BBBBBBBR BBBBBBRR BBBBBRRR"});
427 // A different root signature: the bundle (created with pso_a2, on root2) sets it and its own arguments. The
428 // parent's arguments are gone afterwards and the bundle's are the parent's.
429 s.push_back({"root signature: a bundle sets another one; the parent continues with it and the bundle's arguments",
430 [parent_state](Rig& r, ID3D12GraphicsCommandList* l) {
431 auto* b = r.bundle(r.pso_a2.p, [&](ID3D12GraphicsCommandList* b) {
432 b->SetGraphicsRootSignature(r.root2.p);
433 b->IASetPrimitiveTopology(strip);
434 r.offset(b, 0, 0);
435 r.tint(b, tint_yellow);
436 const UINT extra = 0;
437 b->SetGraphicsRoot32BitConstants(2, 1, &extra, 0);
438 b->DrawInstanced(4, 1, 0, 0);
439 });
440 parent_state(r, l, tlist);
441 r.offset(l, 1, -1);
442 r.tint(l, tint_green);
443 r.execute(l, b);
444 r.vertices(l, vb_other);
445 l->DrawInstanced(4, 1, 0, 0);
446 }, ROWS4("YYYYBBBB") " " ROWS4("BBBBYYYY")});
447 return s;
448}
449
450} // namespace
451
452namespace {
453
454bool compile_hlsl(const char* source, const char* entry, const char* profile, std::vector<std::uint8_t>& out) {
455 const HMODULE compiler = LoadLibraryExA("d3dcompiler_47.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
456 const auto compile = compiler ? reinterpret_cast<pD3DCompile>(GetProcAddress(compiler, "D3DCompile")) : nullptr;
457 if (!compile) return false;
458 ID3DBlob* blob = nullptr;
459 ID3DBlob* errors = nullptr;
460 const HRESULT hr = compile(source, std::strlen(source), "bundle.hlsl", nullptr, nullptr, entry, profile, 0, 0,
461 &blob, &errors);
462 if (FAILED(hr) && errors) std::fprintf(stderr, "%s\n", static_cast<const char*>(errors->GetBufferPointer()));
463 if (errors) errors->Release();
464 if (FAILED(hr) || !blob) return false;
465 const auto* p = static_cast<const std::uint8_t*>(blob->GetBufferPointer());
466 out.assign(p, p + blob->GetBufferSize());
467 blob->Release();
468 return true;
469}
470
471// The same two shaders as test/glsl/vs_draw.vert and ps_draw.frag: s0, s1 offset the vertex, the root CBV tints.
472constexpr char hlsl[] =
473 "cbuffer Offset : register(b0) { float2 offset; };\n"
474 "cbuffer Tint : register(b1) { float3 tint; };\n"
475 "struct V { float4 position : SV_Position; float4 color : COLOR; };\n"
476 "V vs(float2 position : POSITION, float4 color : COLOR) {\n"
477 " V v; v.position = float4(position + offset, 0, 1); v.color = color; return v; }\n"
478 "float4 ps(V v) : SV_Target { return float4(v.color.r * tint.x, tint.y, v.color.b * tint.z, 1); }\n";
479
480// Runs every scenario and stores the grids; false on a harness failure. A host scenario gets a device of its own
481// (`adapter`, null for the default one): a scenario that removes a host device must not hide the ones after it.
482bool run_all(ID3D12Device* shared, bool own_device, IDXGIAdapter* adapter, const std::vector<std::uint8_t>& vs, const std::vector<std::uint8_t>& ps,
483 const std::vector<Scenario>& list, std::vector<std::string>& grids, std::vector<HRESULT>& closes) {
484 for (const Scenario& scenario : list) {
485 Rig rig;
486 Ref<ID3D12Device> own;
487 if (own_device) D3D12CreateDevice(adapter, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&own.p));
488 ID3D12Device* device = own_device ? own.p : shared;
489 if (!device || !rig.init(device, vs, ps)) {
490 grids.push_back("device unusable\n");
491 closes.push_back(E_FAIL);
492 continue;
493 }
494 std::string grid_text;
495 HRESULT close = S_OK;
496 if (!rig.render(scenario.record, grid_text, close)) return false;
497 grids.push_back(grid_text);
498 closes.push_back(close);
499 }
500 return true;
501}
502
503} // namespace
504
505// What the layer alone can show: the order of commands in the parent, the trace, and object lifetimes.
506int count_of(const std::string& text, const char* needle) {
507 int count = 0;
508 for (std::size_t at = text.find(needle); at != std::string::npos; at = text.find(needle, at + 1)) ++count;
509 return count;
510}
511
512// Sends stderr (where the trace goes) to a file while it lives, with the trace on.
513struct TraceCapture {
514 std::filesystem::path path;
515 int saved = -1;
516 explicit TraceCapture(const std::filesystem::path& file) : path(file) {
517 std::fflush(stderr);
518 std::FILE* out = std::fopen(path.string().c_str(), "wb");
519 saved = _dup(2);
520 if (out && saved >= 0) _dup2(_fileno(out), 2);
521 if (out) std::fclose(out);
522 rt::d3d12_trace::set_enabled(true);
523 }
524 std::string finish() {
525 rt::d3d12_trace::set_enabled(false);
526 std::fflush(stderr);
527 if (saved >= 0) {
528 _dup2(saved, 2);
529 _close(saved);
530 saved = -1;
531 }
532 std::ifstream in(path, std::ios::binary);
533 return {std::istreambuf_iterator<char>(in), std::istreambuf_iterator<char>()};
534 }
535 ~TraceCapture() { finish(); }
536};
537
538bool layer_checks(ID3D12Device* device, const std::vector<std::uint8_t>& vs, const std::vector<std::uint8_t>& ps,
539 const std::filesystem::path& scratch) {
540 constexpr UINT8 all = D3D12_COLOR_WRITE_ENABLE_ALL;
541 // The parent's commands hold the bundle's markers and draws where the bundle made them, between the parent's own.
542 {
543 Rig r;
544 CHECK(r.init(device, vs, ps));
545 const auto mark = [](ID3D12GraphicsCommandList* l, const char* text) {
546 l->SetMarker(1, text, UINT(std::strlen(text) + 1));
547 };
548 auto* b = r.bundle(r.pso_a.p, [&](ID3D12GraphicsCommandList* b) {
549 mark(b, "b1");
550 b->IASetPrimitiveTopology(strip);
551 b->DrawInstanced(4, 1, 0, 0);
552 mark(b, "b2");
553 b->DrawInstanced(4, 1, 0, 0);
554 mark(b, "b3");
555 });
556 CHECK(b);
557 Ref<ID3D12CommandAllocator> allocator;
558 Ref<ID3D12GraphicsCommandList> parent;
559 CHECK(SUCCEEDED(device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(&allocator.p))));
560 CHECK(SUCCEEDED(device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, allocator.p, nullptr,
561 IID_PPV_ARGS(&parent.p))));
562 mark(parent.p, "p0");
563 r.targets(parent.p);
564 parent.p->SetGraphicsRootSignature(r.root1.p);
565 r.vertices(parent.p, vb_quad);
566 r.offset(parent.p, 0, 0);
567 r.tint(parent.p, tint_red);
568 mark(parent.p, "p1");
569 parent.p->ExecuteBundle(b);
570 mark(parent.p, "p2");
571 std::string order;
572 std::vector<leonida::Command> recorded;
573 CHECK(rt::d3d12::recorded_commands(parent.p, recorded));
574 for (const auto& command : recorded) {
575 if (const auto* marker = std::get_if<leonida::DebugMarker>(&command)) order += marker->label + ",";
576 else if (std::holds_alternative<leonida::Draw>(command)) order += "draw,";
577 }
578 if (order != "p0,p1,b1,draw,b2,draw,b3,p2,") {
579 std::fprintf(stderr, "bundle commands in the parent: %s\n", order.c_str());
580 return false;
581 }
582 CHECK(parent->Close() == S_OK);
583 }
584
585 // The trace has one line per call the application made on the bundle, however often it is executed, and none for
586 // the pipeline state it was created or reset with.
587 {
588 Rig r;
589 CHECK(r.init(device, vs, ps));
590 TraceCapture capture(scratch / "trace.txt");
591 auto* b = r.bundle(r.pso_a.p, [&](ID3D12GraphicsCommandList* b) {
592 b->SetGraphicsRootSignature(r.root1.p);
593 b->IASetPrimitiveTopology(strip);
594 b->DrawInstanced(4, 1, 0, 0);
595 });
596 CHECK(b);
597 std::string grid_text;
598 HRESULT close = S_OK;
599 CHECK(r.render([&](Rig& rig, ID3D12GraphicsCommandList* l) {
600 rig.targets(l);
601 rig.vertices(l, vb_quad);
602 for (int i = 0; i < 3; ++i) rig.execute(l, b);
603 }, grid_text, close));
604 CHECK(close == S_OK);
605 CHECK(SUCCEEDED(b->Reset(r.bundle_allocators.back().p, r.pso_a.p)));
606 b->SetGraphicsRootSignature(r.root1.p);
607 r.offset(b, 0, 0);
608 r.tint(b, tint_red);
609 b->IASetPrimitiveTopology(tlist);
610 b->DrawIndexedInstanced(6, 1, 0, 0, 0);
611 CHECK(SUCCEEDED(b->Close()));
612 CHECK(r.render([&](Rig& rig, ID3D12GraphicsCommandList* l) {
613 rig.targets(l);
614 rig.vertices(l, vb_quad);
615 rig.indices(l, ib_quad);
616 rig.execute(l, b);
617 rig.execute(l, b);
618 }, grid_text, close));
619 CHECK(close == S_OK && grid_text == ROWS4("RRRRBBBB") " " BLANK4);
620 const std::string trace = capture.finish();
621 const int pipeline = count_of(trace, "GraphicsCommandList::SetPipelineState called");
622 const int root = count_of(trace, "GraphicsCommandList::SetGraphicsRootSignature called");
623 const int draw = count_of(trace, "GraphicsCommandList::DrawInstanced called");
624 const int indexed = count_of(trace, "GraphicsCommandList::DrawIndexedInstanced called");
625 const int execute = count_of(trace, "GraphicsCommandList::ExecuteBundle called");
626 if (pipeline != 0 || root != 2 || draw != 1 || indexed != 1 || execute != 5) {
627 std::fprintf(stderr, "trace lines: SetPipelineState %d, root signature %d, draw %d, indexed %d, "
628 "ExecuteBundle %d (expected 0, 2, 1, 1, 5)\n", pipeline, root, draw, indexed, execute);
629 return false;
630 }
631 }
632
633 // A root-constant call of zero dwords is as valid in a bundle as on a direct list; a closed bundle takes no more
634 // state calls (they are ignored) and a draw on it makes it invalid, so a parent that executes it fails.
635 {
636 Rig r;
637 CHECK(r.init(device, vs, ps));
638 const UINT none = 0;
639 auto* b = r.bundle(r.pso_a.p, [&](ID3D12GraphicsCommandList* b) {
640 b->SetGraphicsRootSignature(r.root1.p);
641 b->SetGraphicsRoot32BitConstants(0, 0, &none, 0);
642 b->IASetPrimitiveTopology(strip);
643 r.offset(b, 0, 0);
644 r.tint(b, tint_red);
645 b->DrawInstanced(4, 1, 0, 0);
646 });
647 CHECK(b);
648 std::string grid_text;
649 HRESULT close = S_OK;
650 const auto run = [&](ID3D12GraphicsCommandList* bundle) {
651 return r.render([&](Rig& rig, ID3D12GraphicsCommandList* l) {
652 rig.targets(l);
653 rig.vertices(l, vb_quad);
654 rig.execute(l, bundle);
655 }, grid_text, close);
656 };
657 CHECK(run(b));
658 CHECK(close == S_OK && grid_text == ROWS4("RRRRBBBB") " " BLANK4);
659 b->IASetPrimitiveTopology(tlist); // closed: ignored, so the bundle still draws the whole quad
660 CHECK(run(b));
661 CHECK(close == S_OK && grid_text == ROWS4("RRRRBBBB") " " BLANK4);
662 b->DrawInstanced(4, 1, 0, 0); // closed: invalid
663 CHECK(run(b));
664 CHECK(close == E_INVALIDARG);
665 }
666
667 // The application may release the pipeline state and root signature as soon as it has recorded them, and the
668 // bundle itself while a list that executed it is still open.
669 {
670 Rig r;
671 CHECK(r.init(device, vs, ps));
672 ID3D12GraphicsCommandList* b = nullptr;
673 {
674 Ref<ID3D12RootSignature> root;
675 Ref<ID3D12PipelineState> pso;
676 CHECK(r.make_root(2, root) && r.make_pso(root.p, all, pso));
677 b = r.bundle(pso.p, [&](ID3D12GraphicsCommandList* b) {
678 b->SetGraphicsRootSignature(root.p);
679 b->IASetPrimitiveTopology(strip);
680 r.offset(b, 0, 0);
681 r.tint(b, tint_red);
682 b->DrawInstanced(4, 1, 0, 0);
683 });
684 }
685 CHECK(b);
686 std::string grid_text;
687 HRESULT close = S_OK;
688 bool reset_ok = false;
689 CHECK(r.render([&](Rig& rig, ID3D12GraphicsCommandList* l) {
690 rig.targets(l);
691 rig.vertices(l, vb_quad);
692 rig.execute(l, b);
693 }, grid_text, close));
694 if (close != S_OK || grid_text != ROWS4("RRRRBBBB") " " BLANK4) {
695 std::fprintf(stderr, "first parent of a released bundle: Close 0x%08lx, %s\n",
696 static_cast<unsigned long>(close), grid_text.c_str());
697 return false;
698 }
699 CHECK(r.render([&](Rig& rig, ID3D12GraphicsCommandList* l) {
700 rig.targets(l);
701 rig.vertices(l, vb_quad);
702 rig.execute(l, b);
703 reset_ok = SUCCEEDED(rig.bundles.back()->Reset(rig.bundle_allocators.back().p, nullptr));
704 rig.bundles.clear();
705 rig.bundle_allocators.clear();
706 rig.offset(l, 1, -1); // the bundle's root signature and pipeline state are the parent's now
707 l->DrawInstanced(4, 1, 0, 0);
708 }, grid_text, close));
709 if (!reset_ok || close != S_OK || grid_text != ROWS4("RRRRBBBB") " " ROWS4("BBBBRRRR")) {
710 std::fprintf(stderr, "second parent, bundle released while open: Close 0x%08lx, %s\n",
711 static_cast<unsigned long>(close), grid_text.c_str());
712 return false;
713 }
714 }
715 return true;
716}
717
718int main() {
719 std::setvbuf(stdout, nullptr, _IONBF, 0);
720 vktest::Device vk;
721 const auto device_status = vk.initialize();
722 if (device_status == vktest::DeviceStatus::unavailable) {
723 std::fprintf(stderr, "SKIP: no usable Vulkan 1.3 device\n");
724 return 77;
725 }
726 REQUIRE(device_status == vktest::DeviceStatus::ready);
727 const auto list = scenarios();
728
729 // Layer shaders: FSSM-shaped containers found by hash in a translator-style index.
730 const auto vs_program = fssm_program({0x56530101, 0xbf810000});
731 const auto ps_program = fssm_program({0x50530101, 0xbf810000});
732 const auto vs_container = shader_container(vs_program), ps_container = shader_container(ps_program);
733 // Removed on every way out of main.
734 struct Scratch {
735 std::filesystem::path path = std::filesystem::temp_directory_path() / "leonida_bundle_test";
736 Scratch() { std::filesystem::create_directories(path); }
737 ~Scratch() {
738 std::error_code ignored;
739 std::filesystem::remove_all(path, ignored);
740 }
741 } scratch;
742 const auto& library = scratch.path;
743 std::filesystem::copy_file(LEONIDA_TEST_VS_SPV, library / "vs_draw.spv", std::filesystem::copy_options::overwrite_existing);
744 std::filesystem::copy_file(LEONIDA_TEST_PS_SPV, library / "ps_draw.spv", std::filesystem::copy_options::overwrite_existing);
745 {
746 std::ofstream index(library / "index.json", std::ios::binary);
747 index << "{\"vs_draw\": {\"stage\": \"vs\", \"fssm_sha256\": \"" << leonida::sha256_hex(vs_program)
748 << "\", \"bindings\": [], \"push_constant_bytes\": 144, \"input_signature\": ["
749 "{\"semantic\": \"COLOR\", \"semantic_index\": 0, \"register\": 0, \"mask\": 15, \"rw_mask\": 15, "
750 "\"system_value\": 0, \"component_type\": \"float\"}, "
751 "{\"semantic\": \"POSITION\", \"semantic_index\": 0, \"register\": 1, \"mask\": 3, \"rw_mask\": 3, "
752 "\"system_value\": 0, \"component_type\": \"float\"}]},\n"
753 " \"ps_draw\": {\"stage\": \"ps\", \"fssm_sha256\": \"" << leonida::sha256_hex(ps_program)
754 << "\", \"bindings\": [], \"push_constant_bytes\": 144, \"outputs\": [0]}}";
755 }
756 const unsigned errors_before = vk.validation_errors();
757 std::vector<std::string> layer_grids;
758 std::vector<HRESULT> layer_closes;
759 {
760 rt::d3d12::VulkanDeviceInfo info{};
761 info.get_instance_proc = vk.instance_proc;
762 info.instance = vk.instance;
763 info.physical = vk.physical;
764 info.device = vk.device;
765 info.queue = vk.queue;
766 info.queue_family = vk.family;
767 info.buffer_device_address = true;
768 info.shader_dir = library.string();
769 Ref<ID3D12Device> ours;
770 REQUIRE(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&ours.p))));
771 REQUIRE(run_all(ours.p, false, nullptr, vs_container, ps_container, list, layer_grids, layer_closes));
772 REQUIRE(layer_checks(ours.p, vs_container, ps_container, library));
773 }
774
775 // The host: Windows' D3D12 on the default adapter and on WARP.
776 std::vector<std::uint8_t> host_vs, host_ps;
777 const bool wine = hostwine::host_is_wine();
778 const bool host_shaders = !wine && compile_hlsl(hlsl, "vs", "vs_5_0", host_vs) &&
779 compile_hlsl(hlsl, "ps", "ps_5_0", host_ps);
780 struct HostRun {
781 const char* name = "";
782 bool ran = false;
783 std::vector<std::string> grids;
784 std::vector<HRESULT> closes;
785 } hosts[2];
786 hosts[0].name = "the default adapter";
787 hosts[1].name = "WARP";
788 if (host_shaders) {
789 Ref<IDXGIFactory4> factory;
790 REQUIRE(SUCCEEDED(CreateDXGIFactory1(IID_PPV_ARGS(&factory.p))));
791 for (int i = 0; i < 2; ++i) {
792 Ref<IDXGIAdapter> adapter;
793 Ref<ID3D12Device> host;
794 if (i == 1 && FAILED(factory->EnumWarpAdapter(IID_PPV_ARGS(&adapter.p)))) continue;
795 if (FAILED(D3D12CreateDevice(adapter.p, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&host.p)))) continue;
796 REQUIRE(run_all(nullptr, true, adapter.p, host_vs, host_ps, list, hosts[i].grids, hosts[i].closes));
797 hosts[i].ran = true;
798 }
799 } else if (!wine) {
800 std::fprintf(stderr, "no HLSL compiler: the host is not run\n");
801 }
802
803 // Every grid, the layer's against the table and each host's against it too. A host that is unavailable or
804 // Wine's vkd3d (which answers differently, see host_wine.h) is not compared; the table still holds the layer.
805 unsigned failures = 0, compared = 0;
806 const auto verdict = [&](const char* who, const Scenario& scenario, const std::string& grid, HRESULT close) {
807 const bool ok = grid == scenario.expected && close == S_OK;
808 if (!ok) {
809 std::fprintf(stderr, "FAIL %s on %s: Close 0x%08lx\n got %s\n expected %s\n", scenario.name, who,
810 static_cast<unsigned long>(close), grid.c_str(), scenario.expected);
811 ++failures;
812 }
813 };
814 for (std::size_t i = 0; i < list.size(); ++i) {
815 if (!list[i].expected) {
816 std::printf("%s | layer %s", list[i].name, layer_grids[i].c_str());
817 for (const auto& host : hosts)
818 if (host.ran) std::printf(" | %s %s", host.name, host.grids[i].c_str());
819 std::printf("\n");
820 ++failures;
821 continue;
822 }
823 verdict("the layer", list[i], layer_grids[i], layer_closes[i]);
824 for (const auto& host : hosts) {
825 if (!host.ran) continue;
826 verdict(host.name, list[i], host.grids[i], host.closes[i]);
827 ++compared;
828 }
829 }
830 const unsigned validation_errors = vk.validation_errors() - errors_before;
831 if (validation_errors) {
832 std::fprintf(stderr, "%u Vulkan validation errors\n", validation_errors);
833 ++failures;
834 }
835 if (!hosts[0].ran && !hosts[1].ran && !hostwine::host_is_wine())
836 std::fprintf(stderr, "no D3D12 reference device (default adapter or WARP)\n");
837 std::printf("bundles: %zu scenarios on the layer, %u host comparisons, %u failures\n", list.size(), compared,
838 failures);
839 return failures ? 1 : 0;
840}
diff --git a/runtime/test/d3d12_com_test.cpp b/runtime/test/d3d12_com_test.cpp
index 134617ad2..5f30d83b5 100644
--- a/runtime/test/d3d12_com_test.cpp
+++ b/runtime/test/d3d12_com_test.cpp
@@ -5,6 +5,7 @@
5#include "vk_test_device.h" 5#include "vk_test_device.h"
6#include "../shims/d3d12_com.h" 6#include "../shims/d3d12_com.h"
7#include "../shims/d3d12_trace.h" 7#include "../shims/d3d12_trace.h"
8#include "../src/gfx10_descriptors.h"
8 9
9#include <array> 10#include <array>
10#include <cstdint> 11#include <cstdint>
@@ -97,7 +98,7 @@ int main(int argc, char** argv) {
97 EXPECT(queue->GetDesc().Type == D3D12_COMMAND_LIST_TYPE_DIRECT); 98 EXPECT(queue->GetDesc().Type == D3D12_COMMAND_LIST_TYPE_DIRECT);
98 EXPECT(list->GetType() == D3D12_COMMAND_LIST_TYPE_DIRECT); 99 EXPECT(list->GetType() == D3D12_COMMAND_LIST_TYPE_DIRECT);
99 100
100 // ExecuteBundle: a closed bundle is inlined at the call site, and its recorded sticky state spills back. 101 // ExecuteBundle: a closed bundle's state calls play on the parent, so what the bundle set stays there.
101 Ref<ID3D12GraphicsCommandList8> list8; 102 Ref<ID3D12GraphicsCommandList8> list8;
102 EXPECT(SUCCEEDED(list->QueryInterface(IID_PPV_ARGS(&list8.p)))); 103 EXPECT(SUCCEEDED(list->QueryInterface(IID_PPV_ARGS(&list8.p))));
103 list8->OMSetFrontAndBackStencilRef(1, 2); 104 list8->OMSetFrontAndBackStencilRef(1, 2);
@@ -269,6 +270,18 @@ int main(int argc, char** argv) {
269 EXPECT(invalid_bundle_call([&](auto* b) { b->ClearRenderTargetView(rtv_handle, bundle_clear_color, 0, nullptr); })); 270 EXPECT(invalid_bundle_call([&](auto* b) { b->ClearRenderTargetView(rtv_handle, bundle_clear_color, 0, nullptr); }));
270 EXPECT(invalid_bundle_call([&](auto* b) { b->ClearDepthStencilView(dsv_handle, D3D12_CLEAR_FLAG_DEPTH, 271 EXPECT(invalid_bundle_call([&](auto* b) { b->ClearDepthStencilView(dsv_handle, D3D12_CLEAR_FLAG_DEPTH,
271 0.5f, 0, 0, nullptr); })); 272 0.5f, 0, 0, nullptr); }));
273 // A valid texture UAV descriptor, which a direct list would accept: only the bundle refuses the clear.
274 const UINT uav_uint[4] = {};
275 const FLOAT uav_float[4] = {};
276 leonida::gfx10::Image uav_image{};
277 uav_image.format = leonida::gfx10::format_from_vulkan(VK_FORMAT_R8G8B8A8_UNORM);
278 uav_image.width = uav_image.height = 4;
279 const auto uav_words = leonida::gfx10::encode(uav_image);
280 const D3D12_CPU_DESCRIPTOR_HANDLE uav_view{reinterpret_cast<SIZE_T>(uav_words.data())};
281 EXPECT(invalid_bundle_call([&](auto* b) {
282 b->ClearUnorderedAccessViewUint({}, uav_view, rt_resource, uav_uint, 0, nullptr); }));
283 EXPECT(invalid_bundle_call([&](auto* b) {
284 b->ClearUnorderedAccessViewFloat({}, uav_view, rt_resource, uav_float, 0, nullptr); }));
272 EXPECT(invalid_bundle_call([&](auto* b) { b->SetPredication(nullptr, 0, D3D12_PREDICATION_OP_EQUAL_ZERO); })); 285 EXPECT(invalid_bundle_call([&](auto* b) { b->SetPredication(nullptr, 0, D3D12_PREDICATION_OP_EQUAL_ZERO); }));
273 // D3D-26: DiscardResource and the atomic copies are not allowed in a bundle; WriteBufferImmediate is 286 // D3D-26: DiscardResource and the atomic copies are not allowed in a bundle; WriteBufferImmediate is
274 // ("Recording command lists and bundles", the bundle restrictions and the API restrictions table). 287 // ("Recording command lists and bundles", the bundle restrictions and the API restrictions table).
diff --git a/runtime/test/d3d12_compute_test.cpp b/runtime/test/d3d12_compute_test.cpp
index d88560a48..8aa5611f2 100644
--- a/runtime/test/d3d12_compute_test.cpp
+++ b/runtime/test/d3d12_compute_test.cpp
@@ -11,9 +11,12 @@
11#include "vk_test_device.h" 11#include "vk_test_device.h"
12#include "../shims/d3d12_com.h" 12#include "../shims/d3d12_com.h"
13#include "../src/gfx10_descriptors.h" 13#include "../src/gfx10_descriptors.h"
14#include "../src/cached_pso.h"
14#include "../src/shader_library.h" 15#include "../src/shader_library.h"
15#include "../shims/d3d12_xs_device.h" 16#include "../shims/d3d12_xs_device.h"
16 17
18#include <dxgi1_4.h>
19
17#include <cstdint> 20#include <cstdint>
18#include <cstring> 21#include <cstring>
19#include <filesystem> 22#include <filesystem>
@@ -136,6 +139,116 @@ D3D12_RESOURCE_BARRIER transition(ID3D12Resource* resource, D3D12_RESOURCE_STATE
136 return barrier; 139 return barrier;
137} 140}
138 141
142// The CachedPSO cases both devices answer, in this order: the same description, another Flags, an equal root
143// signature object, a root signature with other content, a truncated blob, a blob of junk, its first, middle and last
144// byte changed, a pointer with size 0, a null pointer with a size.
145constexpr int cached_case_count = 11;
146
147template<class Device>
148std::vector<HRESULT> cached_pso_cases(Device* device, D3D12_COMPUTE_PIPELINE_STATE_DESC desc,
149 const std::vector<std::uint8_t>& root_blob,
150 const std::vector<std::uint8_t>& other_root_blob) {
151 std::vector<HRESULT> out;
152 auto create = [&](D3D12_COMPUTE_PIPELINE_STATE_DESC d, const void* p, SIZE_T n) {
153 d.CachedPSO = {p, n};
154 ID3D12PipelineState* made = nullptr;
155 HRESULT hr = device->CreateComputePipelineState(&d, IID_PPV_ARGS(&made));
156 if (SUCCEEDED(hr) != (made != nullptr)) hr = E_UNEXPECTED; // a result and its object disagree
157 if (made) made->Release();
158 return hr;
159 };
160 ID3D12PipelineState* pso = nullptr;
161 if (FAILED(device->CreateComputePipelineState(&desc, IID_PPV_ARGS(&pso)))) return out;
162 ID3DBlob* blob = nullptr;
163 const HRESULT got = pso->GetCachedBlob(&blob);
164 const HRESULT got_null = pso->GetCachedBlob(nullptr);
165 pso->Release();
166 if (FAILED(got) || !blob || got_null != S_OK) {
167 if (blob) blob->Release();
168 return out;
169 }
170 const auto* p = static_cast<const std::uint8_t*>(blob->GetBufferPointer());
171 std::vector<std::uint8_t> bytes(p, p + blob->GetBufferSize());
172 blob->Release();
173 ID3D12RootSignature* same_root = nullptr;
174 ID3D12RootSignature* other_root = nullptr;
175 device->CreateRootSignature(0, root_blob.data(), root_blob.size(), IID_PPV_ARGS(&same_root));
176 device->CreateRootSignature(0, other_root_blob.data(), other_root_blob.size(), IID_PPV_ARGS(&other_root));
177 if (!same_root || !other_root) return out;
178
179 out.push_back(create(desc, bytes.data(), bytes.size()));
180 D3D12_COMPUTE_PIPELINE_STATE_DESC flags = desc;
181 flags.Flags = D3D12_PIPELINE_STATE_FLAG_TOOL_DEBUG;
182 out.push_back(create(flags, bytes.data(), bytes.size()));
183 D3D12_COMPUTE_PIPELINE_STATE_DESC same = desc;
184 same.pRootSignature = same_root;
185 out.push_back(create(same, bytes.data(), bytes.size()));
186 D3D12_COMPUTE_PIPELINE_STATE_DESC other = desc;
187 other.pRootSignature = other_root;
188 out.push_back(create(other, bytes.data(), bytes.size()));
189 out.push_back(create(desc, bytes.data(), bytes.size() / 2));
190 const std::vector<std::uint8_t> junk(bytes.size(), 0xab);
191 out.push_back(create(desc, junk.data(), junk.size()));
192 for (const std::size_t at : {std::size_t(0), bytes.size() / 2, bytes.size() - 1}) {
193 bytes[at] ^= 0xff;
194 out.push_back(create(desc, bytes.data(), bytes.size()));
195 bytes[at] ^= 0xff;
196 }
197 out.push_back(create(desc, bytes.data(), 0));
198 out.push_back(create(desc, nullptr, 16));
199 same_root->Release();
200 other_root->Release();
201 return out;
202}
203
204// The same cases on the PC runtime, with an empty compute shader from d3dcompiler_47: the default adapter, then WARP.
205// Empty when the host has no D3D12 device or no compiler (Wine), which the caller reports as a skip.
206std::vector<std::vector<HRESULT>> host_cached_pso_cases(const std::vector<std::uint8_t>& root_blob,
207 const std::vector<std::uint8_t>& other_root_blob) {
208 using CompileFn = HRESULT(WINAPI*)(LPCVOID, SIZE_T, LPCSTR, const void*, void*, LPCSTR, LPCSTR, UINT, UINT,
209 ID3DBlob**, ID3DBlob**);
210 using CreateDeviceFn = decltype(&::D3D12CreateDevice);
211 std::vector<std::vector<HRESULT>> out;
212 const HMODULE compiler = LoadLibraryExA("d3dcompiler_47.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
213 const HMODULE d3d12 = LoadLibraryExA("d3d12.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
214 const HMODULE dxgi = LoadLibraryExA("dxgi.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
215 if (!compiler || !d3d12 || !dxgi) return out;
216 const auto compile = reinterpret_cast<CompileFn>(reinterpret_cast<void*>(GetProcAddress(compiler, "D3DCompile")));
217 const auto create_device =
218 reinterpret_cast<CreateDeviceFn>(reinterpret_cast<void*>(GetProcAddress(d3d12, "D3D12CreateDevice")));
219 using FactoryFn = HRESULT(WINAPI*)(REFIID, void**);
220 const auto create_factory =
221 reinterpret_cast<FactoryFn>(reinterpret_cast<void*>(GetProcAddress(dxgi, "CreateDXGIFactory1")));
222 if (!compile || !create_device || !create_factory) return out;
223 static const char source[] = "[numthreads(1, 1, 1)] void main() {}";
224 ID3DBlob* shader = nullptr;
225 if (FAILED(compile(source, sizeof(source) - 1, nullptr, nullptr, nullptr, "main", "cs_5_0", 0, 0, &shader,
226 nullptr)) || !shader)
227 return out;
228 IDXGIFactory4* factory = nullptr;
229 if (SUCCEEDED(create_factory(IID_PPV_ARGS(&factory)))) {
230 IDXGIAdapter* warp = nullptr;
231 factory->EnumWarpAdapter(IID_PPV_ARGS(&warp));
232 for (IUnknown* adapter : {static_cast<IUnknown*>(nullptr), static_cast<IUnknown*>(warp)}) {
233 ID3D12Device* host = nullptr;
234 if (FAILED(create_device(adapter, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&host)))) continue;
235 ID3D12RootSignature* root = nullptr;
236 if (SUCCEEDED(host->CreateRootSignature(0, root_blob.data(), root_blob.size(), IID_PPV_ARGS(&root)))) {
237 D3D12_COMPUTE_PIPELINE_STATE_DESC desc{};
238 desc.pRootSignature = root;
239 desc.CS = {shader->GetBufferPointer(), shader->GetBufferSize()};
240 out.push_back(cached_pso_cases(host, desc, root_blob, other_root_blob));
241 root->Release();
242 }
243 host->Release();
244 }
245 if (warp) warp->Release();
246 factory->Release();
247 }
248 shader->Release();
249 return out;
250}
251
139} // namespace 252} // namespace
140 253
141int main() { 254int main() {
@@ -258,6 +371,51 @@ int main() {
258 device.p, &native_desc, nullptr, &out_null) == E_POINTER && !out_null); 371 device.p, &native_desc, nullptr, &out_null) == E_POINTER && !out_null);
259 EXPECT(reinterpret_cast<XboxNativeComputePipelineFn>(slot(device.p, 67))( 372 EXPECT(reinterpret_cast<XboxNativeComputePipelineFn>(slot(device.p, 67))(
260 device.p, &native_desc, &pso_iid, nullptr) == E_POINTER); 373 device.p, &native_desc, &pso_iid, nullptr) == E_POINTER);
374 // GetCachedBlob and CachedPSO answer as the PC runtime does (src/cached_pso.h).
375 {
376 D3D12_VERSIONED_ROOT_SIGNATURE_DESC other_desc = root_desc;
377 other_desc.Desc_1_0.NumParameters = 2;
378 const auto other_root_blob = serialize(other_desc);
379 EXPECT(!other_root_blob.empty());
380 const std::vector<HRESULT> layer = cached_pso_cases(device.p, pso_desc, root_blob, other_root_blob);
381 EXPECT(int(layer.size()) == cached_case_count);
382 const std::vector<HRESULT> expected = {S_OK, S_OK, S_OK, E_INVALIDARG,
383 E_INVALIDARG, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG,
384 E_INVALIDARG, E_INVALIDARG, S_OK};
385 EXPECT(layer == expected);
386 const auto hosts = host_cached_pso_cases(root_blob, other_root_blob);
387 if (hosts.empty()) std::printf("SKIP: no host D3D12 device or compiler for the CachedPSO comparison\n");
388 for (const auto& host : hosts) EXPECT(host == layer);
389 if (!hosts.empty()) std::printf("cached PSO: %zu host adapter(s) gave the same %d answers\n", hosts.size(), cached_case_count);
390
391 // Every byte of the blob counts, and the adapter and driver fields give the runtime's own errors.
392 Ref<ID3DBlob> blob;
393 EXPECT(pso->GetCachedBlob(&blob.p) == S_OK && blob.p);
394 const auto* p = static_cast<const std::uint8_t*>(blob->GetBufferPointer());
395 std::vector<std::uint8_t> bytes(p, p + blob->GetBufferSize());
396 auto attempt = [&](const std::vector<std::uint8_t>& b) {
397 D3D12_COMPUTE_PIPELINE_STATE_DESC d = pso_desc;
398 d.CachedPSO = {b.data(), b.size()};
399 Ref<ID3D12PipelineState> made;
400 return device->CreateComputePipelineState(&d, IID_PPV_ARGS(&made.p));
401 };
402 for (std::size_t at = 0; at < bytes.size(); ++at) {
403 auto changed = bytes;
404 changed[at] ^= 0x01;
405 EXPECT(attempt(changed) == E_INVALIDARG);
406 }
407 auto resealed = [](std::vector<std::uint8_t> b, std::size_t at) {
408 b[at] ^= 0x01;
409 const std::uint32_t sum = leonida::cached_pso::fnv1a(b.data(), b.size() - 4);
410 for (int i = 0; i < 4; ++i) b[b.size() - 4 + i] = std::uint8_t(sum >> (8 * i));
411 return b;
412 };
413 EXPECT(attempt(resealed(bytes, 8)) == D3D12_ERROR_ADAPTER_NOT_FOUND); // vendor
414 EXPECT(attempt(resealed(bytes, 12)) == D3D12_ERROR_ADAPTER_NOT_FOUND); // device
415 EXPECT(attempt(resealed(bytes, 16)) == D3D12_ERROR_DRIVER_VERSION_MISMATCH);
416 EXPECT(attempt(resealed(bytes, 20)) == D3D12_ERROR_DRIVER_VERSION_MISMATCH); // pipelineCacheUUID
417 EXPECT(attempt(resealed(bytes, 4)) == E_INVALIDARG); // version
418 }
261 419
262 // A device whose maxPushConstantsSize is the Vulkan minimum (128 bytes) cannot hold the 144-byte block, so 420 // A device whose maxPushConstantsSize is the Vulkan minimum (128 bytes) cannot hold the 144-byte block, so
263 // its PSOs are refused instead of creating a pipeline layout the spec forbids (#224's fallback flag). 421 // its PSOs are refused instead of creating a pipeline layout the spec forbids (#224's fallback flag).
diff --git a/runtime/test/d3d12_descriptor_test.cpp b/runtime/test/d3d12_descriptor_test.cpp
index d28ebda9f..f2a33c4f2 100644
--- a/runtime/test/d3d12_descriptor_test.cpp
+++ b/runtime/test/d3d12_descriptor_test.cpp
@@ -1784,11 +1784,19 @@ int main() {
1784 // More than 4096 SRVs and more than a full shader-visible sampler heap (2048): 5000 distinct views of the 1784 // More than 4096 SRVs and more than a full shader-visible sampler heap (2048): 5000 distinct views of the
1785 // texture (mip ranges by swizzles), then one more that samples as the texture, and 2100 distinct wrapping 1785 // texture (mip ranges by swizzles), then one more that samples as the texture, and 2100 distinct wrapping
1786 // samplers (MaxLOD apart). The last view through the last sampler must give the texture, one tile to the 1786 // samplers (MaxLOD apart). The last view through the last sampler must give the texture, one tile to the
1787 // right; a fallback view or the fallback (clamping) sampler would not. 1787 // right; a fallback view or the fallback (clamping) sampler would not. A set with less room than that
1788 // (MoltenVK's keeps the default 4096 2D images and 1024 samplers, docs/d3d12_vulkan.md section 5) gets as
1789 // many as fill each short array exactly: its last view and sampler must still give the texture, and one
1790 // more of each must be refused and read as the fallbacks.
1788 { 1791 {
1789 constexpr UINT many_views = 5000, many_samplers = 2100, heap_samplers = 2048; 1792 constexpr UINT wanted_views = 5000, wanted_samplers = 2100, heap_samplers = 2048;
1793 const auto room = rt::d3d12::bindless_room(device.p);
1794 EXPECT(room.images_2d >= 2 && room.samplers >= 1);
1795 const bool views_capped = room.images_2d < wanted_views + 1, samplers_capped = room.samplers < wanted_samplers;
1796 const UINT many_views = views_capped ? room.images_2d - 1 : wanted_views;
1797 const UINT many_samplers = samplers_capped ? room.samplers : wanted_samplers;
1790 Ref<ID3D12DescriptorHeap> many_view_heap, many_sampler_heaps[2]; 1798 Ref<ID3D12DescriptorHeap> many_view_heap, many_sampler_heaps[2];
1791 D3D12_DESCRIPTOR_HEAP_DESC many_desc{D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, many_views + 1, 1799 D3D12_DESCRIPTOR_HEAP_DESC many_desc{D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, many_views + 2,
1792 D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE, 0}; 1800 D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE, 0};
1793 EXPECT(SUCCEEDED(device->CreateDescriptorHeap(&many_desc, IID_PPV_ARGS(&many_view_heap.p)))); 1801 EXPECT(SUCCEEDED(device->CreateDescriptorHeap(&many_desc, IID_PPV_ARGS(&many_view_heap.p))));
1794 many_desc = {D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER, heap_samplers, D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE, 1802 many_desc = {D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER, heap_samplers, D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE,
@@ -1815,28 +1823,41 @@ int main() {
1815 std::memcpy(tsharps.emplace_back().data(), reinterpret_cast<const void*>(many_view_cpu + i * step), 32); 1823 std::memcpy(tsharps.emplace_back().data(), reinterpret_cast<const void*>(many_view_cpu + i * step), 32);
1816 } 1824 }
1817 // Every mip with alpha forced to one: the texture's texels (alpha 255), under a T# no other view has. 1825 // Every mip with alpha forced to one: the texture's texels (alpha 255), under a T# no other view has.
1826 // The one past it, a short array's extra, forces alpha to zero.
1818 D3D12_SHADER_RESOURCE_VIEW_DESC last_srv{}; 1827 D3D12_SHADER_RESOURCE_VIEW_DESC last_srv{};
1819 last_srv.Format = sampled_desc.Format; 1828 last_srv.Format = sampled_desc.Format;
1820 last_srv.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D; 1829 last_srv.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
1821 last_srv.Shader4ComponentMapping = 1830 last_srv.Shader4ComponentMapping =
1822 D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(0, 1, 2, D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_1); 1831 D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(0, 1, 2, D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_1);
1823 last_srv.Texture2D = {0, UINT(-1), 0, 0}; 1832 last_srv.Texture2D = {0, UINT(-1), 0, 0};
1824 const std::uint64_t last_view = many_view_cpu + many_views * step; 1833 const std::uint64_t last_view = many_view_cpu + many_views * step, extra_view = last_view + step;
1825 device->CreateShaderResourceView(texture.p, &last_srv, D3D12_CPU_DESCRIPTOR_HANDLE{SIZE_T(last_view)}); 1834 device->CreateShaderResourceView(texture.p, &last_srv, D3D12_CPU_DESCRIPTOR_HANDLE{SIZE_T(last_view)});
1826 std::memcpy(tsharps.emplace_back().data(), reinterpret_cast<const void*>(last_view), 32); 1835 std::memcpy(tsharps.emplace_back().data(), reinterpret_cast<const void*>(last_view), 32);
1836 if (views_capped) {
1837 EXPECT(rt::d3d12::bindless_room(device.p).images_2d == 0);
1838 last_srv.Shader4ComponentMapping =
1839 D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(0, 1, 2, D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0);
1840 device->CreateShaderResourceView(texture.p, &last_srv, D3D12_CPU_DESCRIPTOR_HANDLE{SIZE_T(extra_view)});
1841 std::memcpy(tsharps.emplace_back().data(), reinterpret_cast<const void*>(extra_view), 32);
1842 }
1827 std::memcpy(tsharps.emplace_back().data(), view_bytes(own), 32); 1843 std::memcpy(tsharps.emplace_back().data(), view_bytes(own), 32);
1828 std::sort(tsharps.begin(), tsharps.end()); 1844 std::sort(tsharps.begin(), tsharps.end());
1829 EXPECT(std::unique(tsharps.begin(), tsharps.end()) == tsharps.end()); // distinct set entries 1845 EXPECT(std::unique(tsharps.begin(), tsharps.end()) == tsharps.end()); // distinct set entries
1830 1846
1831 std::vector<std::array<std::uint32_t, 4>> ssharps; 1847 std::vector<std::array<std::uint32_t, 4>> ssharps;
1832 std::uint64_t last_sampler = 0; 1848 std::uint64_t last_sampler = 0;
1833 for (UINT i = 0; i < many_samplers; ++i) { 1849 const UINT created_samplers = many_samplers + (samplers_capped ? 1 : 0);
1850 for (UINT i = 0; i < created_samplers; ++i) {
1851 if (i == many_samplers) EXPECT(rt::d3d12::bindless_room(device.p).samplers == 0);
1834 D3D12_SAMPLER_DESC many_sampler = sampler_desc; 1852 D3D12_SAMPLER_DESC many_sampler = sampler_desc;
1835 many_sampler.MaxLOD = float(i + 1) / 256.0f; // the S# keeps 8 fraction bits; LOD 0 is sampled 1853 many_sampler.MaxLOD = float(i + 1) / 256.0f; // the S# keeps 8 fraction bits; LOD 0 is sampled
1836 last_sampler = cpu_start(many_sampler_heaps[i / heap_samplers].p) + (i % heap_samplers) * sampler_step; 1854 const std::uint64_t at =
1837 device->CreateSampler(&many_sampler, D3D12_CPU_DESCRIPTOR_HANDLE{SIZE_T(last_sampler)}); 1855 cpu_start(many_sampler_heaps[i / heap_samplers].p) + (i % heap_samplers) * sampler_step;
1838 std::memcpy(ssharps.emplace_back().data(), reinterpret_cast<const void*>(last_sampler), 16); 1856 device->CreateSampler(&many_sampler, D3D12_CPU_DESCRIPTOR_HANDLE{SIZE_T(at)});
1857 std::memcpy(ssharps.emplace_back().data(), reinterpret_cast<const void*>(at), 16);
1858 if (i < many_samplers) last_sampler = at;
1839 } 1859 }
1860 const std::uint64_t extra_sampler = last_sampler + sampler_step; // many_samplers < heap_samplers then
1840 std::memcpy(ssharps.emplace_back().data(), sampler_bytes, 16); 1861 std::memcpy(ssharps.emplace_back().data(), sampler_bytes, 16);
1841 std::sort(ssharps.begin(), ssharps.end()); 1862 std::sort(ssharps.begin(), ssharps.end());
1842 EXPECT(std::unique(ssharps.begin(), ssharps.end()) == ssharps.end()); 1863 EXPECT(std::unique(ssharps.begin(), ssharps.end()) == ssharps.end());
@@ -1847,20 +1868,63 @@ int main() {
1847 queue->ExecuteCommandLists(1, lists); 1868 queue->ExecuteCommandLists(1, lists);
1848 EXPECT(rt::d3d12::last_execute_result(queue.p) == leonida::ReplayResult::success); 1869 EXPECT(rt::d3d12::last_execute_result(queue.p) == leonida::ReplayResult::success);
1849 d.fn<PFN_vkDeviceWaitIdle>("vkDeviceWaitIdle")(d.device); 1870 d.fn<PFN_vkDeviceWaitIdle>("vkDeviceWaitIdle")(d.device);
1850 SampleKeys last_keys{}; 1871 const auto in_table = [&](std::uint64_t descriptor, bool sampler) {
1851 std::memcpy(last_keys.tsharp, reinterpret_cast<const void*>(last_view), sizeof(last_keys.tsharp)); 1872 std::uint32_t key[8]{~0u, ~0u, ~0u, ~0u, ~0u, ~0u, ~0u, ~0u};
1852 std::memcpy(last_keys.ssharp, reinterpret_cast<const void*>(last_sampler), sizeof(last_keys.ssharp)); 1873 std::memcpy(key, reinterpret_cast<const void*>(descriptor), sampler ? 16 : 32);
1853 std::array<std::uint8_t, bytes> last_texels{}; 1874 return rt::d3d12::bindless_hash_lookup(device.p, key) != 0;
1854 EXPECT(sample_through_set(d, set0, set0_layout, {&last_keys, 1}, last_texels.data())); 1875 };
1876 EXPECT(in_table(last_view, false) && in_table(last_sampler, true));
1877 if (views_capped) EXPECT(!in_table(extra_view, false));
1878 if (samplers_capped) EXPECT(!in_table(extra_sampler, true));
1879
1880 // The last view through the last sampler; then a short array's extra in its place, which reads as the
1881 // fallback: zeros for the view, and the clamping sampler's edge column for the sampler.
1882 SampleKeys last_keys[3]{};
1883 std::memcpy(last_keys[0].tsharp, reinterpret_cast<const void*>(last_view), sizeof(last_keys[0].tsharp));
1884 std::memcpy(last_keys[0].ssharp, reinterpret_cast<const void*>(last_sampler), sizeof(last_keys[0].ssharp));
1885 UINT key_count = 1;
1886 if (views_capped) {
1887 last_keys[key_count] = last_keys[0];
1888 std::memcpy(last_keys[key_count].tsharp, reinterpret_cast<const void*>(extra_view),
1889 sizeof(last_keys[key_count].tsharp));
1890 last_keys[key_count].first = key_count * texels;
1891 ++key_count;
1892 }
1893 if (samplers_capped) {
1894 last_keys[key_count] = last_keys[0];
1895 std::memcpy(last_keys[key_count].ssharp, reinterpret_cast<const void*>(extra_sampler),
1896 sizeof(last_keys[key_count].ssharp));
1897 last_keys[key_count].first = key_count * texels;
1898 ++key_count;
1899 }
1900 std::array<std::uint8_t, 3 * bytes> last_texels{};
1901 EXPECT(sample_through_set(d, set0, set0_layout, {last_keys, key_count}, last_texels.data()));
1902 const char* const names[] = {"the last view through the last sampler", "the refused view",
1903 "the refused sampler"};
1855 UINT differ = 0; 1904 UINT differ = 0;
1856 for (UINT i = 0; i < texels; ++i) 1905 for (UINT k = 0; k < key_count; ++k) {
1857 if (std::memcmp(last_texels.data() + 4 * i, texel(i % size, i / size).data(), 4) != 0 && differ++ < 4) 1906 const UINT kind = k == 0 ? 0 : views_capped && k == 1 ? 1 : 2;
1858 std::fprintf(stderr, "view %u through sampler %u, texel %u: got %u,%u,%u,%u\n", many_views + 1, 1907 for (UINT i = 0; i < texels; ++i) {
1859 many_samplers, i, last_texels[4 * i], last_texels[4 * i + 1], last_texels[4 * i + 2], 1908 const auto want = kind == 0 ? texel(i % size, i / size)
1860 last_texels[4 * i + 3]); 1909 : kind == 1 ? std::array<std::uint8_t, 4>{}
1910 : texel(size - 1, i / size);
1911 const auto* got = last_texels.data() + k * bytes + 4 * i;
1912 if (std::memcmp(got, want.data(), 4) != 0 && differ++ < 4)
1913 std::fprintf(stderr, "%s, texel %u: got %u,%u,%u,%u; expected %u,%u,%u,%u\n", names[kind], i,
1914 got[0], got[1], got[2], got[3], want[0], want[1], want[2], want[3]);
1915 }
1916 }
1861 EXPECT(differ == 0); 1917 EXPECT(differ == 0);
1862 std::printf("bindless capacity: the %uth SRV through the %uth sampler gave the texture\n", many_views + 1, 1918 if (!views_capped && !samplers_capped)
1863 many_samplers); 1919 std::printf("bindless capacity: the %uth SRV through the %uth sampler gave the texture\n",
1920 many_views + 1, many_samplers);
1921 else
1922 std::printf("bindless capacity: the set had room for %u more 2D views and %u more samplers, fewer than "
1923 "%u and %u: the last of each gave the texture, and one more %s refused and read as the "
1924 "fallback\n", room.images_2d, room.samplers, wanted_views + 1, wanted_samplers,
1925 views_capped && samplers_capped ? "of each was"
1926 : views_capped ? "view was"
1927 : "sampler was");
1864 } 1928 }
1865 1929
1866 // 96-bit textures (D3D-62): R32G32B32_FLOAT holding the texture's red, green and blue as n/255, 1930 // 96-bit textures (D3D-62): R32G32B32_FLOAT holding the texture's red, green and blue as n/255,
@@ -2261,6 +2325,262 @@ int main() {
2261 EXPECT(rt::d3d12::bindless_hash_lookup(device.p, cast_key) != 0); 2325 EXPECT(rt::d3d12::bindless_hash_lookup(device.p, cast_key) != 0);
2262 } 2326 }
2263 2327
2328 // Depth SRVs: D16_UNORM / R16_TYPELESS (depth) and D32_FLOAT / R32_TYPELESS (depth) only allow matching depth
2329 // view formats (R16_UNORM / R32_FLOAT, plus UNKNOWN on typed D16/D32). Colour casts on depth textures
2330 // (R16_FLOAT/SNORM/UINT/SINT on D16, R32_UINT/SINT on D32, or any colour format on D24S8/D32S8) must produce
2331 // null descriptors with zero Vulkan validation errors.
2332 {
2333 const unsigned validation_before_depth = d.validation_errors();
2334 constexpr UINT depth_tex_count = 4;
2335 constexpr DXGI_FORMAT depth_tex_formats[depth_tex_count] = {
2336 DXGI_FORMAT_D16_UNORM, DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_R32_TYPELESS};
2337 constexpr DXGI_FORMAT depth_dsv_formats[depth_tex_count] = {
2338 DXGI_FORMAT_D16_UNORM, DXGI_FORMAT_D16_UNORM, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_D32_FLOAT};
2339 // Multiples of 1/255 are exact in both D16_UNORM (65535 = 255 * 257) and D32_FLOAT.
2340 constexpr std::uint8_t depth_clear_u8[depth_tex_count] = {51, 102, 153, 204};
2341 Ref<ID3D12Resource> depth_textures[depth_tex_count];
2342 for (UINT i = 0; i < depth_tex_count; ++i) {
2343 D3D12_RESOURCE_DESC dd = texture_desc;
2344 dd.Format = depth_tex_formats[i];
2345 dd.Flags = D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
2346 EXPECT(SUCCEEDED(device->CreateCommittedResource(&default_heap, D3D12_HEAP_FLAG_NONE, &dd,
2347 D3D12_RESOURCE_STATE_DEPTH_WRITE, nullptr,
2348 IID_PPV_ARGS(&depth_textures[i].p))));
2349 }
2350 Ref<ID3D12DescriptorHeap> depth_dsv_heap, depth_srv_heap;
2351 const D3D12_DESCRIPTOR_HEAP_DESC depth_dsv_hd{D3D12_DESCRIPTOR_HEAP_TYPE_DSV, depth_tex_count,
2352 D3D12_DESCRIPTOR_HEAP_FLAG_NONE, 0};
2353 EXPECT(SUCCEEDED(device->CreateDescriptorHeap(&depth_dsv_hd, IID_PPV_ARGS(&depth_dsv_heap.p))));
2354 const UINT dsv_step = device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_DSV);
2355 const std::uint64_t dsv_cpu = reinterpret_cast<XboxHeapHandleFn>(slot(depth_dsv_heap.p, 9))(depth_dsv_heap.p);
2356 const auto dsv_slot = [&](UINT i) { return D3D12_CPU_DESCRIPTOR_HANDLE{SIZE_T(dsv_cpu + i * dsv_step)}; };
2357 for (UINT i = 0; i < depth_tex_count; ++i) {
2358 D3D12_DEPTH_STENCIL_VIEW_DESC dsv{};
2359 dsv.Format = depth_dsv_formats[i];
2360 dsv.ViewDimension = D3D12_DSV_DIMENSION_TEXTURE2D;
2361 device->CreateDepthStencilView(depth_textures[i].p, &dsv, dsv_slot(i));
2362 }
2363
2364 // Valid depth SRVs: 0: D16 default, 1: D16->R16_UNORM, 2: R16_TYPELESS->R16_UNORM,
2365 // 3: D32 default, 4: D32->R32_FLOAT, 5: R32_TYPELESS->R32_FLOAT; 6: scratch for invalid.
2366 constexpr UINT valid_depth_srvs = 6, depth_scratch = 6;
2367 const D3D12_DESCRIPTOR_HEAP_DESC depth_srv_hd{D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, valid_depth_srvs + 1,
2368 D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE, 0};
2369 EXPECT(SUCCEEDED(device->CreateDescriptorHeap(&depth_srv_hd, IID_PPV_ARGS(&depth_srv_heap.p))));
2370 const std::uint64_t depth_srv_cpu =
2371 reinterpret_cast<XboxHeapHandleFn>(slot(depth_srv_heap.p, 9))(depth_srv_heap.p);
2372 const auto depth_slot = [&](UINT i) { return D3D12_CPU_DESCRIPTOR_HANDLE{SIZE_T(depth_srv_cpu + i * step)}; };
2373 const auto depth_bytes = [&](UINT i) { return reinterpret_cast<std::uint8_t*>(depth_srv_cpu + i * step); };
2374 const auto depth_null = [&](UINT i) {
2375 return std::all_of(depth_bytes(i), depth_bytes(i) + step, [](std::uint8_t b) { return b == 0; });
2376 };
2377
2378 struct ValidDepthSrv {
2379 UINT tex_index;
2380 DXGI_FORMAT view_format; // UNKNOWN => pass nullptr
2381 VkFormat expected_vk;
2382 };
2383 constexpr ValidDepthSrv valid_cases[valid_depth_srvs] = {
2384 {0, DXGI_FORMAT_UNKNOWN, VK_FORMAT_D16_UNORM},
2385 {0, DXGI_FORMAT_R16_UNORM, VK_FORMAT_D16_UNORM},
2386 {1, DXGI_FORMAT_R16_UNORM, VK_FORMAT_D16_UNORM},
2387 {2, DXGI_FORMAT_UNKNOWN, VK_FORMAT_D32_SFLOAT},
2388 {2, DXGI_FORMAT_R32_FLOAT, VK_FORMAT_D32_SFLOAT},
2389 {3, DXGI_FORMAT_R32_FLOAT, VK_FORMAT_D32_SFLOAT},
2390 };
2391 for (UINT i = 0; i < valid_depth_srvs; ++i) {
2392 const auto& vc = valid_cases[i];
2393 D3D12_SHADER_RESOURCE_VIEW_DESC srv{};
2394 srv.Format = vc.view_format;
2395 srv.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
2396 srv.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
2397 srv.Texture2D.MipLevels = 1;
2398 device->CreateShaderResourceView(depth_textures[vc.tex_index].p,
2399 vc.view_format == DXGI_FORMAT_UNKNOWN ? nullptr : &srv, depth_slot(i));
2400 g::ImageWords words{};
2401 std::memcpy(words.data(), depth_bytes(i), sizeof(words));
2402 g::Image decoded{};
2403 EXPECT(g::is_image(words) && g::decode(words, decoded));
2404 EXPECT(decoded.type == g::ImageType::image_2d);
2405 EXPECT(decoded.format == g::format_from_vulkan(vc.expected_vk));
2406 EXPECT(decoded.swizzle == g::channels_r);
2407 std::uint32_t key[8]{};
2408 std::memcpy(key, words.data(), sizeof(key));
2409 EXPECT(rt::d3d12::bindless_hash_lookup(device.p, key) != 0);
2410 }
2411
2412 // Invalid depth SRVs: every non-depth colour format and mismatched/typeless format must leave a null
2413 // descriptor and emit zero Vulkan validation errors.
2414 const auto expect_depth_srv_null = [&](ID3D12Resource* res, const D3D12_SHADER_RESOURCE_VIEW_DESC* srv) {
2415 std::memset(depth_bytes(depth_scratch), 0x77, step);
2416 device->CreateShaderResourceView(res, srv, depth_slot(depth_scratch));
2417 return depth_null(depth_scratch);
2418 };
2419 const auto check_bad_formats = [&](ID3D12Resource* res, std::initializer_list<DXGI_FORMAT> bad_formats) {
2420 for (const DXGI_FORMAT fmt : bad_formats) {
2421 D3D12_SHADER_RESOURCE_VIEW_DESC srv{};
2422 srv.Format = fmt;
2423 srv.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
2424 srv.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
2425 srv.Texture2D.MipLevels = 1;
2426 if (!expect_depth_srv_null(res, &srv)) return false;
2427 }
2428 return true;
2429 };
2430 // D16_UNORM and R16_TYPELESS (depth): R16_FLOAT, R16_SNORM, R16_UINT, R16_SINT and other mismatched views.
2431 EXPECT(check_bad_formats(depth_textures[0].p,
2432 {DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_SNORM, DXGI_FORMAT_R16_UINT,
2433 DXGI_FORMAT_R16_SINT, DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_D16_UNORM,
2434 DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R8G8B8A8_UNORM}));
2435 EXPECT(expect_depth_srv_null(depth_textures[1].p, nullptr)); // UNKNOWN on R16_TYPELESS (depth)
2436 EXPECT(check_bad_formats(depth_textures[1].p,
2437 {DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_SNORM,
2438 DXGI_FORMAT_R16_UINT, DXGI_FORMAT_R16_SINT, DXGI_FORMAT_R16_TYPELESS,
2439 DXGI_FORMAT_D16_UNORM, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R8G8B8A8_UNORM}));
2440 // D32_FLOAT and R32_TYPELESS (depth): R32_UINT, R32_SINT and other mismatched views.
2441 EXPECT(check_bad_formats(depth_textures[2].p,
2442 {DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_SINT, DXGI_FORMAT_R32_TYPELESS,
2443 DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM}));
2444 EXPECT(expect_depth_srv_null(depth_textures[3].p, nullptr)); // UNKNOWN on R32_TYPELESS (depth)
2445 EXPECT(check_bad_formats(depth_textures[3].p,
2446 {DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_SINT,
2447 DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_R16_UNORM,
2448 DXGI_FORMAT_R8G8B8A8_UNORM}));
2449
2450 // D24_UNORM_S8_UINT / R24G8_TYPELESS and D32_FLOAT_S8X24_UINT / R32G8X24_TYPELESS: colour view formats
2451 // must also be rejected, while depth-plane and stencil-plane views continue working.
2452 for (const auto& [res_fmt, valid_depth_fmt, valid_stencil_fmt, is_typeless] :
2453 {std::tuple{DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_R24_UNORM_X8_TYPELESS,
2454 DXGI_FORMAT_X24_TYPELESS_G8_UINT, false},
2455 std::tuple{DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS,
2456 DXGI_FORMAT_X24_TYPELESS_G8_UINT, true},
2457 std::tuple{DXGI_FORMAT_D32_FLOAT_S8X24_UINT, DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS,
2458 DXGI_FORMAT_X32_TYPELESS_G8X24_UINT, false},
2459 std::tuple{DXGI_FORMAT_R32G8X24_TYPELESS, DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS,
2460 DXGI_FORMAT_X32_TYPELESS_G8X24_UINT, true}}) {
2461 D3D12_RESOURCE_DESC ds_desc = texture_desc;
2462 ds_desc.Format = res_fmt;
2463 ds_desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
2464 Ref<ID3D12Resource> ds_tex;
2465 EXPECT(SUCCEEDED(device->CreateCommittedResource(&default_heap, D3D12_HEAP_FLAG_NONE, &ds_desc,
2466 D3D12_RESOURCE_STATE_COMMON, nullptr,
2467 IID_PPV_ARGS(&ds_tex.p))));
2468 if (is_typeless) EXPECT(expect_depth_srv_null(ds_tex.p, nullptr));
2469 EXPECT(check_bad_formats(ds_tex.p,
2470 {DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_SINT,
2471 DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R8G8B8A8_UNORM,
2472 DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_D32_FLOAT_S8X24_UINT,
2473 DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R32G8X24_TYPELESS}));
2474 D3D12_SHADER_RESOURCE_VIEW_DESC ds_srv{};
2475 ds_srv.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
2476 ds_srv.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
2477 ds_srv.Texture2D.MipLevels = 1;
2478 ds_srv.Format = valid_depth_fmt;
2479 ds_srv.Texture2D.PlaneSlice = 0;
2480 device->CreateShaderResourceView(ds_tex.p, &ds_srv, depth_slot(depth_scratch));
2481 EXPECT(!depth_null(depth_scratch));
2482 ds_srv.Format = valid_stencil_fmt;
2483 ds_srv.Texture2D.PlaneSlice = 1;
2484 device->CreateShaderResourceView(ds_tex.p, &ds_srv, depth_slot(depth_scratch));
2485 EXPECT(!depth_null(depth_scratch));
2486 }
2487
2488 // Colour R16_TYPELESS and R32_TYPELESS (without ALLOW_DEPTH_STENCIL) still allow colour casts,
2489 // while rejecting depth view formats on colour textures.
2490 for (const auto& [colour_typeless, good_colour, bad_depth] :
2491 {std::tuple{DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_D16_UNORM},
2492 std::tuple{DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_UINT, DXGI_FORMAT_D32_FLOAT}}) {
2493 D3D12_RESOURCE_DESC col_desc = texture_desc;
2494 col_desc.Format = colour_typeless;
2495 Ref<ID3D12Resource> col_tex;
2496 EXPECT(SUCCEEDED(device->CreateCommittedResource(&default_heap, D3D12_HEAP_FLAG_NONE, &col_desc,
2497 D3D12_RESOURCE_STATE_COMMON, nullptr,
2498 IID_PPV_ARGS(&col_tex.p))));
2499 D3D12_SHADER_RESOURCE_VIEW_DESC col_srv{};
2500 col_srv.Format = good_colour;
2501 col_srv.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
2502 col_srv.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
2503 col_srv.Texture2D.MipLevels = 1;
2504 device->CreateShaderResourceView(col_tex.p, &col_srv, depth_slot(depth_scratch));
2505 EXPECT(!depth_null(depth_scratch));
2506 EXPECT(check_bad_formats(col_tex.p, {bad_depth}));
2507 }
2508
2509 // Depth resource with a castable format list (allow_channel_cast = true): valid depth SRV still works
2510 // and colour SRVs still leave a null descriptor with zero validation errors.
2511 {
2512 Ref<ID3D12Device10> inner10;
2513 EXPECT(SUCCEEDED(inner->QueryInterface(IID_PPV_ARGS(&inner10.p))));
2514 D3D12_RESOURCE_DESC1 d16_cast_desc{};
2515 d16_cast_desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
2516 d16_cast_desc.Width = size;
2517 d16_cast_desc.Height = size;
2518 d16_cast_desc.DepthOrArraySize = 1;
2519 d16_cast_desc.MipLevels = 1;
2520 d16_cast_desc.Format = DXGI_FORMAT_D16_UNORM;
2521 d16_cast_desc.SampleDesc = {1, 0};
2522 d16_cast_desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
2523 const DXGI_FORMAT d16_list[] = {DXGI_FORMAT_D16_UNORM};
2524 Ref<ID3D12Resource> d16_cast_tex;
2525 EXPECT(SUCCEEDED(inner10->CreateCommittedResource3(
2526 &default_heap, D3D12_HEAP_FLAG_NONE, &d16_cast_desc, D3D12_BARRIER_LAYOUT_COMMON, nullptr, nullptr,
2527 1, d16_list, IID_PPV_ARGS(&d16_cast_tex.p))));
2528 D3D12_SHADER_RESOURCE_VIEW_DESC d16_srv{};
2529 d16_srv.Format = DXGI_FORMAT_R16_UNORM;
2530 d16_srv.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
2531 d16_srv.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
2532 d16_srv.Texture2D.MipLevels = 1;
2533 device->CreateShaderResourceView(d16_cast_tex.p, &d16_srv, depth_slot(depth_scratch));
2534 EXPECT(!depth_null(depth_scratch));
2535 EXPECT(check_bad_formats(d16_cast_tex.p,
2536 {DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_SNORM, DXGI_FORMAT_R16_UINT,
2537 DXGI_FORMAT_R16_SINT, DXGI_FORMAT_R8G8B8A8_UNORM}));
2538 }
2539
2540 // Clear each depth texture and sample all 6 valid depth SRVs on the GPU to confirm they read back their
2541 // cleared depth value in R (with G=0, B=0, A=1).
2542 EXPECT(SUCCEEDED(allocator->Reset()) && SUCCEEDED(list->Reset(allocator.p, nullptr)));
2543 for (UINT i = 0; i < depth_tex_count; ++i) {
2544 list->ClearDepthStencilView(dsv_slot(i), D3D12_CLEAR_FLAG_DEPTH, float(depth_clear_u8[i]) / 255.0f, 0,
2545 0, nullptr);
2546 const D3D12_RESOURCE_BARRIER barrier = transition(
2547 depth_textures[i].p, D3D12_RESOURCE_STATE_DEPTH_WRITE, D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE);
2548 list->ResourceBarrier(1, &barrier);
2549 }
2550 EXPECT(list->Close() == S_OK);
2551 queue->ExecuteCommandLists(1, lists);
2552 EXPECT(rt::d3d12::last_execute_result(queue.p) == leonida::ReplayResult::success);
2553 ++packed_signal;
2554 EXPECT(SUCCEEDED(queue->Signal(fence.p, packed_signal)) &&
2555 SUCCEEDED(fence->SetEventOnCompletion(packed_signal, nullptr)));
2556#ifdef LEONIDA_TEST_CS_SAMPLE_SPV
2557 SampleKeys depth_keys[valid_depth_srvs]{};
2558 for (UINT i = 0; i < valid_depth_srvs; ++i) {
2559 std::memcpy(depth_keys[i].tsharp, depth_bytes(i), sizeof(depth_keys[i].tsharp));
2560 std::memcpy(depth_keys[i].ssharp, sampler_bytes, sizeof(depth_keys[i].ssharp));
2561 depth_keys[i].first = i * texels;
2562 }
2563 std::vector<std::uint8_t> depth_pixels(valid_depth_srvs * bytes);
2564 EXPECT(sample_through_set(d, set0, set0_layout, depth_keys, depth_pixels.data()));
2565 UINT depth_differ = 0;
2566 for (UINT k = 0; k < valid_depth_srvs; ++k) {
2567 const std::uint8_t want[4] = {depth_clear_u8[valid_cases[k].tex_index], 0, 0, 255};
2568 for (UINT i = 0; i < texels; ++i) {
2569 const std::uint8_t* got = depth_pixels.data() + k * bytes + i * 4;
2570 if (std::memcmp(got, want, 4) != 0 && depth_differ++ < 4)
2571 std::fprintf(stderr, "depth SRV %u texel %u: got %u,%u,%u,%u, want %u,%u,%u,%u\n", k, i,
2572 unsigned(got[0]), unsigned(got[1]), unsigned(got[2]), unsigned(got[3]),
2573 unsigned(want[0]), unsigned(want[1]), unsigned(want[2]), unsigned(want[3]));
2574 }
2575 }
2576 EXPECT(depth_differ == 0);
2577 std::printf("depth SRVs: %u valid D16/D32 views sampled cleared depth values; invalid colour casts rejected "
2578 "as null descriptors (validation errors: %u)\n",
2579 valid_depth_srvs, d.validation_errors() - validation_before_depth);
2580#endif
2581 EXPECT(d.validation_errors() == validation_before_depth);
2582 }
2583
2264 upload.reset(); 2584 upload.reset();
2265 array_texture.reset(); 2585 array_texture.reset();
2266 line.reset(); 2586 line.reset();
diff --git a/runtime/test/d3d12_draw_test.cpp b/runtime/test/d3d12_draw_test.cpp
index 79fb69a70..b108fa8ec 100644
--- a/runtime/test/d3d12_draw_test.cpp
+++ b/runtime/test/d3d12_draw_test.cpp
@@ -202,6 +202,40 @@ int main() {
202 instance_desc.InputLayout = {instance_elements, 2}; 202 instance_desc.InputLayout = {instance_elements, 2};
203 EXPECT(SUCCEEDED(device->CreateGraphicsPipelineState(&instance_desc, IID_PPV_ARGS(&instanced.p)))); 203 EXPECT(SUCCEEDED(device->CreateGraphicsPipelineState(&instance_desc, IID_PPV_ARGS(&instanced.p))));
204 204
205 // CachedPSO on a graphics description: what the PC runtime matches, measured on an RTX 3060
206 // (src/cached_pso.h). Flags is not part of it; every state below is.
207 {
208 Ref<ID3DBlob> blob;
209 EXPECT(pso->GetCachedBlob(&blob.p) == S_OK && blob.p && blob->GetBufferSize());
210 auto with_blob = [&](D3D12_GRAPHICS_PIPELINE_STATE_DESC d) {
211 d.CachedPSO = {blob->GetBufferPointer(), blob->GetBufferSize()};
212 Ref<ID3D12PipelineState> made;
213 const HRESULT hr = device->CreateGraphicsPipelineState(&d, IID_PPV_ARGS(&made.p));
214 return SUCCEEDED(hr) == (made.p != nullptr) ? hr : E_UNEXPECTED;
215 };
216 EXPECT(with_blob(pso_desc) == S_OK);
217 D3D12_GRAPHICS_PIPELINE_STATE_DESC changed = pso_desc;
218 changed.Flags = D3D12_PIPELINE_STATE_FLAG_TOOL_DEBUG;
219 EXPECT(with_blob(changed) == S_OK);
220 EXPECT(with_blob(mrt_desc) == E_INVALIDARG);
221 EXPECT(with_blob(instance_desc) == E_INVALIDARG);
222 changed = pso_desc;
223 changed.RasterizerState.CullMode = D3D12_CULL_MODE_NONE;
224 EXPECT(with_blob(changed) == E_INVALIDARG);
225 changed = pso_desc;
226 changed.BlendState.RenderTarget[0].RenderTargetWriteMask = D3D12_COLOR_WRITE_ENABLE_RED;
227 EXPECT(with_blob(changed) == E_INVALIDARG);
228 changed = pso_desc;
229 changed.SampleMask = 1;
230 EXPECT(with_blob(changed) == E_INVALIDARG);
231 changed = pso_desc;
232 changed.IBStripCutValue = D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF;
233 EXPECT(with_blob(changed) == E_INVALIDARG);
234 changed = pso_desc;
235 changed.RTVFormats[0] = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
236 EXPECT(with_blob(changed) == E_INVALIDARG);
237 }
238
205 // State that needs a Vulkan feature this test device does not enable is refused, not passed to the driver. 239 // State that needs a Vulkan feature this test device does not enable is refused, not passed to the driver.
206 D3D12_GRAPHICS_PIPELINE_STATE_DESC needs_feature = pso_desc; 240 D3D12_GRAPHICS_PIPELINE_STATE_DESC needs_feature = pso_desc;
207 needs_feature.RasterizerState.FillMode = D3D12_FILL_MODE_WIREFRAME; // fillModeNonSolid 241 needs_feature.RasterizerState.FillMode = D3D12_FILL_MODE_WIREFRAME; // fillModeNonSolid
diff --git a/runtime/test/d3d12_first_light_test.cpp b/runtime/test/d3d12_first_light_test.cpp
new file mode 100644
index 000000000..8dcc2ca9c
--- /dev/null
+++ b/runtime/test/d3d12_first_light_test.cpp
@@ -0,0 +1,395 @@
1// First light through the port's D3D12 layer (docs/first_light.md section 5): the real model and the real translated
2// VS/PS that tools/first_light.py assembled from the user's package, drawn through the Xbox-ABI device proxy over the
3// Vulkan device. Package-gated: it reads everything at run time from LEONIDA_FIRST_LIGHT_DIR (the first_light.py
4// output folder) and prints SKIP and exits 77 when that is unset. No game data is in the repository.
5// - CreateGraphicsPipelineState gets the game's own DXBC containers (vs.dxbc, ps.dxbc) and finds both stages by the
6// SHA-256 of the FSSM program inside them, in the translator index first_light.py wrote (index.json, vs.spv,
7// ps.spv); nothing bypasses the lookup. The hashes must also be the ones manifest.json records;
8// - the input layout (POSITION float3, TEXCOORD float2, stride 20) is matched to the VS input signature by
9// semantic; mesh.bin's vertices and indices go through an upload heap into DEFAULT buffers in the GPU address
10// arena, and one DrawIndexedInstanced draws the whole mesh with no depth test and no culling, as vk_harness does;
11// - the R32G32B32A32_FLOAT target is cleared to -1 (vk_harness's clear) and read back through CopyTextureRegion.
12// The oracle is vk_harness's (tests/test_first_light.py): coverage in the manifest's window, the clear corner keeps
13// -1, and the centre pixel is the UV the mesh's last covering triangle gives there. D3D12 clip space is y-up and the
14// layer flips the viewport, while vk_harness draws with a y-down viewport, so vk_harness row r is row H-1-r here.
15// When the folder also has vk_harness's image.raw, every pixel must equal it with the rows flipped.
16// Set LEONIDA_VK_VALIDATION=1 to run under VK_LAYER_KHRONOS_validation.
17#include "vk_test_device.h"
18#include "d3d12_test_shaders.h"
19#include "../shims/d3d12_com.h"
20#include "../shims/d3d12_xs_device.h"
21#include "../src/shader_library.h"
22
23#include <array>
24#include <cmath>
25#include <cstdlib>
26#include <cstring>
27
28#define EXPECT(condition) do { \
29 if (!(condition)) { std::fprintf(stderr, "line %d: %s\n", __LINE__, #condition); return 1; } \
30} while (0)
31
32using namespace d3d12test;
33using XboxHeapHandleFn = std::uint64_t(WINAPI*)(void* heap); // heap slot 9: handle in RAX
34using Pixel = std::array<float, 4>;
35
36namespace {
37
38std::vector<std::uint8_t> read_file(const std::filesystem::path& path) {
39 std::ifstream in(path, std::ios::binary);
40 return {std::istreambuf_iterator<char>(in), std::istreambuf_iterator<char>()};
41}
42
43double number(const leonida::Json& object, std::string_view key, double fallback = -1) {
44 const leonida::Json* value = object.find(key);
45 return value && value->kind == leonida::Json::Kind::number ? value->number : fallback;
46}
47
48// [x, y] from the manifest, or false when it is missing.
49bool pixel_of(const leonida::Json& object, std::string_view key, std::array<double, 2>& out) {
50 const leonida::Json* value = object.find(key);
51 if (!value || value->kind != leonida::Json::Kind::array || value->array.size() != 2) return false;
52 for (int i = 0; i < 2; ++i) {
53 if (value->array[i].kind != leonida::Json::Kind::number) return false;
54 out[i] = value->array[i].number;
55 }
56 return true;
57}
58
59std::string stage_hash(const leonida::Json& manifest, std::string_view stage) {
60 const leonida::Json* entry = manifest.find(stage);
61 const leonida::Json* hash = entry ? entry->find("fssm_sha256") : nullptr;
62 return hash && hash->kind == leonida::Json::Kind::string ? hash->string : std::string();
63}
64
65} // namespace
66
67int main() {
68 const char* dir_env = std::getenv("LEONIDA_FIRST_LIGHT_DIR");
69 if (!dir_env || !*dir_env) {
70 std::printf("SKIP: LEONIDA_FIRST_LIGHT_DIR is not set (run tools/first_light.py first)\n");
71 return 77;
72 }
73 vktest::Device d;
74 const auto device_status = d.initialize();
75 if (device_status == vktest::DeviceStatus::unavailable) {
76 std::fprintf(stderr, "SKIP: no usable Vulkan 1.3 device\n");
77 return 77;
78 }
79 EXPECT(device_status == vktest::DeviceStatus::ready);
80
81 // The work folder: the manifest, the mesh, the game's two containers and the translator's index for them.
82 const std::filesystem::path dir = dir_env;
83 const auto manifest_text = read_file(dir / "manifest.json");
84 leonida::Json manifest;
85 EXPECT(leonida::JsonReader(std::string_view(reinterpret_cast<const char*>(manifest_text.data()),
86 manifest_text.size()))
87 .parse(manifest));
88 for (const char* name : {"vs.dxbc", "ps.dxbc", "index.json", "vs.spv", "ps.spv", "mesh.bin"}) {
89 if (!std::filesystem::is_regular_file(dir / name)) {
90 std::fprintf(stderr, "%s has no %s: re-run tools/first_light.py (it writes the D3D12 inputs too)\n",
91 dir.string().c_str(), name);
92 return 1;
93 }
94 }
95 const UINT width = UINT(number(manifest, "width")), height = UINT(number(manifest, "height"));
96 EXPECT(width > 0 && width <= 4096 && height > 0 && height <= 4096);
97 const UINT pitch = (width * sizeof(Pixel) + 255) / 256 * 256;
98
99 const auto vs_container = read_file(dir / "vs.dxbc"), ps_container = read_file(dir / "ps.dxbc");
100 const std::string vs_hash = leonida::sha256_hex(leonida::fssm_program(vs_container));
101 const std::string ps_hash = leonida::sha256_hex(leonida::fssm_program(ps_container));
102 EXPECT(vs_hash == stage_hash(manifest, "vs") && ps_hash == stage_hash(manifest, "ps"));
103 leonida::ShaderLibrary library;
104 EXPECT(library.load(dir.string()));
105 EXPECT(library.find("vs", vs_hash) && library.find("ps", ps_hash));
106 // The lookup is keyed by stage as well as hash: each program must not be found as the other stage.
107 EXPECT(!library.find("vs", ps_hash) && !library.find("ps", vs_hash));
108
109 // mesh.bin: u32 vertex_count, u32 index_count, (x, y, z, u, v) f32 per vertex, u32 indices.
110 const auto mesh = read_file(dir / "mesh.bin");
111 EXPECT(mesh.size() >= 8);
112 std::uint32_t vertex_count = 0, index_count = 0;
113 std::memcpy(&vertex_count, mesh.data(), 4);
114 std::memcpy(&index_count, mesh.data() + 4, 4);
115 constexpr UINT stride = 5 * sizeof(float);
116 const std::size_t vertex_bytes = std::size_t(vertex_count) * stride, index_bytes = std::size_t(index_count) * 4;
117 EXPECT(vertex_count && index_count && mesh.size() == 8 + vertex_bytes + index_bytes);
118 EXPECT(vertex_count == number(manifest, "vertex_count") && index_count == number(manifest, "index_count"));
119 const std::size_t index_offset = (vertex_bytes + 255) / 256 * 256;
120
121 std::vector<Pixel> pixels(std::size_t(width) * height);
122 {
123 rt::d3d12::VulkanDeviceInfo info{};
124 info.get_instance_proc = d.instance_proc;
125 info.instance = d.instance;
126 info.physical = d.physical;
127 info.device = d.device;
128 info.queue = d.queue;
129 info.queue_family = d.family;
130 info.buffer_device_address = true;
131 info.subgroup = d.subgroup;
132 info.shader_dir = dir.string();
133 ID3D12Device* inner = nullptr;
134 EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&inner))));
135 Ref<ID3D12Device> device;
136 EXPECT(SUCCEEDED(rt::d3d12_xs::create_device_proxy(inner, __uuidof(ID3D12Device),
137 reinterpret_cast<void**>(&device.p))));
138 rt::d3d12::set_device_outer(inner, device.p);
139
140 // No root parameters: the VS applies no matrix and the PS has no bindings (vk_harness pushes zeros too).
141 D3D12_VERSIONED_ROOT_SIGNATURE_DESC root_desc{};
142 root_desc.Version = D3D_ROOT_SIGNATURE_VERSION_1_0;
143 root_desc.Desc_1_0 = {0, nullptr, 0, nullptr, D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT};
144 const auto root_blob = serialize_root_signature(root_desc);
145 EXPECT(!root_blob.empty());
146 Ref<ID3D12RootSignature> root;
147 EXPECT(SUCCEEDED(device->CreateRootSignature(0, root_blob.data(), root_blob.size(), IID_PPV_ARGS(&root.p))));
148
149 const D3D12_INPUT_ELEMENT_DESC elements[2] = {
150 {"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0},
151 {"TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0}};
152 D3D12_GRAPHICS_PIPELINE_STATE_DESC pso_desc{};
153 pso_desc.pRootSignature = root.p;
154 pso_desc.VS = {vs_container.data(), vs_container.size()};
155 pso_desc.PS = {ps_container.data(), ps_container.size()};
156 pso_desc.BlendState.RenderTarget[0].RenderTargetWriteMask = D3D12_COLOR_WRITE_ENABLE_ALL;
157 pso_desc.SampleMask = 0xffffffff;
158 pso_desc.RasterizerState.FillMode = D3D12_FILL_MODE_SOLID;
159 pso_desc.RasterizerState.CullMode = D3D12_CULL_MODE_NONE;
160 pso_desc.RasterizerState.DepthClipEnable = TRUE;
161 pso_desc.InputLayout = {elements, 2};
162 pso_desc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
163 pso_desc.NumRenderTargets = 1;
164 pso_desc.RTVFormats[0] = DXGI_FORMAT_R32G32B32A32_FLOAT;
165 pso_desc.SampleDesc.Count = 1;
166 {
167 // The pixel shader's container as the VS: the proxy finds no vs program with that hash, so no PSO.
168 D3D12_GRAPHICS_PIPELINE_STATE_DESC swapped = pso_desc;
169 swapped.VS = pso_desc.PS;
170 Ref<ID3D12PipelineState> wrong;
171 EXPECT(FAILED(device->CreateGraphicsPipelineState(&swapped, IID_PPV_ARGS(&wrong.p))) && !wrong.p);
172 }
173 Ref<ID3D12PipelineState> pso;
174 EXPECT(SUCCEEDED(device->CreateGraphicsPipelineState(&pso_desc, IID_PPV_ARGS(&pso.p))));
175
176 const D3D12_HEAP_PROPERTIES default_heap{D3D12_HEAP_TYPE_DEFAULT};
177 const D3D12_HEAP_PROPERTIES upload_heap{D3D12_HEAP_TYPE_UPLOAD};
178 const D3D12_HEAP_PROPERTIES readback_heap{D3D12_HEAP_TYPE_READBACK};
179 Ref<ID3D12Resource> vertex_buffer, index_buffer, upload, readback, target;
180 const auto vb_desc = buffer_desc(vertex_bytes), ib_desc = buffer_desc(index_bytes);
181 EXPECT(SUCCEEDED(device->CreateCommittedResource(&default_heap, D3D12_HEAP_FLAG_NONE, &vb_desc,
182 D3D12_RESOURCE_STATE_COPY_DEST, nullptr,
183 IID_PPV_ARGS(&vertex_buffer.p))));
184 EXPECT(SUCCEEDED(device->CreateCommittedResource(&default_heap, D3D12_HEAP_FLAG_NONE, &ib_desc,
185 D3D12_RESOURCE_STATE_COPY_DEST, nullptr,
186 IID_PPV_ARGS(&index_buffer.p))));
187 const auto upload_desc = buffer_desc(index_offset + index_bytes);
188 EXPECT(SUCCEEDED(device->CreateCommittedResource(&upload_heap, D3D12_HEAP_FLAG_NONE, &upload_desc,
189 D3D12_RESOURCE_STATE_GENERIC_READ, nullptr,
190 IID_PPV_ARGS(&upload.p))));
191 const auto readback_desc = buffer_desc(UINT64(pitch) * height);
192 EXPECT(SUCCEEDED(device->CreateCommittedResource(&readback_heap, D3D12_HEAP_FLAG_NONE, &readback_desc,
193 D3D12_RESOURCE_STATE_COPY_DEST, nullptr,
194 IID_PPV_ARGS(&readback.p))));
195 D3D12_RESOURCE_DESC rt_desc{};
196 rt_desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
197 rt_desc.Width = width;
198 rt_desc.Height = height;
199 rt_desc.DepthOrArraySize = 1;
200 rt_desc.MipLevels = 1;
201 rt_desc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
202 rt_desc.SampleDesc.Count = 1;
203 rt_desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
204 EXPECT(SUCCEEDED(device->CreateCommittedResource(&default_heap, D3D12_HEAP_FLAG_NONE, &rt_desc,
205 D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&target.p))));
206
207 std::uint8_t* up = nullptr;
208 EXPECT(SUCCEEDED(upload->Map(0, nullptr, reinterpret_cast<void**>(&up))));
209 std::memcpy(up, mesh.data() + 8, vertex_bytes);
210 std::memcpy(up + index_offset, mesh.data() + 8 + vertex_bytes, index_bytes);
211
212 const D3D12_DESCRIPTOR_HEAP_DESC heap_desc{D3D12_DESCRIPTOR_HEAP_TYPE_RTV, 1, D3D12_DESCRIPTOR_HEAP_FLAG_NONE, 0};
213 Ref<ID3D12DescriptorHeap> rtv_heap;
214 EXPECT(SUCCEEDED(device->CreateDescriptorHeap(&heap_desc, IID_PPV_ARGS(&rtv_heap.p))));
215 const D3D12_CPU_DESCRIPTOR_HANDLE rtv{
216 SIZE_T(reinterpret_cast<XboxHeapHandleFn>(slot(rtv_heap.p, 9))(rtv_heap.p))};
217 device->CreateRenderTargetView(target.p, nullptr, rtv);
218
219 D3D12_COMMAND_QUEUE_DESC queue_desc{};
220 Ref<ID3D12CommandQueue> queue;
221 Ref<ID3D12CommandAllocator> allocator;
222 Ref<ID3D12GraphicsCommandList> list;
223 Ref<ID3D12Fence> fence;
224 EXPECT(SUCCEEDED(device->CreateCommandQueue(&queue_desc, IID_PPV_ARGS(&queue.p))));
225 EXPECT(SUCCEEDED(device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(&allocator.p))));
226 EXPECT(SUCCEEDED(device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, allocator.p, pso.p,
227 IID_PPV_ARGS(&list.p))));
228 EXPECT(SUCCEEDED(device->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&fence.p))));
229
230 list->CopyBufferRegion(vertex_buffer.p, 0, upload.p, 0, vertex_bytes);
231 list->CopyBufferRegion(index_buffer.p, 0, upload.p, index_offset, index_bytes);
232 D3D12_RESOURCE_BARRIER barriers[3] = {
233 transition(vertex_buffer.p, D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER),
234 transition(index_buffer.p, D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_INDEX_BUFFER),
235 transition(target.p, D3D12_RESOURCE_STATE_COMMON, D3D12_RESOURCE_STATE_RENDER_TARGET)};
236 list->ResourceBarrier(3, barriers);
237 const FLOAT clear[4] = {-1, -1, -1, -1}; // vk_harness's clear: marks untouched pixels
238 list->ClearRenderTargetView(rtv, clear, 0, nullptr);
239
240 list->SetGraphicsRootSignature(root.p);
241 list->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
242 const D3D12_VERTEX_BUFFER_VIEW vbv{vertex_buffer->GetGPUVirtualAddress(), UINT(vertex_bytes), stride};
243 list->IASetVertexBuffers(0, 1, &vbv);
244 const D3D12_INDEX_BUFFER_VIEW ibv{index_buffer->GetGPUVirtualAddress(), UINT(index_bytes),
245 DXGI_FORMAT_R32_UINT};
246 list->IASetIndexBuffer(&ibv);
247 const D3D12_VIEWPORT viewport{0, 0, float(width), float(height), 0, 1};
248 const D3D12_RECT scissor{0, 0, LONG(width), LONG(height)};
249 list->RSSetViewports(1, &viewport);
250 list->RSSetScissorRects(1, &scissor);
251 list->OMSetRenderTargets(1, &rtv, FALSE, nullptr);
252 list->DrawIndexedInstanced(index_count, 1, 0, 0, 0);
253
254 D3D12_RESOURCE_BARRIER to_copy = transition(target.p, D3D12_RESOURCE_STATE_RENDER_TARGET,
255 D3D12_RESOURCE_STATE_COPY_SOURCE);
256 list->ResourceBarrier(1, &to_copy);
257 D3D12_TEXTURE_COPY_LOCATION dst{};
258 dst.pResource = readback.p;
259 dst.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
260 dst.PlacedFootprint = {0, {DXGI_FORMAT_R32G32B32A32_FLOAT, width, height, 1, pitch}};
261 D3D12_TEXTURE_COPY_LOCATION src{};
262 src.pResource = target.p;
263 src.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
264 list->CopyTextureRegion(&dst, 0, 0, 0, &src, nullptr);
265 EXPECT(list->Close() == S_OK);
266 ID3D12CommandList* lists[] = {list.p};
267 queue->ExecuteCommandLists(1, lists);
268 EXPECT(rt::d3d12::last_execute_result(queue.p) == leonida::ReplayResult::success);
269 EXPECT(SUCCEEDED(queue->Signal(fence.p, 1)));
270 EXPECT(SUCCEEDED(fence->SetEventOnCompletion(1, nullptr)));
271 std::uint8_t* mapped = nullptr;
272 EXPECT(SUCCEEDED(readback->Map(0, nullptr, reinterpret_cast<void**>(&mapped))));
273 for (UINT row = 0; row < height; ++row)
274 std::memcpy(&pixels[std::size_t(row) * width], mapped + std::size_t(row) * pitch, width * sizeof(Pixel));
275
276 for (auto* r : {&vertex_buffer, &index_buffer, &upload, &readback, &target}) r->reset();
277 pso.reset();
278 root.reset();
279 rtv_heap.reset();
280 list.reset();
281 allocator.reset();
282 queue.reset();
283 fence.reset();
284 EXPECT(rt::d3d12_xs::device_proxy_ref_count(device.p) == 1);
285 }
286
287 // vk_harness's (x, y) is (x, H-1-y) here: same clip-space point, opposite viewport direction.
288 const auto at = [&](UINT x, UINT vk_y) -> const Pixel& { return pixels[std::size_t(height - 1 - vk_y) * width + x]; };
289 unsigned covered = 0;
290 for (const Pixel& p : pixels) covered += p[3] > 0.5f;
291 const double ratio = double(covered) / (double(width) * height);
292 std::printf("covered %u/%u (%.3f)\n", covered, width * height, ratio);
293 EXPECT(ratio >= number(manifest, "min_coverage", 0.0) && ratio <= number(manifest, "max_coverage", 1.0));
294 std::array<double, 2> clear_xy{}, centre_xy{}, centre_uv{};
295 if (pixel_of(manifest, "clear_pixel", clear_xy)) {
296 const Pixel& p = at(UINT(clear_xy[0]), UINT(clear_xy[1]));
297 const float want = float(number(manifest, "clear", -1.0));
298 std::printf("clear pixel (%u, %u): %g %g %g %g\n", UINT(clear_xy[0]), height - 1 - UINT(clear_xy[1]), p[0],
299 p[1], p[2], p[3]);
300 for (float c : p) EXPECT(std::fabs(c - want) <= 1e-5f);
301 }
302 if (pixel_of(manifest, "centre_uv", centre_uv)) {
303 if (!pixel_of(manifest, "centre_pixel", centre_xy)) centre_xy = {double(width / 2), double(height / 2)};
304 const Pixel& p = at(UINT(centre_xy[0]), UINT(centre_xy[1]));
305 std::printf("centre pixel (%u, %u): %.5f %.5f %.5f %.5f (mesh UV %.5f %.5f)\n", UINT(centre_xy[0]),
306 height - 1 - UINT(centre_xy[1]), p[0], p[1], p[2], p[3], centre_uv[0], centre_uv[1]);
307 const double want[4] = {centre_uv[0], centre_uv[1], 0.0, 1.0};
308 for (int c = 0; c < 4; ++c) EXPECT(std::fabs(p[c] - want[c]) <= 2e-3);
309 }
310 // first_light.py's probes: pixels where U and V differ, so a swapped or mirrored UV cannot pass (#1906).
311 if (const leonida::Json* probes = manifest.find("uv_probes"); probes && probes->kind == leonida::Json::Kind::array) {
312 for (const leonida::Json& probe : probes->array) {
313 std::array<double, 2> xy{}, uv{};
314 EXPECT(pixel_of(probe, "pixel", xy) && pixel_of(probe, "uv", uv));
315 const Pixel& p = at(UINT(xy[0]), UINT(xy[1]));
316 const double want[4] = {uv[0], uv[1], 0.0, 1.0};
317 for (int c = 0; c < 4; ++c) EXPECT(std::fabs(p[c] - want[c]) <= 2e-3);
318 }
319 std::printf("%zu UV probes match\n", probes->array.size());
320 }
321
322 // vk_harness's own image of the same draw, which first_light.py --run writes; required, so the whole-image check
323 // cannot be skipped silently. The PS exports with v_cvt_pkrtz_f16_f32 (round toward zero to f16), so an f32
324 // interpolant a few ulps apart, which the opposite viewport direction gives, can land on the adjacent f16 value:
325 // measured on an RTX 3060, 1 of 16,384 pixels, and vk_harness drawing the mesh mirrored in y reproduces this
326 // image bit for bit. Coverage (alpha) must match exactly.
327 const auto vk_raw = read_file(dir / "image.raw");
328 if (vk_raw.empty()) {
329 std::fprintf(stderr, "%s has no image.raw: run tools/first_light.py with --run first\n", dir.string().c_str());
330 return 1;
331 }
332 {
333 EXPECT(vk_raw.size() == pixels.size() * sizeof(Pixel));
334 // Both values must be exact halves (the PS exported f16) and adjacent in half order: ordered index = the
335 // half's bits for +, minus the magnitude bits for -, so 0x3bff and 0x3c00 are one step and so are 0 and 0x0001.
336 const auto half_index = [](float f, int& out) {
337 const float a = std::fabs(f);
338 if (!(a <= 65504.0f)) return false;
339 int e = 0;
340 const float m = std::frexp(a, &e); // a = m * 2^e, m in [0.5, 1)
341 int bits;
342 if (a == 0.0f) {
343 bits = 0;
344 } else if (e <= -14) { // subnormal half: a = k * 2^-24
345 const float k = std::ldexp(a, 24);
346 if (k != std::floor(k)) return false;
347 bits = int(k);
348 } else {
349 const float k = std::ldexp(m, 11); // 11 significant bits, implicit one included
350 if (k != std::floor(k)) return false;
351 bits = ((e + 14) << 10) | (int(k) & 0x3ff);
352 }
353 out = std::signbit(f) ? -bits : bits;
354 return true;
355 };
356 const auto one_f16_step = [&](float a, float b) {
357 int ia = 0, ib = 0;
358 return half_index(a, ia) && half_index(b, ib) && std::abs(ia - ib) <= 1;
359 };
360 EXPECT(one_f16_step(1.0f, 0.99951171875f) && !one_f16_step(1.0f, 0.9990234375f)); // 0x3c00 vs 0x3bff, 0x3bfe
361 EXPECT(one_f16_step(0.0f, 5.9604645e-8f) && !one_f16_step(0.0f, 1.1920929e-7f)); // 0 vs 0x0001, 0x0002
362 unsigned exact = 0, f16_step = 0, differ = 0;
363 for (UINT y = 0; y < height; ++y) {
364 for (UINT x = 0; x < width; ++x) {
365 Pixel want;
366 std::memcpy(want.data(), vk_raw.data() + (std::size_t(y) * width + x) * sizeof(Pixel), sizeof(Pixel));
367 const Pixel& got = at(x, y);
368 if (std::memcmp(got.data(), want.data(), sizeof(Pixel)) == 0) {
369 ++exact;
370 continue;
371 }
372 const bool close = got[3] == want[3] && one_f16_step(got[0], want[0]) &&
373 one_f16_step(got[1], want[1]) && one_f16_step(got[2], want[2]);
374 ++(close ? f16_step : differ);
375 std::fprintf(stderr, "vk_harness (%u, %u): %g %g %g %g, here (%u, %u): %g %g %g %g%s\n", x, y,
376 want[0], want[1], want[2], want[3], x, height - 1 - y, got[0], got[1], got[2], got[3],
377 close ? " (one f16 step)" : "");
378 if (differ > 8) return 1;
379 }
380 }
381 std::printf("against vk_harness's image.raw (rows flipped): %u of %u pixels bit-exact, %u one f16 step apart, "
382 "%u different\n", exact, width * height, f16_step, differ);
383 EXPECT(differ == 0);
384 // An adjacent half only appears where the f32 interpolant sits a few ulps from an f16 truncation boundary,
385 // about 2^-11 of values per channel: 1 pixel of 12,804 covered on the RTX 3060. Allow at most one covered
386 // pixel in a thousand, so a regression that moves the whole image by one half step (thousands) fails.
387 EXPECT(f16_step <= covered / 1000);
388 }
389 if (d.validation_errors()) {
390 std::fprintf(stderr, "%u validation errors\n", d.validation_errors());
391 return 1;
392 }
393 std::printf("first light through D3D12: the game's VS+PS found by FSSM hash drew %u triangles\n", index_count / 3);
394 return 0;
395}
diff --git a/runtime/test/d3d12_shader_cache_test.cpp b/runtime/test/d3d12_shader_cache_test.cpp
new file mode 100644
index 000000000..94b0aa5b9
--- /dev/null
+++ b/runtime/test/d3d12_shader_cache_test.cpp
@@ -0,0 +1,322 @@
1// Synthetic test for ID3D12Device9::CreateShaderCacheSession, ID3D12ShaderCacheSession
2// (FindValue, StoreValue, SetDeleteOnDestroy, GetDesc), and ID3D12Device9::ShaderCacheControl (D3D-34).
3// Compares argument validation, StoreValue/FindValue semantics, size queries, duplicate rejection,
4// shared-session visibility, and SetDeleteOnDestroy against the host Windows D3D12 runtime when available.
5// No game data.
6#include "vk_test_device.h"
7#include "d3d12_copy_compare.h"
8#include "../shims/d3d12_com.h"
9
10#include <cstdint>
11#include <cstdio>
12#include <cstring>
13#include <filesystem>
14#include <vector>
15
16#define EXPECT(condition) do { \
17 if (!(condition)) { std::fprintf(stderr, "line %d: %s\n", __LINE__, #condition); return 1; } \
18} while (0)
19
20namespace {
21
22template<typename T>
23struct Ref {
24 T* p = nullptr;
25 ~Ref() { reset(); }
26 void reset() { if (p) { p->Release(); p = nullptr; } }
27 T* operator->() const { return p; }
28};
29
30int exercise_shader_cache(ID3D12Device9* dev, const char* label) {
31 // {7c83f2a1-4b5e-4d19-9a32-1f2e3d4c5b6a}
32 const GUID id1 = {0x7c83f2a1, 0x4b5e, 0x4d19, {0x9a, 0x32, 0x1f, 0x2e, 0x3d, 0x4c, 0x5b, 0x6a}};
33 const GUID id2 = {0x1b74e9d0, 0x2c3a, 0x4f81, {0x8e, 0x11, 0x5a, 0x6b, 0x7c, 0x8d, 0x9e, 0x0f}};
34 const GUID zero_id{};
35
36 D3D12_SHADER_CACHE_SESSION_DESC desc{};
37 desc.Identifier = id1;
38 desc.Mode = D3D12_SHADER_CACHE_MODE_MEMORY;
39 desc.Flags = D3D12_SHADER_CACHE_FLAG_NONE;
40 desc.Version = 1;
41
42 // 1. CreateShaderCacheSession argument validation & capability check (null output -> S_FALSE).
43 EXPECT(dev->CreateShaderCacheSession(nullptr, __uuidof(ID3D12ShaderCacheSession), nullptr) == E_INVALIDARG);
44 EXPECT(dev->CreateShaderCacheSession(&desc, __uuidof(ID3D12ShaderCacheSession), nullptr) == S_FALSE);
45
46 D3D12_SHADER_CACHE_SESSION_DESC bad = desc;
47 bad.Identifier = zero_id;
48 Ref<ID3D12ShaderCacheSession> bad_s;
49 EXPECT(dev->CreateShaderCacheSession(&bad, IID_PPV_ARGS(&bad_s.p)) == E_INVALIDARG && !bad_s.p);
50 EXPECT(dev->CreateShaderCacheSession(&bad, __uuidof(ID3D12ShaderCacheSession), nullptr) == E_INVALIDARG);
51
52 bad = desc;
53 bad.Mode = static_cast<D3D12_SHADER_CACHE_MODE>(2);
54 EXPECT(dev->CreateShaderCacheSession(&bad, IID_PPV_ARGS(&bad_s.p)) == E_INVALIDARG && !bad_s.p);
55
56 bad = desc;
57 bad.Flags = static_cast<D3D12_SHADER_CACHE_FLAGS>(0x4);
58 EXPECT(dev->CreateShaderCacheSession(&bad, IID_PPV_ARGS(&bad_s.p)) == E_INVALIDARG && !bad_s.p);
59
60 void* wrong_iid = nullptr;
61 EXPECT(dev->CreateShaderCacheSession(&desc, __uuidof(ID3D12Fence), &wrong_iid) == E_NOINTERFACE && !wrong_iid);
62
63 // 2. StoreValue / FindValue / GetDesc / GetDevice.
64 Ref<ID3D12ShaderCacheSession> s1;
65 EXPECT(SUCCEEDED(dev->CreateShaderCacheSession(&desc, IID_PPV_ARGS(&s1.p))) && s1.p);
66 const D3D12_SHADER_CACHE_SESSION_DESC got = s1->GetDesc();
67 EXPECT(std::memcmp(&got.Identifier, &desc.Identifier, sizeof(GUID)) == 0);
68 EXPECT(got.Mode == desc.Mode && got.Flags == desc.Flags && got.Version == desc.Version);
69 Ref<ID3D12Device> parent;
70 EXPECT(SUCCEEDED(s1->GetDevice(IID_PPV_ARGS(&parent.p))) && parent.p);
71
72 const std::uint32_t k1 = 0x12345678u;
73 const std::uint32_t v1 = 0xCAFEBABEu;
74 std::uint32_t out_v = 0;
75 UINT sz = sizeof(out_v);
76 EXPECT(s1->FindValue(&k1, sizeof(k1), &out_v, &sz) == DXGI_ERROR_NOT_FOUND);
77 EXPECT(sz == sizeof(out_v));
78 EXPECT(s1->FindValue(nullptr, sizeof(k1), &out_v, &sz) == E_INVALIDARG);
79 EXPECT(s1->FindValue(&k1, 0, &out_v, &sz) == E_INVALIDARG);
80 EXPECT(s1->FindValue(&k1, sizeof(k1), &out_v, nullptr) == E_INVALIDARG);
81
82 EXPECT(s1->StoreValue(nullptr, sizeof(k1), &v1, sizeof(v1)) == E_INVALIDARG);
83 EXPECT(s1->StoreValue(&k1, 0, &v1, sizeof(v1)) == E_INVALIDARG);
84 EXPECT(s1->StoreValue(&k1, sizeof(k1), nullptr, sizeof(v1)) == E_INVALIDARG);
85 EXPECT(s1->StoreValue(&k1, sizeof(k1), &v1, 0) == E_INVALIDARG);
86 EXPECT(s1->StoreValue(&k1, sizeof(k1), &v1, sizeof(v1)) == S_OK);
87 EXPECT(s1->StoreValue(&k1, sizeof(k1), &v1, sizeof(v1)) == DXGI_ERROR_ALREADY_EXISTS);
88
89 // Size query (pValue == nullptr) returns S_OK and writes stored size.
90 sz = 0;
91 EXPECT(s1->FindValue(&k1, sizeof(k1), nullptr, &sz) == S_OK && sz == sizeof(v1));
92 sz = 2;
93 EXPECT(s1->FindValue(&k1, sizeof(k1), nullptr, &sz) == S_OK && sz == sizeof(v1));
94 // Non-null buffer too small returns DXGI_ERROR_MORE_DATA and writes required size.
95 sz = 2;
96 EXPECT(s1->FindValue(&k1, sizeof(k1), &out_v, &sz) == DXGI_ERROR_MORE_DATA && sz == sizeof(v1));
97 // Oversized buffer returns S_OK, writes exact stored size, and copies payload.
98 sz = 8;
99 out_v = 0;
100 EXPECT(s1->FindValue(&k1, sizeof(k1), &out_v, &sz) == S_OK && sz == sizeof(v1) && out_v == v1);
101
102 // 3. Shared store across sessions with the same (Identifier, Mode, Version) + SetDeleteOnDestroy.
103 Ref<ID3D12ShaderCacheSession> s2;
104 EXPECT(SUCCEEDED(dev->CreateShaderCacheSession(&desc, IID_PPV_ARGS(&s2.p))) && s2.p);
105 sz = sizeof(out_v);
106 out_v = 0;
107 EXPECT(s2->FindValue(&k1, sizeof(k1), &out_v, &sz) == S_OK && sz == sizeof(v1) && out_v == v1);
108
109 // Different Identifier does not see k1.
110 D3D12_SHADER_CACHE_SESSION_DESC desc2 = desc;
111 desc2.Identifier = id2;
112 Ref<ID3D12ShaderCacheSession> other;
113 EXPECT(SUCCEEDED(dev->CreateShaderCacheSession(&desc2, IID_PPV_ARGS(&other.p))) && other.p);
114 sz = sizeof(out_v);
115 EXPECT(other->FindValue(&k1, sizeof(k1), &out_v, &sz) == DXGI_ERROR_NOT_FOUND);
116 other->SetDeleteOnDestroy();
117 other.reset();
118
119 // Marking s1 delete-on-destroy keeps data alive while s2 is still open, then deletes once s2 releases.
120 s1->SetDeleteOnDestroy();
121 s1.reset();
122 sz = sizeof(out_v);
123 out_v = 0;
124 EXPECT(s2->FindValue(&k1, sizeof(k1), &out_v, &sz) == S_OK && sz == sizeof(v1) && out_v == v1);
125 s2.reset();
126
127 Ref<ID3D12ShaderCacheSession> s3;
128 EXPECT(SUCCEEDED(dev->CreateShaderCacheSession(&desc, IID_PPV_ARGS(&s3.p))) && s3.p);
129 sz = sizeof(out_v);
130 EXPECT(s3->FindValue(&k1, sizeof(k1), &out_v, &sz) == DXGI_ERROR_NOT_FOUND);
131 s3->SetDeleteOnDestroy();
132 s3.reset();
133
134 // 4. ShaderCacheControl invalid-argument checks (same on host and layer).
135 EXPECT(dev->ShaderCacheControl(D3D12_SHADER_CACHE_KIND_FLAGS(0), D3D12_SHADER_CACHE_CONTROL_FLAG_ENABLE) ==
136 E_INVALIDARG);
137 EXPECT(dev->ShaderCacheControl(D3D12_SHADER_CACHE_KIND_FLAG_APPLICATION_MANAGED,
138 D3D12_SHADER_CACHE_CONTROL_FLAGS(0)) == E_INVALIDARG);
139 EXPECT(dev->ShaderCacheControl(D3D12_SHADER_CACHE_KIND_FLAG_APPLICATION_MANAGED,
140 D3D12_SHADER_CACHE_CONTROL_FLAGS(0x8)) == E_INVALIDARG);
141 EXPECT(dev->ShaderCacheControl(D3D12_SHADER_CACHE_KIND_FLAG_APPLICATION_MANAGED,
142 D3D12_SHADER_CACHE_CONTROL_FLAG_ENABLE | D3D12_SHADER_CACHE_CONTROL_FLAG_DISABLE) ==
143 E_INVALIDARG);
144
145 std::printf("shader cache (%s): validation, StoreValue/FindValue, size queries, sharing and SetDeleteOnDestroy OK\n",
146 label);
147 return 0;
148}
149
150} // namespace
151
152int main() {
153 vktest::Device d;
154 const auto status = d.initialize();
155 if (status == vktest::DeviceStatus::unavailable) {
156 std::fprintf(stderr, "SKIP: no usable Vulkan 1.3 device\n");
157 return 77;
158 }
159 EXPECT(status == vktest::DeviceStatus::ready);
160
161 rt::d3d12::VulkanDeviceInfo info{};
162 info.get_instance_proc = d.instance_proc;
163 info.instance = d.instance;
164 info.physical = d.physical;
165 info.device = d.device;
166 info.queue = d.queue;
167 info.queue_family = d.family;
168 info.buffer_device_address = true;
169
170 Ref<ID3D12Device9> device;
171 EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&device.p))));
172 EXPECT(exercise_shader_cache(device.p, "Vulkan layer") == 0);
173
174 // Layer-specific ShaderCacheControl CLEAR / DISABLE / ENABLE and entry/byte limit checks.
175 {
176 const GUID id_ctrl = {0x4a12b3c4, 0x5d6e, 0x47f8, {0x90, 0xa1, 0xb2, 0xc3, 0xd4, 0xe5, 0xf6, 0x07}};
177 D3D12_SHADER_CACHE_SESSION_DESC desc{};
178 desc.Identifier = id_ctrl;
179 desc.Mode = D3D12_SHADER_CACHE_MODE_MEMORY;
180 desc.MaximumInMemoryCacheEntries = 1;
181 desc.MaximumInMemoryCacheSizeBytes = 8;
182 Ref<ID3D12ShaderCacheSession> s;
183 EXPECT(SUCCEEDED(device->CreateShaderCacheSession(&desc, IID_PPV_ARGS(&s.p))) && s.p);
184
185 const std::uint32_t k1 = 1, k2 = 2;
186 const std::uint64_t v1 = 0x1122334455667788ull;
187 EXPECT(s->StoreValue(&k1, sizeof(k1), &v1, sizeof(v1)) == S_OK);
188 EXPECT(s->StoreValue(&k2, sizeof(k2), &v1, sizeof(v1)) == E_OUTOFMEMORY);
189
190 EXPECT(device->ShaderCacheControl(D3D12_SHADER_CACHE_KIND_FLAG_APPLICATION_MANAGED,
191 D3D12_SHADER_CACHE_CONTROL_FLAG_DISABLE) == S_OK);
192 std::uint64_t out = 0;
193 UINT sz = sizeof(out);
194 EXPECT(s->FindValue(&k1, sizeof(k1), &out, &sz) == DXGI_ERROR_NOT_FOUND);
195
196 EXPECT(device->ShaderCacheControl(D3D12_SHADER_CACHE_KIND_FLAG_APPLICATION_MANAGED,
197 D3D12_SHADER_CACHE_CONTROL_FLAG_ENABLE) == S_OK);
198 sz = sizeof(out);
199 EXPECT(s->FindValue(&k1, sizeof(k1), &out, &sz) == S_OK && out == v1);
200
201 EXPECT(device->ShaderCacheControl(D3D12_SHADER_CACHE_KIND_FLAG_APPLICATION_MANAGED,
202 D3D12_SHADER_CACHE_CONTROL_FLAG_CLEAR) == S_OK);
203 sz = sizeof(out);
204 EXPECT(s->FindValue(&k1, sizeof(k1), &out, &sz) == DXGI_ERROR_NOT_FOUND);
205 s->SetDeleteOnDestroy();
206 }
207
208 // Cross-device process-wide sharing: two distinct ID3D12Device9 objects in the same process share the store.
209 {
210 const GUID id_shared = {0x99887766, 0x5544, 0x4321, {0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67, 0x89}};
211 D3D12_SHADER_CACHE_SESSION_DESC desc{};
212 desc.Identifier = id_shared;
213 desc.Mode = D3D12_SHADER_CACHE_MODE_MEMORY;
214 desc.Version = 2;
215
216 Ref<ID3D12Device9> device2;
217 EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&device2.p))));
218 Ref<ID3D12ShaderCacheSession> s_dev1, s_dev2;
219 EXPECT(SUCCEEDED(device->CreateShaderCacheSession(&desc, IID_PPV_ARGS(&s_dev1.p))) && s_dev1.p);
220 EXPECT(SUCCEEDED(device2->CreateShaderCacheSession(&desc, IID_PPV_ARGS(&s_dev2.p))) && s_dev2.p);
221
222 const std::uint32_t k = 0x55AA1234u;
223 const std::uint64_t v = 0xDEADBEEFCAFEBABEull;
224 EXPECT(s_dev1->StoreValue(&k, sizeof(k), &v, sizeof(v)) == S_OK);
225 std::uint64_t out = 0;
226 UINT sz = sizeof(out);
227 EXPECT(s_dev2->FindValue(&k, sizeof(k), &out, &sz) == S_OK && sz == sizeof(v) && out == v);
228 s_dev1->SetDeleteOnDestroy();
229 s_dev1.reset();
230 s_dev2.reset();
231 device2.reset();
232 }
233
234 // D3D12_SHADER_CACHE_MODE_DISK persistence across session + device teardown and cleanup on SetDeleteOnDestroy.
235 {
236 const auto prev_cwd = std::filesystem::current_path();
237 const auto temp_dir = std::filesystem::temp_directory_path() / L"leonida_shader_cache_disk_test";
238 std::error_code ec;
239 std::filesystem::remove_all(temp_dir, ec);
240 std::filesystem::create_directories(temp_dir);
241 struct RestoreCwd {
242 std::filesystem::path prev;
243 std::filesystem::path dir;
244 ~RestoreCwd() {
245 std::error_code e;
246 std::filesystem::current_path(prev, e);
247 std::filesystem::remove_all(dir, e);
248 }
249 } restore_cwd{prev_cwd, temp_dir};
250 std::filesystem::current_path(temp_dir);
251
252 const GUID id_disk = {0x31415926, 0x5358, 0x4979, {0x83, 0x23, 0x84, 0x62, 0x64, 0x33, 0x83, 0x27}};
253 D3D12_SHADER_CACHE_SESSION_DESC disk_desc{};
254 disk_desc.Identifier = id_disk;
255 disk_desc.Mode = D3D12_SHADER_CACHE_MODE_DISK;
256 disk_desc.Flags = D3D12_SHADER_CACHE_FLAG_USE_WORKING_DIR;
257 disk_desc.Version = 7;
258
259 const std::uint32_t k = 0x0F1E2D3Cu;
260 const std::uint64_t v = 0x0123456789ABCDEFull;
261 {
262 Ref<ID3D12Device9> dev_a;
263 EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&dev_a.p))));
264 Ref<ID3D12ShaderCacheSession> s_a;
265 EXPECT(SUCCEEDED(dev_a->CreateShaderCacheSession(&disk_desc, IID_PPV_ARGS(&s_a.p))) && s_a.p);
266 EXPECT(s_a->StoreValue(&k, sizeof(k), &v, sizeof(v)) == S_OK);
267 }
268 // After dev_a and s_a are destroyed, the cache file must exist on disk and reload into a brand-new device.
269 bool found_file = false;
270 for (const auto& entry : std::filesystem::directory_iterator(temp_dir)) {
271 if (entry.is_regular_file() && entry.path().extension() == L".bin") found_file = true;
272 }
273 EXPECT(found_file);
274 {
275 Ref<ID3D12Device9> dev_b;
276 EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&dev_b.p))));
277 Ref<ID3D12ShaderCacheSession> s_b;
278 EXPECT(SUCCEEDED(dev_b->CreateShaderCacheSession(&disk_desc, IID_PPV_ARGS(&s_b.p))) && s_b.p);
279 std::uint64_t out = 0;
280 UINT sz = sizeof(out);
281 EXPECT(s_b->FindValue(&k, sizeof(k), &out, &sz) == S_OK && sz == sizeof(v) && out == v);
282 s_b->SetDeleteOnDestroy();
283 }
284 // After SetDeleteOnDestroy + release, the file must be gone and a fresh session must miss.
285 bool file_remains = false;
286 for (const auto& entry : std::filesystem::directory_iterator(temp_dir)) {
287 if (entry.is_regular_file() && entry.path().extension() == L".bin") file_remains = true;
288 }
289 EXPECT(!file_remains);
290 {
291 Ref<ID3D12Device9> dev_c;
292 EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&dev_c.p))));
293 Ref<ID3D12ShaderCacheSession> s_c;
294 EXPECT(SUCCEEDED(dev_c->CreateShaderCacheSession(&disk_desc, IID_PPV_ARGS(&s_c.p))) && s_c.p);
295 std::uint64_t out = 0;
296 UINT sz = sizeof(out);
297 EXPECT(s_c->FindValue(&k, sizeof(k), &out, &sz) == DXGI_ERROR_NOT_FOUND);
298 s_c->SetDeleteOnDestroy();
299 }
300 std::printf("shader cache (disk persistence + cross-device sharing): OK\n");
301 }
302
303 // Compare the same scenarios against the host Windows D3D12 runtime when ID3D12Device9 is available.
304 {
305 copycmp::Ptr<ID3D12Device> host;
306 std::string adapter_name;
307 if (copycmp::create_host(host, adapter_name)) {
308 Ref<ID3D12Device9> host9;
309 if (SUCCEEDED(host.p->QueryInterface(IID_PPV_ARGS(&host9.p))) && host9.p) {
310 EXPECT(exercise_shader_cache(host9.p, adapter_name.c_str()) == 0);
311 }
312 }
313 }
314
315 device.reset();
316 if (d.validation_errors()) {
317 std::fprintf(stderr, "%u validation errors\n", d.validation_errors());
318 return 1;
319 }
320 std::printf("d3d12_shader_cache_test: passed (0 validation errors)\n");
321 return 0;
322}
diff --git a/runtime/test/d3d12_texture1d_test.cpp b/runtime/test/d3d12_texture1d_test.cpp
new file mode 100644
index 000000000..007c513b4
--- /dev/null
+++ b/runtime/test/d3d12_texture1d_test.cpp
@@ -0,0 +1,272 @@
1// Minimal smoke test for D3D12 1D texture creation and RTV/DSV/SRV/UAV views.
2
3#include "../shims/d3d12_com.h"
4#include "../src/gfx10_descriptors.h"
5
6#include <cstdio>
7#include <cstring>
8
9namespace {
10
11int fail(const char* msg, HRESULT hr = S_OK) {
12 std::fprintf(stderr, "FAIL: %s (hr=0x%08X)\n", msg, static_cast<unsigned>(hr));
13 return 1;
14}
15
16D3D12_HEAP_PROPERTIES default_heap() {
17 D3D12_HEAP_PROPERTIES hp{};
18 hp.Type = D3D12_HEAP_TYPE_DEFAULT;
19 return hp;
20}
21
22} // namespace
23
24int main() {
25 ID3D12Device* dev = nullptr;
26 HRESULT hr = rt::d3d12::create_vulkan_device_standalone(IID_PPV_ARGS(&dev));
27 if (FAILED(hr) || !dev) {
28 std::printf("SKIP: no Vulkan device (hr=0x%08X)\n", static_cast<unsigned>(hr));
29 return 77;
30 }
31
32 D3D12_DESCRIPTOR_HEAP_DESC cbv_heap_desc{};
33 cbv_heap_desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV;
34 cbv_heap_desc.NumDescriptors = 8;
35 ID3D12DescriptorHeap* cbv_heap = nullptr;
36 hr = dev->CreateDescriptorHeap(&cbv_heap_desc, IID_PPV_ARGS(&cbv_heap));
37 if (FAILED(hr) || !cbv_heap) return fail("CreateDescriptorHeap(CBV_SRV_UAV)", hr);
38
39 D3D12_DESCRIPTOR_HEAP_DESC rtv_heap_desc{};
40 rtv_heap_desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_RTV;
41 rtv_heap_desc.NumDescriptors = 2;
42 ID3D12DescriptorHeap* rtv_heap = nullptr;
43 hr = dev->CreateDescriptorHeap(&rtv_heap_desc, IID_PPV_ARGS(&rtv_heap));
44 if (FAILED(hr) || !rtv_heap) return fail("CreateDescriptorHeap(RTV)", hr);
45
46 D3D12_DESCRIPTOR_HEAP_DESC dsv_heap_desc{};
47 dsv_heap_desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_DSV;
48 dsv_heap_desc.NumDescriptors = 2;
49 ID3D12DescriptorHeap* dsv_heap = nullptr;
50 hr = dev->CreateDescriptorHeap(&dsv_heap_desc, IID_PPV_ARGS(&dsv_heap));
51 if (FAILED(hr) || !dsv_heap) return fail("CreateDescriptorHeap(DSV)", hr);
52
53 const UINT cbv_inc = dev->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV);
54 const UINT rtv_inc = dev->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV);
55 const UINT dsv_inc = dev->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_DSV);
56
57 // 1D color texture (DepthOrArraySize = 1) and 1D array (DepthOrArraySize = 4)
58 D3D12_RESOURCE_DESC tex1d_single_desc{};
59 tex1d_single_desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE1D;
60 tex1d_single_desc.Width = 64;
61 tex1d_single_desc.Height = 1;
62 tex1d_single_desc.DepthOrArraySize = 1;
63 tex1d_single_desc.MipLevels = 2;
64 tex1d_single_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
65 tex1d_single_desc.SampleDesc = {1, 0};
66 tex1d_single_desc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
67 tex1d_single_desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
68
69 D3D12_RESOURCE_DESC tex1d_desc = tex1d_single_desc;
70 tex1d_desc.DepthOrArraySize = 4;
71
72 ID3D12Resource* tex1d_single = nullptr;
73 ID3D12Resource* tex1d = nullptr;
74 const D3D12_HEAP_PROPERTIES hp = default_heap();
75 hr = dev->CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE, &tex1d_single_desc, D3D12_RESOURCE_STATE_COMMON,
76 nullptr, IID_PPV_ARGS(&tex1d_single));
77 if (FAILED(hr) || !tex1d_single) return fail("CreateCommittedResource(TEXTURE1D single)", hr);
78 hr = dev->CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE, &tex1d_desc, D3D12_RESOURCE_STATE_COMMON,
79 nullptr, IID_PPV_ARGS(&tex1d));
80 if (FAILED(hr) || !tex1d) return fail("CreateCommittedResource(TEXTURE1D array)", hr);
81
82 D3D12_CPU_DESCRIPTOR_HANDLE cbv_cpu = cbv_heap->GetCPUDescriptorHandleForHeapStart();
83 D3D12_CPU_DESCRIPTOR_HANDLE rtv_cpu = rtv_heap->GetCPUDescriptorHandleForHeapStart();
84 D3D12_CPU_DESCRIPTOR_HANDLE dsv_cpu = dsv_heap->GetCPUDescriptorHandleForHeapStart();
85
86 // SRV: default (nullptr) on 1D single, explicit TEXTURE1D on 1D single (mip 1) and array (slice 0)
87 dev->CreateShaderResourceView(tex1d_single, nullptr, cbv_cpu);
88
89 D3D12_SHADER_RESOURCE_VIEW_DESC srv1d_mip1{};
90 srv1d_mip1.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
91 srv1d_mip1.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE1D;
92 srv1d_mip1.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
93 srv1d_mip1.Texture1D.MostDetailedMip = 1;
94 srv1d_mip1.Texture1D.MipLevels = 1;
95 dev->CreateShaderResourceView(tex1d_single, &srv1d_mip1, {cbv_cpu.ptr + cbv_inc * 1});
96
97 D3D12_SHADER_RESOURCE_VIEW_DESC srv1d{};
98 srv1d.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
99 srv1d.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE1D;
100 srv1d.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
101 srv1d.Texture1D.MipLevels = 2;
102 dev->CreateShaderResourceView(tex1d, &srv1d, {cbv_cpu.ptr + cbv_inc * 2});
103
104 // UAV: default (nullptr) on 1D single, explicit TEXTURE1D on 1D single (mip 0) and array (slice 0, mip 1)
105 dev->CreateUnorderedAccessView(tex1d_single, nullptr, nullptr, {cbv_cpu.ptr + cbv_inc * 3});
106
107 D3D12_UNORDERED_ACCESS_VIEW_DESC uav1d_single{};
108 uav1d_single.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
109 uav1d_single.ViewDimension = D3D12_UAV_DIMENSION_TEXTURE1D;
110 uav1d_single.Texture1D.MipSlice = 0;
111 dev->CreateUnorderedAccessView(tex1d_single, nullptr, &uav1d_single, {cbv_cpu.ptr + cbv_inc * 4});
112
113 D3D12_UNORDERED_ACCESS_VIEW_DESC uav1d{};
114 uav1d.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
115 uav1d.ViewDimension = D3D12_UAV_DIMENSION_TEXTURE1D;
116 uav1d.Texture1D.MipSlice = 1;
117 dev->CreateUnorderedAccessView(tex1d, nullptr, &uav1d, {cbv_cpu.ptr + cbv_inc * 5});
118
119 // Default (nullptr) SRV and UAV on a 1D array must write a null descriptor (set 0 has no 1D-array binding).
120 std::memset(reinterpret_cast<void*>(cbv_cpu.ptr + cbv_inc * 6), 0x77, cbv_inc * 2);
121 dev->CreateShaderResourceView(tex1d, nullptr, {cbv_cpu.ptr + cbv_inc * 6});
122 dev->CreateUnorderedAccessView(tex1d, nullptr, nullptr, {cbv_cpu.ptr + cbv_inc * 7});
123
124 namespace g = leonida::gfx10;
125 const auto decode_and_lookup = [&](UINT slot, g::Image& img) {
126 g::ImageWords words{};
127 std::memcpy(words.data(), reinterpret_cast<const void*>(cbv_cpu.ptr + cbv_inc * slot), sizeof(words));
128 if (!g::is_image(words) || !g::decode(words, img)) return false;
129 std::uint32_t key[8]{};
130 std::memcpy(key, words.data(), sizeof(key));
131 return rt::d3d12::bindless_hash_lookup(dev, key) != 0;
132 };
133 g::Image img{};
134 if (!decode_and_lookup(0, img) || img.type != g::ImageType::image_1d || img.width != 64 || img.mip_count != 2 ||
135 img.layer_count != 1)
136 return fail("default 1D SRV T# or bindless lookup mismatch");
137 if (!decode_and_lookup(1, img) || img.type != g::ImageType::image_1d || img.first_mip != 1 ||
138 img.mip_count != 1 || img.layer_count != 1)
139 return fail("explicit 1D mip-1 SRV T# or bindless lookup mismatch");
140 if (!decode_and_lookup(2, img) || img.type != g::ImageType::image_1d || img.layer_count != 1 || img.mip_count != 2)
141 return fail("explicit 1D SRV on array T# or bindless lookup mismatch");
142 if (!decode_and_lookup(3, img) || img.type != g::ImageType::image_1d || img.mip_count != 1 || img.layer_count != 1)
143 return fail("default 1D UAV T# or bindless lookup mismatch");
144 if (!decode_and_lookup(4, img) || img.type != g::ImageType::image_1d || img.first_mip != 0 ||
145 img.mip_count != 1 || img.layer_count != 1)
146 return fail("explicit 1D UAV T# or bindless lookup mismatch");
147 if (!decode_and_lookup(5, img) || img.type != g::ImageType::image_1d || img.first_mip != 1 || img.mip_count != 1 ||
148 img.layer_count != 1)
149 return fail("explicit 1D UAV on array T# or bindless lookup mismatch");
150 for (UINT slot = 6; slot < 8; ++slot) {
151 const auto* bytes = reinterpret_cast<const std::uint8_t*>(cbv_cpu.ptr + cbv_inc * slot);
152 for (UINT b = 0; b < 32; ++b)
153 if (bytes[b] != 0) return fail("default 1DArray view should write a null descriptor");
154 }
155
156 // RTV / DSV 1D bounds validation (out-of-bounds mip/slice must write a null TargetView)
157 D3D12_RENDER_TARGET_VIEW_DESC bad_rtv{};
158 bad_rtv.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
159 bad_rtv.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE1DARRAY;
160 bad_rtv.Texture1DArray.MipSlice = 5;
161 bad_rtv.Texture1DArray.FirstArraySlice = 0;
162 bad_rtv.Texture1DArray.ArraySize = 1;
163 dev->CreateRenderTargetView(tex1d, &bad_rtv, {rtv_cpu.ptr + rtv_inc});
164 if (*reinterpret_cast<const std::uint64_t*>(rtv_cpu.ptr + rtv_inc) != 0)
165 return fail("out-of-bounds 1D RTV should be null");
166
167 D3D12_DEPTH_STENCIL_VIEW_DESC bad_dsv{};
168 bad_dsv.Format = DXGI_FORMAT_D32_FLOAT;
169 bad_dsv.ViewDimension = D3D12_DSV_DIMENSION_TEXTURE1DARRAY;
170 bad_dsv.Texture1DArray.MipSlice = 0;
171 bad_dsv.Texture1DArray.FirstArraySlice = 4;
172 bad_dsv.Texture1DArray.ArraySize = 1;
173 dev->CreateDepthStencilView(tex1d, &bad_dsv, {dsv_cpu.ptr + dsv_inc});
174 if (*reinterpret_cast<const std::uint64_t*>(dsv_cpu.ptr + dsv_inc) != 0)
175 return fail("out-of-bounds 1D DSV should be null");
176
177 // GPU round-trip: upload buffer -> CopyTextureRegion -> TEXTURE1D -> CopyTextureRegion -> readback buffer
178 D3D12_PLACED_SUBRESOURCE_FOOTPRINT footprint{};
179 UINT num_rows = 0;
180 UINT64 row_bytes = 0, total_bytes = 0;
181 dev->GetCopyableFootprints(&tex1d_desc, 0, 1, 0, &footprint, &num_rows, &row_bytes, &total_bytes);
182 if (total_bytes == 0 || footprint.Footprint.Height != 1 || footprint.Footprint.Depth != 1) {
183 return fail("GetCopyableFootprints(TEXTURE1D)");
184 }
185
186 D3D12_HEAP_PROPERTIES upload_hp{D3D12_HEAP_TYPE_UPLOAD};
187 D3D12_HEAP_PROPERTIES readback_hp{D3D12_HEAP_TYPE_READBACK};
188 D3D12_RESOURCE_DESC buf_desc{};
189 buf_desc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
190 buf_desc.Width = total_bytes;
191 buf_desc.Height = 1;
192 buf_desc.DepthOrArraySize = 1;
193 buf_desc.MipLevels = 1;
194 buf_desc.Format = DXGI_FORMAT_UNKNOWN;
195 buf_desc.SampleDesc = {1, 0};
196 buf_desc.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
197
198 ID3D12Resource* upload_buf = nullptr;
199 ID3D12Resource* readback_buf = nullptr;
200 hr = dev->CreateCommittedResource(&upload_hp, D3D12_HEAP_FLAG_NONE, &buf_desc,
201 D3D12_RESOURCE_STATE_GENERIC_READ, nullptr, IID_PPV_ARGS(&upload_buf));
202 if (FAILED(hr) || !upload_buf) return fail("CreateCommittedResource(upload)", hr);
203 hr = dev->CreateCommittedResource(&readback_hp, D3D12_HEAP_FLAG_NONE, &buf_desc,
204 D3D12_RESOURCE_STATE_COPY_DEST, nullptr, IID_PPV_ARGS(&readback_buf));
205 if (FAILED(hr) || !readback_buf) return fail("CreateCommittedResource(readback)", hr);
206
207 unsigned char* mapped = nullptr;
208 hr = upload_buf->Map(0, nullptr, reinterpret_cast<void**>(&mapped));
209 if (FAILED(hr) || !mapped) return fail("upload_buf->Map", hr);
210 for (UINT i = 0; i < 64 * 4; ++i) mapped[i] = static_cast<unsigned char>((i * 7 + 13) & 0xFF);
211 upload_buf->Unmap(0, nullptr);
212
213 D3D12_COMMAND_QUEUE_DESC qd{};
214 ID3D12CommandQueue* queue = nullptr;
215 ID3D12CommandAllocator* alloc = nullptr;
216 ID3D12GraphicsCommandList* cmd = nullptr;
217 ID3D12Fence* fence = nullptr;
218 if (FAILED(hr = dev->CreateCommandQueue(&qd, IID_PPV_ARGS(&queue)))) return fail("CreateCommandQueue", hr);
219 if (FAILED(hr = dev->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(&alloc))))
220 return fail("CreateCommandAllocator", hr);
221 if (FAILED(hr = dev->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, alloc, nullptr, IID_PPV_ARGS(&cmd))))
222 return fail("CreateCommandList", hr);
223 if (FAILED(hr = dev->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&fence)))) return fail("CreateFence", hr);
224
225 D3D12_TEXTURE_COPY_LOCATION src_loc{upload_buf, D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, footprint};
226 D3D12_TEXTURE_COPY_LOCATION dst_loc{tex1d, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, {}};
227 cmd->CopyTextureRegion(&dst_loc, 0, 0, 0, &src_loc, nullptr);
228
229 D3D12_RESOURCE_BARRIER barrier{};
230 barrier.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
231 barrier.Transition = {tex1d, 0, D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_COPY_SOURCE};
232 cmd->ResourceBarrier(1, &barrier);
233
234 D3D12_TEXTURE_COPY_LOCATION rb_loc{readback_buf, D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, footprint};
235 cmd->CopyTextureRegion(&rb_loc, 0, 0, 0, &dst_loc, nullptr);
236 if (FAILED(hr = cmd->Close())) return fail("cmd->Close", hr);
237
238 ID3D12CommandList* lists[] = {cmd};
239 queue->ExecuteCommandLists(1, lists);
240 HANDLE ev = CreateEventW(nullptr, FALSE, FALSE, nullptr);
241 if (FAILED(hr = queue->Signal(fence, 1))) return fail("queue->Signal", hr);
242 if (fence->GetCompletedValue() < 1) {
243 fence->SetEventOnCompletion(1, ev);
244 WaitForSingleObject(ev, INFINITE);
245 }
246 CloseHandle(ev);
247
248 unsigned char* rb_mapped = nullptr;
249 hr = readback_buf->Map(0, nullptr, reinterpret_cast<void**>(&rb_mapped));
250 if (FAILED(hr) || !rb_mapped) return fail("readback_buf->Map", hr);
251 for (UINT i = 0; i < 64 * 4; ++i) {
252 const unsigned char expected = static_cast<unsigned char>((i * 7 + 13) & 0xFF);
253 if (rb_mapped[i] != expected) return fail("1D texture readback mismatch");
254 }
255 readback_buf->Unmap(0, nullptr);
256
257 fence->Release();
258 cmd->Release();
259 alloc->Release();
260 queue->Release();
261 readback_buf->Release();
262 upload_buf->Release();
263 tex1d->Release();
264 tex1d_single->Release();
265 dsv_heap->Release();
266 rtv_heap->Release();
267 cbv_heap->Release();
268 dev->Release();
269
270 std::printf("PASS: d3d12_texture1d_test (1D/1DArray SRV, UAV + CopyTextureRegion round-trip)\n");
271 return 0;
272}
diff --git a/runtime/test/d3d12_typeless_families_test.cpp b/runtime/test/d3d12_typeless_families_test.cpp
new file mode 100644
index 000000000..936fbbbee
--- /dev/null
+++ b/runtime/test/d3d12_typeless_families_test.cpp
@@ -0,0 +1,416 @@
1// Typed RTVs of every TYPELESS color family (D3D-275): ClearRenderTargetView through an RTV in each typed format of
2// the family, read back byte for byte and compared with the host's D3D12 on the same adapter (matched by LUID, the
3// D3D-188 rule) and with WARP. Before D3D-275 only the RGBA8 family was reinterpreted: an R16_UINT or R32G32_UINT RTV
4// of a typeless texture cleared through the resource's own (float or UNORM) format.
5// Then draws: a full-screen pass writing a constant (integers for UINT views, floats for FLOAT and UNORM ones) into a
6// typed RTV of a typeless texture, whose PSO names the typed format, compared with the same pass on the host (HLSL
7// compiled by d3dcompiler_47). The layer's shaders are GLSL stand-ins for translated ones (test/glsl/vs_fullscreen.vert,
8// ps_typeless_float.frag, ps_typeless_uint.frag), found by the FSSM hash of their containers in a translator-style
9// index; without glslangValidator at build time only the clears run.
10// A view format the layer does not map yet (its CheckFeatureSupport gives no RENDER_TARGET) is reported and skipped,
11// so the R8 family and the 16-bit integer and normalized formats are covered as soon as their mapping lands.
12// Synthetic data only. LEONIDA_VK_VALIDATION=1 runs it under VK_LAYER_KHRONOS_validation.
13#include "vk_test_device.h"
14#include "host_wine.h"
15#include "../shims/d3d12_com.h"
16#if defined(LEONIDA_TYPELESS_VS_SPV)
17#include "d3d12_test_shaders.h"
18#include "../src/shader_library.h"
19
20#include <d3dcompiler.h>
21#endif
22
23#include <dxgi1_4.h>
24
25#include <cstdint>
26#include <cstdio>
27#include <cstring>
28#include <filesystem>
29#include <fstream>
30#include <string>
31#include <vector>
32
33namespace {
34
35template<class T>
36struct Ref {
37 T* p = nullptr;
38 ~Ref() { if (p) p->Release(); }
39 T* operator->() const { return p; }
40};
41
42struct Family {
43 DXGI_FORMAT typeless;
44 std::vector<DXGI_FORMAT> views;
45};
46
47// Values that tell the interpretations apart: a fraction (UNORM / FLOAT), 7 (UINT keeps it, UNORM clamps it to 1),
48// a negative one (SINT / SNORM keep it, unsigned ones clamp it), one past every 8- and 16-bit integer range.
49constexpr float kValues[2][4] = {{0.5f, 7.0f, -1.0f, 300.0f}, {0.25f, 1.0f, -128.0f, 70000.0f}};
50
51// A full-screen pass for one device: its root signature blob and VS / PS bytecode (shader containers for the layer,
52// DXBC for the host).
53struct Pass {
54 const std::vector<std::uint8_t>* root;
55 const std::vector<std::uint8_t>* vs;
56 const std::vector<std::uint8_t>* ps;
57};
58
59// Renders into a 4x4 TYPELESS texture through an RTV in `view` and reads it back: a clear to `value`, or (`pass`
60// given) a full-screen draw whose PSO names `view`. False when a step failed.
61bool render_and_read(ID3D12Device* device, DXGI_FORMAT typeless, DXGI_FORMAT view, const float* value,
62 const Pass* pass, std::vector<unsigned char>& bytes) {
63 D3D12_RESOURCE_DESC desc{};
64 desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
65 desc.Width = 4;
66 desc.Height = 4;
67 desc.DepthOrArraySize = 1;
68 desc.MipLevels = 1;
69 desc.Format = typeless;
70 desc.SampleDesc = {1, 0};
71 desc.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET;
72 const D3D12_HEAP_PROPERTIES def_heap{D3D12_HEAP_TYPE_DEFAULT}, rb_heap{D3D12_HEAP_TYPE_READBACK};
73 Ref<ID3D12Resource> texture, readback;
74 if (FAILED(device->CreateCommittedResource(&def_heap, D3D12_HEAP_FLAG_NONE, &desc, D3D12_RESOURCE_STATE_RENDER_TARGET,
75 nullptr, IID_PPV_ARGS(&texture.p))))
76 return false;
77 D3D12_PLACED_SUBRESOURCE_FOOTPRINT footprint{};
78 UINT rows = 0;
79 UINT64 row_bytes = 0, total = 0;
80 device->GetCopyableFootprints(&desc, 0, 1, 0, &footprint, &rows, &row_bytes, &total);
81 D3D12_RESOURCE_DESC buffer{};
82 buffer.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
83 buffer.Width = total;
84 buffer.Height = 1;
85 buffer.DepthOrArraySize = 1;
86 buffer.MipLevels = 1;
87 buffer.SampleDesc = {1, 0};
88 buffer.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
89 if (FAILED(device->CreateCommittedResource(&rb_heap, D3D12_HEAP_FLAG_NONE, &buffer, D3D12_RESOURCE_STATE_COPY_DEST,
90 nullptr, IID_PPV_ARGS(&readback.p))))
91 return false;
92 Ref<ID3D12DescriptorHeap> heap;
93 const D3D12_DESCRIPTOR_HEAP_DESC hd{D3D12_DESCRIPTOR_HEAP_TYPE_RTV, 1};
94 if (FAILED(device->CreateDescriptorHeap(&hd, IID_PPV_ARGS(&heap.p)))) return false;
95 D3D12_RENDER_TARGET_VIEW_DESC rtv{};
96 rtv.Format = view;
97 rtv.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2D;
98 const auto handle = heap->GetCPUDescriptorHandleForHeapStart();
99 device->CreateRenderTargetView(texture.p, &rtv, handle);
100 Ref<ID3D12RootSignature> root;
101 Ref<ID3D12PipelineState> pso;
102 if (pass) {
103 if (FAILED(device->CreateRootSignature(0, pass->root->data(), pass->root->size(), IID_PPV_ARGS(&root.p))))
104 return false;
105 D3D12_GRAPHICS_PIPELINE_STATE_DESC pd{};
106 pd.pRootSignature = root.p;
107 pd.VS = {pass->vs->data(), pass->vs->size()};
108 pd.PS = {pass->ps->data(), pass->ps->size()};
109 pd.BlendState.RenderTarget[0].RenderTargetWriteMask = D3D12_COLOR_WRITE_ENABLE_ALL;
110 pd.SampleMask = UINT_MAX;
111 pd.RasterizerState.FillMode = D3D12_FILL_MODE_SOLID;
112 pd.RasterizerState.CullMode = D3D12_CULL_MODE_NONE;
113 pd.RasterizerState.DepthClipEnable = TRUE;
114 pd.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
115 pd.NumRenderTargets = 1;
116 pd.RTVFormats[0] = view;
117 pd.SampleDesc = {1, 0};
118 if (FAILED(device->CreateGraphicsPipelineState(&pd, IID_PPV_ARGS(&pso.p)))) return false;
119 }
120 Ref<ID3D12CommandQueue> queue;
121 Ref<ID3D12CommandAllocator> alloc;
122 Ref<ID3D12GraphicsCommandList> list;
123 Ref<ID3D12Fence> fence;
124 const D3D12_COMMAND_QUEUE_DESC qd{D3D12_COMMAND_LIST_TYPE_DIRECT};
125 if (FAILED(device->CreateCommandQueue(&qd, IID_PPV_ARGS(&queue.p))) ||
126 FAILED(device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(&alloc.p))) ||
127 FAILED(device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, alloc.p, nullptr, IID_PPV_ARGS(&list.p))) ||
128 FAILED(device->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&fence.p))))
129 return false;
130 if (pass) {
131 const D3D12_VIEWPORT viewport{0, 0, 4, 4, 0, 1};
132 const D3D12_RECT scissor{0, 0, 4, 4};
133 list->SetGraphicsRootSignature(root.p);
134 list->SetPipelineState(pso.p);
135 list->OMSetRenderTargets(1, &handle, FALSE, nullptr);
136 list->RSSetViewports(1, &viewport);
137 list->RSSetScissorRects(1, &scissor);
138 list->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
139 list->DrawInstanced(3, 1, 0, 0);
140 } else {
141 list->ClearRenderTargetView(handle, value, 0, nullptr);
142 }
143 D3D12_RESOURCE_BARRIER barrier{};
144 barrier.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
145 barrier.Transition = {texture.p, D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES, D3D12_RESOURCE_STATE_RENDER_TARGET,
146 D3D12_RESOURCE_STATE_COPY_SOURCE};
147 list->ResourceBarrier(1, &barrier);
148 D3D12_TEXTURE_COPY_LOCATION dst{readback.p, D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT};
149 dst.PlacedFootprint = footprint;
150 D3D12_TEXTURE_COPY_LOCATION src{texture.p, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX};
151 list->CopyTextureRegion(&dst, 0, 0, 0, &src, nullptr);
152 if (FAILED(list->Close())) return false;
153 ID3D12CommandList* lists[] = {list.p};
154 queue->ExecuteCommandLists(1, lists);
155 if (FAILED(queue->Signal(fence.p, 1)) || FAILED(fence->SetEventOnCompletion(1, nullptr))) return false;
156 void* mapped = nullptr;
157 if (FAILED(readback->Map(0, nullptr, &mapped))) return false;
158 bytes.clear();
159 for (UINT y = 0; y < rows; ++y) {
160 const auto* row = static_cast<const unsigned char*>(mapped) + footprint.Offset + y * footprint.Footprint.RowPitch;
161 bytes.insert(bytes.end(), row, row + row_bytes);
162 }
163 const D3D12_RANGE none{};
164 readback->Unmap(0, &none);
165 return true;
166}
167
168// The host's D3D12 device on the adapter whose LUID the Vulkan device reports (not the default adapter: D3D-188).
169bool host_device(const vktest::Device& vk, Ref<ID3D12Device>& out, std::string& name) {
170 VkPhysicalDeviceIDProperties id{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES};
171 VkPhysicalDeviceProperties2 props{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2, &id};
172 vk.instance_fn<PFN_vkGetPhysicalDeviceProperties2>("vkGetPhysicalDeviceProperties2")(vk.physical, &props);
173 Ref<IDXGIFactory4> factory;
174 if (!id.deviceLUIDValid || FAILED(CreateDXGIFactory1(IID_PPV_ARGS(&factory.p)))) return false;
175 LUID luid{};
176 std::memcpy(&luid, id.deviceLUID, sizeof(luid));
177 Ref<IDXGIAdapter1> adapter;
178 if (FAILED(factory->EnumAdapterByLuid(luid, IID_PPV_ARGS(&adapter.p)))) return false;
179 DXGI_ADAPTER_DESC1 desc{};
180 adapter->GetDesc1(&desc);
181 char utf8[256]{};
182 WideCharToMultiByte(CP_UTF8, 0, desc.Description, -1, utf8, sizeof(utf8), nullptr, nullptr);
183 name = utf8;
184 return SUCCEEDED(D3D12CreateDevice(adapter.p, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&out.p)));
185}
186
187std::string hex(const std::vector<unsigned char>& bytes, std::size_t texel) {
188 std::string s;
189 char b[4];
190 for (std::size_t i = 0; i < texel && i < bytes.size(); ++i) {
191 std::snprintf(b, sizeof(b), "%02x", bytes[i]);
192 s += b;
193 }
194 return s;
195}
196
197// The layer and the host report the format in the same way: no RENDER_TARGET support means the layer has no mapping.
198bool renders(ID3D12Device* device, DXGI_FORMAT typeless, DXGI_FORMAT view) {
199 D3D12_FEATURE_DATA_FORMAT_SUPPORT typeless_support{typeless}, support{view};
200 return SUCCEEDED(device->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &typeless_support,
201 sizeof(typeless_support))) &&
202 (typeless_support.Support1 & D3D12_FORMAT_SUPPORT1_TEXTURE2D) &&
203 SUCCEEDED(device->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &support, sizeof(support))) &&
204 (support.Support1 & D3D12_FORMAT_SUPPORT1_RENDER_TARGET);
205}
206
207#if defined(LEONIDA_TYPELESS_VS_SPV)
208// HLSL for the host's pass, the same constants as the GLSL stand-ins.
209constexpr char kHostVs[] =
210 "float4 main(uint id : SV_VertexID) : SV_Position {\n"
211 " float2 corner = float2(id & 2, (id << 1) & 2);\n"
212 " return float4(corner * 2.0 - 1.0, 0.0, 1.0);\n"
213 "}\n";
214constexpr char kHostPsFloat[] = "float4 main() : SV_Target { return float4(0.5, -2.0, 1.5, 0.25); }\n";
215constexpr char kHostPsUint[] = "uint4 main() : SV_Target { return uint4(7, 300, 1000, 3); }\n";
216
217bool compile_hlsl(pD3DCompile compile, const char* source, const char* target, std::vector<std::uint8_t>& out) {
218 ID3DBlob* code = nullptr;
219 ID3DBlob* errors = nullptr;
220 const HRESULT hr = compile(source, std::strlen(source), nullptr, nullptr, nullptr, "main", target, 0, 0, &code,
221 &errors);
222 if (errors) {
223 std::fprintf(stderr, "%s\n", static_cast<const char*>(errors->GetBufferPointer()));
224 errors->Release();
225 }
226 if (FAILED(hr) || !code) return false;
227 const auto* p = static_cast<const std::uint8_t*>(code->GetBufferPointer());
228 out.assign(p, p + code->GetBufferSize());
229 code->Release();
230 return true;
231}
232#endif
233
234} // namespace
235
236int main() {
237 vktest::Device vk;
238 vk.request_buffer_device_address = true;
239 const auto status = vk.initialize();
240 if (status == vktest::DeviceStatus::unavailable) return 77;
241 if (status != vktest::DeviceStatus::ready) return 1;
242 if (hostwine::host_is_wine()) return 77; // the host D3D12 runtime is the reference
243 rt::d3d12::VulkanDeviceInfo info{};
244 info.get_instance_proc = vk.instance_proc;
245 info.instance = vk.instance;
246 info.physical = vk.physical;
247 info.device = vk.device;
248 info.queue = vk.queue;
249 info.queue_family = vk.family;
250 info.bindless = vk.bindless;
251 info.bindless_partially_bound = vk.partially_bound;
252 info.host_image_copy = vk.host_image_copy;
253 info.buffer_device_address = vk.buffer_device_address;
254#if defined(LEONIDA_TYPELESS_VS_SPV)
255 // The layer's pass: shader containers around synthetic FSSM programs, and the index that maps their hashes to the
256 // compiled GLSL stand-ins.
257 const auto vs_program = d3d12test::fssm_program({0x56530275, 0xbf810000});
258 const auto ps_float_program = d3d12test::fssm_program({0x50530275, 0xbf810000});
259 const auto ps_uint_program = d3d12test::fssm_program({0x50530276, 0xbf810000});
260 const auto vs_container = d3d12test::shader_container(vs_program);
261 const auto ps_float_container = d3d12test::shader_container(ps_float_program);
262 const auto ps_uint_container = d3d12test::shader_container(ps_uint_program);
263 const auto library = std::filesystem::temp_directory_path() / "leonida_typeless_families_test";
264 std::filesystem::create_directories(library);
265 const auto overwrite = std::filesystem::copy_options::overwrite_existing;
266 std::filesystem::copy_file(LEONIDA_TYPELESS_VS_SPV, library / "vs.spv", overwrite);
267 std::filesystem::copy_file(LEONIDA_TYPELESS_PS_FLOAT_SPV, library / "ps_float.spv", overwrite);
268 std::filesystem::copy_file(LEONIDA_TYPELESS_PS_UINT_SPV, library / "ps_uint.spv", overwrite);
269 {
270 std::ofstream index(library / "index.json", std::ios::binary);
271 index << "{\"vs\": {\"stage\": \"vs\", \"fssm_sha256\": \"" << leonida::sha256_hex(vs_program)
272 << "\", \"bindings\": [], \"push_constant_bytes\": 144, \"input_signature\": []},\n"
273 " \"ps_float\": {\"stage\": \"ps\", \"fssm_sha256\": \"" << leonida::sha256_hex(ps_float_program)
274 << "\", \"bindings\": [], \"push_constant_bytes\": 144, \"outputs\": [0]},\n"
275 " \"ps_uint\": {\"stage\": \"ps\", \"fssm_sha256\": \"" << leonida::sha256_hex(ps_uint_program)
276 << "\", \"bindings\": [], \"push_constant_bytes\": 144, \"outputs\": [0]}}";
277 }
278 info.shader_dir = library.string();
279#endif
280 Ref<ID3D12Device> ours, host, warp;
281 std::string adapter;
282 if (FAILED(rt::d3d12::create_vulkan_device(info, IID_PPV_ARGS(&ours.p)))) return 1;
283 if (!host_device(vk, host, adapter)) {
284 std::fprintf(stderr, "no host D3D12 device on the Vulkan device's adapter\n");
285 return 77;
286 }
287 {
288 Ref<IDXGIFactory4> factory;
289 Ref<IDXGIAdapter> warp_adapter;
290 if (SUCCEEDED(CreateDXGIFactory1(IID_PPV_ARGS(&factory.p))) &&
291 SUCCEEDED(factory->EnumWarpAdapter(IID_PPV_ARGS(&warp_adapter.p))))
292 D3D12CreateDevice(warp_adapter.p, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&warp.p));
293 }
294 std::printf("host reference: %s%s\n", adapter.c_str(), warp.p ? ", and WARP" : "");
295 const std::vector<Family> families = {
296 {DXGI_FORMAT_R8G8B8A8_TYPELESS, {DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,
297 DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_R8G8B8A8_SINT}},
298 {DXGI_FORMAT_B8G8R8A8_TYPELESS, {DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM_SRGB}},
299 {DXGI_FORMAT_R16G16B16A16_TYPELESS, {DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_UNORM,
300 DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_R16G16B16A16_SNORM,
301 DXGI_FORMAT_R16G16B16A16_SINT}},
302 {DXGI_FORMAT_R32G32B32A32_TYPELESS, {DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_UINT,
303 DXGI_FORMAT_R32G32B32A32_SINT}},
304 {DXGI_FORMAT_R32G32_TYPELESS, {DXGI_FORMAT_R32G32_FLOAT, DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_SINT}},
305 {DXGI_FORMAT_R16G16_TYPELESS, {DXGI_FORMAT_R16G16_FLOAT, DXGI_FORMAT_R16G16_UNORM, DXGI_FORMAT_R16G16_UINT,
306 DXGI_FORMAT_R16G16_SNORM, DXGI_FORMAT_R16G16_SINT}},
307 {DXGI_FORMAT_R10G10B10A2_TYPELESS, {DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_R10G10B10A2_UINT}},
308 {DXGI_FORMAT_R8G8_TYPELESS, {DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_R8G8_SNORM,
309 DXGI_FORMAT_R8G8_SINT}},
310 {DXGI_FORMAT_R32_TYPELESS, {DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_SINT}},
311 {DXGI_FORMAT_R16_TYPELESS, {DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UINT,
312 DXGI_FORMAT_R16_SNORM, DXGI_FORMAT_R16_SINT}},
313 {DXGI_FORMAT_R8_TYPELESS, {DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UINT, DXGI_FORMAT_R8_SNORM, DXGI_FORMAT_R8_SINT}},
314 };
315 unsigned compared = 0, skipped = 0, failed = 0, warp_differs = 0;
316 for (const auto& family : families) {
317 for (const DXGI_FORMAT view : family.views) {
318 if (!renders(ours.p, family.typeless, view)) {
319 std::printf("typeless %d view %d: SKIP, the layer has no render target in this format yet\n",
320 int(family.typeless), int(view));
321 ++skipped;
322 continue;
323 }
324 for (const auto& value : kValues) {
325 std::vector<unsigned char> mine, reference, software;
326 if (!render_and_read(host.p, family.typeless, view, value, nullptr, reference)) {
327 std::fprintf(stderr, "typeless %d view %d: the host refused\n", int(family.typeless), int(view));
328 return 1;
329 }
330 if (!render_and_read(ours.p, family.typeless, view, value, nullptr, mine)) {
331 std::fprintf(stderr, "typeless %d view %d: the layer failed\n", int(family.typeless), int(view));
332 return 1;
333 }
334 const std::size_t texel = reference.size() / 16;
335 ++compared;
336 const bool same = mine == reference;
337 failed += !same;
338 if (warp.p && render_and_read(warp.p, family.typeless, view, value, nullptr, software) &&
339 software != reference)
340 ++warp_differs;
341 std::printf("typeless %d view %d clear (%g, %g, %g, %g): host %s, layer %s%s%s\n", int(family.typeless),
342 int(view), value[0], value[1], value[2], value[3], hex(reference, texel).c_str(),
343 hex(mine, texel).c_str(), same ? "" : " MISMATCH",
344 software.empty() || software == reference ? "" : (" WARP " + hex(software, texel)).c_str());
345 }
346 }
347 }
348 std::printf("%u clears compared with %s, %u differ; %u view formats skipped; WARP differs from the host in %u\n",
349 compared, adapter.c_str(), failed, skipped, warp_differs);
350
351 unsigned drawn = 0, draws_failed = 0;
352#if defined(LEONIDA_TYPELESS_VS_SPV)
353 // Draws: the PSO names the typed format, the attachment must be a view of the typeless image in that format.
354 const HMODULE compiler = LoadLibraryExA("d3dcompiler_47.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
355 const auto compile = compiler ? reinterpret_cast<pD3DCompile>(reinterpret_cast<void*>(
356 GetProcAddress(compiler, "D3DCompile")))
357 : nullptr;
358 std::vector<std::uint8_t> host_vs, host_ps_float, host_ps_uint;
359 if (!compile || !compile_hlsl(compile, kHostVs, "vs_5_0", host_vs) ||
360 !compile_hlsl(compile, kHostPsFloat, "ps_5_0", host_ps_float) ||
361 !compile_hlsl(compile, kHostPsUint, "ps_5_0", host_ps_uint)) {
362 std::fprintf(stderr, "d3dcompiler_47 could not compile the host's pass\n");
363 return 1;
364 }
365 D3D12_VERSIONED_ROOT_SIGNATURE_DESC root_desc{};
366 root_desc.Version = D3D_ROOT_SIGNATURE_VERSION_1_0;
367 const auto root_blob = d3d12test::serialize_root_signature(root_desc);
368 if (root_blob.empty()) return 1;
369 const Pass host_float{&root_blob, &host_vs, &host_ps_float}, host_uint{&root_blob, &host_vs, &host_ps_uint};
370 const Pass ours_float{&root_blob, &vs_container, &ps_float_container};
371 const Pass ours_uint{&root_blob, &vs_container, &ps_uint_container};
372 struct DrawCase {
373 DXGI_FORMAT typeless, view;
374 bool uint;
375 };
376 const DrawCase draws[] = {
377 {DXGI_FORMAT_R16G16B16A16_TYPELESS, DXGI_FORMAT_R16G16B16A16_UINT, true},
378 {DXGI_FORMAT_R16G16B16A16_TYPELESS, DXGI_FORMAT_R16G16B16A16_FLOAT, false},
379 {DXGI_FORMAT_R16G16B16A16_TYPELESS, DXGI_FORMAT_R16G16B16A16_UNORM, false},
380 {DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_UINT, true},
381 {DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, false},
382 {DXGI_FORMAT_R10G10B10A2_TYPELESS, DXGI_FORMAT_R10G10B10A2_UINT, true},
383 {DXGI_FORMAT_R10G10B10A2_TYPELESS, DXGI_FORMAT_R10G10B10A2_UNORM, false},
384 {DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_UINT, true},
385 };
386 for (const auto& c : draws) {
387 if (!renders(ours.p, c.typeless, c.view)) {
388 std::printf("typeless %d view %d draw: SKIP, the layer has no render target in this format yet\n",
389 int(c.typeless), int(c.view));
390 ++skipped;
391 continue;
392 }
393 std::vector<unsigned char> mine, reference;
394 if (!render_and_read(host.p, c.typeless, c.view, nullptr, c.uint ? &host_uint : &host_float, reference)) {
395 std::fprintf(stderr, "typeless %d view %d draw: the host refused\n", int(c.typeless), int(c.view));
396 return 1;
397 }
398 if (!render_and_read(ours.p, c.typeless, c.view, nullptr, c.uint ? &ours_uint : &ours_float, mine)) {
399 std::fprintf(stderr, "typeless %d view %d draw: the layer failed\n", int(c.typeless), int(c.view));
400 return 1;
401 }
402 ++drawn;
403 const bool same = mine == reference;
404 draws_failed += !same;
405 std::printf("typeless %d view %d draw (%s): host %s, layer %s%s\n", int(c.typeless), int(c.view),
406 c.uint ? "7, 300, 1000, 3" : "0.5, -2, 1.5, 0.25", hex(reference, reference.size() / 16).c_str(),
407 hex(mine, reference.size() / 16).c_str(), same ? "" : " MISMATCH");
408 }
409 std::printf("%u draws compared with %s, %u differ\n", drawn, adapter.c_str(), draws_failed);
410#endif
411 if (vk.validation_errors()) {
412 std::fprintf(stderr, "%u Vulkan validation errors\n", vk.validation_errors());
413 return 1;
414 }
415 return failed || draws_failed ? 1 : 0;
416}
diff --git a/runtime/test/d3d12_uav_clear_test.cpp b/runtime/test/d3d12_uav_clear_test.cpp
index 1968dc371..27664696e 100644
--- a/runtime/test/d3d12_uav_clear_test.cpp
+++ b/runtime/test/d3d12_uav_clear_test.cpp
@@ -574,9 +574,47 @@ int main() {
574 {"RGBA8_UNORM, Float and Uint", DXGI_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM, 8, 8, 1, 1, false, 574 {"RGBA8_UNORM, Float and Uint", DXGI_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM, 8, 8, 1, 1, false,
575 {texture_clear(VK_FORMAT_R8G8B8A8_UNORM, true, floats(1.0f, 0.5f, 0.0f, 1.0f), 0, 0, 1), 575 {texture_clear(VK_FORMAT_R8G8B8A8_UNORM, true, floats(1.0f, 0.5f, 0.0f, 1.0f), 0, 0, 1),
576 texture_clear(VK_FORMAT_R8G8B8A8_UNORM, false, {0x10, 0x20, 0x130, 0x40}, 0, 0, 1, {{1, 1, 3, 7}})}}, 576 texture_clear(VK_FORMAT_R8G8B8A8_UNORM, false, {0x10, 0x20, 0x130, 0x40}, 0, 0, 1, {{1, 1, 3, 7}})}},
577 {"R32_TYPELESS through an R32_UINT view", DXGI_FORMAT_R32_TYPELESS, VK_FORMAT_R32_SFLOAT, 8, 4, 2, 1, false, 577 {"R32_TYPELESS through R32_UINT / R32_SINT / R32_SFLOAT (including NaN bits)", DXGI_FORMAT_R32_TYPELESS,
578 VK_FORMAT_R32_SFLOAT, 8, 4, 2, 1, false,
578 {texture_clear(VK_FORMAT_R32_UINT, false, {0x40490fdb, 0, 0, 0}, 0, 0, 1), 579 {texture_clear(VK_FORMAT_R32_UINT, false, {0x40490fdb, 0, 0, 0}, 0, 0, 1),
579 texture_clear(VK_FORMAT_R32_SFLOAT, true, floats(-0.25f, 0, 0, 0), 1, 0, 1)}}, 580 texture_clear(VK_FORMAT_R32_UINT, false, {0x7f800001u, 0, 0, 0}, 0, 0, 1),
581 texture_clear(VK_FORMAT_R32_UINT, false, {0xffffffffu, 0, 0, 0}, 0, 0, 1, {{1, 1, 6, 3}}),
582 texture_clear(VK_FORMAT_R32_SINT, false, {0xff800001u, 0, 0, 0}, 1, 0, 1),
583 texture_clear(VK_FORMAT_R32_SFLOAT, true, floats(-0.25f, 0, 0, 0), 1, 0, 1, {{0, 0, 2, 2}})}},
584 {"R32G32_TYPELESS through R32G32_UINT (NaN bit patterns)", DXGI_FORMAT_R32G32_TYPELESS,
585 VK_FORMAT_R32G32_SFLOAT, 8, 4, 1, 1, false,
586 {texture_clear(VK_FORMAT_R32G32_UINT, false, {0x7f800001u, 0xffffffffu, 0, 0}, 0, 0, 1),
587 texture_clear(VK_FORMAT_R32G32_SINT, false, {0xff800001u, 0x7fffffffu, 0, 0}, 0, 0, 1, {{2, 1, 6, 3}})}},
588 {"R32G32B32A32_TYPELESS through R32G32B32A32_UINT (NaN bit patterns)", DXGI_FORMAT_R32G32B32A32_TYPELESS,
589 VK_FORMAT_R32G32B32A32_SFLOAT, 4, 4, 1, 1, false,
590 {texture_clear(VK_FORMAT_R32G32B32A32_UINT, false, {0x7f800001u, 0xffffffffu, 0x7fffffffu, 0xff800001u},
591 0, 0, 1)}},
592 {"R16G16_TYPELESS through UNORM, UINT, SINT and SNORM", DXGI_FORMAT_R16G16_TYPELESS,
593 VK_FORMAT_R16G16_SFLOAT, 8, 8, 2, 2, false,
594 {texture_clear(VK_FORMAT_R16G16_UNORM, true, floats(1.0f, 1.0f, 0.0f, 0.0f), 0, 0, 2),
595 texture_clear(VK_FORMAT_R16G16_UNORM, true, floats(0.5f, 1.0f, 0.0f, 0.0f), 0, 0, 1, {{1, 1, 5, 4}}),
596 texture_clear(VK_FORMAT_R16G16_UINT, false, {0xffffu, 0x7fffu, 0, 0}, 0, 1, 1),
597 texture_clear(VK_FORMAT_R16G16_UINT, false, {0x7c01u, 0xfc01u, 0, 0}, 0, 1, 1, {{2, 2, 6, 6}}),
598 texture_clear(VK_FORMAT_R16G16_SINT, false, {0xffffu, 0x8000u, 0, 0}, 1, 0, 1),
599 texture_clear(VK_FORMAT_R16G16_SNORM, true, floats(1.0f, -1.0f, 0.0f, 0.0f), 1, 1, 1)}},
600 {"R16G16B16A16_TYPELESS through UNORM, UINT, SINT and SNORM", DXGI_FORMAT_R16G16B16A16_TYPELESS,
601 VK_FORMAT_R16G16B16A16_SFLOAT, 8, 8, 2, 2, false,
602 {texture_clear(VK_FORMAT_R16G16B16A16_UNORM, true, floats(1.0f, 0.5f, 0.0f, 1.0f), 0, 0, 2),
603 texture_clear(VK_FORMAT_R16G16B16A16_UINT, false, {0xffffu, 0x7fffu, 0x7c01u, 0xfc01u}, 0, 1, 1),
604 texture_clear(VK_FORMAT_R16G16B16A16_SINT, true, floats(-1.0f, 32767.0f, -32768.0f, 0.0f), 0, 0, 1,
605 {{1, 2, 6, 5}}),
606 texture_clear(VK_FORMAT_R16G16B16A16_SNORM, true, floats(1.0f, -1.0f, 0.5f, 0.0f), 1, 0, 2)}},
607 {"R8G8B8A8_TYPELESS through UINT, SINT and SNORM", DXGI_FORMAT_R8G8B8A8_TYPELESS,
608 VK_FORMAT_R8G8B8A8_UNORM, 8, 8, 2, 1, false,
609 {texture_clear(VK_FORMAT_R8G8B8A8_UINT, false, {0xffu, 0x80u, 0x7fu, 0x01u}, 0, 0, 1),
610 texture_clear(VK_FORMAT_R8G8B8A8_SINT, true, floats(-128.0f, -1.0f, 127.0f, 0.0f), 0, 0, 1,
611 {{1, 1, 5, 6}}),
612 texture_clear(VK_FORMAT_R8G8B8A8_SNORM, true, floats(1.0f, -1.0f, 0.5f, -0.5f), 1, 0, 1)}},
613 {"R16_TYPELESS through UINT, SFLOAT and SNORM", DXGI_FORMAT_R16_TYPELESS,
614 VK_FORMAT_R16_UNORM, 8, 4, 2, 1, false,
615 {texture_clear(VK_FORMAT_R16_UINT, false, {0xffffu, 0, 0, 0}, 0, 0, 1),
616 texture_clear(VK_FORMAT_R16_SFLOAT, true, floats(1.0f, 0, 0, 0), 0, 0, 1, {{2, 1, 6, 3}}),
617 texture_clear(VK_FORMAT_R16_SNORM, true, floats(1.0f, 0, 0, 0), 1, 0, 1)}},
580 {"RGBA16_FLOAT rectangles", DXGI_FORMAT_R16G16B16A16_FLOAT, VK_FORMAT_R16G16B16A16_SFLOAT, 16, 16, 2, 2, 618 {"RGBA16_FLOAT rectangles", DXGI_FORMAT_R16G16B16A16_FLOAT, VK_FORMAT_R16G16B16A16_SFLOAT, 16, 16, 2, 2,
581 false, 619 false,
582 {texture_clear(VK_FORMAT_R16G16B16A16_SFLOAT, true, floats(0.25f, -8.0f, 1.0f, 0.0f), 1, 0, 2, 620 {texture_clear(VK_FORMAT_R16G16B16A16_SFLOAT, true, floats(0.25f, -8.0f, 1.0f, 0.0f), 1, 0, 2,
diff --git a/runtime/test/d3d12_vulkan_device_test.cpp b/runtime/test/d3d12_vulkan_device_test.cpp
index 91d3244ce..6b7a399bf 100644
--- a/runtime/test/d3d12_vulkan_device_test.cpp
+++ b/runtime/test/d3d12_vulkan_device_test.cpp
@@ -867,6 +867,28 @@ int compare_allocation_info(ID3D12Device* ours) {
867 mismatch("no resources", empty_a, empty_b); 867 mismatch("no resources", empty_a, empty_b);
868 868
869 Ref<ID3D12Device8> ours8; 869 Ref<ID3D12Device8> ours8;
870 // MULTISAMPLE_QUALITY_LEVELS with TILED_RESOURCE: the same answers as the host, except 128-bit formats at 4x,
871 // which the AMD drivers refuse and WARP and NVIDIA report (and GetResourceAllocationInfo allocates here).
872 for (const DXGI_FORMAT format : {rgba8, DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R32G32_FLOAT,
873 DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_D32_FLOAT,
874 DXGI_FORMAT_R32G32B32_FLOAT}) {
875 for (const UINT samples : {1u, 2u, 4u, 8u, 16u}) {
876 D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS x{format, samples,
877 D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_TILED_RESOURCE};
878 D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS y = x;
879 const HRESULT hx = ours->CheckFeatureSupport(D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS, &x, sizeof(x));
880 const HRESULT hy = host->CheckFeatureSupport(D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS, &y, sizeof(y));
881 const bool wide = format == DXGI_FORMAT_R32G32B32A32_FLOAT;
882 if (hx == hy && (x.NumQualityLevels == y.NumQualityLevels ||
883 (wide && samples == 4 && x.NumQualityLevels == 1 && y.NumQualityLevels == 0)))
884 continue;
885 if (mismatches++ < 24)
886 std::fprintf(stderr, "tiled quality levels format %d %ux: ours 0x%08lx %u, host 0x%08lx %u\n",
887 int(format), samples, static_cast<unsigned long>(hx), x.NumQualityLevels,
888 static_cast<unsigned long>(hy), y.NumQualityLevels);
889 }
890 }
891
870 if (FAILED(ours->QueryInterface(IID_PPV_ARGS(&ours8.p)))) return mismatches + 1; 892 if (FAILED(ours->QueryInterface(IID_PPV_ARGS(&ours8.p)))) return mismatches + 1;
871 const D3D12_RESOURCE_DESC mixed[] = {with(texture_desc(16, 16, rgba8, none), k4), buffer_desc(300), 893 const D3D12_RESOURCE_DESC mixed[] = {with(texture_desc(16, 16, rgba8, none), k4), buffer_desc(300),
872 with(texture_desc(64, 64, rgba8, rt), 0, 4)}; 894 with(texture_desc(64, 64, rgba8, rt), 0, 4)};
@@ -1388,6 +1410,64 @@ int compare_depth_multisample_quality_levels(ID3D12Device* ours, VkSampleCountFl
1388 return mismatches; 1410 return mismatches;
1389} 1411}
1390 1412
1413bool check_plain_resolve_formats(ID3D12Device* device) {
1414 struct Case { DXGI_FORMAT format; bool valid; bool depth = false; DXGI_FORMAT requested = DXGI_FORMAT_UNKNOWN; };
1415 constexpr Case cases[] = {
1416 {DXGI_FORMAT_R8G8B8A8_UINT, false},
1417 {DXGI_FORMAT_R8G8B8A8_SINT, false},
1418 {DXGI_FORMAT_R32_UINT, false},
1419 {DXGI_FORMAT_R32_SINT, false},
1420 {DXGI_FORMAT_R32G32B32A32_SINT, false},
1421 {DXGI_FORMAT_R8G8B8A8_UINT, false, false, DXGI_FORMAT_R8G8B8A8_UNORM},
1422 {DXGI_FORMAT_R8G8B8A8_UNORM, true},
1423 {DXGI_FORMAT_R16G16B16A16_FLOAT, true},
1424 {DXGI_FORMAT_D32_FLOAT, true, true},
1425 };
1426 Ref<ID3D12CommandAllocator> allocator;
1427 Ref<ID3D12GraphicsCommandList> list;
1428 if (FAILED(device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(&allocator.p))) ||
1429 FAILED(device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, allocator.p, nullptr,
1430 IID_PPV_ARGS(&list.p)))) return false;
1431 const D3D12_HEAP_PROPERTIES heap{D3D12_HEAP_TYPE_DEFAULT};
1432 bool ok = true;
1433 unsigned tested = 0, skipped = 0;
1434 for (const auto& c : cases) {
1435 D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS quality{c.format, 4};
1436 if (FAILED(device->CheckFeatureSupport(D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS, &quality, sizeof(quality))))
1437 return false;
1438 if (!quality.NumQualityLevels) {
1439 std::printf("plain resolve format %d: 4x MSAA unsupported, skipped\n", int(c.format));
1440 ++skipped;
1441 continue;
1442 }
1443 auto desc = texture_desc(8, 8, c.format, c.depth ? D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL
1444 : D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET);
1445 desc.SampleDesc.Count = 4;
1446 Ref<ID3D12Resource> src, dst;
1447 if (FAILED(device->CreateCommittedResource(&heap, D3D12_HEAP_FLAG_NONE, &desc,
1448 D3D12_RESOURCE_STATE_RESOLVE_SOURCE, nullptr,
1449 IID_PPV_ARGS(&src.p)))) return false;
1450 desc.SampleDesc.Count = 1;
1451 if (FAILED(device->CreateCommittedResource(&heap, D3D12_HEAP_FLAG_NONE, &desc,
1452 D3D12_RESOURCE_STATE_RESOLVE_DEST, nullptr,
1453 IID_PPV_ARGS(&dst.p)))) return false;
1454 const DXGI_FORMAT requested = c.requested == DXGI_FORMAT_UNKNOWN ? c.format : c.requested;
1455 list->ResolveSubresource(dst.p, 0, src.p, 0, requested);
1456 const HRESULT result = list->Close();
1457 if (result != (c.valid ? S_OK : E_INVALIDARG)) {
1458 std::fprintf(stderr, "plain resolve format %d: Close returned 0x%08lx, expected 0x%08lx\n",
1459 int(c.format), static_cast<unsigned long>(result),
1460 static_cast<unsigned long>(c.valid ? S_OK : E_INVALIDARG));
1461 ok = false;
1462 }
1463 ++tested;
1464 if (FAILED(list->Reset(allocator.p, nullptr))) return false;
1465 }
1466 if (FAILED(list->Close())) return false;
1467 std::printf("plain resolve format validation: %u tested, %u unsupported cases skipped\n", tested, skipped);
1468 return ok;
1469}
1470
1391// Compare the Vulkan-backed resolve output byte-for-byte with the host runtime for every common supported format, 1471// Compare the Vulkan-backed resolve output byte-for-byte with the host runtime for every common supported format,
1392// sample count and region form. A host-unsupported combination is a deliberate skip; a mismatch in advertised 1472// sample count and region form. A host-unsupported combination is a deliberate skip; a mismatch in advertised
1393// support or in the resulting pixels is a failure. The region forms need ID3D12GraphicsCommandList7 on the host; 1473// support or in the resulting pixels is a failure. The region forms need ID3D12GraphicsCommandList7 on the host;
@@ -2319,8 +2399,7 @@ int compare_feature_options(ID3D12Device* ours, const rt::d3d12::VulkanDeviceInf
2319 const bool expect_ok = (type == D3D12_COMMAND_LIST_TYPE_DIRECT || 2399 const bool expect_ok = (type == D3D12_COMMAND_LIST_TYPE_DIRECT ||
2320 type == D3D12_COMMAND_LIST_TYPE_COMPUTE || 2400 type == D3D12_COMMAND_LIST_TYPE_COMPUTE ||
2321 type == D3D12_COMMAND_LIST_TYPE_COPY) && 2401 type == D3D12_COMMAND_LIST_TYPE_COPY) &&
2322 (prio == D3D12_COMMAND_QUEUE_PRIORITY_NORMAL || 2402 prio == D3D12_COMMAND_QUEUE_PRIORITY_NORMAL;
2323 prio == D3D12_COMMAND_QUEUE_PRIORITY_HIGH);
2324 if (ours->CheckFeatureSupport(D3D12_FEATURE_COMMAND_QUEUE_PRIORITY, &q, sizeof(q)) != S_OK || 2403 if (ours->CheckFeatureSupport(D3D12_FEATURE_COMMAND_QUEUE_PRIORITY, &q, sizeof(q)) != S_OK ||
2325 q.PriorityForTypeIsSupported != (expect_ok ? TRUE : FALSE)) 2404 q.PriorityForTypeIsSupported != (expect_ok ? TRUE : FALSE))
2326 fail("COMMAND_QUEUE_PRIORITY answer mismatch"); 2405 fail("COMMAND_QUEUE_PRIORITY answer mismatch");
@@ -2777,16 +2856,6 @@ int compare_invalid_arguments(ID3D12Device* ours) {
2777 Ref<ID3D12Device10> newer; 2856 Ref<ID3D12Device10> newer;
2778 return SUCCEEDED(d->QueryInterface(IID_PPV_ARGS(&newer.p))); 2857 return SUCCEEDED(d->QueryInterface(IID_PPV_ARGS(&newer.p)));
2779 }; 2858 };
2780 const auto not_elevated = [](ID3D12Device*) {
2781 HANDLE token = nullptr;
2782 TOKEN_ELEVATION elevation{};
2783 DWORD size = 0;
2784 const bool elevated = OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token) &&
2785 GetTokenInformation(token, TokenElevation, &elevation, sizeof(elevation), &size) &&
2786 elevation.TokenIsElevated;
2787 if (token) CloseHandle(token);
2788 return !elevated;
2789 };
2790 static const Case cases[] = { 2859 static const Case cases[] = {
2791 // CreateCommittedResource: arguments. 2860 // CreateCommittedResource: arguments.
2792 // A null D3D12_HEAP_PROPERTIES faults in the host runtime, so it is not compared. 2861 // A null D3D12_HEAP_PROPERTIES faults in the host runtime, so it is not compared.
@@ -3440,7 +3509,7 @@ int compare_invalid_arguments(ID3D12Device* ours) {
3440 }}, 3509 }},
3441 {"command queue: global realtime priority", [](ID3D12Device* d) { 3510 {"command queue: global realtime priority", [](ID3D12Device* d) {
3442 return command_queue(d, {D3D12_COMMAND_LIST_TYPE_DIRECT, D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME}); 3511 return command_queue(d, {D3D12_COMMAND_LIST_TYPE_DIRECT, D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME});
3443 }, +not_elevated}, 3512 }},
3444 {"command queue: compute", [](ID3D12Device* d) { return command_queue(d, {D3D12_COMMAND_LIST_TYPE_COMPUTE}); }}, 3513 {"command queue: compute", [](ID3D12Device* d) { return command_queue(d, {D3D12_COMMAND_LIST_TYPE_COMPUTE}); }},
3445 {"command queue: copy", [](ID3D12Device* d) { return command_queue(d, {D3D12_COMMAND_LIST_TYPE_COPY}); }}, 3514 {"command queue: copy", [](ID3D12Device* d) { return command_queue(d, {D3D12_COMMAND_LIST_TYPE_COPY}); }},
3446 {"command queue: high priority", [](ID3D12Device* d) { 3515 {"command queue: high priority", [](ID3D12Device* d) {
@@ -3827,6 +3896,7 @@ int main() {
3827 rt::d3d12::set_device_outer(inner, device.p); // the proxy now owns `inner` 3896 rt::d3d12::set_device_outer(inner, device.p); // the proxy now owns `inner`
3828 EXPECT(rt::d3d12_xs::is_device_proxy(device.p)); 3897 EXPECT(rt::d3d12_xs::is_device_proxy(device.p));
3829 EXPECT(rt::d3d12_xs::device_proxy_slot_count(device.p) == 80); // ID3D12Device11 3898 EXPECT(rt::d3d12_xs::device_proxy_slot_count(device.p) == 80); // ID3D12Device11
3899 EXPECT(check_plain_resolve_formats(device.p));
3830 3900
3831 { 3901 {
3832 Ref<ID3D12Device11> device11; 3902 Ref<ID3D12Device11> device11;
@@ -4231,8 +4301,40 @@ int main() {
4231 granted_q.reset(); 4301 granted_q.reset();
4232 rt::d3d12::set_global_realtime_privilege_override_for_test(-1); 4302 rt::d3d12::set_global_realtime_privilege_override_for_test(-1);
4233 4303
4304 Ref<ID3D12Device> host;
4305 create_host_device(host);
4306 if (host.p) EXPECT(command_queue(device.p, rt_desc) == command_queue(host.p, rt_desc));
4307
4308 // SecurityAnonymous thread impersonation (OpenThreadToken fails with ERROR_CANT_OPEN_ANONYMOUS, not
4309 // ERROR_NO_TOKEN) must fail closed instead of falling back to the process token, matching the host runtime.
4310 const auto check_security_anonymous_impersonation = [&]() -> int {
4311 HANDLE proc_token = nullptr;
4312 if (!OpenProcessToken(GetCurrentProcess(), TOKEN_DUPLICATE, &proc_token)) return 0;
4313 HANDLE anon_imp = nullptr;
4314 if (DuplicateTokenEx(proc_token, MAXIMUM_ALLOWED, nullptr, SecurityAnonymous, TokenImpersonation,
4315 &anon_imp)) {
4316 if (SetThreadToken(nullptr, anon_imp)) {
4317 struct RevertImpersonation {
4318 ~RevertImpersonation() { RevertToSelf(); }
4319 } revert_impersonation;
4320 HANDLE opened = nullptr;
4321 EXPECT(!OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE, &opened));
4322 EXPECT(GetLastError() == ERROR_CANT_OPEN_ANONYMOUS);
4323 if (opened) CloseHandle(opened);
4324 EXPECT(!rt::d3d12::has_global_realtime_privilege());
4325 EXPECT(command_queue(device.p, rt_desc) == DXGI_ERROR_ACCESS_DENIED);
4326 if (host.p) EXPECT(command_queue(host.p, rt_desc) == DXGI_ERROR_ACCESS_DENIED);
4327 }
4328 CloseHandle(anon_imp);
4329 }
4330 CloseHandle(proc_token);
4331 return 0;
4332 };
4333 if (check_security_anonymous_impersonation() != 0) return 1;
4334
4234 // When the process token holds SeIncreaseBasePriorityPrivilege (e.g. an elevated session), toggle the 4335 // When the process token holds SeIncreaseBasePriorityPrivilege (e.g. an elevated session), toggle the
4235 // real token privilege and verify both states against the host D3D12 runtime. 4336 // real token privilege and verify both states (plus SecurityAnonymous impersonation while the process
4337 // token has the privilege enabled) against the host D3D12 runtime.
4236 HANDLE token = nullptr; 4338 HANDLE token = nullptr;
4237 LUID luid{}; 4339 LUID luid{};
4238 if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token)) { 4340 if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token)) {
@@ -4246,9 +4348,11 @@ int main() {
4246 GetLastError() == ERROR_SUCCESS) { 4348 GetLastError() == ERROR_SUCCESS) {
4247 EXPECT(rt::d3d12::has_global_realtime_privilege()); 4349 EXPECT(rt::d3d12::has_global_realtime_privilege());
4248 EXPECT(command_queue(device.p, rt_desc) == S_OK); 4350 EXPECT(command_queue(device.p, rt_desc) == S_OK);
4249 Ref<ID3D12Device> host; 4351 if (host.p) EXPECT(command_queue(host.p, rt_desc) == S_OK);
4250 if (create_host_device(host)) { 4352 if (check_security_anonymous_impersonation() != 0) {
4251 EXPECT(command_queue(host.p, rt_desc) == S_OK); 4353 AdjustTokenPrivileges(token, FALSE, &prev, 0, nullptr, nullptr);
4354 CloseHandle(token);
4355 return 1;
4252 } 4356 }
4253 tp.Privileges[0].Attributes = 0; 4357 tp.Privileges[0].Attributes = 0;
4254 if (AdjustTokenPrivileges(token, FALSE, &tp, 0, nullptr, nullptr) && 4358 if (AdjustTokenPrivileges(token, FALSE, &tp, 0, nullptr, nullptr) &&
@@ -5554,6 +5658,69 @@ int main() {
5554 { 5658 {
5555 Ref<ID3D12Device> standalone; 5659 Ref<ID3D12Device> standalone;
5556 EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device_standalone(IID_PPV_ARGS(&standalone.p)))); 5660 EXPECT(SUCCEEDED(rt::d3d12::create_vulkan_device_standalone(IID_PPV_ARGS(&standalone.p))));
5661 // What translated shaders can declare beyond Int64/Float64 (the index's `features`) is enabled wherever the GPU
5662 // has it: image stores and loads without a format, gather offsets, LOD clamps, a vertex shader's layer and
5663 // viewport. Creating a module that declares one without it breaks VUID-VkShaderModuleCreateInfo-pCode-08740.
5664 const rt::d3d12::VulkanDeviceInfo* made = rt::d3d12::vulkan_device_info(standalone.p);
5665 EXPECT(made != nullptr);
5666 if (made) {
5667 const auto features2 = reinterpret_cast<PFN_vkGetPhysicalDeviceFeatures2>(
5668 made->get_instance_proc(made->instance, "vkGetPhysicalDeviceFeatures2"));
5669 EXPECT(features2 != nullptr);
5670 VkPhysicalDeviceVulkan12Features have12{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES};
5671 VkPhysicalDeviceFeatures2 have{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2, &have12};
5672 if (features2) features2(made->physical, &have);
5673 const VkPhysicalDeviceFeatures& on = made->features;
5674 EXPECT(on.shaderStorageImageWriteWithoutFormat == have.features.shaderStorageImageWriteWithoutFormat);
5675 EXPECT(on.shaderStorageImageReadWithoutFormat == have.features.shaderStorageImageReadWithoutFormat);
5676 EXPECT(on.shaderImageGatherExtended == have.features.shaderImageGatherExtended);
5677 EXPECT(on.shaderResourceMinLod == have.features.shaderResourceMinLod);
5678 EXPECT(made->shader_output_layer == (have12.shaderOutputLayer == VK_TRUE));
5679 EXPECT(made->shader_output_viewport_index == (have12.shaderOutputViewportIndex == VK_TRUE));
5680 // The pixel-shader extensions (barycentrics, the POPS interlock, maintenance8's texel offsets): each is
5681 // enabled exactly when the GPU offers the extension and its feature. A structure is chained into the
5682 // query only when its extension is offered.
5683 const auto enumerate = reinterpret_cast<PFN_vkEnumerateDeviceExtensionProperties>(
5684 made->get_instance_proc(made->instance, "vkEnumerateDeviceExtensionProperties"));
5685 EXPECT(enumerate != nullptr);
5686 std::vector<VkExtensionProperties> offered;
5687 std::uint32_t offered_count = 0;
5688 if (enumerate && enumerate(made->physical, nullptr, &offered_count, nullptr) == VK_SUCCESS) {
5689 offered.resize(offered_count);
5690 enumerate(made->physical, nullptr, &offered_count, offered.data());
5691 offered.resize(offered_count);
5692 }
5693 const auto has = [&](const char* name) {
5694 return std::any_of(offered.begin(), offered.end(),
5695 [&](const VkExtensionProperties& e) { return std::strcmp(e.extensionName, name) == 0; });
5696 };
5697 VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR bary{
5698 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR};
5699 VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT lock{
5700 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT};
5701 VkPhysicalDeviceFeatures2 ext_query{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2};
5702 if (has(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME)) {
5703 bary.pNext = ext_query.pNext;
5704 ext_query.pNext = &bary;
5705 }
5706 if (has(VK_EXT_FRAGMENT_SHADER_INTERLOCK_EXTENSION_NAME)) {
5707 lock.pNext = ext_query.pNext;
5708 ext_query.pNext = &lock;
5709 }
5710#ifdef VK_KHR_MAINTENANCE_8_EXTENSION_NAME
5711 VkPhysicalDeviceMaintenance8FeaturesKHR m8{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_8_FEATURES_KHR};
5712 if (has(VK_KHR_MAINTENANCE_8_EXTENSION_NAME)) {
5713 m8.pNext = ext_query.pNext;
5714 ext_query.pNext = &m8;
5715 }
5716#endif
5717 if (features2) features2(made->physical, &ext_query);
5718 EXPECT(made->fragment_shader_barycentric == (bary.fragmentShaderBarycentric == VK_TRUE));
5719 EXPECT(made->fragment_shader_interlock == (lock.fragmentShaderPixelInterlock == VK_TRUE));
5720#ifdef VK_KHR_MAINTENANCE_8_EXTENSION_NAME
5721 EXPECT(made->maintenance8 == (m8.maintenance8 == VK_TRUE));
5722#endif
5723 }
5557 D3D12_COMMAND_QUEUE_DESC queue_desc{}; 5724 D3D12_COMMAND_QUEUE_DESC queue_desc{};
5558 Ref<ID3D12CommandQueue> queue; 5725 Ref<ID3D12CommandQueue> queue;
5559 Ref<ID3D12Fence> fence; 5726 Ref<ID3D12Fence> fence;
diff --git a/runtime/test/d3d12_xdxr_rt_test.cpp b/runtime/test/d3d12_xdxr_rt_test.cpp
index 51f357fc1..dd6ab2f88 100644
--- a/runtime/test/d3d12_xdxr_rt_test.cpp
+++ b/runtime/test/d3d12_xdxr_rt_test.cpp
@@ -256,7 +256,7 @@ int main(int argc, char** argv) {
256 if (FAILED(rb->Map(0, nullptr, &p))) return false; 256 if (FAILED(rb->Map(0, nullptr, &p))) return false;
257 std::uint32_t units = 0; 257 std::uint32_t units = 0;
258 std::memcpy(&units, static_cast<char*>(p) + 4, 4); // header totalSizeIn64BNodes 258 std::memcpy(&units, static_cast<char*>(p) + 4, 4); // header totalSizeIn64BNodes
259 const UINT64 used = UINT64(units) * 64; 259 const UINT64 used = (UINT64(units) + 1) * 64; // the field does not count the 64-byte header
260 const bool ok = used && used <= size && write_file(dir + "/" + name + ".bin", p, std::size_t(used)) && 260 const bool ok = used && used <= size && write_file(dir + "/" + name + ".bin", p, std::size_t(used)) &&
261 write_file(dir + "/" + name + ".json", json.data(), json.size()); 261 write_file(dir + "/" + name + ".json", json.data(), json.size());
262 rb->Unmap(0, nullptr); 262 rb->Unmap(0, nullptr);
diff --git a/runtime/test/file_system_test.cpp b/runtime/test/file_system_test.cpp
index 1fcaf6710..3a4bc5860 100644
--- a/runtime/test/file_system_test.cpp
+++ b/runtime/test/file_system_test.cpp
@@ -17,8 +17,13 @@ namespace {
17 17
18using CreateFileWFn = HANDLE(WINAPI*)(LPCWSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE); 18using CreateFileWFn = HANDLE(WINAPI*)(LPCWSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE);
19using CreateFileAFn = HANDLE(WINAPI*)(LPCSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE); 19using CreateFileAFn = HANDLE(WINAPI*)(LPCSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE);
20using CreateFile2Fn = HANDLE(WINAPI*)(LPCWSTR, DWORD, DWORD, DWORD, LPCREATEFILE2_EXTENDED_PARAMETERS);
20using FindFirstFileWFn = HANDLE(WINAPI*)(LPCWSTR, LPWIN32_FIND_DATAW); 21using FindFirstFileWFn = HANDLE(WINAPI*)(LPCWSTR, LPWIN32_FIND_DATAW);
21using FindFirstFileAFn = HANDLE(WINAPI*)(LPCSTR, LPWIN32_FIND_DATAA); 22using FindFirstFileAFn = HANDLE(WINAPI*)(LPCSTR, LPWIN32_FIND_DATAA);
23using FindFirstFileExWFn =
24 HANDLE(WINAPI*)(LPCWSTR, FINDEX_INFO_LEVELS, LPVOID, FINDEX_SEARCH_OPS, LPVOID, DWORD);
25using FindFirstFileExAFn =
26 HANDLE(WINAPI*)(LPCSTR, FINDEX_INFO_LEVELS, LPVOID, FINDEX_SEARCH_OPS, LPVOID, DWORD);
22using FindNextFileWFn = BOOL(WINAPI*)(HANDLE, LPWIN32_FIND_DATAW); 27using FindNextFileWFn = BOOL(WINAPI*)(HANDLE, LPWIN32_FIND_DATAW);
23using FindCloseFn = BOOL(WINAPI*)(HANDLE); 28using FindCloseFn = BOOL(WINAPI*)(HANDLE);
24using GetFileAttributesWFn = DWORD(WINAPI*)(LPCWSTR); 29using GetFileAttributesWFn = DWORD(WINAPI*)(LPCWSTR);
@@ -26,6 +31,20 @@ using GetFileAttributesAFn = DWORD(WINAPI*)(LPCSTR);
26using GetFileAttributesExWFn = BOOL(WINAPI*)(LPCWSTR, GET_FILEEX_INFO_LEVELS, LPVOID); 31using GetFileAttributesExWFn = BOOL(WINAPI*)(LPCWSTR, GET_FILEEX_INFO_LEVELS, LPVOID);
27using DeleteFileWFn = BOOL(WINAPI*)(LPCWSTR); 32using DeleteFileWFn = BOOL(WINAPI*)(LPCWSTR);
28using DeleteFileAFn = BOOL(WINAPI*)(LPCSTR); 33using DeleteFileAFn = BOOL(WINAPI*)(LPCSTR);
34using CreateDirectoryWFn = BOOL(WINAPI*)(LPCWSTR, LPSECURITY_ATTRIBUTES);
35using CreateDirectoryAFn = BOOL(WINAPI*)(LPCSTR, LPSECURITY_ATTRIBUTES);
36using CreateDirectoryExWFn = BOOL(WINAPI*)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES);
37using RemoveDirectoryWFn = BOOL(WINAPI*)(LPCWSTR);
38using RemoveDirectoryAFn = BOOL(WINAPI*)(LPCSTR);
39using MoveFileWFn = BOOL(WINAPI*)(LPCWSTR, LPCWSTR);
40using MoveFileExWFn = BOOL(WINAPI*)(LPCWSTR, LPCWSTR, DWORD);
41using MoveFileAFn = BOOL(WINAPI*)(LPCSTR, LPCSTR);
42using CopyFileWFn = BOOL(WINAPI*)(LPCWSTR, LPCWSTR, BOOL);
43using CopyFileAFn = BOOL(WINAPI*)(LPCSTR, LPCSTR, BOOL);
44using CopyFileExWFn = BOOL(WINAPI*)(LPCWSTR, LPCWSTR, LPPROGRESS_ROUTINE, LPVOID, LPBOOL, DWORD);
45using CopyFile2Fn = HRESULT(WINAPI*)(PCWSTR, PCWSTR, COPYFILE2_EXTENDED_PARAMETERS*);
46using SetFileAttributesWFn = BOOL(WINAPI*)(LPCWSTR, DWORD);
47using SetFileAttributesAFn = BOOL(WINAPI*)(LPCSTR, DWORD);
29 48
30int g_checks = 0; 49int g_checks = 0;
31int g_failures = 0; 50int g_failures = 0;
@@ -260,6 +279,238 @@ int main() {
260 "the parent folder stays listed after deleting a nested package file"); 279 "the parent folder stays listed after deleting a nested package file");
261 } 280 }
262 281
282 // Deleting one package file must not hide its folder. The overlay has never written to GAME:\pkgonly, so the
283 // folder is only in the package, and its marker folder under .gta6rt-deleted is not a marker for the folder.
284 {
285 write_path(package / "pkgonly" / "a.txt", "package");
286 write_path(package / "pkgonly" / "b.txt", "package");
287 check(delete_w(L"GAME:\\pkgonly\\a.txt") != FALSE, "DeleteFileW hides a file in a package-only folder");
288 const DWORD folder = attributes_w(L"GAME:\\pkgonly");
289 check(folder != INVALID_FILE_ATTRIBUTES && (folder & FILE_ATTRIBUTE_DIRECTORY) != 0,
290 "the folder of a deleted package file still resolves");
291 check(contains(list(first_w, next_w, find_close, L"GAME:\\*"), L"pkgonly"),
292 "and is still in its parent's listing");
293 check(contains(list(first_w, next_w, find_close, L"GAME:\\pkgonly\\*"), L"b.txt"),
294 "and its other files are still listed");
295 const HANDLE h =
296 create_w(L"GAME:\\pkgonly\\b.txt", GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, nullptr);
297 check(h != INVALID_HANDLE_VALUE, "and its other files still open");
298 if (h != INVALID_HANDLE_VALUE) ::CloseHandle(h);
299 }
300
301 // Folders, moves, copies and attributes: the same mapping, through the names a title imports.
302 const auto mkdir_w = resolve<CreateDirectoryWFn>("api-ms-win-core-file-l1-1-0.dll", "CreateDirectoryW");
303 const auto mkdir_a = resolve<CreateDirectoryAFn>("kernel32.dll", "CreateDirectoryA");
304 const auto mkdir_ex_w = resolve<CreateDirectoryExWFn>("kernel32.dll", "CreateDirectoryExW");
305 const auto rmdir_w = resolve<RemoveDirectoryWFn>("api-ms-win-core-file-l1-1-0.dll", "RemoveDirectoryW");
306 const auto rmdir_a = resolve<RemoveDirectoryAFn>("kernelbase.dll", "RemoveDirectoryA");
307 const auto move_w = resolve<MoveFileWFn>("kernel32.dll", "MoveFileW");
308 const auto move_ex_w = resolve<MoveFileExWFn>("api-ms-win-core-file-l2-1-0.dll", "MoveFileExW");
309 const auto move_a = resolve<MoveFileAFn>("kernel32.dll", "MoveFileA");
310 const auto copy_w = resolve<CopyFileWFn>("kernel32.dll", "CopyFileW");
311 const auto copy_a = resolve<CopyFileAFn>("kernel32.dll", "CopyFileA");
312 const auto copy_ex_w = resolve<CopyFileExWFn>("api-ms-win-core-file-l2-1-0.dll", "CopyFileExW");
313 const auto copy2 = resolve<CopyFile2Fn>("api-ms-win-core-file-l2-1-0.dll", "CopyFile2");
314 const auto setattr_w = resolve<SetFileAttributesWFn>("api-ms-win-core-file-l1-1-0.dll", "SetFileAttributesW");
315 const auto setattr_a = resolve<SetFileAttributesAFn>("kernel32.dll", "SetFileAttributesA");
316 check(mkdir_w && mkdir_a && mkdir_ex_w && rmdir_w && rmdir_a && move_w && move_ex_w && move_a && copy_w &&
317 copy_a && copy_ex_w && copy2 && setattr_w && setattr_a,
318 "the folder, move, copy and attribute calls resolve through the registry");
319
320 write_path(package / "misc" / "one.txt", "one");
321 write_path(package / "misc" / "two.txt", "two");
322 write_path(package / "misc" / "three.txt", "three");
323 write_path(package / "misc" / "inner" / "deep.txt", "deep");
324 write_path(package / "misc" / "keep.txt", "keep");
325
326 // CreateDirectory: the new folder is in the overlay; names the title can already see are refused.
327 {
328 check(mkdir_w(L"GAME:\\cache", nullptr) != FALSE, "CreateDirectoryW makes GAME:\\cache");
329 check(std::filesystem::is_directory(overlay / "cache"), "in the overlay");
330 check(!std::filesystem::exists(package / "cache"), "and not in the package");
331 const DWORD a = attributes_w(L"GAME:\\cache");
332 check(a != INVALID_FILE_ATTRIBUTES && (a & FILE_ATTRIBUTE_DIRECTORY) != 0, "the new folder resolves");
333 check(contains(list(first_w, next_w, find_close, L"GAME:\\*"), L"cache"), "and is listed");
334 check(mkdir_a("GAME:\\cache\\narrow", nullptr) != FALSE && std::filesystem::is_directory(overlay / "cache" / "narrow"),
335 "CreateDirectoryA takes a console path");
336 check(mkdir_ex_w(L"GAME:\\misc", L"GAME:\\cache\\from_template", nullptr) != FALSE &&
337 std::filesystem::is_directory(overlay / "cache" / "from_template"),
338 "CreateDirectoryExW maps both the template and the new folder");
339 SetLastError(0);
340 check(mkdir_w(L"GAME:\\misc", nullptr) == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
341 "a folder only the package has already exists");
342 check(!std::filesystem::exists(overlay / "misc"), "and nothing is mirrored for it");
343 SetLastError(0);
344 check(mkdir_w(L"GAME:\\misc\\one.txt", nullptr) == FALSE && GetLastError() == ERROR_ALREADY_EXISTS,
345 "a package file's name already exists");
346 SetLastError(0);
347 check(mkdir_w(L"GAME:\\", nullptr) == FALSE && GetLastError() == ERROR_ALREADY_EXISTS, "GAME:\\ already exists");
348 SetLastError(0);
349 check(mkdir_w(L"GAME:\\nowhere\\child", nullptr) == FALSE && GetLastError() == ERROR_PATH_NOT_FOUND,
350 "a folder whose parent does not exist reports ERROR_PATH_NOT_FOUND");
351 check(!std::filesystem::exists(overlay / "nowhere"), "and leaves no parent behind");
352 check(mkdir_w(L"GAME:\\misc\\made", nullptr) != FALSE && std::filesystem::is_directory(overlay / "misc" / "made"),
353 "a new folder inside a package folder lands in the overlay");
354 }
355
356 // RemoveDirectory: an overlay folder goes; a package folder is hidden by a marker once it is empty.
357 {
358 check(rmdir_w(L"GAME:\\cache\\narrow") != FALSE && !std::filesystem::exists(overlay / "cache" / "narrow"),
359 "RemoveDirectoryW removes an empty overlay folder");
360 SetLastError(0);
361 check(rmdir_w(L"GAME:\\cache\\narrow") == FALSE && GetLastError() == ERROR_FILE_NOT_FOUND,
362 "removing it again reports ERROR_FILE_NOT_FOUND");
363 SetLastError(0);
364 check(rmdir_w(L"GAME:\\misc\\inner") == FALSE && GetLastError() == ERROR_DIR_NOT_EMPTY,
365 "a package folder with files is not empty");
366 SetLastError(0);
367 check(rmdir_w(L"GAME:\\misc\\keep.txt") == FALSE && GetLastError() == ERROR_DIRECTORY,
368 "a file is not a folder");
369 SetLastError(0);
370 check(rmdir_w(L"GAME:\\") == FALSE && GetLastError() == ERROR_ACCESS_DENIED, "GAME:\\ cannot be removed");
371 check(delete_w(L"GAME:\\misc\\inner\\deep.txt") != FALSE, "once its file is deleted");
372 check(rmdir_a("GAME:\\misc\\inner") != FALSE, "RemoveDirectoryA removes the now empty package folder");
373 check(std::filesystem::exists(package / "misc" / "inner" / "deep.txt"), "the package keeps the folder and file");
374 SetLastError(0);
375 check(attributes_w(L"GAME:\\misc\\inner") == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND,
376 "the removed folder no longer resolves");
377 check(!contains(list(first_w, next_w, find_close, L"GAME:\\misc\\*"), L"inner"), "and is not listed");
378 const DWORD misc = attributes_w(L"GAME:\\misc");
379 check(misc != INVALID_FILE_ATTRIBUTES && (misc & FILE_ATTRIBUTE_DIRECTORY) != 0, "its parent is still there");
380 check(mkdir_w(L"GAME:\\misc\\inner", nullptr) != FALSE, "the removed name can be made again");
381 check(list(first_w, next_w, find_close, L"GAME:\\misc\\inner\\*").size() == 2,
382 "and the new folder is empty: only . and ..");
383 }
384
385 // MoveFile: the destination is in the overlay; a moved package file is deleted by a marker.
386 {
387 check(move_w(L"GAME:\\misc\\one.txt", L"GAME:\\misc\\moved.txt") != FALSE, "MoveFileW moves a package file");
388 check(read_path(overlay / "misc" / "moved.txt") == "one", "its bytes are in the overlay under the new name");
389 check(read_path(package / "misc" / "one.txt") == "one", "the package file is not modified");
390 SetLastError(0);
391 check(attributes_w(L"GAME:\\misc\\one.txt") == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND,
392 "the old name is gone");
393 SetLastError(0);
394 check(move_ex_w(L"GAME:\\misc\\moved.txt", L"GAME:\\misc\\two.txt", 0) == FALSE &&
395 GetLastError() == ERROR_ALREADY_EXISTS,
396 "MoveFileExW will not replace a package file without MOVEFILE_REPLACE_EXISTING");
397 check(move_ex_w(L"GAME:\\misc\\moved.txt", L"GAME:\\misc\\two.txt", MOVEFILE_REPLACE_EXISTING) != FALSE,
398 "and replaces it with the flag");
399 HANDLE h = create_w(L"GAME:\\misc\\two.txt", GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, nullptr);
400 check(h != INVALID_HANDLE_VALUE && read_handle(h) == "one", "the replaced name reads the moved bytes");
401 if (h != INVALID_HANDLE_VALUE) ::CloseHandle(h);
402 check(read_path(package / "misc" / "two.txt") == "two", "the package's own two.txt is untouched");
403 check(!std::filesystem::exists(overlay / "misc" / "moved.txt"), "the overlay source of the move is gone");
404 check(move_a("GAME:\\misc\\three.txt", "GAME:\\cache\\three.txt") != FALSE &&
405 read_path(overlay / "cache" / "three.txt") == "three",
406 "MoveFileA moves into another folder");
407 check(move_w(L"GAME:\\cache\\from_template", L"GAME:\\cache\\renamed") != FALSE &&
408 std::filesystem::is_directory(overlay / "cache" / "renamed"),
409 "an overlay folder is renamed");
410 SetLastError(0);
411 check(move_w(L"GAME:\\misc", L"GAME:\\misc2") == FALSE && GetLastError() == ERROR_ACCESS_DENIED,
412 "a package folder is not moved");
413 SetLastError(0);
414 check(move_w(L"GAME:\\misc\\keep.txt", (root / "host.txt").c_str()) == FALSE &&
415 GetLastError() == ERROR_NOT_SAME_DEVICE,
416 "a move between GAME: and a host path is refused as cross-volume");
417 SetLastError(0);
418 check(move_ex_w(L"GAME:\\misc\\keep.txt", nullptr, MOVEFILE_DELAY_UNTIL_REBOOT) == FALSE &&
419 GetLastError() == ERROR_INVALID_PARAMETER,
420 "a boot-time delete of a console file is refused");
421 SetLastError(0);
422 check(move_w(L"GAME:\\misc\\gone.txt", L"GAME:\\misc\\x.txt") == FALSE && GetLastError() == ERROR_FILE_NOT_FOUND,
423 "moving a missing file reports ERROR_FILE_NOT_FOUND");
424 SetLastError(0);
425 check(move_w(L"GAME:\\misc\\keep.txt", L"GAME:\\nowhere\\keep.txt") == FALSE &&
426 GetLastError() == ERROR_PATH_NOT_FOUND,
427 "moving into a missing folder reports ERROR_PATH_NOT_FOUND");
428 }
429
430 // MOVEFILE_WRITE_THROUGH on a package file: the copy and the marker are flushed before the call returns.
431 {
432 write_path(package / "misc" / "wt.txt", "wt");
433 check(move_ex_w(L"GAME:\\misc\\wt.txt", L"GAME:\\misc\\wt_moved.txt", MOVEFILE_WRITE_THROUGH) != FALSE,
434 "MoveFileExW with MOVEFILE_WRITE_THROUGH moves a package file");
435 check(read_path(overlay / "misc" / "wt_moved.txt") == "wt", "its bytes are in the overlay");
436 SetLastError(0);
437 check(attributes_w(L"GAME:\\misc\\wt.txt") == INVALID_FILE_ATTRIBUTES && GetLastError() == ERROR_FILE_NOT_FOUND,
438 "and the old name is deleted");
439 }
440
441 // CopyFile: reads where a read would, writes the overlay; an existing name counts even if only the package has it.
442 {
443 check(copy_w(L"GAME:\\misc\\keep.txt", L"GAME:\\cache\\keep_copy.txt", TRUE) != FALSE &&
444 read_path(overlay / "cache" / "keep_copy.txt") == "keep",
445 "CopyFileW copies a package file into the overlay");
446 check(read_path(package / "misc" / "keep.txt") == "keep", "and the source stays");
447 SetLastError(0);
448 check(copy_w(L"GAME:\\misc\\keep.txt", L"GAME:\\data\\sub", FALSE) == FALSE && GetLastError() == ERROR_ACCESS_DENIED,
449 "a copy onto a folder is refused");
450 write_path(package / "misc" / "target.txt", "target");
451 SetLastError(0);
452 check(copy_w(L"GAME:\\misc\\keep.txt", L"GAME:\\misc\\target.txt", TRUE) == FALSE &&
453 GetLastError() == ERROR_FILE_EXISTS,
454 "fail-if-exists sees a name only the package has");
455 check(copy_a("GAME:\\misc\\keep.txt", "GAME:\\misc\\target.txt", FALSE) != FALSE &&
456 read_path(overlay / "misc" / "target.txt") == "keep" && read_path(package / "misc" / "target.txt") == "target",
457 "CopyFileA overwrites through the overlay and leaves the package file alone");
458 const std::filesystem::path host_copy = root / "host_copy.txt";
459 check(copy_w(L"GAME:\\misc\\keep.txt", host_copy.c_str(), TRUE) != FALSE && read_path(host_copy) == "keep",
460 "a copy from GAME: to a host path works");
461 check(copy_ex_w(host_copy.c_str(), L"GAME:\\cache\\from_host.txt", nullptr, nullptr, nullptr, COPY_FILE_FAIL_IF_EXISTS) !=
462 FALSE &&
463 read_path(overlay / "cache" / "from_host.txt") == "keep",
464 "CopyFileExW copies from a host path into GAME:");
465 COPYFILE2_EXTENDED_PARAMETERS params{};
466 params.dwSize = sizeof(params);
467 params.dwCopyFlags = COPY_FILE_FAIL_IF_EXISTS;
468 check(copy2(L"GAME:\\misc\\keep.txt", L"GAME:\\cache\\copy2.txt", &params) == S_OK &&
469 read_path(overlay / "cache" / "copy2.txt") == "keep",
470 "CopyFile2 copies too");
471 check(copy2(L"GAME:\\misc\\keep.txt", L"GAME:\\misc\\two.txt", &params) == HRESULT_FROM_WIN32(ERROR_FILE_EXISTS),
472 "and returns its HRESULT for an existing name");
473 SetLastError(0);
474 check(copy_w(L"GAME:\\misc\\one.txt", L"GAME:\\cache\\one.txt", FALSE) == FALSE && GetLastError() == ERROR_FILE_NOT_FOUND,
475 "a deleted name cannot be copied");
476 }
477
478 // SetFileAttributes: the overlay copy gets the attributes; the package keeps its own.
479 {
480 const DWORD before = ::GetFileAttributesW((package / "misc" / "keep.txt").c_str());
481 check(setattr_w(L"GAME:\\misc\\keep.txt", FILE_ATTRIBUTE_READONLY) != FALSE, "SetFileAttributesW on a package file");
482 const DWORD now = attributes_w(L"GAME:\\misc\\keep.txt");
483 check(now != INVALID_FILE_ATTRIBUTES && (now & FILE_ATTRIBUTE_READONLY) != 0, "the title sees the new attributes");
484 check(read_path(overlay / "misc" / "keep.txt") == "keep", "on a copy of the file in the overlay");
485 check(::GetFileAttributesW((package / "misc" / "keep.txt").c_str()) == before, "the package file keeps its own");
486 check(setattr_a("GAME:\\misc\\keep.txt", FILE_ATTRIBUTE_NORMAL) != FALSE &&
487 (attributes_w(L"GAME:\\misc\\keep.txt") & FILE_ATTRIBUTE_READONLY) == 0,
488 "SetFileAttributesA changes the overlay copy back");
489 check(setattr_w(L"GAME:\\data\\sub", FILE_ATTRIBUTE_HIDDEN) != FALSE &&
490 (attributes_w(L"GAME:\\data\\sub") & FILE_ATTRIBUTE_HIDDEN) != 0,
491 "a package folder's attributes are set on an overlay mirror");
492 check(count(list(first_w, next_w, find_close, L"GAME:\\data\\*"), L"sub") == 1, "which is listed once");
493 SetLastError(0);
494 check(setattr_w(L"GAME:\\misc\\one.txt", FILE_ATTRIBUTE_NORMAL) == FALSE && GetLastError() == ERROR_FILE_NOT_FOUND,
495 "a deleted name has no attributes to set");
496 }
497
498 // Nothing leaves the package and the overlay.
499 {
500 SetLastError(0);
501 check(mkdir_w(L"GAME:\\..\\escape_dir", nullptr) == FALSE && GetLastError() == ERROR_INVALID_NAME &&
502 !std::filesystem::exists(root / "escape_dir"),
503 "a folder above GAME: is refused");
504 SetLastError(0);
505 check(move_w(L"GAME:\\misc\\keep.txt", L"GAME:\\..\\escape.txt") == FALSE && GetLastError() == ERROR_INVALID_NAME,
506 "a move above GAME: is refused");
507 SetLastError(0);
508 check(copy_w(L"GAME:\\misc\\keep.txt", L"GAME:\\C:\\x", FALSE) == FALSE && GetLastError() == ERROR_INVALID_NAME,
509 "a copy to a drive inside GAME: is refused");
510 SetLastError(0);
511 check(rmdir_w(L"GAME:\\..") == FALSE && GetLastError() == ERROR_INVALID_NAME, "removing above GAME: is refused");
512 }
513
263 // Nothing leaves the package and the overlay. 514 // Nothing leaves the package and the overlay.
264 { 515 {
265 SetLastError(0); 516 SetLastError(0);
@@ -284,6 +535,78 @@ int main() {
284 "a null listing buffer is refused"); 535 "a null listing buffer is refused");
285 } 536 }
286 537
538 // CreateFile2 and FindFirstFileExA/W (used by GDK/OneCore titles and std::filesystem).
539 {
540 const auto create2 = resolve<CreateFile2Fn>("api-ms-win-core-file-l1-2-0.dll", "CreateFile2");
541 const auto first_ex_w = resolve<FindFirstFileExWFn>("api-ms-win-core-file-l1-1-0.dll", "FindFirstFileExW");
542 const auto first_ex_a = resolve<FindFirstFileExAFn>("kernelbase.dll", "FindFirstFileExA");
543 check(create2 && first_ex_w && first_ex_a, "CreateFile2 and FindFirstFileExA/W are registered");
544
545 // CreateFile2 reads an untouched package file without modifying it.
546 write_path(package / "data" / "cf2_pkg.txt", "pkg-cf2");
547 CREATEFILE2_EXTENDED_PARAMETERS ext{};
548 ext.dwSize = sizeof(ext);
549 ext.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
550 const HANDLE h_read = create2(L"GAME:\\data\\cf2_pkg.txt", GENERIC_READ, FILE_SHARE_READ, OPEN_EXISTING, &ext);
551 check(h_read != INVALID_HANDLE_VALUE && read_handle(h_read) == "pkg-cf2",
552 "CreateFile2 reads a GAME: file from the package");
553 if (h_read != INVALID_HANDLE_VALUE) ::CloseHandle(h_read);
554
555 // CreateFile2 write goes to the overlay, leaving the package untouched.
556 const HANDLE h_write = create2(L"GAME:\\data\\cf2.txt", GENERIC_WRITE, 0, CREATE_ALWAYS, &ext);
557 check(h_write != INVALID_HANDLE_VALUE, "CreateFile2 creates a new GAME: file in the overlay");
558 if (h_write != INVALID_HANDLE_VALUE) {
559 DWORD written = 0;
560 ::WriteFile(h_write, "cf2", 3, &written, nullptr);
561 ::CloseHandle(h_write);
562 }
563 check(read_path(overlay / "data" / "cf2.txt") == "cf2" && !std::filesystem::exists(package / "data" / "cf2.txt"),
564 "CreateFile2 writes land in the overlay and never in the package");
565
566 // CreateFile2 refuses path traversal.
567 SetLastError(0);
568 const HANDLE h_esc = create2(L"GAME:\\..\\cf2_escape.txt", GENERIC_WRITE, 0, CREATE_ALWAYS, &ext);
569 check(h_esc == INVALID_HANDLE_VALUE && GetLastError() == ERROR_INVALID_NAME,
570 "CreateFile2 refuses a path above GAME:");
571 if (h_esc != INVALID_HANDLE_VALUE) ::CloseHandle(h_esc);
572
573 // FindFirstFileExW merges package + overlay and honours FindExInfoBasic & FindExSearchLimitToDirectories.
574 WIN32_FIND_DATAW fd{};
575 std::vector<std::wstring> basic_names;
576 bool alt_empty = true;
577 HANDLE hf = first_ex_w(L"GAME:\\data\\*", FindExInfoBasic, &fd, FindExSearchNameMatch, nullptr, 0);
578 check(hf != INVALID_HANDLE_VALUE, "FindFirstFileExW opens a GAME: directory listing");
579 if (hf != INVALID_HANDLE_VALUE) {
580 do {
581 basic_names.emplace_back(fd.cFileName);
582 if (fd.cAlternateFileName[0] != L'\0') alt_empty = false;
583 } while (next_w(hf, &fd));
584 find_close(hf);
585 }
586 check(contains(basic_names, L"hello.txt") && contains(basic_names, L"cf2.txt") && !contains(basic_names, L"bye.txt"),
587 "FindFirstFileExW merges overlay + package and hides deleted files");
588 check(alt_empty, "FindFirstFileExW(FindExInfoBasic) leaves cAlternateFileName empty");
589
590 std::vector<std::wstring> dir_names;
591 HANDLE hdir = first_ex_w(L"GAME:\\data\\*", FindExInfoStandard, &fd, FindExSearchLimitToDirectories, nullptr, 0);
592 check(hdir != INVALID_HANDLE_VALUE, "FindFirstFileExW(FindExSearchLimitToDirectories) succeeds");
593 if (hdir != INVALID_HANDLE_VALUE) {
594 do {
595 dir_names.emplace_back(fd.cFileName);
596 } while (next_w(hdir, &fd));
597 find_close(hdir);
598 }
599 check(contains(dir_names, L"sub") && !contains(dir_names, L"hello.txt"),
600 "FindFirstFileExW(FindExSearchLimitToDirectories) returns only directories");
601
602 // FindFirstFileExA works on GAME: paths too.
603 WIN32_FIND_DATAA fda{};
604 HANDLE hfa = first_ex_a("GAME:\\data\\cf2.txt", FindExInfoBasic, &fda, FindExSearchNameMatch, nullptr, 0);
605 check(hfa != INVALID_HANDLE_VALUE && std::string(fda.cFileName) == "cf2.txt",
606 "FindFirstFileExA finds an overlay file under GAME:");
607 if (hfa != INVALID_HANDLE_VALUE) find_close(hfa);
608 }
609
287 std::filesystem::remove_all(root); 610 std::filesystem::remove_all(root);
288 std::printf("%d check(s), %d failure(s)\n", g_checks, g_failures); 611 std::printf("%d check(s), %d failure(s)\n", g_checks, g_failures);
289 return g_failures == 0 ? 0 : 1; 612 return g_failures == 0 ? 0 : 1;
diff --git a/runtime/test/fixtures/tiny_bundled_load.cpp b/runtime/test/fixtures/tiny_bundled_load.cpp
index 51fbaac72..f2a3b7f36 100644
--- a/runtime/test/fixtures/tiny_bundled_load.cpp
+++ b/runtime/test/fixtures/tiny_bundled_load.cpp
@@ -27,6 +27,15 @@ int main() {
27 if (GetModuleHandleW(L"tiny_bundled_dll.dll") != nullptr) 27 if (GetModuleHandleW(L"tiny_bundled_dll.dll") != nullptr)
28 return fail("GetModuleHandleW before LoadLibrary should be NULL", 0); 28 return fail("GetModuleHandleW before LoadLibrary should be NULL", 0);
29 29
30 // DONT_RESOLVE_DLL_REFERENCES must fail explicitly rather than silently resolving imports and running DllMain.
31 SetLastError(0);
32 if (LoadLibraryExW(L"tiny_bundled_dll.dll", nullptr, DONT_RESOLVE_DLL_REFERENCES) != nullptr ||
33 GetLastError() != ERROR_NOT_SUPPORTED) {
34 return fail("LoadLibraryExW(DONT_RESOLVE_DLL_REFERENCES) fails with ERROR_NOT_SUPPORTED", GetLastError());
35 }
36 if (GetModuleHandleW(L"tiny_bundled_dll.dll") != nullptr)
37 return fail("DONT_RESOLVE_DLL_REFERENCES must not map or register the bundled DLL", 0);
38
30 HMODULE mod = LoadLibraryW(L"tiny_bundled_dll.dll"); 39 HMODULE mod = LoadLibraryW(L"tiny_bundled_dll.dll");
31 if (!mod) return fail("LoadLibraryW(tiny_bundled_dll.dll)", GetLastError()); 40 if (!mod) return fail("LoadLibraryW(tiny_bundled_dll.dll)", GetLastError());
32 41
diff --git a/runtime/test/fixtures/tiny_gdk_load.cpp b/runtime/test/fixtures/tiny_gdk_load.cpp
index 291d3a5d7..f4c6a163c 100644
--- a/runtime/test/fixtures/tiny_gdk_load.cpp
+++ b/runtime/test/fixtures/tiny_gdk_load.cpp
@@ -68,10 +68,32 @@ int main() {
68 reinterpret_cast<Close>(vtable[17])(obj, queue); 68 reinterpret_cast<Close>(vtable[17])(obj, queue);
69 reinterpret_cast<Release>(vtable[2])(obj); 69 reinterpret_cast<Release>(vtable[2])(obj);
70 70
71 // A class not served yet (XNetworkingImpl) is refused, with the out pointer cleared. 71 // XNetworkingImpl is served through QueryApiImpl (slot 15: XNetworkingGetConnectivityHint).
72 const GUID networking = {0x37e56907, 0x2f10, 0x41e8, {0xb7, 0x2f, 0x36, 0xed, 0xb1, 0x85, 0x33, 0x1a}}; 72 const GUID networking = {0x37e56907, 0x2f10, 0x41e8, {0xb7, 0x2f, 0x36, 0xed, 0xb1, 0x85, 0x33, 0x1a}};
73 void* net_obj = nullptr;
74 hr = query(&networking, networking, &net_obj);
75 if (hr != S_OK || !net_obj)
76 return fail("QueryApiImpl hands out XNetworkingImpl", static_cast<unsigned long>(hr));
77 void* const* net_vtable = *static_cast<void* const* const*>(net_obj);
78 struct Hint {
79 UINT32 level;
80 UINT32 cost;
81 UINT32 iana;
82 bool init;
83 bool appr;
84 bool over;
85 bool roam;
86 } hint{};
87 using GetHint = HRESULT(STDMETHODCALLTYPE*)(void*, Hint*);
88 hr = reinterpret_cast<GetHint>(net_vtable[15])(net_obj, &hint);
89 if (hr != S_OK || !hint.init)
90 return fail("XNetworkingImpl slot 15 (XNetworkingGetConnectivityHint)", static_cast<unsigned long>(hr));
91 reinterpret_cast<Release>(net_vtable[2])(net_obj);
92
93 // A class not served yet (an unprovided class id) is refused, with the out pointer cleared.
94 const GUID unprovided = {0x973a344e, 0x24bf, 0x4d0f, {0x84, 0x57, 0x56, 0xc5, 0x34, 0x89, 0x2b, 0x29}};
73 void* out = reinterpret_cast<void*>(1); 95 void* out = reinterpret_cast<void*>(1);
74 hr = query(&networking, networking, &out); 96 hr = query(&unprovided, unprovided, &out);
75 if (hr != static_cast<HRESULT>(0x80070032) || out != nullptr) 97 if (hr != static_cast<HRESULT>(0x80070032) || out != nullptr)
76 return fail("QueryApiImpl refuses an unprovided class and clears its out pointer", static_cast<unsigned long>(hr)); 98 return fail("QueryApiImpl refuses an unprovided class and clears its out pointer", static_cast<unsigned long>(hr));
77 hr = uninit(); 99 hr = uninit();
diff --git a/runtime/test/fixtures/tiny_tls_cb_only.cpp b/runtime/test/fixtures/tiny_tls_cb_only.cpp
new file mode 100644
index 000000000..d8062c073
--- /dev/null
+++ b/runtime/test/fixtures/tiny_tls_cb_only.cpp
@@ -0,0 +1,42 @@
1// Callback-only static TLS fixture DLL: defines _tls_used with StartAddressOfRawData == EndAddressOfRawData == 0
2// and SizeOfZeroFill == 0 while providing a TLS callback (no CRT .tls section). Ordinary test code, not game data.
3#include <windows.h>
4
5namespace {
6
7ULONG g_tls_index = 0;
8int g_attach_count = 0;
9int g_detach_count = 0;
10volatile DWORD g_watched_thread = 0;
11int g_thread_attach_count = 0;
12int g_thread_detach_count = 0;
13
14void NTAPI tls_callback(PVOID, DWORD reason, PVOID) {
15 if (reason == DLL_PROCESS_ATTACH) ++g_attach_count;
16 if (reason == DLL_PROCESS_DETACH) ++g_detach_count;
17 if (GetCurrentThreadId() == g_watched_thread) {
18 if (reason == DLL_THREAD_ATTACH) ++g_thread_attach_count;
19 if (reason == DLL_THREAD_DETACH) ++g_thread_detach_count;
20 }
21}
22
23PIMAGE_TLS_CALLBACK g_callbacks[] = {tls_callback, nullptr};
24
25} // namespace
26
27extern "C" const IMAGE_TLS_DIRECTORY64 _tls_used = {
28 0, // StartAddressOfRawData
29 0, // EndAddressOfRawData
30 reinterpret_cast<ULONGLONG>(&g_tls_index), // AddressOfIndex
31 reinterpret_cast<ULONGLONG>(g_callbacks), // AddressOfCallBacks
32 0, // SizeOfZeroFill
33 0, // Characteristics
34};
35
36extern "C" __declspec(dllexport) void __cdecl tiny_tls_cb_watch_thread(DWORD id) { g_watched_thread = id; }
37extern "C" __declspec(dllexport) int __cdecl tiny_tls_cb_attach_count() { return g_attach_count; }
38extern "C" __declspec(dllexport) int __cdecl tiny_tls_cb_detach_count() { return g_detach_count; }
39extern "C" __declspec(dllexport) int __cdecl tiny_tls_cb_thread_attach_count() { return g_thread_attach_count; }
40extern "C" __declspec(dllexport) int __cdecl tiny_tls_cb_thread_detach_count() { return g_thread_detach_count; }
41
42extern "C" BOOL WINAPI DllMainCRTStartup(HINSTANCE, DWORD, LPVOID) { return TRUE; }
diff --git a/runtime/test/frame_pacer_test.cpp b/runtime/test/frame_pacer_test.cpp
index b1b5d7432..1226e513d 100644
--- a/runtime/test/frame_pacer_test.cpp
+++ b/runtime/test/frame_pacer_test.cpp
@@ -441,6 +441,31 @@ int main() {
441 EXPECT(stats[0].time_us == 5 * period && stats[0].percent_scanned == 0.0f); 441 EXPECT(stats[0].time_us == 5 * period && stats[0].percent_scanned == 0.0f);
442 } 442 }
443 443
444 // Rescheduling changes future origins but not the vblank an issued token was due at.
445 {
446 ManualFrameClock clock;
447 FramePacer pacer(clock);
448 EXPECT(setup(pacer, 1, period / 4));
449 clock.advance_us(period + period / 4);
450 std::uint64_t token = 0;
451 EXPECT(pacer.wait_frame_event(frame_event_origin, 0, 0, &token) == pacer_hr::ok);
452 EXPECT(pacer.schedule_frame_event(frame_event_origin, period / 2, 0) == pacer_hr::ok);
453
454 clock.advance_us(3 * period / 4); // vblank 2, still the deadline of the original token
455 EXPECT(pacer.present_timing(token).late_us == 0);
456 clock.advance_us(period / 4);
457 const auto timing = pacer.present_timing(token);
458 EXPECT(timing.late_us == period / 4);
459 const auto sync = decide_present_sync(timing.late_us, timing.period_us, 30.0f);
460 EXPECT(sync == PresentSync::immediate);
461 pacer.commit_present_token(token, 1, sync);
462
463 FrameStatistic display{};
464 std::uint32_t count = 1;
465 EXPECT(pacer.get_frame_statistics(token, stat_display, &count, &display) == pacer_hr::ok);
466 EXPECT(count == 1 && display.percent_scanned == 25.0f);
467 }
468
444 // A frame behind one that still waits for its vblank cannot be shown at once (it would overtake it): not late. 469 // A frame behind one that still waits for its vblank cannot be shown at once (it would overtake it): not late.
445 { 470 {
446 ManualFrameClock clock; 471 ManualFrameClock clock;
diff --git a/runtime/test/gameinput_test.cpp b/runtime/test/gameinput_test.cpp
index f525d1cb9..a65b444a1 100644
--- a/runtime/test/gameinput_test.cpp
+++ b/runtime/test/gameinput_test.cpp
@@ -393,6 +393,33 @@ void test_keyboard_pad_sticks(IGameInput* input, IGameInputDevice* kb) {
393 } 393 }
394 check(monotonic && polls < 100 && sticks_at_rest(st), "keyboard pad: right stick decays to 0 when the mouse stops"); 394 check(monotonic && polls < 100 && sticks_at_rest(st), "keyboard pad: right stick decays to 0 when the mouse stops");
395 395
396 // LEONIDA_MOUSE_SENSITIVITY scales the axis units per count: 2 doubles, 0.5 halves; out of range clamps.
397 auto settle = [&] {
398 for (int i = 0; i < 200 && !sticks_at_rest(pad_state(input, kb)); ++i) rt::gameinput::poll();
399 };
400 set_env("LEONIDA_MOUSE_SENSITIVITY", "2");
401 rt::gameinput::reload_config();
402 g_cursor_x += 10;
403 rt::gameinput::poll();
404 check(approx(pad_state(input, kb).rightThumbstickX, 20480 / 32767.0f), "keyboard pad: mouse sensitivity 2 doubles the stick");
405 settle();
406 set_env("LEONIDA_MOUSE_SENSITIVITY", "0.5");
407 rt::gameinput::reload_config();
408 g_cursor_x -= 10;
409 rt::gameinput::poll();
410 check(approx(pad_state(input, kb).rightThumbstickX, -5120 / 32767.0f), "keyboard pad: mouse sensitivity 0.5 halves the stick");
411 settle();
412 set_env("LEONIDA_MOUSE_SENSITIVITY", "100");
413 rt::gameinput::reload_config();
414 check(rt::gameinput::config().mouse_sensitivity == 10.0f, "keyboard pad: mouse sensitivity clamps to 10");
415 set_env("LEONIDA_MOUSE_SENSITIVITY", "0");
416 rt::gameinput::reload_config();
417 check(approx(rt::gameinput::config().mouse_sensitivity, 0.1f), "keyboard pad: mouse sensitivity clamps to 0.1");
418 set_env("LEONIDA_MOUSE_SENSITIVITY", nullptr);
419 rt::gameinput::reload_config();
420 check(rt::gameinput::config().mouse_sensitivity == 1.0f && rt::gameinput::config().ds_trigger_gain == 1.0f,
421 "keyboard pad: mouse sensitivity defaults to 1 and leaves the trigger gain alone");
422
396 g_keys[VK_RBUTTON] = true; 423 g_keys[VK_RBUTTON] = true;
397 rt::gameinput::poll(); 424 rt::gameinput::poll();
398 st = pad_state(input, kb); 425 st = pad_state(input, kb);
@@ -608,6 +635,20 @@ void test_aggregate_device(IGameInput* input) {
608 IGameInputReading* r = nullptr; 635 IGameInputReading* r = nullptr;
609 check(input->GetCurrentReading(GameInputKindGamepad, agg, &r) == GAMEINPUT_E_READING_NOT_FOUND && !r, 636 check(input->GetCurrentReading(GameInputKindGamepad, agg, &r) == GAMEINPUT_E_READING_NOT_FOUND && !r,
610 "aggregate device returns READING_NOT_FOUND when no pads are connected"); 637 "aggregate device returns READING_NOT_FOUND when no pads are connected");
638 check(input->GetCurrentReading(GameInputKindKeyboard, agg, &r) == GAMEINPUT_E_READING_NOT_FOUND && !r,
639 "aggregate device returns READING_NOT_FOUND for kind mismatch with no pads");
640
641 // Callback registration guards for aggregate device
642 GameInputCallbackToken reading_tok = 0xbeef;
643 check(input->RegisterReadingCallback(agg, GameInputKindGamepad, 0.0f, nullptr, on_reading, &reading_tok) == E_NOTIMPL &&
644 reading_tok == kInvalidCallbackToken,
645 "RegisterReadingCallback rejects aggregate device with E_NOTIMPL and invalid token");
646
647 GameInputCallbackToken device_tok = 0xbeef;
648 check(input->RegisterDeviceCallback(agg, GameInputKindGamepad, GameInputDeviceConnected,
649 GameInputBlockingEnumeration, nullptr, on_device, &device_tok) == E_NOTIMPL &&
650 device_tok == kInvalidCallbackToken,
651 "RegisterDeviceCallback rejects aggregate device with E_NOTIMPL and invalid token");
611 652
612 // Attach a virtual pad and verify aggregate device yields readings from it 653 // Attach a virtual pad and verify aggregate device yields readings from it
613 Pad xbox; 654 Pad xbox;
@@ -624,6 +665,10 @@ void test_aggregate_device(IGameInput* input) {
624 r->Release(); 665 r->Release();
625 } 666 }
626 667
668 IGameInputReading* r_mismatch = nullptr;
669 check(input->GetCurrentReading(GameInputKindKeyboard, agg, &r_mismatch) == GAMEINPUT_E_READING_NOT_FOUND && !r_mismatch,
670 "aggregate device rejects kind mismatch even when pad is connected");
671
627 SDL_SetJoystickVirtualButton(xbox.js, SDL_GAMEPAD_BUTTON_SOUTH, false); 672 SDL_SetJoystickVirtualButton(xbox.js, SDL_GAMEPAD_BUTTON_SOUTH, false);
628 rt::gameinput::poll(); 673 rt::gameinput::poll();
629 IGameInputReading* r2 = nullptr; 674 IGameInputReading* r2 = nullptr;
@@ -1062,6 +1107,17 @@ int main() {
1062 check(input->GetPreviousReading(idle, GameInputKindGamepad, dev, nullptr) == E_POINTER && 1107 check(input->GetPreviousReading(idle, GameInputKindGamepad, dev, nullptr) == E_POINTER &&
1063 input->GetPreviousReading(nullptr, GameInputKindGamepad, dev, &hit) == E_INVALIDARG && !hit, 1108 input->GetPreviousReading(nullptr, GameInputKindGamepad, dev, &hit) == E_INVALIDARG && !hit,
1064 "history: a null output is E_POINTER, a null reference E_INVALIDARG"); 1109 "history: a null output is E_POINTER, a null reference E_INVALIDARG");
1110 // GetTemporalReading: E_NOTIMPL with a null reading, as GameInput v0 itself, for a timestamp in the history, one
1111 // before it and the current time, with and without a device filter.
1112 const uint64_t idle_us = idle->GetTimestamp();
1113 bool temporal_notimpl = true;
1114 for (const uint64_t at : {idle_us, idle_us - 1'000'000, input->GetCurrentTimestamp()})
1115 for (IGameInputDevice* filter : {dev, static_cast<IGameInputDevice*>(nullptr)}) {
1116 IGameInputReading* temporal = idle; // a stale value the call must clear
1117 temporal_notimpl &= input->GetTemporalReading(at, filter, &temporal) == E_NOTIMPL && !temporal;
1118 }
1119 check(temporal_notimpl && input->GetTemporalReading(idle_us, dev, nullptr) == E_POINTER,
1120 "history: GetTemporalReading is E_NOTIMPL with a null reading, as in GameInput v0");
1065 1121
1066 // Two pads in one stream, one poll each: A on the Xbox pad, B on the DualSense, Y on the Xbox pad. 1122 // Two pads in one stream, one poll each: A on the Xbox pad, B on the DualSense, Y on the Xbox pad.
1067 IGameInputReading* start = current(input, dev); 1123 IGameInputReading* start = current(input, dev);
diff --git a/runtime/test/gfx10_descriptors_test.cpp b/runtime/test/gfx10_descriptors_test.cpp
index d651e885b..48724afae 100644
--- a/runtime/test/gfx10_descriptors_test.cpp
+++ b/runtime/test/gfx10_descriptors_test.cpp
@@ -209,6 +209,55 @@ int main() {
209 CHECK(vulkan_view_format(VK_FORMAT_R8G8B8A8_UINT, 20, true) == VK_FORMAT_R32_UINT); 209 CHECK(vulkan_view_format(VK_FORMAT_R8G8B8A8_UINT, 20, true) == VK_FORMAT_R32_UINT);
210 CHECK(vulkan_view_format(VK_FORMAT_UNDEFINED, 56) == VK_FORMAT_UNDEFINED); 210 CHECK(vulkan_view_format(VK_FORMAT_UNDEFINED, 56) == VK_FORMAT_UNDEFINED);
211 211
212 // Depth/stencil images are only compatible with their own format, even with allow_channel_cast = true,
213 // and colour images never resolve to a depth/stencil view format.
214 for (const VkFormat ds : {VK_FORMAT_D16_UNORM, VK_FORMAT_X8_D24_UNORM_PACK32, VK_FORMAT_D32_SFLOAT,
215 VK_FORMAT_S8_UINT, VK_FORMAT_D16_UNORM_S8_UINT, VK_FORMAT_D24_UNORM_S8_UINT,
216 VK_FORMAT_D32_SFLOAT_S8_UINT})
217 CHECK(is_depth_stencil_format(ds));
218 for (const VkFormat colour : {VK_FORMAT_R16_UNORM, VK_FORMAT_R16_SFLOAT, VK_FORMAT_R32_SFLOAT, VK_FORMAT_R32_UINT,
219 VK_FORMAT_R8_UINT, VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_UNDEFINED})
220 CHECK(!is_depth_stencil_format(colour));
221 for (const bool cast : {false, true}) {
222 CHECK(vulkan_view_format(VK_FORMAT_D16_UNORM, 7, cast) == VK_FORMAT_D16_UNORM);
223 for (const std::uint32_t bad_d16 : {8u, 11u, 12u, 13u, 1u, 20u, 22u, 56u, 141u, 146u})
224 CHECK(vulkan_view_format(VK_FORMAT_D16_UNORM, bad_d16, cast) == VK_FORMAT_UNDEFINED);
225 CHECK(vulkan_view_format(VK_FORMAT_D32_SFLOAT, 22, cast) == VK_FORMAT_D32_SFLOAT);
226 for (const std::uint32_t bad_d32 : {20u, 21u, 7u, 13u, 56u, 141u, 146u})
227 CHECK(vulkan_view_format(VK_FORMAT_D32_SFLOAT, bad_d32, cast) == VK_FORMAT_UNDEFINED);
228 CHECK(vulkan_view_format(VK_FORMAT_D24_UNORM_S8_UINT, 141, cast) == VK_FORMAT_D24_UNORM_S8_UINT);
229 CHECK(vulkan_view_format(VK_FORMAT_X8_D24_UNORM_PACK32, 141, cast) == VK_FORMAT_X8_D24_UNORM_PACK32);
230 CHECK(vulkan_view_format(VK_FORMAT_D32_SFLOAT_S8_UINT, 146, cast) == VK_FORMAT_D32_SFLOAT_S8_UINT);
231 CHECK(vulkan_view_format(VK_FORMAT_S8_UINT, 5, cast) == VK_FORMAT_S8_UINT);
232 for (const std::uint32_t bad_ds : {1u, 5u, 7u, 13u, 20u, 21u, 22u, 56u}) {
233 CHECK(vulkan_view_format(VK_FORMAT_D24_UNORM_S8_UINT, bad_ds, cast) == VK_FORMAT_UNDEFINED);
234 CHECK(vulkan_view_format(VK_FORMAT_D32_SFLOAT_S8_UINT, bad_ds, cast) == VK_FORMAT_UNDEFINED);
235 }
236 CHECK(vulkan_view_format(VK_FORMAT_D24_UNORM_S8_UINT, 146, cast) == VK_FORMAT_UNDEFINED);
237 CHECK(vulkan_view_format(VK_FORMAT_D32_SFLOAT_S8_UINT, 141, cast) == VK_FORMAT_UNDEFINED);
238 // Colour images never resolve to a depth/stencil view format, while normal colour casts remain intact.
239 CHECK(vulkan_view_format(VK_FORMAT_R32_SFLOAT, 141, cast) == VK_FORMAT_UNDEFINED);
240 CHECK(vulkan_view_format(VK_FORMAT_R32_SFLOAT, 146, cast) == VK_FORMAT_UNDEFINED);
241 CHECK(vulkan_view_format(VK_FORMAT_R8G8B8A8_UNORM, 141, cast) == VK_FORMAT_UNDEFINED);
242 CHECK(vulkan_view_format(VK_FORMAT_R8G8B8A8_UNORM, 146, cast) == VK_FORMAT_UNDEFINED);
243 CHECK(vulkan_view_format(VK_FORMAT_R16_UNORM, 13, cast) == VK_FORMAT_R16_SFLOAT);
244 CHECK(vulkan_view_format(VK_FORMAT_R32_SFLOAT, 20, cast) == VK_FORMAT_R32_UINT);
245 }
246 // Exhaustive invariant across the whole format table: depth/stencil images only accept their own code,
247 // and colour images never produce a depth/stencil view format.
248 for (const FormatRow& img : format_table) {
249 for (const FormatRow& view : format_table) {
250 for (const bool cast : {false, true}) {
251 const VkFormat resolved = vulkan_view_format(img.vulkan, view.gfx10, cast);
252 if (is_depth_stencil_format(img.vulkan)) {
253 CHECK(resolved == (img.gfx10 == view.gfx10 ? img.vulkan : VK_FORMAT_UNDEFINED));
254 } else {
255 CHECK(!is_depth_stencil_format(resolved));
256 }
257 }
258 }
259 }
260
212 // DST_SEL as a component mapping. 261 // DST_SEL as a component mapping.
213 const auto same = [](const VkComponentMapping& m, VkComponentSwizzle r, VkComponentSwizzle g, VkComponentSwizzle b, 262 const auto same = [](const VkComponentMapping& m, VkComponentSwizzle r, VkComponentSwizzle g, VkComponentSwizzle b,
214 VkComponentSwizzle a) { return m.r == r && m.g == g && m.b == b && m.a == a; }; 263 VkComponentSwizzle a) { return m.r == r && m.g == g && m.b == b && m.a == a; };
diff --git a/runtime/test/glsl/ps_typeless_float.frag b/runtime/test/glsl/ps_typeless_float.frag
new file mode 100644
index 000000000..ab3afaff9
--- /dev/null
+++ b/runtime/test/glsl/ps_typeless_float.frag
@@ -0,0 +1,8 @@
1#version 460
2// A pixel shader standing in for a translated one in d3d12_typeless_families_test (D3D-275): a constant that FLOAT
3// keeps, and UNORM views clamp (-2 to 0, 1.5 to 1) and round (0.25). The host draw's HLSL writes the same.
4layout(location = 0) out vec4 target;
5
6void main() {
7 target = vec4(0.5, -2.0, 1.5, 0.25);
8}
diff --git a/runtime/test/glsl/ps_typeless_uint.frag b/runtime/test/glsl/ps_typeless_uint.frag
new file mode 100644
index 000000000..cf69e3591
--- /dev/null
+++ b/runtime/test/glsl/ps_typeless_uint.frag
@@ -0,0 +1,9 @@
1#version 460
2// A pixel shader standing in for a translated one in d3d12_typeless_families_test (D3D-275): an integer constant
3// every UINT view down to R10G10B10A2_UINT holds (7 is 0x00000007 in R32_UINT, not a float's bits). The host draw's
4// HLSL writes the same.
5layout(location = 0) out uvec4 target;
6
7void main() {
8 target = uvec4(7u, 300u, 1000u, 3u);
9}
diff --git a/runtime/test/loader_tls_test.cpp b/runtime/test/loader_tls_test.cpp
index e3360fca7..8b7b7b179 100644
--- a/runtime/test/loader_tls_test.cpp
+++ b/runtime/test/loader_tls_test.cpp
@@ -307,36 +307,139 @@ void test_thread_outlives_loader(const fs::path& dll) {
307 "its copy is freed when it ends after the Loader, with no callback into the unmapped image"); 307 "its copy is freed when it ends after the Loader, with no callback into the unmapped image");
308} 308}
309 309
310void test_second_tls_module_rejected(const fs::path& dll, const fs::path& temp) { 310void test_multiple_tls_modules(const fs::path& dll, const fs::path& temp) {
311 std::printf("\n-- one mapped TLS module at a time --\n"); 311 std::printf("\n-- multiple simultaneous mapped TLS modules --\n");
312 const fs::path copy = temp / "tiny_tls_second.dll"; 312 const fs::path copy2 = temp / "tiny_tls_second.dll";
313 const fs::path copy3 = temp / "tiny_tls_third.dll";
313 // CopyFileW, not fs::copy_file: MSVC's copy_file calls CopyFile2, which Wine 9 doesn't implement. 314 // CopyFileW, not fs::copy_file: MSVC's copy_file calls CopyFile2, which Wine 9 doesn't implement.
314 check(CopyFileW(dll.c_str(), copy.c_str(), FALSE) != 0, "copied the TLS fixture under a second name"); 315 check(CopyFileW(dll.c_str(), copy2.c_str(), FALSE) != 0, "copied the TLS fixture under a second name");
316 check(CopyFileW(dll.c_str(), copy3.c_str(), FALSE) != 0, "copied the TLS fixture under a third name");
315 317
316 { 318 {
317 rt::Loader loader(dll.parent_path()); 319 rt::Loader loader(dll.parent_path());
318 rt::Module& first = loader.load(dll); 320 rt::Module& first = loader.load(dll);
319 check(first.tls_index != rt::kNoTlsIndex, "the first TLS module is initialized"); 321 rt::Module& second = loader.load(copy2);
320 322 rt::Module& third = loader.load(copy3);
321 bool rejected = false; 323 loader.initialise();
322 std::string message; 324
323 try { 325 check(first.tls_index != rt::kNoTlsIndex && second.tls_index != rt::kNoTlsIndex &&
324 loader.load(copy); 326 third.tls_index != rt::kNoTlsIndex,
325 } catch (const std::runtime_error& e) { 327 "all three simultaneous TLS modules receive reserved module TLS indices");
326 rejected = true; 328 check(first.tls_index != second.tls_index && first.tls_index != third.tls_index &&
327 message = e.what(); 329 second.tls_index != third.tls_index,
328 } 330 "each simultaneous TLS module gets a distinct OS module TLS index");
329 check(rejected, "a second mapped module with TLS is rejected instead of sharing a slot"); 331
330 check(message.find("only one manually mapped module") != std::string::npos, 332 auto get1 = find_export<int(__cdecl*)()>(first, "tiny_tls_get");
331 "the rejection explains the one-module TLS limit"); 333 auto set1 = find_export<void(__cdecl*)(int)>(first, "tiny_tls_set");
334 auto get2 = find_export<int(__cdecl*)()>(second, "tiny_tls_get");
335 auto set2 = find_export<void(__cdecl*)(int)>(second, "tiny_tls_set");
336 auto get3 = find_export<int(__cdecl*)()>(third, "tiny_tls_get");
337 auto set3 = find_export<void(__cdecl*)(int)>(third, "tiny_tls_set");
338 auto watch1 = find_export<void(__cdecl*)(DWORD)>(first, "tiny_tls_watch_thread");
339 auto watch2 = find_export<void(__cdecl*)(DWORD)>(second, "tiny_tls_watch_thread");
340 auto watch3 = find_export<void(__cdecl*)(DWORD)>(third, "tiny_tls_watch_thread");
341 auto pa1 = find_export<int(__cdecl*)()>(first, "tiny_tls_attach_count");
342 auto pa2 = find_export<int(__cdecl*)()>(second, "tiny_tls_attach_count");
343 auto pa3 = find_export<int(__cdecl*)()>(third, "tiny_tls_attach_count");
344 auto ta1 = find_export<int(__cdecl*)()>(first, "tiny_tls_thread_attach_count");
345 auto ta2 = find_export<int(__cdecl*)()>(second, "tiny_tls_thread_attach_count");
346 auto ta3 = find_export<int(__cdecl*)()>(third, "tiny_tls_thread_attach_count");
347 auto td1 = find_export<int(__cdecl*)()>(first, "tiny_tls_thread_detach_count");
348 auto td2 = find_export<int(__cdecl*)()>(second, "tiny_tls_thread_detach_count");
349 auto td3 = find_export<int(__cdecl*)()>(third, "tiny_tls_thread_detach_count");
350
351 check(get1() == 7 && get2() == 7 && get3() == 7, "all three modules start from their template value 7");
352 set1(101);
353 set2(202);
354 set3(303);
355 check(get1() == 101 && get2() == 202 && get3() == 303,
356 "writes to each module's TLS slot stay isolated on the main thread");
357
358 // A worker thread started after load() must get its own fresh template copies for all three modules and run
359 // DLL_THREAD_ATTACH / DLL_THREAD_DETACH callbacks on all three.
360 struct WorkerCtx {
361 int(__cdecl* get1)();
362 void(__cdecl* set1)(int);
363 int(__cdecl* get2)();
364 void(__cdecl* set2)(int);
365 int(__cdecl* get3)();
366 void(__cdecl* set3)(int);
367 int init1 = 0, init2 = 0, init3 = 0;
368 int after1 = 0, after2 = 0, after3 = 0;
369 };
370 WorkerCtx ctx{get1, set1, get2, set2, get3, set3};
371 HANDLE thread = CreateThread(
372 nullptr, 0,
373 [](void* p) -> DWORD {
374 auto* c = static_cast<WorkerCtx*>(p);
375 c->init1 = c->get1();
376 c->init2 = c->get2();
377 c->init3 = c->get3();
378 c->set1(1111);
379 c->set2(2222);
380 c->set3(3333);
381 c->after1 = c->get1();
382 c->after2 = c->get2();
383 c->after3 = c->get3();
384 return 0;
385 },
386 &ctx, CREATE_SUSPENDED, nullptr);
387 const DWORD tid = GetThreadId(thread);
388 watch1(tid);
389 watch2(tid);
390 watch3(tid);
391 ResumeThread(thread);
392 WaitForSingleObject(thread, INFINITE);
393 CloseHandle(thread);
394
395 check(ctx.init1 == 7 && ctx.init2 == 7 && ctx.init3 == 7,
396 "worker thread receives fresh template copies for all three modules");
397 check(ctx.after1 == 1111 && ctx.after2 == 2222 && ctx.after3 == 3333,
398 "worker thread writes stay isolated across all three modules");
399 check(get1() == 101 && get2() == 202 && get3() == 303,
400 "main thread TLS values are untouched by the worker thread");
401 check(pa1() == 1 && pa2() == 1 && pa3() == 1,
402 "each of the three modules received DLL_PROCESS_ATTACH once");
403 check(ta1() == 1 && ta2() == 1 && ta3() == 1,
404 "each of the three modules received DLL_THREAD_ATTACH once for the worker");
405 check(td1() == 1 && td2() == 1 && td3() == 1,
406 "each of the three modules received DLL_THREAD_DETACH once for the worker");
407 }
408
409 // Callback-only TLS module (tls_raw_size + tls_zero_fill == 0): must still receive DLL_THREAD_ATTACH and
410 // DLL_THREAD_DETACH on worker threads.
411 const fs::path cb_only_dll = dll.parent_path() / "tiny_tls_cb_only.dll";
412 if (fs::exists(cb_only_dll)) {
413 rt::Loader loader(cb_only_dll.parent_path());
414 rt::Module& m = loader.load(cb_only_dll);
415 loader.initialise();
416
417 auto watch = find_export<void(__cdecl*)(DWORD)>(m, "tiny_tls_cb_watch_thread");
418 auto pa = find_export<int(__cdecl*)()>(m, "tiny_tls_cb_attach_count");
419 auto ta = find_export<int(__cdecl*)()>(m, "tiny_tls_cb_thread_attach_count");
420 auto td = find_export<int(__cdecl*)()>(m, "tiny_tls_cb_thread_detach_count");
421
422 check(m.tls_raw_size == 0 && m.tls_zero_fill == 0 && m.tls_block == nullptr,
423 "callback-only TLS fixture has no TLS data block");
424 check(m.tls_slot != rt::kNoTlsIndex, "callback-only TLS fixture is assigned a TLS slot");
425
426 HANDLE thread = CreateThread(nullptr, 0, [](void*) -> DWORD { return 0; }, nullptr, CREATE_SUSPENDED, nullptr);
427 watch(GetThreadId(thread));
428 ResumeThread(thread);
429 WaitForSingleObject(thread, INFINITE);
430 CloseHandle(thread);
431
432 check(pa() == 1, "callback-only TLS module received DLL_PROCESS_ATTACH once");
433 check(ta() == 1, "callback-only TLS module received DLL_THREAD_ATTACH once");
434 check(td() == 1, "callback-only TLS module received DLL_THREAD_DETACH once");
332 } 435 }
333 436
334 // After the first loader restores its slot, the copy loads normally. 437 // After the loader is destroyed, all slots are released and reusable.
335 { 438 {
336 rt::Loader loader(copy.parent_path()); 439 rt::Loader loader(copy2.parent_path());
337 rt::Module& m = loader.load(copy); 440 rt::Module& m = loader.load(copy2);
338 check(m.tls_index != rt::kNoTlsIndex, "the copied TLS module loads after the first loader is destroyed"); 441 check(m.tls_index != rt::kNoTlsIndex, "slots are reusable after the first loader is destroyed");
339 check(find_export<int(__cdecl*)()>(m, "tiny_tls_get")() == 7, "the copied module reads its template value"); 442 check(find_export<int(__cdecl*)()>(m, "tiny_tls_get")() == 7, "the reloaded module reads its template value");
340 } 443 }
341} 444}
342 445
@@ -370,7 +473,7 @@ int main(int argc, char** argv) {
370 test_tls(tls_dll); 473 test_tls(tls_dll);
371 test_thread_events(tls_dll); 474 test_thread_events(tls_dll);
372 test_thread_outlives_loader(tls_dll); 475 test_thread_outlives_loader(tls_dll);
373 test_second_tls_module_rejected(tls_dll, temp.path); 476 test_multiple_tls_modules(tls_dll, temp.path);
374 } catch (const std::exception& e) { 477 } catch (const std::exception& e) {
375 ++g_checks; 478 ++g_checks;
376 ++g_failures; 479 ++g_failures;
diff --git a/runtime/test/process_cmdline_test.cpp b/runtime/test/process_cmdline_test.cpp
index 8f35a8ef7..01f1b38a5 100644
--- a/runtime/test/process_cmdline_test.cpp
+++ b/runtime/test/process_cmdline_test.cpp
@@ -112,6 +112,66 @@ void check_winmain(const std::wstring& program, const std::vector<std::wstring>&
112 } 112 }
113 } 113 }
114} 114}
115
116// msvcrt.dll's __getmainargs/__wgetmainargs (what a MinGW or old-MSVC CRT startup calls) hand out the game's argv and
117// the process environment. The wide environment (_wenviron) does not exist until a wide environment function has run,
118// and the narrow table is reallocated by _putenv, so both must be read at the call, not remembered by
119// set_command_line (RT-136). `name=value` must be found in `env`, whatever was set before or after set_command_line.
120template <typename C, typename Fn>
121bool env_has(Fn getmainargs, const C* entry) {
122 int argc = 0;
123 C** argv = nullptr;
124 C** env = nullptr;
125 if (getmainargs(&argc, &argv, &env, 0, nullptr) != 0 || argc < 1 || !argv || !argv[0] || !env) return false;
126 for (C** e = env; *e; ++e) {
127 if constexpr (sizeof(C) == 1) {
128 if (std::strcmp(reinterpret_cast<const char*>(*e), reinterpret_cast<const char*>(entry)) == 0) return true;
129 } else {
130 if (std::wcscmp(reinterpret_cast<const wchar_t*>(*e), reinterpret_cast<const wchar_t*>(entry)) == 0)
131 return true;
132 }
133 }
134 return false;
135}
136
137void check_getmainargs_environment() {
138 using Narrow = int(__cdecl*)(int*, char***, char***, int, void*);
139 using Wide = int(__cdecl*)(int*, wchar_t***, wchar_t***, int, void*);
140 const auto narrow_fn = reinterpret_cast<Narrow>(rt::shims::find("msvcrt.dll", "__getmainargs"));
141 const auto wide_fn = reinterpret_cast<Wide>(rt::shims::find("msvcrt.dll", "__wgetmainargs"));
142 if (!narrow_fn || !wide_fn) {
143 std::fprintf(stderr, "FAIL msvcrt.dll!__getmainargs/__wgetmainargs are not shimmed\n");
144 ++failures;
145 return;
146 }
147 // First use of the wide environment in this process: set_command_line runs before anything made _wenviron.
148 // main() hosts start with only the narrow table; if a toolchain change made _wenviron exist, the first-call
149 // checks below no longer prove the creation path, so say so rather than pass silently.
150 if (_wenviron) std::printf("note: _wenviron already exists at startup; its lazy creation is not exercised\n");
151 rt::process::set_command_line(L"game.exe", {L"-x"});
152 if (_putenv_s("LEONIDA_RT136_A", "before") != 0 || // narrow only; the wide table is built on first use
153 !env_has<wchar_t>(wide_fn, L"LEONIDA_RT136_A=before")) {
154 std::fprintf(stderr, "FAIL __wgetmainargs: no environment (or one without LEONIDA_RT136_A) at the first call\n");
155 ++failures;
156 }
157 if (!env_has<char>(narrow_fn, "LEONIDA_RT136_A=before")) {
158 std::fprintf(stderr, "FAIL __getmainargs: no environment (or one without LEONIDA_RT136_A)\n");
159 ++failures;
160 }
161 // A variable set after set_command_line reallocates the CRT's table; a pointer kept from before would dangle.
162 if (_putenv_s("LEONIDA_RT136_B", "after") != 0 || _wputenv_s(L"LEONIDA_RT136_C", L"after") != 0) {
163 std::fprintf(stderr, "FAIL _putenv_s/_wputenv_s did not set the test variables\n");
164 ++failures;
165 }
166 if (!env_has<wchar_t>(wide_fn, L"LEONIDA_RT136_B=after") || !env_has<wchar_t>(wide_fn, L"LEONIDA_RT136_C=after")) {
167 std::fprintf(stderr, "FAIL __wgetmainargs: an environment variable set after set_command_line is missing\n");
168 ++failures;
169 }
170 if (!env_has<char>(narrow_fn, "LEONIDA_RT136_B=after") || !env_has<char>(narrow_fn, "LEONIDA_RT136_C=after")) {
171 std::fprintf(stderr, "FAIL __getmainargs: an environment variable set after set_command_line is missing\n");
172 ++failures;
173 }
174}
115} // namespace 175} // namespace
116 176
117int main() { 177int main() {
@@ -126,6 +186,7 @@ int main() {
126 check_non_ascii(L"\u0394\u0416\u6F22 x", "an argument outside any single-byte code page"); 186 check_non_ascii(L"\u0394\u0416\u6F22 x", "an argument outside any single-byte code page");
127 187
128 check_import_names(); 188 check_import_names();
189 check_getmainargs_environment();
129 check_winmain(L"game.exe", {L"-foo", L"with space"}, L"-foo \"with space\"", "arguments after a plain name"); 190 check_winmain(L"game.exe", {L"-foo", L"with space"}, L"-foo \"with space\"", "arguments after a plain name");
130 check_winmain(L"C:\\My Games\\game.exe", {L"-x"}, L"-x", "a quoted program name with a space"); 191 check_winmain(L"C:\\My Games\\game.exe", {L"-x"}, L"-x", "a quoted program name with a space");
131 check_winmain(L"game.exe", {}, L"", "no arguments"); 192 check_winmain(L"game.exe", {}, L"", "no arguments");
diff --git a/runtime/test/replay_uav_clear_offset_test.cpp b/runtime/test/replay_uav_clear_offset_test.cpp
index 260237e69..6b59c0245 100644
--- a/runtime/test/replay_uav_clear_offset_test.cpp
+++ b/runtime/test/replay_uav_clear_offset_test.cpp
@@ -3,6 +3,8 @@
3// the resource, as copies and atomic copies already treat it. No Vulkan loader, GPU or game data: the transfer 3// the resource, as copies and atomic copies already treat it. No Vulkan loader, GPU or game data: the transfer
4// functions are fakes that record the ranges they are given. 4// functions are fakes that record the ranges they are given.
5#include "../src/vulkan_replay.h" 5#include "../src/vulkan_replay.h"
6#include <array>
7#include <bit>
6#include <cstdint> 8#include <cstdint>
7#include <cstdio> 9#include <cstdio>
8#include <vector> 10#include <vector>
@@ -14,6 +16,24 @@ struct Write {
14}; 16};
15std::vector<Write> writes; 17std::vector<Write> writes;
16 18
19unsigned image_clears = 0, attachment_clears = 0;
20VkFormat requested_view_format = VK_FORMAT_UNDEFINED;
21VkImageSubresourceRange requested_view_range{};
22VkClearColorValue captured_color{};
23VkClearRect captured_rect{};
24VkRect2D captured_render_area{};
25std::uint32_t captured_render_layers = 0;
26
27void reset_texture_capture() {
28 image_clears = attachment_clears = 0;
29 requested_view_format = VK_FORMAT_UNDEFINED;
30 requested_view_range = {};
31 captured_color = {};
32 captured_rect = {};
33 captured_render_area = {};
34 captured_render_layers = 0;
35}
36
17VKAPI_ATTR void VKAPI_CALL barrier(VkCommandBuffer, VkPipelineStageFlags, VkPipelineStageFlags, VkDependencyFlags, 37VKAPI_ATTR void VKAPI_CALL barrier(VkCommandBuffer, VkPipelineStageFlags, VkPipelineStageFlags, VkDependencyFlags,
18 std::uint32_t, const VkMemoryBarrier*, std::uint32_t, const VkBufferMemoryBarrier*, 38 std::uint32_t, const VkMemoryBarrier*, std::uint32_t, const VkBufferMemoryBarrier*,
19 std::uint32_t, const VkImageMemoryBarrier*) {} 39 std::uint32_t, const VkImageMemoryBarrier*) {}
@@ -26,6 +46,24 @@ VKAPI_ATTR void VKAPI_CALL update(VkCommandBuffer, VkBuffer, VkDeviceSize offset
26VKAPI_ATTR void VKAPI_CALL copy(VkCommandBuffer, VkBuffer, VkBuffer, std::uint32_t count, const VkBufferCopy* r) { 46VKAPI_ATTR void VKAPI_CALL copy(VkCommandBuffer, VkBuffer, VkBuffer, std::uint32_t count, const VkBufferCopy* r) {
27 for (std::uint32_t i = 0; i < count; ++i) writes.push_back({'c', r[i].dstOffset, r[i].size, r[i].srcOffset}); 47 for (std::uint32_t i = 0; i < count; ++i) writes.push_back({'c', r[i].dstOffset, r[i].size, r[i].srcOffset});
28} 48}
49VKAPI_ATTR void VKAPI_CALL clear_image(VkCommandBuffer, VkImage, VkImageLayout, const VkClearColorValue* value,
50 std::uint32_t, const VkImageSubresourceRange*) {
51 captured_color = *value;
52 ++image_clears;
53}
54VKAPI_ATTR void VKAPI_CALL begin_rendering(VkCommandBuffer, const VkRenderingInfo* info) {
55 captured_render_area = info->renderArea;
56 captured_render_layers = info->layerCount;
57}
58VKAPI_ATTR void VKAPI_CALL end_rendering(VkCommandBuffer) {}
59VKAPI_ATTR void VKAPI_CALL clear_attachments(VkCommandBuffer, std::uint32_t count, const VkClearAttachment* values,
60 std::uint32_t rect_count, const VkClearRect* rects) {
61 if (count == 1 && rect_count >= 1) {
62 captured_color = values[0].clearValue.color;
63 captured_rect = rects[0];
64 ++attachment_clears;
65 }
66}
29 67
30int failures = 0; 68int failures = 0;
31void expect(bool ok, const char* what) { 69void expect(bool ok, const char* what) {
@@ -88,7 +126,132 @@ int main() {
88 "rectangle clear replays"); 126 "rectangle clear replays");
89 expect(inside(at + 16, at + 28), "elements 2..5 of a view at 8 are [at + 16, at + 28)"); 127 expect(inside(at + 16, at + 28), "elements 2..5 of a view at 8 are [at + 16, at + 28)");
90 128
129 // Typeless / mutable texture UAV clears where view_format != binding.format must clear through an attachment view
130 // of view_format with clear_color decoded in view_format, avoiding SFLOAT NaN round-trips (issue #1902).
131 ReplayFunctions tex_vk = vk;
132 tex_vk.clear_color_image = clear_image;
133 tex_vk.begin_rendering = begin_rendering;
134 tex_vk.end_rendering = end_rendering;
135 tex_vk.clear_attachments = clear_attachments;
136 tex_vk.image_view = [](const ResourceBinding& b, const VkImageSubresourceRange& r) {
137 requested_view_format = b.format;
138 requested_view_range = r;
139 return reinterpret_cast<VkImageView>(std::uintptr_t{0x2000});
140 };
141
142 const auto run_tex = [&](const ResourceBinding& binding, const UavView& view, bool is_float,
143 std::array<std::uint32_t, 4> values, std::span<const Rect> rects = {},
144 const ReplayFunctions* custom_vk = nullptr) {
145 reset_texture_capture();
146 CommandList list;
147 list.clear_unordered_access(view, is_float, values, rects);
148 list.close();
149 return replay(list, VK_NULL_HANDLE, [&](ResourceId id) { return id == 2 ? &binding : nullptr; },
150 custom_vk ? *custom_vk : tex_vk);
151 };
152
153 ResourceBinding tex{};
154 tex.image = reinterpret_cast<VkImage>(std::uintptr_t{0x3000});
155 tex.format = VK_FORMAT_R16G16_SFLOAT;
156 tex.aspects = VK_IMAGE_ASPECT_COLOR_BIT;
157 tex.width = 8;
158 tex.height = 6;
159 tex.mip_levels = 2;
160 tex.array_layers = 4;
161 tex.color_attachment = true;
162
163 const auto fbits = [](float f) { return std::bit_cast<std::uint32_t>(f); };
164 // R16G16_TYPELESS (SFLOAT) cleared as R16G16_UNORM Float(1.0, 1.0): uses R16G16_UNORM view and float32 {1, 1}.
165 expect(run_tex(tex, {2, false, VK_FORMAT_R16G16_UNORM, 0, 0, 0, 0, 1, 2}, true, {fbits(1.0f), fbits(1.0f), 0, 0}) ==
166 ReplayResult::success,
167 "R16G16_TYPELESS -> R16G16_UNORM whole-view clear replays");
168 expect(image_clears == 0 && attachment_clears == 1,
169 "R16G16_TYPELESS -> R16G16_UNORM uses attachment clear, not vkCmdClearColorImage");
170 expect(requested_view_format == VK_FORMAT_R16G16_UNORM,
171 "R16G16_TYPELESS -> R16G16_UNORM creates image view with view_format");
172 expect(requested_view_range.baseMipLevel == 0 && requested_view_range.baseArrayLayer == 1 &&
173 requested_view_range.layerCount == 2 && captured_render_layers == 2,
174 "reinterpreted UAV clear preserves mip and layer range");
175 expect(captured_color.float32[0] == 1.0f && captured_color.float32[1] == 1.0f,
176 "R16G16_UNORM clear value is decoded in view_format (not half-float NaN)");
177 expect(captured_rect.rect.offset.x == 0 && captured_rect.rect.offset.y == 0 &&
178 captured_rect.rect.extent.width == 8 && captured_rect.rect.extent.height == 6 &&
179 captured_rect.layerCount == 2,
180 "reinterpreted whole-view clear covers full mip extent and layers");
181
182 // R16G16_TYPELESS (SFLOAT) cleared as R16G16_UINT with half-float NaN bit patterns 0xffff and 0x7fff.
183 const Rect sub_rect{1, 1, 4, 3};
184 expect(run_tex(tex, {2, false, VK_FORMAT_R16G16_UINT, 0, 0, 0, 1, 0, 1}, false, {0xffff, 0x7fff, 0, 0},
185 std::span<const Rect>(&sub_rect, 1)) == ReplayResult::success,
186 "R16G16_TYPELESS -> R16G16_UINT rect clear replays");
187 expect(image_clears == 0 && attachment_clears == 1 && requested_view_format == VK_FORMAT_R16G16_UINT,
188 "R16G16_UINT rect clear uses R16G16_UINT view");
189 expect(captured_color.uint32[0] == 0xffff && captured_color.uint32[1] == 0x7fff,
190 "R16G16_UINT clear passes exact uint32 values");
191 expect(captured_render_area.extent.width == 4 && captured_render_area.extent.height == 3 &&
192 captured_rect.rect.extent.width == 3 && captured_rect.rect.extent.height == 2,
193 "R16G16_UINT rect clear clips to mip 1 extent");
194
195 // Same-format whole-view unpredicated clear stays on vkCmdClearColorImage.
196 expect(run_tex(tex, {2, false, VK_FORMAT_R16G16_SFLOAT, 0, 0, 0, 0, 0, 1}, true, {fbits(0.5f), fbits(-2.0f), 0, 0}) ==
197 ReplayResult::success,
198 "same-format R16G16_SFLOAT whole-view clear replays");
199 expect(image_clears == 1 && attachment_clears == 0, "same-format whole-view clear uses vkCmdClearColorImage");
200
201 // R32_TYPELESS (SFLOAT) cleared as R32_UINT with sNaN bit pattern 0x7f800001.
202 ResourceBinding r32 = tex;
203 r32.format = VK_FORMAT_R32_SFLOAT;
204 expect(run_tex(r32, {2, false, VK_FORMAT_R32_UINT, 0, 0, 0, 0, 0, 1}, false, {0x7f800001u, 0, 0, 0}) ==
205 ReplayResult::success,
206 "R32_TYPELESS -> R32_UINT sNaN clear replays");
207 expect(image_clears == 0 && attachment_clears == 1 && requested_view_format == VK_FORMAT_R32_UINT &&
208 captured_color.uint32[0] == 0x7f800001u,
209 "R32_UINT clear uses R32_UINT attachment view with exact sNaN bits");
210
211 // R8G8B8A8_TYPELESS (UNORM) cleared as R8G8B8A8_UINT and R8G8B8A8_SINT uses view_format directly.
212 ResourceBinding rgba8 = tex;
213 rgba8.format = VK_FORMAT_R8G8B8A8_UNORM;
214 expect(run_tex(rgba8, {2, false, VK_FORMAT_R8G8B8A8_UINT, 0, 0, 0, 0, 0, 1}, false, {0xff, 0x80, 0x7f, 1}) ==
215 ReplayResult::success,
216 "R8G8B8A8_TYPELESS -> R8G8B8A8_UINT clear replays");
217 expect(image_clears == 0 && attachment_clears == 1 && requested_view_format == VK_FORMAT_R8G8B8A8_UINT &&
218 captured_color.uint32[0] == 0xff && captured_color.uint32[1] == 0x80 &&
219 captured_color.uint32[2] == 0x7f && captured_color.uint32[3] == 1,
220 "R8G8B8A8_UINT clear uses R8G8B8A8_UINT attachment view");
221
222 // Emulated R9G9B9E5_SHAREDEXP (backed by R32_UINT) must NOT request an E5B9G9R9 color attachment view.
223 ResourceBinding r9e5 = tex;
224 r9e5.format = VK_FORMAT_R32_UINT;
225 expect(run_tex(r9e5, {2, false, VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, 0, 0, 0, 0, 0, 1}, true,
226 {fbits(1.0f), fbits(2.0f), fbits(4.0f), 0}) == ReplayResult::success,
227 "emulated R9G9B9E5 whole-view clear replays");
228 expect(image_clears == 1 && attachment_clears == 0 && captured_color.uint32[0] == 0x94010040u,
229 "emulated R9G9B9E5 whole-view clear stays on R32_UINT vkCmdClearColorImage");
230 expect(run_tex(r9e5, {2, false, VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, 0, 0, 0, 0, 0, 1}, true,
231 {fbits(1.0f), fbits(2.0f), fbits(4.0f), 0}, std::span<const Rect>(&sub_rect, 1)) ==
232 ReplayResult::success,
233 "emulated R9G9B9E5 rect clear replays");
234 expect(image_clears == 0 && attachment_clears == 1 && requested_view_format == VK_FORMAT_R32_UINT &&
235 captured_color.uint32[0] == 0x94010040u,
236 "emulated R9G9B9E5 rect clear uses R32_UINT attachment view");
237
238 // When dynamic rendering is unavailable, reinterpretation refuses instead of corrupting via vkCmdClearColorImage.
239 ReplayFunctions no_render = tex_vk;
240 no_render.begin_rendering = nullptr;
241 expect(run_tex(tex, {2, false, VK_FORMAT_R16G16_UNORM, 0, 0, 0, 0, 0, 1}, true, {fbits(1.0f), fbits(1.0f), 0, 0},
242 {}, &no_render) == ReplayResult::unsupported,
243 "reinterpreted UAV clear without dynamic rendering returns unsupported");
244
245 // When color_attachment_format reports a view format unsupported as an attachment, keep the backing format path.
246 ReplayFunctions no_unorm_rt = tex_vk;
247 no_unorm_rt.color_attachment_format = [](VkFormat f) { return f != VK_FORMAT_R16G16_UNORM; };
248 expect(run_tex(tex, {2, false, VK_FORMAT_R16G16_UNORM, 0, 0, 0, 0, 0, 1}, true, {fbits(0.0f), fbits(0.0f), 0, 0},
249 {}, &no_unorm_rt) == ReplayResult::success,
250 "non-attachable view format falls back to backing format");
251 expect(image_clears == 1 && attachment_clears == 0,
252 "non-attachable view format whole-view clear uses vkCmdClearColorImage");
253
91 if (failures) return 1; 254 if (failures) return 1;
92 std::printf("replay_uav_clear_offset: buffer UAV clears write their resource's range of a shared buffer\n"); 255 std::printf("replay_uav_clear_offset: buffer offsets and typeless texture view-format clears all passed\n");
93 return 0; 256 return 0;
94} 257}
diff --git a/runtime/test/shaders/build.py b/runtime/test/shaders/build.py
index 7ec6608d6..412dc2b8f 100644
--- a/runtime/test/shaders/build.py
+++ b/runtime/test/shaders/build.py
@@ -13,8 +13,8 @@ FSSM program (the magic, zeros up to OFFSET, then the words): it is published as
13SHA-256 goes into the index as fssm_sha256, which is what the layer looks a PSO's shader up by (the translator 13SHA-256 goes into the index as fssm_sha256, which is what the layer looks a PSO's shader up by (the translator
14hashes <work>/fssm/<name>.fssm for the game's programs, and compute shaders here already). A test builds the shader container from that file. The words 14hashes <work>/fssm/<name>.fssm for the game's programs, and compute shaders here already). A test builds the shader container from that file. The words
15are also what a shader reads through s_getpc_b64 (the code base) at that offset. 15are also what a shader reads through s_getpc_b64 (the code base) at that offset.
16The stage comes from the name's prefix. Mesh and geometry shaders (ms_, gs_) also need a DXBC container with 16The stage comes from the name's prefix. Mesh shaders (ms_) also need a DXBC container with their PSV0, which this
17their signatures, which this doesn't make. 17doesn't make; geometry shaders (gs_) get gs_tri's signatures (gs_container).
18The comment at the top of each .asm says which test program to run on the result and what it should print. 18The comment at the top of each .asm says which test program to run on the result and what it should print.
19With LEONIDA_FMA=khr (or glsl), the fused multiply-adds are translated with --fma khr (OpFmaKHR, which needs 19With LEONIDA_FMA=khr (or glsl), the fused multiply-adds are translated with --fma khr (OpFmaKHR, which needs
20VK_KHR_shader_fma; the test programs enable it when the device has it, else they exit 77) or --fma glsl. 20VK_KHR_shader_fma; the test programs enable it when the device has it, else they exit 77) or --fma glsl.
@@ -108,6 +108,16 @@ def clip_container():
108 + b"OSG1" + struct.pack("<I", len(payload)) + payload) 108 + b"OSG1" + struct.pack("<I", len(payload)) + payload)
109 109
110 110
111def gs_container():
112 # ISG1 and OSG1 of the gs_* fixtures, as scripts/run_gpu_tests.py makes them for gs_tri: SV_Position (system value
113 # 1) in register 0 and TEXCOORD0 in register 1, float4 (component type 3), no names.
114 sig = struct.pack("<II", 2, 8) + b"".join(struct.pack("<6I2B6x", 0, 0, 0, sv, 3, reg, 0xF, 0xF)
115 for sv, reg in ((1, 0), (0, 1)))
116 chunk = struct.pack("<I", len(sig)) + sig
117 return (b"DXBC" + bytes(16) + struct.pack("<5I", 1, 40 + 2 * (4 + len(chunk)), 2, 40, 44 + len(chunk))
118 + b"ISG1" + chunk + b"OSG1" + chunk)
119
120
111def translate_tests(work, names): 121def translate_tests(work, names):
112 disasm, fssm, spirv = (work / d for d in ("disasm", "fssm", "spirv")) 122 disasm, fssm, spirv = (work / d for d in ("disasm", "fssm", "spirv"))
113 disasm.mkdir() 123 disasm.mkdir()
@@ -140,6 +150,8 @@ def translate_tests(work, names):
140 (fssm / (n + ".fssm")).write_bytes(program) 150 (fssm / (n + ".fssm")).write_bytes(program)
141 elif n in CLIP_CASES and n != "vs_clip_undeclared": 151 elif n in CLIP_CASES and n != "vs_clip_undeclared":
142 (work / (n + ".dxbc")).write_bytes(clip_container()) 152 (work / (n + ".dxbc")).write_bytes(clip_container())
153 elif n.startswith("gs_"):
154 (work / (n + ".dxbc")).write_bytes(gs_container())
143 else: 155 else:
144 (work / (n + ".dxbc")).write_bytes(bytes(32)) # chunk count 0 156 (work / (n + ".dxbc")).write_bytes(bytes(32)) # chunk count 0
145 cmd = [sys.executable, "-I", TRANSLATOR, disasm, "--out", spirv] 157 cmd = [sys.executable, "-I", TRANSLATOR, disasm, "--out", spirv]
@@ -169,7 +181,7 @@ def main():
169 unknown = sorted(set(names) - set(available)) 181 unknown = sorted(set(names) - set(available))
170 if unknown: 182 if unknown:
171 sys.exit("Unknown test shaders: " + ", ".join(unknown)) 183 sys.exit("Unknown test shaders: " + ", ".join(unknown))
172 skipped = [n for n in names if n.startswith(("ms_", "gs_"))] 184 skipped = [n for n in names if n.startswith("ms_")]
173 if skipped: 185 if skipped:
174 print("not built (need a DXBC container with signatures):", ", ".join(skipped)) 186 print("not built (need a DXBC container with signatures):", ", ".join(skipped))
175 names = [n for n in names if n not in skipped] 187 names = [n for n in names if n not in skipped]
diff --git a/runtime/test/shaders/check.py b/runtime/test/shaders/check.py
index 00acdc5ef..bec6947e7 100644
--- a/runtime/test/shaders/check.py
+++ b/runtime/test/shaders/check.py
@@ -78,17 +78,20 @@ COMPUTE = [("cs_lds", "4", "mirror64"), ("cs_exec64", "1", "exec64"), ("cs_bvh",
78COMPUTE += [("cs_bvh32", "1", "bvh")] # TEST-184: image_bvh_intersect_ray, the 32-bit node pointer; same scene and words 78COMPUTE += [("cs_bvh32", "1", "bvh")] # TEST-184: image_bvh_intersect_ray, the 32-bit node pointer; same scene and words
79CS_STORE = [0x400080ff, 0xe00003ff, 0x3c004000, 0xeeeeeeee, 0x40003c00, 0xbc003800, 0x40ff8000, 0x3ff00000] 79CS_STORE = [0x400080ff, 0xe00003ff, 0x3c004000, 0xeeeeeeee, 0x40003c00, 0xbc003800, 0x40ff8000, 0x3ff00000]
80CS_SMEM = [0x5eed0024, 0x5eed0028, 0x5eed002c, 0x5eed0030, 0x5eed0010, 0x5eed0014, 0x5eed0018, 0x5eed001c] 80CS_SMEM = [0x5eed0024, 0x5eed0028, 0x5eed002c, 0x5eed0030, 0x5eed0010, 0x5eed0014, 0x5eed0018, 0x5eed001c]
81WAVE32_DUMPS = ("cs_store", "cs_smem_soffset_imm", "cs_wqm_w32", "cs_w32_lane_wrap", "cs_movrelsd_2", "cs_w32_permute", 81# -0, and NaN checks that need SignedZeroInfNanPreserve (cs_signed_zero_nan.asm); 0 in out[4..7] means it's missing
82SIGNED_ZERO_NAN = [0x80000000, 0x80000000, 0x80008000, 0x00008000, 1, 1, 1, 0x00007c00]
83WAVE32_DUMPS = ("cs_store", "cs_signed_zero_nan", "cs_smem_soffset_imm", "cs_wqm_w32", "cs_w32_lane_wrap", "cs_movrelsd_2", "cs_w32_permute",
82 "cs_barrier_divergent", "cs_barrier_early_end", "cs_barrier_loop", "cs_w32_lds_u8_d16", "cs_bpermute32", 84 "cs_barrier_divergent", "cs_barrier_early_end", "cs_barrier_loop", "cs_w32_lds_u8_d16", "cs_bpermute32",
83 "cs_w32_partial_scmp", "cs_exec_const", "cs_w32_mask_imm", "cs_w32_int_ext", 85 "cs_w32_partial_scmp", "cs_exec_const", "cs_w32_mask_imm", "cs_w32_int_ext",
84 "cs_w32_salu64", "cs_w32_misc_ext", "cs_w32_new_ops", "cs_w32_sincos", "cs_lds_b64_cmpst") 86 "cs_w32_salu64", "cs_w32_misc_ext", "cs_w32_new_ops", "cs_w32_sincos", "cs_lds_b64_cmpst",
87 "cs_mask_vgpr_exec")
85# Wave32 lane-mask dumps: their EXEC/VCC masks and lane selects cover 32 lanes, so a device whose widest subgroup is 88# Wave32 lane-mask dumps: their EXEC/VCC masks and lane selects cover 32 lanes, so a device whose widest subgroup is
86# narrower (Mesa llvmpipe: 8) can't produce their words. They are skipped there, as ps_bitmask_perm is. They run with 89# narrower (Mesa llvmpipe: 8) can't produce their words. They are skipped there, as ps_bitmask_perm is. They run with
87# 32 lanes requested (WAVE32_LANE_ENV), as run_gpu_tests.py does: a device with a range like 8..32 (Intel ANV) may 90# 32 lanes requested (WAVE32_LANE_ENV), as run_gpu_tests.py does: a device with a range like 8..32 (Intel ANV) may
88# otherwise pick a narrower size and return different words (#774). 91# otherwise pick a narrower size and return different words (#774).
89WAVE32_LANE_ENV = {"VKC_SUBGROUP_SIZE": "32"} 92WAVE32_LANE_ENV = {"VKC_SUBGROUP_SIZE": "32"}
90WAVE32_LANE_DUMPS = ("cs_wqm_w32", "cs_w32_lane_wrap", "cs_w32_permute", "cs_bpermute32", "cs_w32_partial_scmp", "cs_exec_const", 93WAVE32_LANE_DUMPS = ("cs_wqm_w32", "cs_w32_lane_wrap", "cs_w32_permute", "cs_bpermute32", "cs_w32_partial_scmp", "cs_exec_const",
91 "cs_w32_mask_imm", "cs_lds_b64_cmpst") 94 "cs_w32_mask_imm", "cs_lds_b64_cmpst", "cs_mask_vgpr_exec")
92CS_DPP = [("cs_dpp", [1, 0, 3, 2, 5, 4, 7, 6]), 95CS_DPP = [("cs_dpp", [1, 0, 3, 2, 5, 4, 7, 6]),
93 ("cs_dpp_row", [0, 0, 1, 2, 3, 4, 5, 6]), 96 ("cs_dpp_row", [0, 0, 1, 2, 3, 4, 5, 6]),
94 ("cs_dpp_mask", [1, 0, 3, 2, 0xeeeeeeee, 0xeeeeeeee, 0xeeeeeeee, 0xeeeeeeee]), 97 ("cs_dpp_mask", [1, 0, 3, 2, 0xeeeeeeee, 0xeeeeeeee, 0xeeeeeeee, 0xeeeeeeee]),
@@ -125,6 +128,8 @@ CS_DUMPS = [*CS_DPP, ("cs_store", CS_STORE), ("cs_smem_soffset_imm", CS_SMEM),
125 # not bit 0 for every lane; word = set lanes | lowest lane << 8 (derivations in each .asm header) 128 # not bit 0 for every lane; word = set lanes | lowest lane << 8 (derivations in each .asm header)
126 ("cs_w32_mask_imm", [2056, 20, 2, 6152, 2050, 4112, 258, 32]), 129 ("cs_w32_mask_imm", [2056, 20, 2, 6152, 2050, 4112, 258, 32]),
127 ("cs_w64_mask_imm", [2056, 1084, 828, 2052, 319, 2104, 516, 2064]), 130 ("cs_w64_mask_imm", [2056, 1084, 828, 2052, 319, 2104, 516, 2064]),
131 # SHADER-99: -0 and NaN survive translation (SignedZeroInfNanPreserve); words 0, 2, 3 on Apple: see below
132 ("cs_signed_zero_nan", SIGNED_ZERO_NAN),
128 ("cs_wave64_ballot", [32, 16, 24, 40, 8, 48]), 133 ("cs_wave64_ballot", [32, 16, 24, 40, 8, 48]),
129 ("cs_wm_half_ops", [32, 16, 16, 0, 16]), ("cs_wm_half_cmp", [1, 0, 1, 1]), 134 ("cs_wm_half_ops", [32, 16, 16, 0, 16]), ("cs_wm_half_cmp", [1, 0, 1, 1]),
130 ("cs_wm_bfm64", [16, 8, 8, 40]), ("cs_wm_scc_rfl", [55, 48]), 135 ("cs_wm_bfm64", [16, 8, 8, 40]), ("cs_wm_scc_rfl", [55, 48]),
@@ -141,7 +146,10 @@ CS_DUMPS = [*CS_DPP, ("cs_store", CS_STORE), ("cs_smem_soffset_imm", CS_SMEM),
141 # SHADER-91: waves that end without an s_barrier don't hold the barrier of the ones still running 146 # SHADER-91: waves that end without an s_barrier don't hold the barrier of the ones still running
142 ("cs_barrier_early_end", [127, 126, 125, 124, 123, 122, 121, 120]), 147 ("cs_barrier_early_end", [127, 126, 125, 124, 123, 122, 121, 120]),
143 # SHADER-91: a barrier in a loop with a per-wave trip count; the k-th one waits for the waves still running 148 # SHADER-91: a barrier in a loop with a per-wave trip count; the k-th one waits for the waves still running
144 ("cs_barrier_loop", [128, 96, 64, 32, 128, 96, 64, 0xEEEEEEEE])] 149 ("cs_barrier_loop", [128, 96, 64, 32, 128, 96, 64, 0xEEEEEEEE]),
150 # SHADER-21 part 2: a mask copied to a VGPR with v_mov_b32 respects EXEC (inactive lanes keep the old VGPR)
151 ("cs_mask_vgpr_exec", [0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
152 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF, 0xDEADBEEF])]
145# num_records bounds check (cs_bounds.asm): one thread, so no 64-wide subgroup requirement. 153# num_records bounds check (cs_bounds.asm): one thread, so no 64-wide subgroup requirement.
146# The SMEM and raw MUBUF rules measured on an RX 6800 (derivations in each .asm header): one thread too. 154# The SMEM and raw MUBUF rules measured on an RX 6800 (derivations in each .asm header): one thread too.
147# Never run cs_smem_sload_neg with a translator that zero-extends the s_load immediate: it reads 4 GiB past the heap. 155# Never run cs_smem_sload_neg with a translator that zero-extends the s_load immediate: it reads 4 GiB past the heap.
@@ -155,12 +163,33 @@ BOUNDS = [("cs_bounds", [0x12345678, 0x12345678, 0x00000000, 0xEEEEEEEE]),
155 ("cs_oob_select", [0x5eed000c, 0, 0x5eed0014, 0, 0x5eed0018, 0xeeeeeeee, 0, 0]), 163 ("cs_oob_select", [0x5eed000c, 0, 0x5eed0014, 0, 0x5eed0018, 0xeeeeeeee, 0, 0]),
156 # the end of an access decides (a start check, Mesa's GFX10 column, reads more); x4 loads and stores per dword, typed all or nothing 164 # the end of an access decides (a start check, Mesa's GFX10 column, reads more); x4 loads and stores per dword, typed all or nothing
157 ("cs_oob_tail", [0, 0, 0x5eed0010, 0, 0xbeef0000, 0xeeeeeeee, 0, 0x5eed0010]), 165 ("cs_oob_tail", [0, 0, 0x5eed0010, 0, 0xbeef0000, 0xeeeeeeee, 0, 0x5eed0010]),
158 # swizzled MUBUF addressing (RDNA2 ISA 8.1.5) and ADD_TID_ENABLE on lanes 0 and 1, derived in the .asm header 166 # swizzled MUBUF addressing (measured natively on gfx1036) and ADD_TID_ENABLE on lanes 0 and 1, derived in the .asm header
159 ("cs_buf_swizzle", [0x5eed0024, 0x5eed0044, 0x5eed004c, 0x5eed0008, 0x5eed0028, 0, 0xbeef0000, 0xbeef0001])] 167 ("cs_buf_swizzle", [0x5eed0024, 0x5eed0044, 0x5eed004c, 0x5eed0008, 0x5eed000c, 0, 0xbeef0000, 0xbeef0001])]
160CMPX_CLASS_WORDS = [0xEEEEEEEE] * 3 + [0x22] + [0x11] * 4 168CMPX_CLASS_WORDS = [0xEEEEEEEE] * 3 + [0x22] + [0x11] * 4
161# cs_fmt_1010102.asm: descriptor loads, immediate-format load, raw input words and the two packed stores. 169# cs_fmt_1010102.asm: descriptor loads, immediate-format load, raw input words and the two packed stores.
162FMT_1010102_WORDS = [0, 0x3F800000, 0, 0x3F800000, 0x3F800000, 0, 0x3F800000, 0, 170FMT_1010102_WORDS = [0, 0x3F800000, 0, 0x3F800000, 0x3F800000, 0, 0x3F800000, 0,
163 0, 0x3F800000, 0, 0x3F800000, 0xC00FFC00, 0x003FF003, 0xE00003FF, 0xFFE00003] 171 0, 0x3F800000, 0, 0x3F800000, 0xC00FFC00, 0x003FF003, 0xE00003FF, 0xFFE00003]
172# cs_fmt_int_narrow.asm: 8- and 16-bit UINT/SINT typed buffer loads and stores (layout in the .asm header). The
173# words are the same program's output on gfx1036 run natively (tools/hw_oracle, wave32 and wave64 identical).
174FMT_INT_NARROW_WORDS = [
175 0x00000080, 0x00000080, 0x00000080, 0x00000080, 0xFFFFFF80, 0xFFFFFF80, 0xFFFFFF80, 0xFFFFFF80,
176 0x0000FF80, 0x0000FF80, 0x0000FF80, 0x0000FF80, 0xFFFFFF80, 0xFFFFFF80, 0xFFFFFF80, 0xFFFFFF80,
177 0x00000080, 0x000000FF, 0x00000080, 0x000000FF, 0xFFFFFF80, 0xFFFFFFFF, 0xFFFFFF80, 0xFFFFFFFF,
178 0xFFFFFF80, 0x00007F01, 0xFFFFFF80, 0x00007F01, 0xFFFFFF80, 0xFFFFFFFF, 0x00000001, 0x0000007F,
179 0xFFFFFF80, 0x00007F01, 0xFFFFFFFF, 0xFFFF8000, 0xFFFFFF80, 0x00000000, 0x00000001, 0x00000001,
180 0x0000FF80, 0x00000000, 0x00000001, 0x00000001, 0xFF80FF80, 0xFF80FF80, 0xFFFFFF80, 0x007F0001,
181 0x7F01FF80, 0x8000FFFF, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
182 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
183 0xEEEEEE7F, 0xEEEEEEEE, 0xEEEEEE7F, 0xEEEEEEEE, 0xEEEE7FFF, 0xEEEEEEEE, 0xEEEE7FFF, 0xEEEEEEEE,
184 0xEEEE807F, 0xEEEEEEEE, 0xEEEE7F7F, 0xEEEEEEEE, 0x7FFF7FFF, 0xEEEEEEEE, 0x80807F7F, 0xEEEEEEEE,
185 0x7FFF7FFF, 0x80008000, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
186 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
187 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
188 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
189 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
190 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
191 0x7F01FF80, 0x8000FFFF, 0x12345678, 0x9ABCDEF0, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE, 0xEEEEEEEE,
192]
164# cs_fmt_sint32.asm: hand-derived full-width and D16 load results, inputs, stores, and untouched words. 193# cs_fmt_sint32.asm: hand-derived full-width and D16 load results, inputs, stores, and untouched words.
165FMT_SINT32_WORDS = [ 194FMT_SINT32_WORDS = [
166 0x80000000, 0x7FFFFFFF, 0x80000000, 1, 195 0x80000000, 0x7FFFFFFF, 0x80000000, 1,
@@ -289,6 +318,8 @@ PIXEL_BITS = {"ps_clip_color": (0x3e800000, 0x3f000000, 0x3f400000, 0x3f800000),
289 "ps_f16_pack": (0x34003c00, 0x38003400, 0x34000000, 0x44004200), 318 "ps_f16_pack": (0x34003c00, 0x38003400, 0x34000000, 0x44004200),
290 # v_pack_b32_f16 neg/abs on the selected half: a sign flip / clear before packing (SHADER-260) 319 # v_pack_b32_f16 neg/abs on the selected half: a sign flip / clear before packing (SHADER-260)
291 "ps_f16_pack_mods": (0x4400b400, 0xc4003400, 0x4400c200, 0xb400b400), 320 "ps_f16_pack_mods": (0x4400b400, 0xc4003400, 0x4400c200, 0xb400b400),
321 # SDWA src_sel on a float inline constant in an f16 op (measured on gfx1036)
322 "ps_sdwa_f16_const": (0xaaaa3800, 0xaaaa1c00, 0xaaaa3e00, 0xaaaa73f0),
292 "ps_sff_imm": (2, 1, 20, 16), 323 "ps_sff_imm": (2, 1, 20, 16),
293 "ps_fnan_med3": (0x40a00000, 0xc0200000, 0xc0200000, 0x40600000), 324 "ps_fnan_med3": (0x40a00000, 0xc0200000, 0xc0200000, 0x40600000),
294 "ps_fnan_fract": (0x3f7fffff, 0x00003bff, 0xc0200000, 0xc0200000), 325 "ps_fnan_fract": (0x3f7fffff, 0x00003bff, 0xc0200000, 0xc0200000),
@@ -305,7 +336,8 @@ PIXEL_BITS = {"ps_clip_color": (0x3e800000, 0x3f000000, 0x3f400000, 0x3f800000),
305 # v_readlane_b32 across both halves of a wave64 (the .asm header derives the words) 336 # v_readlane_b32 across both halves of a wave64 (the .asm header derives the words)
306 "ps_w64x_readlane": (0x40000079, 0x40000010, 0x40000064, 0x400000be)} 337 "ps_w64x_readlane": (0x40000079, 0x40000010, 0x40000064, 0x400000be)}
307# Pixel shaders that are exact only when the pixel stage really ran 64 lanes wide. vk_harness says so when it chained 338# Pixel shaders that are exact only when the pixel stage really ran 64 lanes wide. vk_harness says so when it chained
308# a required subgroup size onto the fragment stage ("fragment subgroup size: N required"). A device that cannot 339# a required subgroup size onto the fragment stage ("fragment subgroup size: N", the whole line; a device that could
340# not take the size gets "fragment subgroup size: N not available" or no line). A device that cannot
309# require 64 there (NVIDIA: 32 only; llvmpipe: 8) has no frame to judge: the test is skipped, not failed. 341# require 64 there (NVIDIA: 32 only; llvmpipe: 8) has no frame to judge: the test is skipped, not failed.
310WIDE_PIXEL_TESTS = {"ps_w64x_readlane": 64} 342WIDE_PIXEL_TESTS = {"ps_w64x_readlane": 64}
311# Pixel shaders that read memory: vk_harness puts this V# in s[0:3] and seeds the heap it points at, as 343# Pixel shaders that read memory: vk_harness puts this V# in s[0:3] and seeds the heap it points at, as
@@ -475,6 +507,10 @@ def fmt_1010102_test(tools, spirv, env=None):
475 return dump_test(tools, spirv, "cs_fmt_1010102", FMT_1010102_WORDS + [0xEEEEEEEE] * 48, 64, env) 507 return dump_test(tools, spirv, "cs_fmt_1010102", FMT_1010102_WORDS + [0xEEEEEEEE] * 48, 64, env)
476 508
477 509
510def fmt_int_narrow_test(tools, spirv, env=None):
511 return dump_test(tools, spirv, "cs_fmt_int_narrow", FMT_INT_NARROW_WORDS, len(FMT_INT_NARROW_WORDS), env)
512
513
478def fmt_sint32_test(tools, spirv, env=None): 514def fmt_sint32_test(tools, spirv, env=None):
479 return dump_test(tools, spirv, "cs_fmt_sint32", FMT_SINT32_WORDS, len(FMT_SINT32_WORDS), env) 515 return dump_test(tools, spirv, "cs_fmt_sint32", FMT_SINT32_WORDS, len(FMT_SINT32_WORDS), env)
480 516
@@ -635,6 +671,29 @@ def vcmpx_forms_narrow_skip(out):
635 return None 671 return None
636 672
637 673
674# Dump words a driver gets wrong with or without SignedZeroInfNanPreserve, by the first word of the device name on
675# vk_compute_test's "device: ..." line. Only these words go unjudged there. Shared with run_gpu_tests.py.
676# - Apple GPUs (MoltenVK) return +0 for cs_signed_zero_nan's -0 products, words 0, 2 and 3 (v_mul_f32, v_pk_mul_f16,
677# v_mul_f16; #1203, SHADER-182).
678# - Mesa llvmpipe returns 0 in word 5, the NaN check of 0 * inf (an inline-constant 0), while its other NaN checks give
679# 1 (#664, Mesa with LLVM 21.1.8). The CI runs the GPU tests on llvmpipe.
680UNJUDGED_WORDS = {"Apple": {"cs_signed_zero_nan": (0, 2, 3)},
681 "llvmpipe": {"cs_signed_zero_nan": (5,)}}
682
683
684def judged_words(name, out, words):
685 """The expected words with None where nothing is judged: UNJUDGED_WORDS for the device that vk_compute_test's
686 "device: ..." line names, else every word as given."""
687 m = re.search(r"^device: (\S+)", out, re.MULTILINE)
688 unjudged = UNJUDGED_WORDS.get(m.group(1), {}).get(name, ()) if m else ()
689 return [None if i in unjudged else w for i, w in enumerate(words)]
690
691
692def words_match(got, want):
693 """The dump's words against want, which may be shorter; a None in want is not judged."""
694 return len(got) >= len(want) and all(w is None or g == w for g, w in zip(got, want))
695
696
638def compute_test(tools, spirv, name, groups, mode, *, require_wave64=False, expected_words=None, needs_32_lanes=False, 697def compute_test(tools, spirv, name, groups, mode, *, require_wave64=False, expected_words=None, needs_32_lanes=False,
639 env=None): 698 env=None):
640 """Return an empty string for a pass, None for unsupported wave64, a Skip for a wave32 lane-mask test on a device 699 """Return an empty string for a pass, None for unsupported wave64, a Skip for a wave32 lane-mask test on a device
@@ -670,7 +729,7 @@ def compute_test(tools, spirv, name, groups, mode, *, require_wave64=False, expe
670 return "" 729 return ""
671 elif expected_words is not None: 730 elif expected_words is not None:
672 m = re.search(r"^out\[0\.\.7\] = ((?:[0-9]+ ){7}[0-9]+)$", out, re.MULTILINE) 731 m = re.search(r"^out\[0\.\.7\] = ((?:[0-9]+ ){7}[0-9]+)$", out, re.MULTILINE)
673 if m and [int(x) for x in m.group(1).split()][:len(expected_words)] == expected_words: 732 if m and words_match([int(x) for x in m.group(1).split()], judged_words(name, out, expected_words)):
674 return "" 733 return ""
675 else: 734 else:
676 m = re.search(r"(\d+) mismatches", out) 735 m = re.search(r"(\d+) mismatches", out)
@@ -1123,7 +1182,7 @@ def wide_pixel_skip(name, out):
1123 """A Skip when `name` needs a 64-wide pixel stage (WIDE_PIXEL_TESTS) and vk_harness's output does not say that size 1182 """A Skip when `name` needs a 64-wide pixel stage (WIDE_PIXEL_TESTS) and vk_harness's output does not say that size
1124 was required of the fragment stage, else None.""" 1183 was required of the fragment stage, else None."""
1125 want = WIDE_PIXEL_TESTS.get(name) 1184 want = WIDE_PIXEL_TESTS.get(name)
1126 if not want or re.search(rf"^fragment subgroup size: {want} required$", out, re.MULTILINE): 1185 if not want or re.search(rf"^fragment subgroup size: {want}$", out, re.MULTILINE):
1127 return None 1186 return None
1128 m = re.search(r"subgroup (\d+)\.\.(\d+)", out) 1187 m = re.search(r"subgroup (\d+)\.\.(\d+)", out)
1129 seen = f": subgroup {m.group(1)}..{m.group(2)}" if m else "" 1188 seen = f": subgroup {m.group(1)}..{m.group(2)}" if m else ""
@@ -1179,7 +1238,7 @@ def pixel_test(tools, spirv, name):
1179 return f"missing {name}.spv" 1238 return f"missing {name}.spv"
1180 if name in ("ps_texoff", "ps_texoff_implicit"): 1239 if name in ("ps_texoff", "ps_texoff_implicit"):
1181 return texoff_test(tools, spirv, name) 1240 return texoff_test(tools, spirv, name)
1182 if name == "ps_interp_f16_high" and BARY_FALLBACK: 1241 if name == "ps_interp_f16_high" and BARY_FALLBACK and not F16_HALVES: # with F16_HALVES it reads decoded halves
1183 return Skip("SKIP (per-vertex interpolants need VK_KHR_fragment_shader_barycentric)") 1242 return Skip("SKIP (per-vertex interpolants need VK_KHR_fragment_shader_barycentric)")
1184 fmt = "<4f" if name == "ps_bary" else "<2I2f" if name in ("ps_flat", "ps_uniform_branch", "ps_scc_mask32") else "<4I" 1243 fmt = "<4f" if name == "ps_bary" else "<2I2f" if name in ("ps_flat", "ps_uniform_branch", "ps_scc_mask32") else "<4I"
1185 px, out = pixels(tools, spirv, name, fmt, PIXEL_VERTEX.get(name, "vs_ids")) 1244 px, out = pixels(tools, spirv, name, fmt, PIXEL_VERTEX.get(name, "vs_ids"))
@@ -1290,6 +1349,7 @@ def main():
1290 expected_words=CMPX_CLASS_WORDS))) 1349 expected_words=CMPX_CLASS_WORDS)))
1291 results.append(("cs_fmt_1010102", fmt_1010102_test(tools, spirv))) 1350 results.append(("cs_fmt_1010102", fmt_1010102_test(tools, spirv)))
1292 results.append(("cs_fmt_sint32", fmt_sint32_test(tools, spirv))) 1351 results.append(("cs_fmt_sint32", fmt_sint32_test(tools, spirv)))
1352 results.append(("cs_fmt_int_narrow", fmt_int_narrow_test(tools, spirv)))
1293 results.append(("cs_fmt_xy_xyz", fmt_xy_xyz_test(tools, spirv))) 1353 results.append(("cs_fmt_xy_xyz", fmt_xy_xyz_test(tools, spirv)))
1294 results.append(("cs_tbuffer_store", tbuffer_store_test(tools, spirv))) 1354 results.append(("cs_tbuffer_store", tbuffer_store_test(tools, spirv)))
1295 for name, groups, want in GLOBAL_OFFSET: 1355 for name, groups, want in GLOBAL_OFFSET:
diff --git a/runtime/test/shaders/cs_buf_swizzle.asm b/runtime/test/shaders/cs_buf_swizzle.asm
index bead1aac3..1b7f72803 100644
--- a/runtime/test/shaders/cs_buf_swizzle.asm
+++ b/runtime/test/shaders/cs_buf_swizzle.asm
@@ -1,10 +1,11 @@
1; Swizzled MUBUF addressing and ADD_TID_ENABLE (docs/design.md, Buffer bounds checking). RDNA2 ISA 8.1.5 "Swizzled 1; Swizzled MUBUF addressing and ADD_TID_ENABLE (docs/design.md, Swizzled buffer addressing). Measured natively on
2; Buffer Addressing", element_size fixed at 4 bytes; fields from Mesa gfx10-rsrc.json: SWIZZLE_ENABLE = word1 bit 31, 2; RDNA2 (gfx1036, wave32 & wave64): SWIZZLE_ENABLE = word1 bit 31, STRIDE = word1 [29:16], INDEX_STRIDE = word3 [22:21]
3; STRIDE = word1 [29:16], INDEX_STRIDE = word3 [22:21] (8 << n), ADD_TID_ENABLE = word3 bit 23: 3; (IS = 8 << n), ADD_TID_ENABLE = word3 bit 23:
4; index = (idxen ? vindex : 0) + (ADD_TID_ENABLE ? lane : 0), offset = (offen ? vaddr : 0) + inst_offset 4; index = idxen ? vindex : (ADD_TID_ENABLE ? lane : 0), offset = uint32((offen ? vaddr : 0) + inst_offset)
5; buffer_offset = (index / IS * stride + offset / 4 * 4) * IS + index % IS * 4 + offset % 4, address = base + 5; buffer_offset = (index / IS * stride + (offset & ~3)) * IS + (index % IS) * 4 + (offset & 3), address = base +
6; soffset + buffer_offset (IS = index_stride). OOB_SELECT 3 with swizzle and stride != 0 checks index >= NUM_RECORDS 6; soffset + buffer_offset (IS = index_stride). With idxen=1, multi-dword accesses step linearly by +4 bytes; with
7; or offset + payload > stride (ISA table 35); ADD_TID_ENABLE also adds the lane in a linear V# (table 36's ring). 7; idxen=0 and ADD_TID_ENABLE=1 (scratch swizzle), raw multi-dword accesses step by 4 * IS. OOB_SELECT 3 with active
8; swizzle and stride != 0 checks (index + soffset) >= NUM_RECORDS or offset + payload > stride.
8; Thread 0 seeds heap bytes 0x40..0x8f (region offset X = byte 0x40 + X) with 0x5eed0000 + X; the heap is 0xee-filled, 9; Thread 0 seeds heap bytes 0x40..0x8f (region offset X = byte 0x40 + X) with 0x5eed0000 + X; the heap is 0xee-filled,
9; so an in-range access past the seed reads 0xeeeeeeee. V# A (s[4:7], literal): base 0x40, swizzled, stride 8, NR 16, 10; so an in-range access past the seed reads 0xeeeeeeee. V# A (s[4:7], literal): base 0x40, swizzled, stride 8, NR 16,
10; IS 8, OOB_SELECT 3. V# B (s[8:11], words 1 and 3 or-ed at run time): base 0x40, swizzled, stride 8, NR 8, IS 16, 11; IS 8, OOB_SELECT 3. V# B (s[8:11], words 1 and 3 or-ed at run time): base 0x40, swizzled, stride 8, NR 8, IS 16,
@@ -14,13 +15,13 @@
14; 1 A, idx 9, off 0: (1 * 8 + 0) * 8 + 1 * 4 = X 0x44: 0x5eed0044 [X 0x48] 15; 1 A, idx 9, off 0: (1 * 8 + 0) * 8 + 1 * 4 = X 0x44: 0x5eed0044 [X 0x48]
15; 2 B, idx 3, off 4: (0 * 8 + 4) * 16 + 3 * 4 = X 0x4c: 0x5eed004c [X 0x1c] 16; 2 B, idx 3, off 4: (0 * 8 + 4) * 16 + 3 * 4 = X 0x4c: 0x5eed004c [X 0x1c]
16; 3 A x2, idx 2, off 0, dword 0: 0 * 8 + 2 * 4 = X 0x8: 0x5eed0008 [X 0x10] 17; 3 A x2, idx 2, off 0, dword 0: 0 * 8 + 2 * 4 = X 0x8: 0x5eed0008 [X 0x10]
17; 4 A x2, idx 2, dword 1 (offset 4): (0 * 8 + 4) * 8 + 2 * 4 = X 0x28: 0x5eed0028 [X 0x14] 18; 4 A x2, idx 2, dword 1 (idxen=1 steps linearly +4): X 0x8 + 4 = X 0xc: 0x5eed000c [X 0x14]
18; 5 A, idx 16, off 0: 16 >= NR 16 -> 0 (the raw check, 4 <= 16, reads X 0x80 past the seed: 0xeeeeeeee) 19; 5 A, idx 16, off 0: 16 >= NR 16 -> 0 (the raw check, 4 <= 16, reads X 0x80 past the seed: 0xeeeeeeee)
19; 6, 7 lanes 0 and 1 store 0xbeef0000 + lane through C: address 0x18 + lane * 4 -> 0xbeef0000 0xbeef0001 20; 6, 7 lanes 0 and 1 store 0xbeef0000 + lane through C: address 0x18 + lane * 4 -> 0xbeef0000 0xbeef0001
20; (without ADD_TID both lanes store to out[6], and out[7] keeps 0xeeeeeeee) 21; (without ADD_TID both lanes store to out[6], and out[7] keeps 0xeeeeeeee)
21; Lanes 0 and 1 only store (no lane reads what another wrote); thread 0 alone seeds and loads. No wave64 requirement. 22; Lanes 0 and 1 only store (no lane reads what another wrote); thread 0 alone seeds and loads. No wave64 requirement.
22; Run: vk_compute_test cs_buf_swizzle.spv 1 dump -> out[0..7] = 0x5eed0024 0x5eed0044 0x5eed004c 0x5eed0008 23; Run: vk_compute_test cs_buf_swizzle.spv 1 dump -> out[0..7] = 0x5eed0024 0x5eed0044 0x5eed004c 0x5eed0008
23; 0x5eed0028 0x00000000 0xbeef0000 0xbeef0001 (1592590372 1592590404 1592590412 1592590344 1592590376 0 3203334144 24; 0x5eed000c 0x00000000 0xbeef0000 0xbeef0001 (1592590372 1592590404 1592590412 1592590344 1592590348 0 3203334144
24; 3203334145). 25; 3203334145).
25v_cmpx_gt_u32_e32 2, v0 26v_cmpx_gt_u32_e32 2, v0
26s_mov_b32 s12, 0x18 27s_mov_b32 s12, 0x18
diff --git a/runtime/test/shaders/cs_fmt_int_narrow.asm b/runtime/test/shaders/cs_fmt_int_narrow.asm
new file mode 100644
index 000000000..5cd87b094
--- /dev/null
+++ b/runtime/test/shaders/cs_fmt_int_narrow.asm
@@ -0,0 +1,126 @@
1; Narrow integer typed buffers: 8/16-bit UINT and SINT formats 5, 6, 11, 12, 18, 19, 28, 61 and 70.
2; Lane 0 writes the source dwords 0x7f01ff80 0x8000ffff 0x12345678 0x9abcdef0 at byte 0x200, then:
3; out[0..35]: buffer_load_format_xyzw with DST_SEL XYZW, four words per format in the order above;
4; out[36..43]: DST_SEL X011 for 8_SINT and 16_UINT (0 and integer 1);
5; out[44..49]: buffer_load_format_d16_xyzw for 8_SINT, 8_8_8_8_SINT and 16_16_16_16_SINT;
6; out[64..81]: buffer_store_format_xyzw of 0x7f, 0x80, -128, -129 (8-bit formats) or 0x7fff, 0x8000, -32768,
7; -32769 (16-bit) at a dword pair per format, with the runtime's selectors (X001, XY01, XYZW); SINT clamps
8; signed, UINT saturates, and a 1-2 byte element keeps the 0xee fill of the rest of its dword.
9; The expected words (check.py FMT_INT_NARROW_WORDS) are this program's output on gfx1036, run natively.
10v_cmpx_eq_u32_e32 0, v0
11v_mov_b32_e32 v1, 0x7f01ff80
12v_mov_b32_e32 v2, 0x8000ffff
13v_mov_b32_e32 v3, 0x12345678
14v_mov_b32_e32 v4, 0x9abcdef0
15v_mov_b32_e32 v5, 0x200
16buffer_store_dwordx4 v[1:4], v5, s[0:3], 0 offen
17s_waitcnt_vscnt null, 0x0
18s_mov_b32 s4, s0
19s_mov_b32 s5, s1
20s_mov_b32 s6, s2
21s_mov_b32 s7, 0x31005fac
22buffer_load_format_xyzw v[8:11], v5, s[4:7], 0 offen
23s_waitcnt vmcnt(0)
24v_mov_b32_e32 v6, 0x0
25buffer_store_dwordx4 v[8:11], v6, s[0:3], 0 offen
26s_mov_b32 s7, 0x31006fac
27buffer_load_format_xyzw v[8:11], v5, s[4:7], 0 offen
28s_waitcnt vmcnt(0)
29v_mov_b32_e32 v6, 0x10
30buffer_store_dwordx4 v[8:11], v6, s[0:3], 0 offen
31s_mov_b32 s7, 0x3100bfac
32buffer_load_format_xyzw v[8:11], v5, s[4:7], 0 offen
33s_waitcnt vmcnt(0)
34v_mov_b32_e32 v6, 0x20
35buffer_store_dwordx4 v[8:11], v6, s[0:3], 0 offen
36s_mov_b32 s7, 0x3100cfac
37buffer_load_format_xyzw v[8:11], v5, s[4:7], 0 offen
38s_waitcnt vmcnt(0)
39v_mov_b32_e32 v6, 0x30
40buffer_store_dwordx4 v[8:11], v6, s[0:3], 0 offen
41s_mov_b32 s7, 0x31012fac
42buffer_load_format_xyzw v[8:11], v5, s[4:7], 0 offen
43s_waitcnt vmcnt(0)
44v_mov_b32_e32 v6, 0x40
45buffer_store_dwordx4 v[8:11], v6, s[0:3], 0 offen
46s_mov_b32 s7, 0x31013fac
47buffer_load_format_xyzw v[8:11], v5, s[4:7], 0 offen
48s_waitcnt vmcnt(0)
49v_mov_b32_e32 v6, 0x50
50buffer_store_dwordx4 v[8:11], v6, s[0:3], 0 offen
51s_mov_b32 s7, 0x3101cfac
52buffer_load_format_xyzw v[8:11], v5, s[4:7], 0 offen
53s_waitcnt vmcnt(0)
54v_mov_b32_e32 v6, 0x60
55buffer_store_dwordx4 v[8:11], v6, s[0:3], 0 offen
56s_mov_b32 s7, 0x3103dfac
57buffer_load_format_xyzw v[8:11], v5, s[4:7], 0 offen
58s_waitcnt vmcnt(0)
59v_mov_b32_e32 v6, 0x70
60buffer_store_dwordx4 v[8:11], v6, s[0:3], 0 offen
61s_mov_b32 s7, 0x31046fac
62buffer_load_format_xyzw v[8:11], v5, s[4:7], 0 offen
63s_waitcnt vmcnt(0)
64v_mov_b32_e32 v6, 0x80
65buffer_store_dwordx4 v[8:11], v6, s[0:3], 0 offen
66s_mov_b32 s7, 0x31006244
67buffer_load_format_xyzw v[8:11], v5, s[4:7], 0 offen
68s_waitcnt vmcnt(0)
69v_mov_b32_e32 v6, 0x90
70buffer_store_dwordx4 v[8:11], v6, s[0:3], 0 offen
71s_mov_b32 s7, 0x3100b244
72buffer_load_format_xyzw v[8:11], v5, s[4:7], 0 offen
73s_waitcnt vmcnt(0)
74v_mov_b32_e32 v6, 0xa0
75buffer_store_dwordx4 v[8:11], v6, s[0:3], 0 offen
76s_mov_b32 s7, 0x31006fac
77buffer_load_format_d16_xyzw v[8:9], v5, s[4:7], 0 offen
78s_waitcnt vmcnt(0)
79v_mov_b32_e32 v6, 0xb0
80buffer_store_dwordx2 v[8:9], v6, s[0:3], 0 offen
81s_mov_b32 s7, 0x3103dfac
82buffer_load_format_d16_xyzw v[8:9], v5, s[4:7], 0 offen
83s_waitcnt vmcnt(0)
84v_mov_b32_e32 v6, 0xb8
85buffer_store_dwordx2 v[8:9], v6, s[0:3], 0 offen
86s_mov_b32 s7, 0x31046fac
87buffer_load_format_d16_xyzw v[8:9], v5, s[4:7], 0 offen
88s_waitcnt vmcnt(0)
89v_mov_b32_e32 v6, 0xc0
90buffer_store_dwordx2 v[8:9], v6, s[0:3], 0 offen
91v_mov_b32_e32 v12, 0x7f
92v_mov_b32_e32 v13, 0x80
93v_mov_b32_e32 v14, 0xffffff80
94v_mov_b32_e32 v15, 0xffffff7f
95v_mov_b32_e32 v16, 0x7fff
96v_mov_b32_e32 v17, 0x8000
97v_mov_b32_e32 v18, 0xffff8000
98v_mov_b32_e32 v19, 0xffff7fff
99s_mov_b32 s7, 0x31005204
100v_mov_b32_e32 v6, 0x100
101buffer_store_format_xyzw v[12:15], v6, s[4:7], 0 offen
102s_mov_b32 s7, 0x31006204
103v_mov_b32_e32 v6, 0x108
104buffer_store_format_xyzw v[12:15], v6, s[4:7], 0 offen
105s_mov_b32 s7, 0x3100b204
106v_mov_b32_e32 v6, 0x110
107buffer_store_format_xyzw v[16:19], v6, s[4:7], 0 offen
108s_mov_b32 s7, 0x3100c204
109v_mov_b32_e32 v6, 0x118
110buffer_store_format_xyzw v[16:19], v6, s[4:7], 0 offen
111s_mov_b32 s7, 0x3101222c
112v_mov_b32_e32 v6, 0x120
113buffer_store_format_xyzw v[12:15], v6, s[4:7], 0 offen
114s_mov_b32 s7, 0x3101322c
115v_mov_b32_e32 v6, 0x128
116buffer_store_format_xyzw v[12:15], v6, s[4:7], 0 offen
117s_mov_b32 s7, 0x3101c22c
118v_mov_b32_e32 v6, 0x130
119buffer_store_format_xyzw v[16:19], v6, s[4:7], 0 offen
120s_mov_b32 s7, 0x3103dfac
121v_mov_b32_e32 v6, 0x138
122buffer_store_format_xyzw v[12:15], v6, s[4:7], 0 offen
123s_mov_b32 s7, 0x31046fac
124v_mov_b32_e32 v6, 0x140
125buffer_store_format_xyzw v[16:19], v6, s[4:7], 0 offen
126s_endpgm
diff --git a/runtime/test/shaders/cs_fmt_sint32.asm b/runtime/test/shaders/cs_fmt_sint32.asm
index a444421ce..fa57f615e 100644
--- a/runtime/test/shaders/cs_fmt_sint32.asm
+++ b/runtime/test/shaders/cs_fmt_sint32.asm
@@ -64,8 +64,8 @@ tbuffer_load_format_x v9, v5, s[4:7], 0 format:[BUF_FMT_32_SINT] offen offset:8
64v_mov_b32_e32 v6, 0x70 64v_mov_b32_e32 v6, 0x70
65buffer_store_dwordx2 v[8:9], v6, s[0:3], 0 offen 65buffer_store_dwordx2 v[8:9], v6, s[0:3], 0 offen
66 66
67; MUBUF store via format 63. 67; MUBUF store via format 63 (DST_SEL XY01, standard 2-component RG).
68s_mov_b32 s7, 0x3103ffac 68s_mov_b32 s7, 0x3103f22c
69v_mov_b32_e32 v6, 0x90 69v_mov_b32_e32 v6, 0x90
70buffer_store_format_xy v[1:2], v6, s[4:7], 0 offen 70buffer_store_format_xy v[1:2], v6, s[4:7], 0 offen
71 71
@@ -80,7 +80,7 @@ v_mov_b32_e32 v6, 0xb0
80buffer_store_format_xyzw v[1:4], v6, s[4:7], 0 offen 80buffer_store_format_xyzw v[1:4], v6, s[4:7], 0 offen
81 81
82; A signed packed store must extend both halves. 82; A signed packed store must extend both halves.
83s_mov_b32 s7, 0x3103ffac 83s_mov_b32 s7, 0x3103f22c
84v_mov_b32_e32 v6, 0xc0 84v_mov_b32_e32 v6, 0xc0
85v_mov_b32_e32 v7, 0x8000fffd 85v_mov_b32_e32 v7, 0x8000fffd
86buffer_store_format_d16_xy v7, v6, s[4:7], 0 offen 86buffer_store_format_d16_xy v7, v6, s[4:7], 0 offen
diff --git a/runtime/test/shaders/cs_mask_vgpr_exec.asm b/runtime/test/shaders/cs_mask_vgpr_exec.asm
new file mode 100644
index 000000000..13e0bc0d9
--- /dev/null
+++ b/runtime/test/shaders/cs_mask_vgpr_exec.asm
@@ -0,0 +1,15 @@
1; group: 32,1,1
2; Part-2 test (SHADER-21 follow-up): a lane mask written to a VGPR under partial EXEC.
3; Hardware: inactive lanes keep their old VGPR value.
4; If the translator's write_all_lanes ignores EXEC, inactive lanes get the mask word instead.
5v_mbcnt_lo_u32_b32 v1, -1, 0
6v_mov_b32_e32 v2, 0xdeadbeef
7v_mov_b32_e32 v5, 1
8v_mov_b32_e32 v6, 2
9v_cmp_lt_u32_e64 vcc_lo, v5, v6
10s_mov_b32 exec_lo, 0x0000000f
11v_mov_b32_e32 v2, vcc_lo
12s_mov_b32 exec_lo, -1
13v_lshlrev_b32_e32 v3, 2, v1
14buffer_store_dword v2, v3, s[0:3], 0 offen
15s_endpgm
diff --git a/runtime/test/shaders/cs_signed_zero_nan.asm b/runtime/test/shaders/cs_signed_zero_nan.asm
new file mode 100644
index 000000000..3dd8555cc
--- /dev/null
+++ b/runtime/test/shaders/cs_signed_zero_nan.asm
@@ -0,0 +1,63 @@
1; group: 8,1,1
2; mattr: +wavefrontsize32,-wavefrontsize64
3; NaN, infinity and -0 come out of RDNA2 float ops as computed (IEEE). The translator declares
4; SignedZeroInfNanPreserve so the driver may not assume they don't occur. Without it, on an RX 9070 XT (AMD
5; 26.11.2) this test gets 0 in out[4..7]: the x != x NaN checks fold to false and the NaN conversion is lost. The
6; f16 fuzzer there also saw -0 products come back +0, and NaN results narrowed with integer ops never stored.
7; Apple GPUs (MoltenVK) return +0 in out[0], out[2] and out[3] with or without the mode (#1203, SHADER-182), so
8; check.py and run_gpu_tests.py don't judge those three words on an Apple device; the other five still count.
9; Mesa llvmpipe returns 0 in out[5] (the 0 * inf check) with or without the mode, while its other NaN checks give 1
10; (#664), so out[5] isn't judged there; the other seven still count (UNJUDGED_WORDS in check.py).
11; Thread 0 stores eight words:
12; out[0] v_mul_f32 -0.0 * 1.0 = 0x80000000
13; out[1] v_add_f32 -0.0 + -0.0 = 0x80000000
14; out[2] v_pk_mul_f16 (-0, -0) * (1.0, 1.0) = 0x80008000
15; out[3] v_mul_f16 -0 * 1.0, high half kept (0) = 0x00008000
16; out[4] v_cmp_neq_f32 x, x with x = inf - inf (NaN) = 0x00000001
17; out[5] v_cmp_neq_f32 x, x with x = 0 * inf (NaN) = 0x00000001
18; out[6] v_cmp_neq_f16 x, x with x = f16 inf - inf (NaN) = 0x00000001
19; out[7] v_cvt_f16_f32 of NaN, exponent bits (& 0x7c00) = 0x00007c00
20; Run: vk_compute_test cs_signed_zero_nan.spv 1 dump
21; out[0..7] = 80000000 80000000 80008000 00008000 00000001 00000001 00000001 00007c00 (hex)
22v_cmpx_eq_u32_e32 0, v0
23v_mov_b32_e32 v1, 0x80000000
24v_mov_b32_e32 v2, 1.0
25v_mul_f32_e32 v10, v1, v2
26v_add_f32_e32 v11, v1, v1
27v_mov_b32_e32 v3, 0x80008000
28v_mov_b32_e32 v4, 0x3c003c00
29v_pk_mul_f16 v12, v3, v4
30v_mov_b32_e32 v13, 0
31v_mul_f16_e32 v13, v3, v4
32v_mov_b32_e32 v5, 0x7f800000
33v_sub_f32_e32 v6, v5, v5
34v_cmp_neq_f32_e32 vcc_lo, v6, v6
35v_cndmask_b32_e64 v14, 0, 1, vcc_lo
36v_mov_b32_e32 v7, 0
37v_mul_f32_e32 v8, v7, v5
38v_cmp_neq_f32_e32 vcc_lo, v8, v8
39v_cndmask_b32_e64 v15, 0, 1, vcc_lo
40v_mov_b32_e32 v9, 0x7c00
41v_sub_f16_e32 v16, v9, v9
42v_cmp_neq_f16_e32 vcc_lo, v16, v16
43v_cndmask_b32_e64 v17, 0, 1, vcc_lo
44v_mov_b32_e32 v18, 0
45v_cvt_f16_f32_e32 v18, v6
46v_and_b32_e32 v18, 0x7c00, v18
47v_mov_b32_e32 v30, 0
48buffer_store_dword v10, v30, s[0:3], 0 offen
49v_mov_b32_e32 v30, 4
50buffer_store_dword v11, v30, s[0:3], 0 offen
51v_mov_b32_e32 v30, 8
52buffer_store_dword v12, v30, s[0:3], 0 offen
53v_mov_b32_e32 v30, 12
54buffer_store_dword v13, v30, s[0:3], 0 offen
55v_mov_b32_e32 v30, 16
56buffer_store_dword v14, v30, s[0:3], 0 offen
57v_mov_b32_e32 v30, 20
58buffer_store_dword v15, v30, s[0:3], 0 offen
59v_mov_b32_e32 v30, 24
60buffer_store_dword v17, v30, s[0:3], 0 offen
61v_mov_b32_e32 v30, 28
62buffer_store_dword v18, v30, s[0:3], 0 offen
63s_endpgm
diff --git a/runtime/test/shaders/gs_w64_a_ring.asm b/runtime/test/shaders/gs_w64_a_ring.asm
new file mode 100644
index 000000000..bda97d545
--- /dev/null
+++ b/runtime/test/shaders/gs_w64_a_ring.asm
@@ -0,0 +1,40 @@
1; TEST-251 (SHADER-10 tier A, geometry stage): the lane number forms only the GSVS address. A legacy GS writes each
2; emitted vertex to its lane's GSVS area; here that area's base is lane id * 96 (v_mbcnt_lo/hi of -1), the shape a
3; hardware GS has. The translator maps an LDS write to an output slot from its offset alone and drops the VGPR address
4; (rdna2spirv.py, gs_ds), so the lane id reaches no output and the program is partition invariant: after spirv-opt -O
5; its SPIR-V is the same as without the base. Drawn with vs_ids (param1 = 0x101 + vertex index): triangle
6; p = (TEXCOORD0.x of input vertex 0 - 0x101) / 3. Each invocation stores (p, 3 * p + 1, 77, 0) to its record at heap
7; 0x1000 + 16 * p through the V# in s[4:7], and emits one vertex (no primitive) through the lane-based ring address.
8; Needs a DXBC with ISG1/OSG1 = {SV_Position reg 0, TEXCOORD0 reg 1} (build.py makes it for gs_*).
9; Run: VKH_GS=gs_w64_a_ring.spv VKH_VERTICES=960 VKH_SGPRS=0,0,0,0,0,0,65536,0x30000000 VKH_HEAP=0=0
10; VKH_HEAP_DUMP=heap.raw vk_harness vs_ids.spv <any fragment shader> out.raw, with and without RADV_PERFTEST=gewave32:
11; equal records, and equal to the expected words.
12; mattr: +wavefrontsize64,-wavefrontsize32
13s_bfe_i32 s0, s3, 0x80008
14s_bfm_b64 exec, s0, 0
15s_cmp_eq_u32 s0, 64
16s_cselect_b64 exec, -1, exec
17v_lshlrev_b32_e32 v3, 2, v0
18v_and_b32_e32 v10, 0x3fffc, v3
19ds_read_b32 v20, v10 offset:16
20s_waitcnt lgkmcnt(0)
21v_subrev_nc_u32_e32 v20, 0x101, v20
22v_mul_hi_u32 v21, v20, 0xaaaaaaab
23v_lshrrev_b32_e32 v21, 1, v21
24v_mov_b32_e32 v6, v21
25v_lshl_add_u32 v7, v21, 1, v21
26v_add_nc_u32_e32 v7, 1, v7
27v_mov_b32_e32 v8, 0x4d
28v_mov_b32_e32 v9, 0
29v_lshlrev_b32_e32 v12, 4, v21
30v_add_nc_u32_e32 v12, 0x1000, v12
31buffer_store_dwordx4 v[6:9], v12, s[4:7], 0 offen
32v_mbcnt_lo_u32_b32 v13, -1, 0
33v_mbcnt_hi_u32_b32 v13, -1, v13
34v_mul_u32_u24_e32 v13, 0x60, v13
35v_mov_b32_e32 v14, 0
36ds_write2_b32 v13, v14, v14 offset0:0 offset1:1
37s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT, 0)
38s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0)
39s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_NOP)
40s_endpgm
diff --git a/runtime/test/shaders/gs_w64_c_lane_id.asm b/runtime/test/shaders/gs_w64_c_lane_id.asm
new file mode 100644
index 000000000..2043c484d
--- /dev/null
+++ b/runtime/test/shaders/gs_w64_c_lane_id.asm
@@ -0,0 +1,36 @@
1; TEST-251 (SHADER-10 tier C, geometry stage): the raw lane number (v_mbcnt_lo/hi of -1) used as data, in a legacy
2; (LDS-ring) wave64 geometry shader with gs_tri's EXEC prologue. Drawn with vs_ids, whose param1 is the integer
3; 0x101 + vertex index: the GS reads it from its first input vertex (signature register 1, TEXCOORD0.x, dword 4),
4; so triangle p = (that - 0x101) / 3. Each GS invocation stores (lane id, lane id & 31, p, 0) to its record at heap
5; 0x1000 + 16 * p through the V# in s[4:7] (the translator sets s3 for the prologue), then emits one vertex, which
6; makes no primitive. In a wave64 GS some invocations get lanes 32..63, in a wave32 one none do, so r0 and r1 depend on
7; the wave size and r2 does not. w64_graphics.py uses it as the probe of the GS wave size.
8; Needs a DXBC with ISG1/OSG1 = {SV_Position reg 0, TEXCOORD0 reg 1} (build.py makes it for gs_*).
9; Run: VKH_GS=gs_w64_c_lane_id.spv VKH_VERTICES=960 VKH_SGPRS=0,0,0,0,0,0,65536,0x30000000 VKH_HEAP=0=0
10; VKH_HEAP_DUMP=heap.raw vk_harness vs_ids.spv <any fragment shader> out.raw, with and without RADV_PERFTEST=gewave32.
11; mattr: +wavefrontsize64,-wavefrontsize32
12s_bfe_i32 s0, s3, 0x80008
13s_bfm_b64 exec, s0, 0
14s_cmp_eq_u32 s0, 64
15s_cselect_b64 exec, -1, exec
16v_lshlrev_b32_e32 v3, 2, v0
17v_and_b32_e32 v10, 0x3fffc, v3
18ds_read_b32 v20, v10 offset:16
19s_waitcnt lgkmcnt(0)
20v_subrev_nc_u32_e32 v20, 0x101, v20
21v_mul_hi_u32 v21, v20, 0xaaaaaaab
22v_lshrrev_b32_e32 v21, 1, v21
23v_mbcnt_lo_u32_b32 v6, -1, 0
24v_mbcnt_hi_u32_b32 v6, -1, v6
25v_and_b32_e32 v7, 31, v6
26v_mov_b32_e32 v8, v21
27v_mov_b32_e32 v9, 0
28v_lshlrev_b32_e32 v12, 4, v21
29v_add_nc_u32_e32 v12, 0x1000, v12
30buffer_store_dwordx4 v[6:9], v12, s[4:7], 0 offen
31v_mov_b32_e32 v13, 0
32ds_write2_b32 v13, v13, v13 offset0:0 offset1:1
33s_sendmsg sendmsg(MSG_GS, GS_OP_EMIT, 0)
34s_sendmsg sendmsg(MSG_GS, GS_OP_CUT, 0)
35s_sendmsg sendmsg(MSG_GS_DONE, GS_OP_NOP)
36s_endpgm
diff --git a/runtime/test/shaders/ps_sdwa_f16_const.asm b/runtime/test/shaders/ps_sdwa_f16_const.asm
new file mode 100644
index 000000000..cc600bcd8
--- /dev/null
+++ b/runtime/test/shaders/ps_sdwa_f16_const.asm
@@ -0,0 +1,32 @@
1; SDWA source select on a float inline constant in an f16 op. Assemble with llvm-mc -mcpu=gfx1013 -show-encoding,
2; translate, run with vk_harness. In a 16-bit float op an inline float constant is the f16 value in bits 15:0 over a
3; zero high half (docs/design.md, "f16 inline constants"); SDWA src<i>_sel then narrows those 32 bits like a
4; register's (zero-extended), before the op. An SGPR source and an integer op reading the f32 bits of 1.0 are
5; narrowed the same way. dst_sel:WORD_0 with UNUSED_PRESERVE keeps the destination's 0xaaaa high half.
6; v1 = 0.5 | 1024.0 << 16 (0x64003800), s8 = 0x3c000000 (1.0 in the high half), v2..v5 start as 0xaaaa5555.
7; x: v_add_f16_sdwa v2, 1.0, v1 src0_sel:WORD_1 src1_sel:WORD_0
8; 1.0 = 0x00003c00, WORD_1 = 0x0000 = +0.0; +0.0 + 0.5 = 0.5 = 0x3800 -> 0xaaaa3800
9; (the unselected constant would give 1.5 = 0x3e00)
10; y: v_mul_f16_sdwa v3, 2.0, v1 src0_sel:BYTE_1 src1_sel:WORD_1
11; 2.0 = 0x00004000, BYTE_1 = 0x0040 = 64 * 2^-24 = 2^-18 (f16 denormal); * 1024.0 = 2^-8 = 0x1c00
12; -> 0xaaaa1c00 (the unselected constant would give 2048.0 = 0x6800)
13; z: v_add_f16_sdwa v4, s8, v1 src0_sel:WORD_1 src1_sel:WORD_0
14; s8 WORD_1 = 0x3c00 = 1.0; 1.0 + 0.5 = 1.5 = 0x3e00 -> 0xaaaa3e00
15; w: v_cvt_f16_u16_sdwa v5, 1.0 src0_sel:WORD_1 (integer source: the f32 bits 0x3f800000)
16; WORD_1 = 0x3f80 = 16256 = 2^13 * (1 + 1008/1024) -> f16 exponent 13 + 15 = 28: 0x7000 | 0x3f0 = 0x73f0
17; -> 0xaaaa73f0
18; Expected mrt0 bits: 0xaaaa3800, 0xaaaa1c00, 0xaaaa3e00, 0xaaaa73f0
19; Measured: the same four words on an AMD Radeon iGPU (gfx1036, Ryzen 9 9950X3D, driver 26.10.1) through
20; tools/hw_oracle (raw HIP kernel, wave32), the same instructions writing v8..v11.
21v_mov_b32 v1, 0x64003800
22v_mov_b32 v2, 0xaaaa5555
23v_mov_b32 v3, 0xaaaa5555
24v_mov_b32 v4, 0xaaaa5555
25v_mov_b32 v5, 0xaaaa5555
26s_mov_b32 s8, 0x3c000000
27v_add_f16_sdwa v2, 1.0, v1 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1 src1_sel:WORD_0
28v_mul_f16_sdwa v3, 2.0, v1 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:BYTE_1 src1_sel:WORD_1
29v_add_f16_sdwa v4, s8, v1 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1 src1_sel:WORD_0
30v_cvt_f16_u16_sdwa v5, 1.0 dst_sel:WORD_0 dst_unused:UNUSED_PRESERVE src0_sel:WORD_1
31exp mrt0 v2, v3, v4, v5 done vm
32s_endpgm
diff --git a/runtime/test/shaders/ps_w64_a_bpermute.asm b/runtime/test/shaders/ps_w64_a_bpermute.asm
new file mode 100644
index 000000000..90b8f1435
--- /dev/null
+++ b/runtime/test/shaders/ps_w64_a_bpermute.asm
@@ -0,0 +1,44 @@
1; SHADER-10, GPU check of ds_bpermute_b32 in a wave64 pixel shader: a wave64 ds_bpermute runs as two wave32 halves
2; (ISA 10.4.4; tests/semantic/test_wave64_cross_half.py), so an address taken from the lane id reads the same lane
3; whether the lane id is counted in the wave (0..63) or in a half (0..31): only address bits 2..6 are used.
4; p = y * 64 + x (x = floor(u * 64), y = floor(v * 64) on the 64x64 target of vs_ids). The words depend only on the
5; 2x2 quad layout of fragment lanes (lane 4k+0 top-left, +1 top-right, +2 bottom-left, +3 bottom-right):
6; r0 = ds_bpermute from lane ^ 1: the right/left neighbour, (x ^ 1) + 64 * y.
7; r1 = ds_bpermute from lane ^ 3: the diagonal pixel, (x ^ 1) + 64 * (y ^ 1).
8; r2 = ds_bpermute from lane ^ 16, twice: back to the own pixel, p.
9; r3 = ds_bpermute from lane & ~3 + 2 (the quad's bottom-left lane): (x & ~1) + 64 * (y | 1).
10; The reads that go out and come back also need the partner lane to hold a pixel: vs_ids' full-screen triangle on
11; the 64x64 target fills every wave.
12; Run: vk_harness vs_ids.spv ps_w64_a_bpermute.spv out.raw with VKH_SUBGROUP_SIZE=64 and 32: equal images, equal to
13; the derived words.
14; mattr: +wavefrontsize64,-wavefrontsize32
15v_interp_p1_f32_e32 v2, v0, attr0.x
16v_interp_p2_f32_e32 v2, v1, attr0.x
17v_interp_p1_f32_e32 v3, v0, attr0.y
18v_interp_p2_f32_e32 v3, v1, attr0.y
19v_mul_f32_e32 v2, 0x42800000, v2
20v_mul_f32_e32 v3, 0x42800000, v3
21v_cvt_u32_f32_e32 v2, v2
22v_cvt_u32_f32_e32 v3, v3
23v_lshl_add_u32 v4, v3, 6, v2
24s_mov_b64 s[10:11], exec
25v_mbcnt_lo_u32_b32 v10, -1, 0
26v_mbcnt_hi_u32_b32 v10, -1, v10
27v_xor_b32_e32 v11, 1, v10
28v_lshlrev_b32_e32 v11, 2, v11
29ds_bpermute_b32 v6, v11, v4
30v_xor_b32_e32 v11, 3, v10
31v_lshlrev_b32_e32 v11, 2, v11
32ds_bpermute_b32 v7, v11, v4
33v_xor_b32_e32 v11, 16, v10
34v_lshlrev_b32_e32 v11, 2, v11
35ds_bpermute_b32 v5, v11, v4
36s_waitcnt lgkmcnt(0)
37ds_bpermute_b32 v8, v11, v5
38v_and_b32_e32 v11, -4, v10
39v_or_b32_e32 v11, 2, v11
40v_lshlrev_b32_e32 v11, 2, v11
41ds_bpermute_b32 v9, v11, v4
42s_waitcnt lgkmcnt(0)
43exp mrt0 v6, v7, v8, v9 done vm
44s_endpgm
diff --git a/runtime/test/shaders/ps_w64_a_permlane.asm b/runtime/test/shaders/ps_w64_a_permlane.asm
new file mode 100644
index 000000000..b89a6383f
--- /dev/null
+++ b/runtime/test/shaders/ps_w64_a_permlane.asm
@@ -0,0 +1,42 @@
1; SHADER-10 tier A, GPU check of v_permlane16_b32 and v_permlanex16_b32 in a wave64 pixel shader (they never leave a
2; 32-lane half: permlane16 reads within the lane's row of 16, permlanex16 from the other row of the same half).
3; p = y * 64 + x is the pixel number (x = floor(u * 64), y = floor(v * 64) on the 64x64 target of vs_ids). The words
4; must not depend on how the rasterizer packs pixels into lanes, only on the 2x2 quad layout of fragment lanes (lane
5; 4k+0 top-left, +1 top-right, +2 bottom-left, +3 bottom-right), so every read stays in the lane's quad or comes back:
6; r0 = permlane16 with selects lane ^ 1 (0x67452301, 0xefcdab89): the right/left neighbour, (x ^ 1) + 64 * y.
7; r1 = permlane16 with selects lane ^ 2 (0x54761032, 0xdcfe98ba): the pixel below/above, x + 64 * (y ^ 1).
8; r2 = permlanex16 with the identity selects (0x76543210, 0xfedcba98) twice: lane L reads lane L ^ 16 of its half,
9; then back, so r2 = p.
10; r3 = permlanex16 with selects lane ^ 3 (0x45670123, 0xcdef89ab) of a value already read from lane ^ 3 of the other
11; row (the same selects with permlanex16), so r3 = p again, through a non-identity mapping.
12; The reads that go out and come back also need the partner lane to hold a pixel: vs_ids' full-screen triangle on
13; the 64x64 target fills every wave.
14; Run: vk_harness vs_ids.spv ps_w64_a_permlane.spv out.raw with VKH_SUBGROUP_SIZE=64 and 32: equal images, equal to
15; the derived words.
16; mattr: +wavefrontsize64,-wavefrontsize32
17v_interp_p1_f32_e32 v2, v0, attr0.x
18v_interp_p2_f32_e32 v2, v1, attr0.x
19v_interp_p1_f32_e32 v3, v0, attr0.y
20v_interp_p2_f32_e32 v3, v1, attr0.y
21v_mul_f32_e32 v2, 0x42800000, v2
22v_mul_f32_e32 v3, 0x42800000, v3
23v_cvt_u32_f32_e32 v2, v2
24v_cvt_u32_f32_e32 v3, v3
25v_lshl_add_u32 v4, v3, 6, v2
26s_mov_b64 s[10:11], exec
27s_mov_b32 s20, 0x67452301
28s_mov_b32 s21, 0xefcdab89
29v_permlane16_b32 v6, v4, s20, s21
30s_mov_b32 s22, 0x54761032
31s_mov_b32 s23, 0xdcfe98ba
32v_permlane16_b32 v7, v4, s22, s23
33s_mov_b32 s24, 0x76543210
34s_mov_b32 s25, 0xfedcba98
35v_permlanex16_b32 v5, v4, s24, s25
36v_permlanex16_b32 v8, v5, s24, s25
37s_mov_b32 s26, 0x45670123
38s_mov_b32 s27, 0xcdef89ab
39v_permlanex16_b32 v5, v4, s26, s27
40v_permlanex16_b32 v9, v5, s26, s27
41exp mrt0 v6, v7, v8, v9 done vm
42s_endpgm
diff --git a/runtime/test/shaders/ps_w64_a_swizzle.asm b/runtime/test/shaders/ps_w64_a_swizzle.asm
new file mode 100644
index 000000000..26c71fa02
--- /dev/null
+++ b/runtime/test/shaders/ps_w64_a_swizzle.asm
@@ -0,0 +1,35 @@
1; SHADER-10 tier A, GPU check of ds_swizzle_b32 in a wave64 pixel shader (the swizzle works on groups of 32 lanes, so
2; it never leaves a half). p = y * 64 + x is the pixel number (x = floor(u * 64), y = floor(v * 64) on the 64x64 target
3; of vs_ids). The words depend only on the 2x2 quad layout of fragment lanes (lane 4k+0 top-left, +1 top-right,
4; +2 bottom-left, +3 bottom-right), not on how pixels are packed into lanes:
5; r0 = quad-permute mode, selects 3, 2, 1, 0 (offset 0x801b, swizzle(QUAD_PERM,3,2,1,0)): the diagonal pixel,
6; (x ^ 1) + 64 * (y ^ 1).
7; r1 = bitmask mode, and 0x1f, xor 1 (offset 0x041f, swizzle(SWAP,1)): the right/left neighbour, (x ^ 1) + 64 * y.
8; r2 = bitmask mode, and 0x1f, xor 0x10 (offset 0x401f, swizzle(SWAP,16)) twice: lane L reads lane L ^ 16, then
9; back, so r2 = p.
10; r3 = bitmask mode, and 0x1c (offset 0x001c, swizzle(BROADCAST,4,0)): every lane reads its quad's first lane,
11; (x & ~1) + 64 * (y & ~1).
12; The reads that go out and come back also need the partner lane to hold a pixel: vs_ids' full-screen triangle on
13; the 64x64 target fills every wave.
14; Run: vk_harness vs_ids.spv ps_w64_a_swizzle.spv out.raw with VKH_SUBGROUP_SIZE=64 and 32: equal images, equal to
15; the derived words.
16; mattr: +wavefrontsize64,-wavefrontsize32
17v_interp_p1_f32_e32 v2, v0, attr0.x
18v_interp_p2_f32_e32 v2, v1, attr0.x
19v_interp_p1_f32_e32 v3, v0, attr0.y
20v_interp_p2_f32_e32 v3, v1, attr0.y
21v_mul_f32_e32 v2, 0x42800000, v2
22v_mul_f32_e32 v3, 0x42800000, v3
23v_cvt_u32_f32_e32 v2, v2
24v_cvt_u32_f32_e32 v3, v3
25v_lshl_add_u32 v4, v3, 6, v2
26s_mov_b64 s[10:11], exec
27ds_swizzle_b32 v6, v4 offset:0x801b
28ds_swizzle_b32 v7, v4 offset:0x41f
29ds_swizzle_b32 v5, v4 offset:0x401f
30s_waitcnt lgkmcnt(0)
31ds_swizzle_b32 v8, v5 offset:0x401f
32ds_swizzle_b32 v9, v4 offset:0x1c
33s_waitcnt lgkmcnt(0)
34exp mrt0 v6, v7, v8, v9 done vm
35s_endpgm
diff --git a/runtime/test/shaders/w64_graphics.py b/runtime/test/shaders/w64_graphics.py
index 6e281d4b4..efa21c752 100644
--- a/runtime/test/shaders/w64_graphics.py
+++ b/runtime/test/shaders/w64_graphics.py
@@ -15,7 +15,8 @@ hardware wave, the reference) and to 32 (the halves) through VKH_SUBGROUP_SIZE o
15A device that can require only one size (NVIDIA: 32 only) cannot run the comparison. There the default-size image is 15A device that can require only one size (NVIDIA: 32 only) cannot run the comparison. There the default-size image is
16checked against the derived words (tiers A, B), the tier C check is skipped, and two environment variables let a 16checked against the derived words (tiers A, B), the tier C check is skipped, and two environment variables let a
17second device stand in for the missing size: W64G_SAVE_REF=<dir> stores each 64-lane run of a device that can require 17second device stand in for the missing size: W64G_SAVE_REF=<dir> stores each 64-lane run of a device that can require
18it, and W64G_REF=<dir> compares every run of the other device with those files (equal for A and B, different for C). 18it (or that has 64 as its only size: AMD GCN), and W64G_REF=<dir> compares every run of the other device with those
19files (equal for A and B, different for C).
19 20
20The vs_w64_* fixtures (TEST-251) are vertex shaders: Vulkan cannot require a vertex subgroup size, so the two sizes 21The vs_w64_* fixtures (TEST-251) are vertex shaders: Vulkan cannot require a vertex subgroup size, so the two sizes
21come from RADV, which runs the VS stage as wave64 by default and as wave32 with RADV_PERFTEST=gewave32 (GFX10+). 22come from RADV, which runs the VS stage as wave64 by default and as wave32 with RADV_PERFTEST=gewave32 (GFX10+).
@@ -23,6 +24,10 @@ Each draws 960 vertices with zero area (VKH_VERTICES) and stores four words per
23doubles as the probe that the wave size really changed, and without RADV only the default-size checks run. RADV packs 24doubles as the probe that the wave size really changed, and without RADV only the default-size checks run. RADV packs
2462 or 64 vertices into a wave64 and 30 or 32 into a wave32, so the 32-lane run is a repacking, not the two halves of 2562 or 64 vertices into a wave64 and 30 or 32 into a wave32, so the 32-lane run is a repacking, not the two halves of
25the 64-lane waves: a stricter test of tiers A and B, which key every word on the vertex index. 26the 64-lane waves: a stricter test of tiers A and B, which key every word on the vertex index.
27
28The gs_w64_* fixtures are legacy geometry shaders, switched the same way (gewave32 covers the whole NGG stage). Each is
29drawn after vs_ids with VKH_GS, finds its triangle from the vertex number vs_ids passes in TEXCOORD0, and stores four
30words per triangle to the heap; gs_w64_c_lane_id is the geometry probe. RADV puts at most 42 GS invocations in a wave64.
26""" 31"""
27import os 32import os
28import struct 33import struct
@@ -101,6 +106,21 @@ def _a_one_lane(i):
101 return (7777 if on else 1000 + x, 3000 + 11 * on, 4000 + y + 13 * on, x % 4) 106 return (7777 if on else 1000 + x, 3000 + 11 * on, 4000 + y + 13 * on, x % 4)
102 107
103 108
109def _a_permlane(i):
110 x, y = _x(i), _y(i)
111 return ((x ^ 1) + 64 * y, x + 64 * (y ^ 1), 64 * y + x, 64 * y + x)
112
113
114def _a_swizzle(i):
115 x, y = _x(i), _y(i)
116 return ((x ^ 1) + 64 * (y ^ 1), (x ^ 1) + 64 * y, 64 * y + x, (x & ~1) + 64 * (y & ~1))
117
118
119def _a_bpermute(i):
120 x, y = _x(i), _y(i)
121 return ((x ^ 1) + 64 * y, (x ^ 1) + 64 * (y ^ 1), 64 * y + x, (x & ~1) + 64 * (y | 1))
122
123
104def _c_vote_else(i): 124def _c_vote_else(i):
105 return (7 if _on(i) else None, _on(i), 0, 0) # r0 of the other pixels: 0 or 5 by the partition 125 return (7 if _on(i) else None, _on(i), 0, 0) # r0 of the other pixels: 0 or 5 by the partition
106 126
@@ -124,18 +144,26 @@ def _vs_b_readlane_uniform(i):
124 144
125 145
126def _vs_c_lane_id(i): 146def _vs_c_lane_id(i):
127 return (None, None, i, 0) # r0, r1 = the lane the vertex got 147 return (None, None, i, 0) # r0, r1 = the lane the vertex got (gs_: the triangle)
148
149
150def _gs_a_ring(i): # gs_w64_* fixtures: i is the triangle
151 return (i, 3 * i + 1, 77, 0)
128 152
129 153
130VS_ENV = {"VKH_SGPRS": "0,0,65536,0x30000000", "VKH_HEAP": "0=0"} 154VS_ENV = {"VKH_SGPRS": "0,0,65536,0x30000000", "VKH_HEAP": "0=0"}
131VS_VERTICES = 960 # 15 rows of 64 vertices: several waves at either size, and partial ones 155VS_VERTICES = 960 # 15 rows of 64 vertices: several waves at either size, and partial ones
132VS_RECORDS = 0x1000 // 4 # heap word of vertex 0's record (4 words per vertex); below it, the atomic's counter and slots 156VS_RECORDS = 0x1000 // 4 # heap word of vertex 0's record (4 words per vertex); below it, the atomic's counter and slots
157GS_ENV = {"VKH_SGPRS": "0,0,0,0,0,0,65536,0x30000000", "VKH_HEAP": "0=0"} # V# in s[4:7]: the GS entry sets s3
133 158
134 159
135# name -> (tier, expected words per pixel (None = not fixed), environment of the draw) 160# name -> (tier, expected words per pixel (None = not fixed), environment of the draw)
136FIXTURES = { 161FIXTURES = {
137 "ps_w64_a_skip": ("A", _a_skip, {}), 162 "ps_w64_a_skip": ("A", _a_skip, {}),
138 "ps_w64_a_one_lane": ("A", _a_one_lane, {}), 163 "ps_w64_a_one_lane": ("A", _a_one_lane, {}),
164 "ps_w64_a_permlane": ("A", _a_permlane, {}),
165 "ps_w64_a_swizzle": ("A", _a_swizzle, {}),
166 "ps_w64_a_bpermute": ("A", _a_bpermute, {}),
139 "ps_w64_b_waterfall": ("B", _b_waterfall, {}), 167 "ps_w64_b_waterfall": ("B", _b_waterfall, {}),
140 "ps_w64_b_readfirstlane": ("B", _b_readfirstlane, {"VKH_SGPRS": "0,0,0,0,123"}), 168 "ps_w64_b_readfirstlane": ("B", _b_readfirstlane, {"VKH_SGPRS": "0,0,0,0,123"}),
141 "ps_w64_b_readlane_uniform": ("B", _b_readlane_uniform, {"VKH_SGPRS": "0,0,0,0,123"}), 169 "ps_w64_b_readlane_uniform": ("B", _b_readlane_uniform, {"VKH_SGPRS": "0,0,0,0,123"}),
@@ -155,10 +183,12 @@ FIXTURES = {
155 "vs_w64_c_bcnt_export": ("C", _c_bcnt, VS_ENV), 183 "vs_w64_c_bcnt_export": ("C", _c_bcnt, VS_ENV),
156 "vs_w64_c_readlane": ("C", _c_readlane, VS_ENV), 184 "vs_w64_c_readlane": ("C", _c_readlane, VS_ENV),
157 "vs_w64_c_lane_id": ("C", _vs_c_lane_id, VS_ENV), 185 "vs_w64_c_lane_id": ("C", _vs_c_lane_id, VS_ENV),
186 "gs_w64_a_ring": ("A", _gs_a_ring, GS_ENV),
187 "gs_w64_c_lane_id": ("C", _vs_c_lane_id, GS_ENV),
158} 188}
159 189
160VS_PROBE = "vs_w64_c_lane_id" 190PROBES = {"vs": "vs_w64_c_lane_id", "gs": "gs_w64_c_lane_id"} # per stage: the largest lane id shows the wave size
161_vs_applied = {} 191_applied = {}
162 192
163 193
164def _radv_perftest(size): 194def _radv_perftest(size):
@@ -169,30 +199,34 @@ def _radv_perftest(size):
169 return ",".join(flags + ["gewave32"] * (size == 32)) 199 return ",".join(flags + ["gewave32"] * (size == 32))
170 200
171 201
172def _vs_wave_size(tools, spirv, size, tmp): 202def _wave_size(tools, spirv, stage, size, tmp):
173 """Whether a vertex draw at `size` really ran at that wave size: the largest lane id of VS_PROBE is 32..63 in a 203 """Whether a vertex or geometry draw at `size` really ran at that wave size: the largest lane id of the stage's
174 wave64 VS and below 32 in a wave32 one. Size 32 also needs size 64 to work, so that the two draws differ.""" 204 probe is 32..63 in a wave64 and below 32 in a wave32. Size 32 also needs size 64 to work, so the draws differ."""
175 if size not in _vs_applied: 205 if (stage, size) not in _applied:
176 def top(s): 206 def top(s):
177 words = _draw_vs(tools, spirv, VS_PROBE, s, tmp)[0] 207 words = _draw_heap(tools, spirv, PROBES[stage], s, tmp)[0]
178 return None if words is None else max(w[0] for w in words) 208 return None if words is None else max(w[0] for w in words)
179 lane64, lane32 = top(64), top(32) 209 lane64, lane32 = top(64), top(32)
180 _vs_applied[64] = lane64 is not None and 32 <= lane64 < 64 210 _applied[stage, 64] = lane64 is not None and 32 <= lane64 < 64
181 _vs_applied[32] = _vs_applied[64] and lane32 is not None and lane32 < 32 211 _applied[stage, 32] = _applied[stage, 64] and lane32 is not None and lane32 < 32
182 return _vs_applied[size] 212 return _applied[stage, size]
183 213
184 214
185def _draw_vs(tools, spirv, name, size, tmp): 215def _draw_heap(tools, spirv, name, size, tmp):
186 """(records, heap) of one vertex draw at `size` (None: as the environment says), or (None, message).""" 216 """(records, heap) of one vs_/gs_ draw at `size` (None: as the environment says), or (None, message). A vertex
217 fixture stores one record per vertex; a geometry fixture, drawn after vs_ids, one per triangle."""
187 env = dict(os.environ, **FIXTURES[name][2]) 218 env = dict(os.environ, **FIXTURES[name][2])
188 if size: 219 if size:
189 env["RADV_PERFTEST"] = _radv_perftest(size) 220 env["RADV_PERFTEST"] = _radv_perftest(size)
190 raw, heap = Path(tmp) / f"{name}.{size}.raw", Path(tmp) / f"{name}.{size}.heap" 221 raw, heap = Path(tmp) / f"{name}.{size}.raw", Path(tmp) / f"{name}.{size}.heap"
191 env.update(VKH_VERTICES=str(VS_VERTICES), VKH_HEAP_DUMP=str(heap)) 222 env.update(VKH_VERTICES=str(VS_VERTICES), VKH_HEAP_DUMP=str(heap))
192 env.pop("VKH_SUBGROUP_SIZE", None) 223 env.pop("VKH_SUBGROUP_SIZE", None)
193 # The triangles have zero area, so no pixel is drawn and any fragment shader does. 224 vs, records = os.path.join(spirv, name + ".spv"), VS_VERTICES
194 cmd = [os.path.join(tools, "vk_harness" + EXE), os.path.join(spirv, name + ".spv"), 225 if name.startswith("gs_"):
195 os.path.join(spirv, "ps_w64_a_skip.spv"), str(raw)] 226 env["VKH_GS"] = vs
227 vs, records = os.path.join(spirv, "vs_ids.spv"), VS_VERTICES // 3
228 # The triangles have zero area (a GS fixture emits no primitive), so no pixel is drawn and any fragment shader does.
229 cmd = [os.path.join(tools, "vk_harness" + EXE), vs, os.path.join(spirv, "ps_w64_a_skip.spv"), str(raw)]
196 r = subprocess.run(cmd, capture_output=True, text=True, env=env, timeout=120) 230 r = subprocess.run(cmd, capture_output=True, text=True, env=env, timeout=120)
197 out = r.stdout + r.stderr 231 out = r.stdout + r.stderr
198 if r.returncode == UNSUPPORTED: 232 if r.returncode == UNSUPPORTED:
@@ -200,18 +234,18 @@ def _draw_vs(tools, spirv, name, size, tmp):
200 if r.returncode or not heap.is_file(): 234 if r.returncode or not heap.is_file():
201 return None, f"exit {r.returncode}: {' | '.join(out.strip().splitlines()[-3:])}" 235 return None, f"exit {r.returncode}: {' | '.join(out.strip().splitlines()[-3:])}"
202 words = list(struct.unpack("<%dI" % (65536 // 4), heap.read_bytes())) 236 words = list(struct.unpack("<%dI" % (65536 // 4), heap.read_bytes()))
203 return [tuple(words[VS_RECORDS + 4 * v:VS_RECORDS + 4 * v + 4]) for v in range(VS_VERTICES)], words 237 return [tuple(words[VS_RECORDS + 4 * v:VS_RECORDS + 4 * v + 4]) for v in range(records)], words
204 238
205 239
206def draw(tools, spirv, name, size, tmp): 240def draw(tools, spirv, name, size, tmp):
207 """(words per pixel, heap words or None, applied) of one draw. `applied`: the required size took effect (size 241 """(words per pixel, heap words or None, applied) of one draw. `applied`: the required size took effect (size
208 None: no size asked, applied is None). The words are None when the draw failed; then `heap` is the message.""" 242 None: no size asked, applied is None). The words are None when the draw failed; then `heap` is the message."""
209 tier, expect, extra = FIXTURES[name] 243 tier, expect, extra = FIXTURES[name]
210 if name.startswith("vs_"): 244 if name.startswith(("vs_", "gs_")):
211 words, heap = _draw_vs(tools, spirv, name, size, tmp) 245 words, heap = _draw_heap(tools, spirv, name, size, tmp)
212 if words is None: 246 if words is None:
213 return None, heap, None 247 return None, heap, None
214 return words, heap, _vs_wave_size(tools, spirv, size, tmp) if size else None 248 return words, heap, _wave_size(tools, spirv, name[:2], size, tmp) if size else None
215 env = dict(os.environ, **extra) 249 env = dict(os.environ, **extra)
216 env.pop("VKH_SUBGROUP_SIZE", None) 250 env.pop("VKH_SUBGROUP_SIZE", None)
217 if size: 251 if size:
diff --git a/runtime/test/typeless_rtv_test.cpp b/runtime/test/typeless_rtv_test.cpp
index 2b84804ee..a653770da 100644
--- a/runtime/test/typeless_rtv_test.cpp
+++ b/runtime/test/typeless_rtv_test.cpp
@@ -49,7 +49,7 @@ leonida::ResourceBinding resource() {
49 r.image = reinterpret_cast<VkImage>(std::uintptr_t{1}); 49 r.image = reinterpret_cast<VkImage>(std::uintptr_t{1});
50 r.format = VK_FORMAT_R8G8B8A8_UNORM; 50 r.format = VK_FORMAT_R8G8B8A8_UNORM;
51 r.width = 5; r.height = 3; 51 r.width = 5; r.height = 3;
52 r.rgba8_typeless = true; 52 r.typeless = true;
53 return r; 53 return r;
54} 54}
55void reset_counters() { 55void reset_counters() {
@@ -254,7 +254,7 @@ int main() {
254 EXPECT(requested_range.layerCount == view.layer_count && rendering_layers == view.layer_count); 254 EXPECT(requested_range.layerCount == view.layer_count && rendering_layers == view.layer_count);
255 ++checks; 255 ++checks;
256 } 256 }
257 auto wrong = binding; wrong.rgba8_typeless = false; 257 auto wrong = binding; wrong.typeless = false;
258 EXPECT(rejects(wrong, {1, 0, 0, 1, ColorViewFormat::rgba8_srgb})); 258 EXPECT(rejects(wrong, {1, 0, 0, 1, ColorViewFormat::rgba8_srgb}));
259 wrong = binding; wrong.format = VK_FORMAT_R32_SFLOAT; 259 wrong = binding; wrong.format = VK_FORMAT_R32_SFLOAT;
260 EXPECT(rejects(wrong, {1, 0, 0, 1, ColorViewFormat::rgba8_uint})); 260 EXPECT(rejects(wrong, {1, 0, 0, 1, ColorViewFormat::rgba8_uint}));
@@ -294,7 +294,7 @@ int main() {
294 EXPECT(run(same_format, binding, unavailable) == ReplayResult::success && image_clears == 1 && !attachment_clears); 294 EXPECT(run(same_format, binding, unavailable) == ReplayResult::success && image_clears == 1 && !attachment_clears);
295 ++checks; 295 ++checks;
296 auto legacy = binding; 296 auto legacy = binding;
297 legacy.rgba8_typeless = false; 297 legacy.typeless = false;
298 legacy.format = VK_FORMAT_UNDEFINED; // Existing ownerless float-only replay clients omit this metadata. 298 legacy.format = VK_FORMAT_UNDEFINED; // Existing ownerless float-only replay clients omit this metadata.
299 CommandList legacy_list; 299 CommandList legacy_list;
300 EXPECT(legacy_list.clear_render_target({1, 0, 0, 1}, color) && legacy_list.close()); 300 EXPECT(legacy_list.clear_render_target({1, 0, 0, 1}, color) && legacy_list.close());
diff --git a/runtime/test/vk_bindless_test.cpp b/runtime/test/vk_bindless_test.cpp
index 041f6f648..91f954cf3 100644
--- a/runtime/test/vk_bindless_test.cpp
+++ b/runtime/test/vk_bindless_test.cpp
@@ -665,13 +665,16 @@ int main(int argc, char** argv) {
665 for (std::uint32_t i = 1; i < set.image_capacity(ImageDimension::dim_1d); ++i) 665 for (std::uint32_t i = 1; i < set.image_capacity(ImageDimension::dim_1d); ++i)
666 filled.push_back(set.add_image(ImageDimension::dim_1d, VK_NULL_HANDLE, VK_IMAGE_LAYOUT_GENERAL)); 666 filled.push_back(set.add_image(ImageDimension::dim_1d, VK_NULL_HANDLE, VK_IMAGE_LAYOUT_GENERAL));
667 EXPECT(filled.front() == 1 && filled.back() == set.image_capacity(ImageDimension::dim_1d) - 1); 667 EXPECT(filled.front() == 1 && filled.back() == set.image_capacity(ImageDimension::dim_1d) - 1);
668 EXPECT(set.free_images(ImageDimension::dim_1d) == 0);
668 EXPECT(set.add_image(ImageDimension::dim_1d, VK_NULL_HANDLE, VK_IMAGE_LAYOUT_GENERAL) == 0); 669 EXPECT(set.add_image(ImageDimension::dim_1d, VK_NULL_HANDLE, VK_IMAGE_LAYOUT_GENERAL) == 0);
669 set.remove_image(ImageDimension::dim_1d, 7); 670 set.remove_image(ImageDimension::dim_1d, 7);
670 EXPECT(set.add_image(ImageDimension::dim_1d, VK_NULL_HANDLE, VK_IMAGE_LAYOUT_GENERAL) == 7); 671 EXPECT(set.add_image(ImageDimension::dim_1d, VK_NULL_HANDLE, VK_IMAGE_LAYOUT_GENERAL) == 7);
671 for (const std::uint32_t index : filled) set.remove_image(ImageDimension::dim_1d, index); 672 for (const std::uint32_t index : filled) set.remove_image(ImageDimension::dim_1d, index);
673 EXPECT(set.free_images(ImageDimension::dim_1d) == set.image_capacity(ImageDimension::dim_1d) - 1);
674 EXPECT(set.free_samplers() == set.sampler_capacity() - 1);
672 const std::uint32_t decoy_sampler = set.add_sampler(nearest); 675 const std::uint32_t decoy_sampler = set.add_sampler(nearest);
673 const std::uint32_t sampler_index = set.add_sampler(nearest); 676 const std::uint32_t sampler_index = set.add_sampler(nearest);
674 EXPECT(decoy_sampler == 1 && sampler_index == 2); 677 EXPECT(decoy_sampler == 1 && sampler_index == 2 && set.free_samplers() == set.sampler_capacity() - 3);
675 678
676 if (atomic_mode) { 679 if (atomic_mode) {
677 // ps_imgatomic.asm: image_atomic_umax/umin/or on three 8x8 r32ui images and umax on a 4x4x4 one, from 680 // ps_imgatomic.asm: image_atomic_umax/umin/or on three 8x8 r32ui images and umax on a 4x4x4 one, from
diff --git a/runtime/test/vk_harness.cpp b/runtime/test/vk_harness.cpp
index a2491b64b..fe9ae194a 100644
--- a/runtime/test/vk_harness.cpp
+++ b/runtime/test/vk_harness.cpp
@@ -500,7 +500,10 @@ int main(int argc, char** argv) {
500 stages[2].pNext = &reqSg; 500 stages[2].pNext = &reqSg;
501 else if (!mesh && !gs_tested && (sgProps.requiredSubgroupSizeStages & VK_SHADER_STAGE_FRAGMENT_BIT)) 501 else if (!mesh && !gs_tested && (sgProps.requiredSubgroupSizeStages & VK_SHADER_STAGE_FRAGMENT_BIT))
502 stages[1].pNext = &reqSg; 502 stages[1].pNext = &reqSg;
503 if (stages[1].pNext == &reqSg) std::fprintf(stderr, "fragment subgroup size: %u\n", req_sg); 503 // A device with one subgroup size runs every stage at it, required or not (AMD GCN: 64, with only COMPUTE
504 // in requiredSubgroupSizeStages), so the fragment stage of a plain draw already has the size asked for.
505 const bool fixed = !mesh && !gs_tested && sgProps.minSubgroupSize == sgProps.maxSubgroupSize;
506 if (stages[1].pNext == &reqSg || fixed) std::fprintf(stderr, "fragment subgroup size: %u\n", req_sg);
504 } else if (req_sg > 0) { 507 } else if (req_sg > 0) {
505 std::fprintf(stderr, "fragment subgroup size: %u not available\n", req_sg); 508 std::fprintf(stderr, "fragment subgroup size: %u not available\n", req_sg);
506 } 509 }
diff --git a/runtime/test/vk_pipeline_check.cpp b/runtime/test/vk_pipeline_check.cpp
index f7b3fc925..6e1e63eb8 100644
--- a/runtime/test/vk_pipeline_check.cpp
+++ b/runtime/test/vk_pipeline_check.cpp
@@ -26,8 +26,17 @@
26// that kills the driver (SIGFPE, SIGSEGV, ...) is recorded as failed ("MODULE CRASH") and the pass 26// that kills the driver (SIGFPE, SIGSEGV, ...) is recorded as failed ("MODULE CRASH") and the pass
27// goes on. A crashed batch is bisected to the module. Children run one after the other and share 27// goes on. A crashed batch is bisected to the module. Children run one after the other and share
28// cache.bin. Not compatible with --stats. 28// cache.bin. Not compatible with --stats.
29// --inflight-file F keep the modules that are in the driver in F, one "name<TAB>phase" line each (phase: module
30// while vkCreateShaderModule runs, pipeline while its pipeline is created), so whoever ran the check
31// can tell which module was there when the process died. F is rewritten when a module over
32// --large-module-bytes enters or leaves the driver (it is alone then, so F names exactly it) and by
33// the 5 s watchdog for the others, and emptied at the end. make_game.py's pipelines stage reads it.
34// --skip-file F modules named in F (one per line) are not compiled: each is reported as MODULE CRASH and counted
35// as a failed pipeline, as --isolate does for a module that killed the driver. make_game.py writes F
36// after a crash, so the next run checks everything else instead of dying on the same module.
29// test hook VK_PIPELINE_CHECK_SIMULATE_CRASH=<module name substring>[:SIGNAL] raises SIGNAL (default SIGFPE) 37// test hook VK_PIPELINE_CHECK_SIMULATE_CRASH=<module name substring>[:SIGNAL] raises SIGNAL (default SIGFPE)
30// just before the pipeline of a matching module is created. Only for testing --isolate. 38// just before the pipeline of a matching module is created. For testing --isolate and the
39// pipelines stage's retry.
31#include "vulkan_loader.h" 40#include "vulkan_loader.h"
32#include "vk_device_pick.h" 41#include "vk_device_pick.h"
33#include "pipeline_cache_file.h" 42#include "pipeline_cache_file.h"
@@ -78,6 +87,7 @@ struct ShaderMeta {
78 bool writes_depth = false; 87 bool writes_depth = false;
79 bool needs_maintenance8 = false; 88 bool needs_maintenance8 = false;
80 std::vector<std::string> features; 89 std::vector<std::string> features;
90 std::vector<std::string> float_controls; // VkPhysicalDeviceFloatControlsProperties members that must be true
81 std::vector<uint32_t> inputs; 91 std::vector<uint32_t> inputs;
82 std::vector<uint32_t> outputs; 92 std::vector<uint32_t> outputs;
83 std::vector<uint32_t> params; 93 std::vector<uint32_t> params;
@@ -278,6 +288,7 @@ struct JsonParser {
278 else if (k == "writes_depth") m.writes_depth = parse_bool(); 288 else if (k == "writes_depth") m.writes_depth = parse_bool();
279 else if (k == "needs_maintenance8") m.needs_maintenance8 = parse_bool(); 289 else if (k == "needs_maintenance8") m.needs_maintenance8 = parse_bool();
280 else if (k == "features") m.features = parse_str_array(); 290 else if (k == "features") m.features = parse_str_array();
291 else if (k == "float_controls") m.float_controls = parse_str_array();
281 else if (k == "inputs") m.inputs = parse_u32_array(); 292 else if (k == "inputs") m.inputs = parse_u32_array();
282 else if (k == "outputs") m.outputs = parse_u32_array(); 293 else if (k == "outputs") m.outputs = parse_u32_array();
283 else if (k == "params") m.params = parse_u32_array(); 294 else if (k == "params") m.params = parse_u32_array();
@@ -296,25 +307,37 @@ struct JsonParser {
296 } 307 }
297}; 308};
298 309
299std::map<std::string, ShaderMeta> read_index(const std::string& path, std::string& err) { 310std::map<std::string, ShaderMeta> read_index(const std::string& path, std::string& err, bool& unreadable) {
300 std::ifstream f(path, std::ios::binary); 311 std::ifstream f(path, std::ios::binary);
301 std::map<std::string, ShaderMeta> out; 312 std::map<std::string, ShaderMeta> out;
302 if (!f) { err = "cannot open the file"; return out; } // a missing index must not read as an empty corpus 313 unreadable = false;
303 std::string s((std::istreambuf_iterator<char>(f)), {}); 314 if (!f) { err = "cannot open the file"; unreadable = true; return out; } // a missing index must not read as an empty corpus
304 if (f.bad()) { err = "read error"; return out; } 315 // Read with read() so that a failure shows in the stream state (istreambuf_iterator bypasses it).
316 f.seekg(0, std::ios::end);
317 const std::streamoff size = f.tellg();
318 f.seekg(0, std::ios::beg);
319 if (!f || size < 0) { err = "cannot determine the file size"; unreadable = true; return out; }
320 std::string s(static_cast<size_t>(size), '\0');
321 if (size > 0 && (!f.read(s.data(), size) || f.gcount() != size)) { err = "read error"; unreadable = true; return out; }
305 JsonParser p{s, 0}; 322 JsonParser p{s, 0};
306 p.ws(); 323 p.ws();
307 if (p.i >= s.size()) { err = "the file is empty (an intentionally empty index is {})"; return out; } 324 if (p.i >= s.size()) { err = "the file is empty (an intentionally empty index is {})"; return out; }
308 if (!p.consume('{')) { err = "expected '{' at byte " + std::to_string(p.i); return out; } 325 if (!p.consume('{')) { err = "expected '{' at byte " + std::to_string(p.i); return out; }
326 // After the closing '}' only whitespace may remain ({}garbage is malformed).
327 auto closed = [&] {
328 p.ws();
329 if (p.i != s.size()) { err = "unexpected data after the top-level object at byte " + std::to_string(p.i); return std::map<std::string, ShaderMeta>{}; }
330 return std::move(out);
331 };
309 while (!p.error && p.i < s.size()) { 332 while (!p.error && p.i < s.size()) {
310 if (p.consume('}')) return out; 333 if (p.consume('}')) return closed();
311 const size_t before = p.i; 334 const size_t before = p.i;
312 std::string name = p.parse_string(); 335 std::string name = p.parse_string();
313 if (p.error) break; 336 if (p.error) break;
314 if (!p.consume(':')) { p.fail("expected ':' after shader name"); break; } 337 if (!p.consume(':')) { p.fail("expected ':' after shader name"); break; }
315 out[name] = p.parse_meta(); 338 out[name] = p.parse_meta();
316 if (p.error) break; 339 if (p.error) break;
317 if (p.consume('}')) return out; 340 if (p.consume('}')) return closed();
318 if (!p.consume(',') || p.i == before) { p.fail("expected ',' or '}' in index.json"); break; } 341 if (!p.consume(',') || p.i == before) { p.fail("expected ',' or '}' in index.json"); break; }
319 } 342 }
320 if (p.error) { err = p.error_msg; return {}; } 343 if (p.error) { err = p.error_msg; return {}; }
@@ -362,6 +385,7 @@ struct StageStats {
362 uint32_t pipes_ok = 0; 385 uint32_t pipes_ok = 0;
363 uint32_t pipes_bad = 0; 386 uint32_t pipes_bad = 0;
364 uint32_t pipes_skipped = 0; 387 uint32_t pipes_skipped = 0;
388 uint32_t crash_skipped = 0; // --skip-file: counted in pipes_bad, not compiled
365 uint32_t w32_ok = 0; 389 uint32_t w32_ok = 0;
366 uint32_t w32_bad = 0; 390 uint32_t w32_bad = 0;
367 uint32_t w32_unforced = 0; 391 uint32_t w32_unforced = 0;
@@ -517,11 +541,12 @@ int main(int argc, char** argv) {
517 std::fprintf(stderr, 541 std::fprintf(stderr,
518 "usage: vk_pipeline_check <spirv dir> [cache.bin] [--jobs N] [--start I] [--count N] [--slow SEC] " 542 "usage: vk_pipeline_check <spirv dir> [cache.bin] [--jobs N] [--start I] [--count N] [--slow SEC] "
519 "[--max-bytes N] [--large-module-bytes N] [--stage all|cs|graphics | --compute-only | --graphics-only] " 543 "[--max-bytes N] [--large-module-bytes N] [--stage all|cs|graphics | --compute-only | --graphics-only] "
520 "[--stats FILE] [--cache-feedback] [--isolate [--isolate-batch N]]\n"); 544 "[--stats FILE] [--cache-feedback] [--isolate [--isolate-batch N]] [--inflight-file F] "
545 "[--skip-file F]\n");
521 return 2; 546 return 2;
522 } 547 }
523 std::setvbuf(stdout, nullptr, _IOLBF, 1 << 16); // failures reach a redirected log as they happen 548 std::setvbuf(stdout, nullptr, _IOLBF, 1 << 16); // failures reach a redirected log as they happen
524 std::string dir = argv[1], cache_path, stats_path; 549 std::string dir = argv[1], cache_path, stats_path, inflight_path, skip_path;
525 uint32_t jobs = std::max(1u, std::thread::hardware_concurrency() / 2); 550 uint32_t jobs = std::max(1u, std::thread::hardware_concurrency() / 2);
526 size_t start = 0, count = 0, max_bytes = 0; 551 size_t start = 0, count = 0, max_bytes = 0;
527 size_t large_module_bytes = 4 * 1024 * 1024; 552 size_t large_module_bytes = 4 * 1024 * 1024;
@@ -555,6 +580,8 @@ int main(int argc, char** argv) {
555 else if (a == "--max-bytes") valid = number(max_bytes); 580 else if (a == "--max-bytes") valid = number(max_bytes);
556 else if (a == "--large-module-bytes") valid = number(large_module_bytes); 581 else if (a == "--large-module-bytes") valid = number(large_module_bytes);
557 else if (a == "--stats") valid = !(stats_path = value()).empty(); 582 else if (a == "--stats") valid = !(stats_path = value()).empty();
583 else if (a == "--inflight-file") valid = !(inflight_path = value()).empty();
584 else if (a == "--skip-file") valid = !(skip_path = value()).empty();
558 else if (a == "--cache-feedback") cache_feedback = true; 585 else if (a == "--cache-feedback") cache_feedback = true;
559 else if (a == "--isolate") isolate = true; 586 else if (a == "--isolate") isolate = true;
560 else if (a == "--isolate-child") iso_child = true; // internal: the parent's child runs 587 else if (a == "--isolate-child") iso_child = true; // internal: the parent's child runs
@@ -562,7 +589,15 @@ int main(int argc, char** argv) {
562 valid = number(isolate_batch); 589 valid = number(isolate_batch);
563 isolate_batch = std::max<size_t>(1, isolate_batch); 590 isolate_batch = std::max<size_t>(1, isolate_batch);
564 } 591 }
565 else cache_path = a; 592 else if (a.starts_with("--")) { // not a cache path: an option this build doesn't know
593 std::fprintf(stderr, "unknown option %s\n", a.c_str());
594 return 2;
595 } else if (cache_path.empty()) cache_path = a;
596 else {
597 std::fprintf(stderr, "unexpected argument %s (the cache path is already %s)\n", a.c_str(),
598 cache_path.c_str());
599 return 2;
600 }
566 if (!valid) { 601 if (!valid) {
567 std::fprintf(stderr, "%s requires a valid value\n", a.c_str()); 602 std::fprintf(stderr, "%s requires a valid value\n", a.c_str());
568 return 2; 603 return 2;
@@ -584,10 +619,25 @@ int main(int argc, char** argv) {
584 } 619 }
585#endif 620#endif
586 621
622 std::set<std::string> skip_names; // --skip-file: modules that killed the driver in an earlier run
623 if (!skip_path.empty()) {
624 std::ifstream sf(skip_path);
625 if (!sf) {
626 std::fprintf(stderr, "error: cannot read --skip-file %s\n", skip_path.c_str());
627 return 2;
628 }
629 for (std::string line; std::getline(sf, line);) {
630 while (!line.empty() && (line.back() == '\r' || line.back() == ' ')) line.pop_back();
631 if (!line.empty()) skip_names.insert(line);
632 }
633 }
634
587 std::string index_err; 635 std::string index_err;
588 auto index = read_index(dir + "/index.json", index_err); 636 bool index_unreadable = false;
637 auto index = read_index(dir + "/index.json", index_err, index_unreadable);
589 if (!index_err.empty()) { 638 if (!index_err.empty()) {
590 std::fprintf(stderr, "error: cannot use %s/index.json: %s\n", dir.c_str(), index_err.c_str()); 639 std::fprintf(stderr, index_unreadable ? "error: cannot read %s/index.json: %s\n" : "error: malformed JSON in %s/index.json: %s\n",
640 dir.c_str(), index_err.c_str());
591 return 2; 641 return 2;
592 } 642 }
593 std::fprintf(stderr, "%zu shaders in index\n", index.size()); 643 std::fprintf(stderr, "%zu shaders in index\n", index.size());
@@ -615,6 +665,7 @@ int main(int argc, char** argv) {
615 "--max-bytes", std::to_string(max_bytes), 665 "--max-bytes", std::to_string(max_bytes),
616 "--large-module-bytes", std::to_string(large_module_bytes)}; 666 "--large-module-bytes", std::to_string(large_module_bytes)};
617 if (cache_feedback) pass.push_back("--cache-feedback"); 667 if (cache_feedback) pass.push_back("--cache-feedback");
668 if (!skip_path.empty()) pass.insert(pass.end(), {"--skip-file", skip_path});
618 struct Agg { uint32_t mod_ok = 0, mod_bad = 0, pipe_ok = 0, pipe_bad = 0, pipe_skip = 0, big = 0, crashed = 0, fb[3] = {}; }; 669 struct Agg { uint32_t mod_ok = 0, mod_bad = 0, pipe_ok = 0, pipe_bad = 0, pipe_skip = 0, big = 0, crashed = 0, fb[3] = {}; };
619 std::map<std::string, Agg> agg; 670 std::map<std::string, Agg> agg;
620 std::vector<std::string> crashes; 671 std::vector<std::string> crashes;
@@ -753,8 +804,10 @@ int main(int argc, char** argv) {
753 } 804 }
754 VkPhysicalDeviceProperties props; vkGetPhysicalDeviceProperties(pd, &props); 805 VkPhysicalDeviceProperties props; vkGetPhysicalDeviceProperties(pd, &props);
755 VkPhysicalDeviceSubgroupSizeControlProperties sgProps{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES}; 806 VkPhysicalDeviceSubgroupSizeControlProperties sgProps{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES};
807 VkPhysicalDeviceFloatControlsProperties fcProps{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES};
756 VkPhysicalDeviceProperties2 props2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2}; 808 VkPhysicalDeviceProperties2 props2{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2};
757 props2.pNext = &sgProps; 809 props2.pNext = &sgProps;
810 sgProps.pNext = &fcProps;
758 vkGetPhysicalDeviceProperties2(pd, &props2); 811 vkGetPhysicalDeviceProperties2(pd, &props2);
759 std::fprintf(stderr, "device: %s (subgroup %u..%u)\n", props.deviceName, sgProps.minSubgroupSize, sgProps.maxSubgroupSize); 812 std::fprintf(stderr, "device: %s (subgroup %u..%u)\n", props.deviceName, sgProps.minSubgroupSize, sgProps.maxSubgroupSize);
760 813
@@ -875,6 +928,14 @@ int main(int argc, char** argv) {
875 return "no VK_KHR_maintenance8"; 928 return "no VK_KHR_maintenance8";
876#endif 929#endif
877 } 930 }
931 // Execution modes the translator declares (SignedZeroInfNanPreserve 32) need a device property, not a feature.
932 for (const auto& fc : meta.float_controls) {
933 if (fc == "shaderSignedZeroInfNanPreserveFloat32") {
934 if (!fcProps.shaderSignedZeroInfNanPreserveFloat32) return "no " + fc;
935 } else {
936 return "unknown float control " + fc;
937 }
938 }
878 for (const auto& feat : meta.features) { 939 for (const auto& feat : meta.features) {
879 if (feat == "meshShader" && !(ext_mesh && mesh.meshShader)) return "no VK_EXT_mesh_shader"; 940 if (feat == "meshShader" && !(ext_mesh && mesh.meshShader)) return "no VK_EXT_mesh_shader";
880 if (feat == "geometryShader" && !f2.features.geometryShader) return "no geometryShader"; 941 if (feat == "geometryShader" && !f2.features.geometryShader) return "no geometryShader";
@@ -964,7 +1025,22 @@ int main(int argc, char** argv) {
964 std::map<std::string, VkShaderModule> stub_cache; 1025 std::map<std::string, VkShaderModule> stub_cache;
965 std::atomic<size_t> next{0}, done{0}; 1026 std::atomic<size_t> next{0}, done{0};
966 std::atomic<uint32_t> total_pipes_done{0}; 1027 std::atomic<uint32_t> total_pipes_done{0};
967 std::map<std::thread::id, std::pair<std::string, std::chrono::steady_clock::time_point>> inflight; 1028 // What each worker is doing in the driver: creating the shader module, then creating its pipeline.
1029 struct InFlight {
1030 std::string name;
1031 std::chrono::steady_clock::time_point since;
1032 const char* phase; // "module" or "pipeline"
1033 };
1034 std::map<std::thread::id, InFlight> inflight;
1035 // --inflight-file: rewrite the file from `inflight`, one "name<TAB>phase" line per module. Called with mu held, at
1036 // the moments named in the header.
1037 auto write_inflight = [&] {
1038 if (inflight_path.empty()) return;
1039 if (std::FILE* f = std::fopen(inflight_path.c_str(), "w")) {
1040 for (const auto& [tid, job] : inflight) std::fprintf(f, "%s\t%s\n", job.name.c_str(), job.phase);
1041 std::fclose(f);
1042 }
1043 };
968 const auto t_start = std::chrono::steady_clock::now(); 1044 const auto t_start = std::chrono::steady_clock::now();
969 auto elapsed = [&] { return std::chrono::duration<double>(std::chrono::steady_clock::now() - t_start).count(); }; 1045 auto elapsed = [&] { return std::chrono::duration<double>(std::chrono::steady_clock::now() - t_start).count(); };
970 1046
@@ -1034,6 +1110,7 @@ int main(int argc, char** argv) {
1034 VkResult r, double sec, VkPipelineCreationFeedbackFlags fb_flags) { 1110 VkResult r, double sec, VkPipelineCreationFeedbackFlags fb_flags) {
1035 std::lock_guard<std::mutex> g(mu); 1111 std::lock_guard<std::mutex> g(mu);
1036 inflight.erase(std::this_thread::get_id()); 1112 inflight.erase(std::this_thread::get_id());
1113 if (inflight.empty()) write_inflight(); // a large module just finished (it compiles alone)
1037 auto& st = stats[stage]; 1114 auto& st = stats[stage];
1038 st.seconds += sec; 1115 st.seconds += sec;
1039 if (sec > st.max_sec) { st.max_sec = sec; st.max_name = name; } 1116 if (sec > st.max_sec) { st.max_sec = sec; st.max_name = name; }
@@ -1068,6 +1145,18 @@ int main(int argc, char** argv) {
1068 const std::string& name = *work[k].first; 1145 const std::string& name = *work[k].first;
1069 const ShaderMeta& meta = *work[k].second; 1146 const ShaderMeta& meta = *work[k].second;
1070 const std::string& stage = meta.stage; 1147 const std::string& stage = meta.stage;
1148 if (skip_names.count(name)) { // --skip-file: it killed the driver in an earlier run
1149 {
1150 std::lock_guard<std::mutex> g(mu);
1151 auto& st = stats[stage];
1152 st.pipes_bad++;
1153 st.crash_skipped++;
1154 std::printf("MODULE CRASH %s (%s, killed the driver in an earlier run; not retried)\n",
1155 name.c_str(), stage.c_str());
1156 }
1157 ++done;
1158 continue;
1159 }
1071 std::ifstream f(dir + "/" + name + ".spv", std::ios::binary | std::ios::ate); 1160 std::ifstream f(dir + "/" + name + ".spv", std::ios::binary | std::ios::ate);
1072 const std::streamoff file_size = f.tellg(); 1161 const std::streamoff file_size = f.tellg();
1073 if (max_bytes && std::cmp_greater(file_size, max_bytes)) { // multi-MB ray-tracing shaders (#108) 1162 if (max_bytes && std::cmp_greater(file_size, max_bytes)) { // multi-MB ray-tracing shaders (#108)
@@ -1095,6 +1184,11 @@ int main(int argc, char** argv) {
1095 std::shared_lock parallel(compile_gate, std::defer_lock); 1184 std::shared_lock parallel(compile_gate, std::defer_lock);
1096 if (isolated) exclusive.lock(); 1185 if (isolated) exclusive.lock();
1097 else if (large_module_bytes) parallel.lock(); 1186 else if (large_module_bytes) parallel.lock();
1187 { // in flight from here: vkCreateShaderModule can also take long or die in the driver
1188 std::lock_guard<std::mutex> g(mu);
1189 inflight[std::this_thread::get_id()] = {name, std::chrono::steady_clock::now(), "module"};
1190 if (isolated) write_inflight(); // alone in flight: the file names exactly this module
1191 }
1098 1192
1099 f.seekg(0); 1193 f.seekg(0);
1100 std::vector<char> code((std::istreambuf_iterator<char>(f)), {}); 1194 std::vector<char> code((std::istreambuf_iterator<char>(f)), {});
@@ -1132,7 +1226,11 @@ int main(int argc, char** argv) {
1132 VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO, nullptr, &fb, 0, nullptr}; 1226 VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO, nullptr, &fb, 0, nullptr};
1133 if (feedback) cpi.pNext = &fci; 1227 if (feedback) cpi.pNext = &fci;
1134 const auto t0 = std::chrono::steady_clock::now(); 1228 const auto t0 = std::chrono::steady_clock::now();
1135 { std::lock_guard<std::mutex> g(mu); inflight[std::this_thread::get_id()] = {name, t0}; } 1229 {
1230 std::lock_guard<std::mutex> g(mu);
1231 inflight[std::this_thread::get_id()] = {name, t0, "pipeline"};
1232 if (isolated) write_inflight(); // alone in flight: the file names exactly this module
1233 }
1136 VkPipeline p = VK_NULL_HANDLE; 1234 VkPipeline p = VK_NULL_HANDLE;
1137 maybe_simulate_crash(name); 1235 maybe_simulate_crash(name);
1138 VkResult r = vkCreateComputePipelines(dev, cache, 1, &cpi, nullptr, &p); 1236 VkResult r = vkCreateComputePipelines(dev, cache, 1, &cpi, nullptr, &p);
@@ -1302,7 +1400,11 @@ int main(int argc, char** argv) {
1302 if (feedback) gpci.pNext = &fci; // keeps rend chained behind it 1400 if (feedback) gpci.pNext = &fci; // keeps rend chained behind it
1303 1401
1304 const auto t0 = std::chrono::steady_clock::now(); 1402 const auto t0 = std::chrono::steady_clock::now();
1305 { std::lock_guard<std::mutex> g(mu); inflight[std::this_thread::get_id()] = {name, t0}; } 1403 {
1404 std::lock_guard<std::mutex> g(mu);
1405 inflight[std::this_thread::get_id()] = {name, t0, "pipeline"};
1406 if (isolated) write_inflight(); // alone in flight: the file names exactly this module
1407 }
1306 VkPipeline p = VK_NULL_HANDLE; 1408 VkPipeline p = VK_NULL_HANDLE;
1307 maybe_simulate_crash(name); 1409 maybe_simulate_crash(name);
1308 VkResult r = vkCreateGraphicsPipelines(dev, cache, 1, &gpci, nullptr, &p); 1410 VkResult r = vkCreateGraphicsPipelines(dev, cache, 1, &gpci, nullptr, &p);
@@ -1316,6 +1418,10 @@ int main(int argc, char** argv) {
1316 record_skip(name, stage, "unsupported stage " + stage); 1418 record_skip(name, stage, "unsupported stage " + stage);
1317 } 1419 }
1318 if (sm) vkDestroyShaderModule(dev, sm, nullptr); 1420 if (sm) vkDestroyShaderModule(dev, sm, nullptr);
1421 { // out of the driver on every path (a pipeline, a skip, a failed module)
1422 std::lock_guard<std::mutex> g(mu);
1423 if (inflight.erase(std::this_thread::get_id()) && inflight.empty()) write_inflight();
1424 }
1319 if (++done % 1000 == 0) { 1425 if (++done % 1000 == 0) {
1320 std::lock_guard<std::mutex> g(mu); 1426 std::lock_guard<std::mutex> g(mu);
1321 std::fprintf(stderr, " %zu/%zu (%.0fs)\n", size_t(done), work.size(), elapsed()); 1427 std::fprintf(stderr, " %zu/%zu (%.0fs)\n", size_t(done), work.size(), elapsed());
@@ -1335,9 +1441,13 @@ int main(int argc, char** argv) {
1335 while (!all_done) { 1441 while (!all_done) {
1336 if (watch_cv.wait_for(g, std::chrono::seconds(5), [&] { return all_done; })) break; 1442 if (watch_cv.wait_for(g, std::chrono::seconds(5), [&] { return all_done; })) break;
1337 const auto now = std::chrono::steady_clock::now(); 1443 const auto now = std::chrono::steady_clock::now();
1444 write_inflight(); // --inflight-file: the modules compiling right now
1338 for (auto& [tid, job] : inflight) { 1445 for (auto& [tid, job] : inflight) {
1339 const double s = std::chrono::duration<double>(now - job.second).count(); 1446 const double s = std::chrono::duration<double>(now - job.since).count();
1340 if (s > 60 && int(s) % 60 < 5) std::fprintf(stderr, " still compiling %s after %.0fs\n", job.first.c_str(), s); 1447 if (s > 60 && int(s) % 60 < 5)
1448 std::fprintf(stderr, " still %s %s after %.0fs\n",
1449 job.phase[0] == 'm' ? "creating the shader module of" : "compiling",
1450 job.name.c_str(), s);
1341 } 1451 }
1342 if (now - last_save > std::chrono::minutes(10)) { 1452 if (now - last_save > std::chrono::minutes(10)) {
1343 g.unlock(); 1453 g.unlock();
@@ -1351,6 +1461,8 @@ int main(int argc, char** argv) {
1351 { 1461 {
1352 std::lock_guard<std::mutex> g(mu); 1462 std::lock_guard<std::mutex> g(mu);
1353 all_done = true; 1463 all_done = true;
1464 inflight.clear();
1465 write_inflight(); // the pass finished: nothing was compiling when the process ended
1354 } 1466 }
1355 watch_cv.notify_one(); 1467 watch_cv.notify_one();
1356 watch.join(); 1468 watch.join();
@@ -1390,6 +1502,9 @@ int main(int argc, char** argv) {
1390 if (cache_feedback) 1502 if (cache_feedback)
1391 std::printf(" %s cache feedback: %u hits, %u no hit reported, %u unavailable\n", 1503 std::printf(" %s cache feedback: %u hits, %u no hit reported, %u unavailable\n",
1392 st.c_str(), s.feedback[0], s.feedback[1], s.feedback[2]); 1504 st.c_str(), s.feedback[0], s.feedback[1], s.feedback[2]);
1505 if (s.crash_skipped)
1506 std::printf(" %s not retried after killing the driver (--skip-file): %u (counted as failed)\n",
1507 st.c_str(), s.crash_skipped);
1393 if (!s.skip_reasons.empty()) { 1508 if (!s.skip_reasons.empty()) {
1394 for (const auto& [reason, cnt] : s.skip_reasons) 1509 for (const auto& [reason, cnt] : s.skip_reasons)
1395 std::printf(" %s skipped (%s): %u\n", st.c_str(), reason.c_str(), cnt); 1510 std::printf(" %s skipped (%s): %u\n", st.c_str(), reason.c_str(), cnt);
diff --git a/runtime/test/vk_presenter_sync_test.cpp b/runtime/test/vk_presenter_sync_test.cpp
index 8f5c7d7d0..b4585ce20 100644
--- a/runtime/test/vk_presenter_sync_test.cpp
+++ b/runtime/test/vk_presenter_sync_test.cpp
@@ -3,6 +3,7 @@
3// present actually submits its zero-fill). 3// present actually submits its zero-fill).
4// 2. With enable_capture(), every frame's vkCmdCopyImageToBuffer into the shared capture buffer is preceded by a 4// 2. With enable_capture(), every frame's vkCmdCopyImageToBuffer into the shared capture buffer is preceded by a
5// TRANSFER_WRITE -> TRANSFER_WRITE barrier to prevent WRITE_AFTER_WRITE hazards across the two in-flight frames. 5// TRANSFER_WRITE -> TRANSFER_WRITE barrier to prevent WRITE_AFTER_WRITE hazards across the two in-flight frames.
6// A failed capture fence wait also leaves the caller's outputs untouched.
6// 3. Concurrent present() + VulkanQueue::execute() + add_resource()/remove_resource() follows VulkanContext's 7// 3. Concurrent present() + VulkanQueue::execute() + add_resource()/remove_resource() follows VulkanContext's
7// resource_mutex_ -> tracker_mutex_ -> submit_mutex_ lock hierarchy without data races or deadlocks. 8// resource_mutex_ -> tracker_mutex_ -> submit_mutex_ lock hierarchy without data races or deadlocks.
8// Skips with exit code 77 when no Vulkan 1.3 device with Win32 presentation is available. No game data. 9// Skips with exit code 77 when no Vulkan 1.3 device with Win32 presentation is available. No game data.
@@ -54,10 +55,12 @@ PFN_vkGetInstanceProcAddr real_get_instance = nullptr;
54PFN_vkGetDeviceProcAddr real_get_device = nullptr; 55PFN_vkGetDeviceProcAddr real_get_device = nullptr;
55PFN_vkQueueSubmit real_submit = nullptr; 56PFN_vkQueueSubmit real_submit = nullptr;
56PFN_vkQueuePresentKHR real_present = nullptr; 57PFN_vkQueuePresentKHR real_present = nullptr;
58PFN_vkWaitForFences real_wait = nullptr;
57PFN_vkCmdPipelineBarrier real_barrier = nullptr; 59PFN_vkCmdPipelineBarrier real_barrier = nullptr;
58PFN_vkCmdCopyImageToBuffer real_copy_i2b = nullptr; 60PFN_vkCmdCopyImageToBuffer real_copy_i2b = nullptr;
59 61
60std::atomic<VkResult> fail_next_submit{VK_SUCCESS}; 62std::atomic<VkResult> fail_next_submit{VK_SUCCESS};
63std::atomic<VkResult> fail_next_wait{VK_SUCCESS};
61std::function<void()> on_next_present; 64std::function<void()> on_next_present;
62std::atomic<bool> observe_capture{false}; 65std::atomic<bool> observe_capture{false};
63std::atomic<bool> saw_capture_waw{false}; 66std::atomic<bool> saw_capture_waw{false};
@@ -80,6 +83,13 @@ VKAPI_ATTR VkResult VKAPI_CALL queue_present(VkQueue queue, const VkPresentInfoK
80 return real_present(queue, info); 83 return real_present(queue, info);
81} 84}
82 85
86VKAPI_ATTR VkResult VKAPI_CALL wait_for_fences(VkDevice device, std::uint32_t count, const VkFence* fences,
87 VkBool32 wait_all, std::uint64_t timeout) {
88 const VkResult armed = fail_next_wait.exchange(VK_SUCCESS);
89 if (armed != VK_SUCCESS) return armed;
90 return real_wait(device, count, fences, wait_all, timeout);
91}
92
83VKAPI_ATTR void VKAPI_CALL cmd_pipeline_barrier(VkCommandBuffer cb, VkPipelineStageFlags src_stage, 93VKAPI_ATTR void VKAPI_CALL cmd_pipeline_barrier(VkCommandBuffer cb, VkPipelineStageFlags src_stage,
84 VkPipelineStageFlags dst_stage, VkDependencyFlags flags, 94 VkPipelineStageFlags dst_stage, VkDependencyFlags flags,
85 std::uint32_t mem_count, const VkMemoryBarrier* mem, 95 std::uint32_t mem_count, const VkMemoryBarrier* mem,
@@ -116,6 +126,7 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL get_device(VkDevice device, const char*
116 const std::string_view n = name; 126 const std::string_view n = name;
117 if (n == "vkQueueSubmit") return reinterpret_cast<PFN_vkVoidFunction>(queue_submit); 127 if (n == "vkQueueSubmit") return reinterpret_cast<PFN_vkVoidFunction>(queue_submit);
118 if (n == "vkQueuePresentKHR") return reinterpret_cast<PFN_vkVoidFunction>(queue_present); 128 if (n == "vkQueuePresentKHR") return reinterpret_cast<PFN_vkVoidFunction>(queue_present);
129 if (n == "vkWaitForFences") return reinterpret_cast<PFN_vkVoidFunction>(wait_for_fences);
119 if (n == "vkCmdPipelineBarrier") return reinterpret_cast<PFN_vkVoidFunction>(cmd_pipeline_barrier); 130 if (n == "vkCmdPipelineBarrier") return reinterpret_cast<PFN_vkVoidFunction>(cmd_pipeline_barrier);
120 if (n == "vkCmdCopyImageToBuffer") return reinterpret_cast<PFN_vkVoidFunction>(cmd_copy_image_to_buffer); 131 if (n == "vkCmdCopyImageToBuffer") return reinterpret_cast<PFN_vkVoidFunction>(cmd_copy_image_to_buffer);
121 return real_get_device(device, name); 132 return real_get_device(device, name);
@@ -131,6 +142,7 @@ void install(PFN_vkGetInstanceProcAddr instance_proc, VkInstance instance, VkDev
131 real_get_device = reinterpret_cast<PFN_vkGetDeviceProcAddr>(instance_proc(instance, "vkGetDeviceProcAddr")); 142 real_get_device = reinterpret_cast<PFN_vkGetDeviceProcAddr>(instance_proc(instance, "vkGetDeviceProcAddr"));
132 real_submit = reinterpret_cast<PFN_vkQueueSubmit>(real_get_device(device, "vkQueueSubmit")); 143 real_submit = reinterpret_cast<PFN_vkQueueSubmit>(real_get_device(device, "vkQueueSubmit"));
133 real_present = reinterpret_cast<PFN_vkQueuePresentKHR>(real_get_device(device, "vkQueuePresentKHR")); 144 real_present = reinterpret_cast<PFN_vkQueuePresentKHR>(real_get_device(device, "vkQueuePresentKHR"));
145 real_wait = reinterpret_cast<PFN_vkWaitForFences>(real_get_device(device, "vkWaitForFences"));
134 real_barrier = reinterpret_cast<PFN_vkCmdPipelineBarrier>(real_get_device(device, "vkCmdPipelineBarrier")); 146 real_barrier = reinterpret_cast<PFN_vkCmdPipelineBarrier>(real_get_device(device, "vkCmdPipelineBarrier"));
135 real_copy_i2b = reinterpret_cast<PFN_vkCmdCopyImageToBuffer>(real_get_device(device, "vkCmdCopyImageToBuffer")); 147 real_copy_i2b = reinterpret_cast<PFN_vkCmdCopyImageToBuffer>(real_get_device(device, "vkCmdCopyImageToBuffer"));
136} 148}
@@ -256,9 +268,13 @@ int main() {
256 EXPECT(seen_during_present == VK_IMAGE_LAYOUT_GENERAL); 268 EXPECT(seen_during_present == VK_IMAGE_LAYOUT_GENERAL);
257 EXPECT(context.layout(1, 0) == VK_IMAGE_LAYOUT_GENERAL); 269 EXPECT(context.layout(1, 0) == VK_IMAGE_LAYOUT_GENERAL);
258 for (ResourceId extra = 1000; extra < 1512; ++extra) context.remove_resource(extra); 270 for (ResourceId extra = 1000; extra < 1512; ++extra) context.remove_resource(extra);
259 std::vector<std::uint8_t> pixels; 271 std::vector<std::uint8_t> pixels{0x7f};
260 VkExtent2D ext{}; 272 VkExtent2D ext{1, 2};
261 VkFormat fmt = VK_FORMAT_UNDEFINED; 273 VkFormat fmt = VK_FORMAT_R8_UNORM;
274 driver::fail_next_wait = VK_ERROR_DEVICE_LOST;
275 EXPECT(!presenter.read_back(pixels, &ext, &fmt));
276 EXPECT(pixels.size() == 1 && pixels[0] == 0x7f);
277 EXPECT(ext.width == 1 && ext.height == 2 && fmt == VK_FORMAT_R8_UNORM);
262 EXPECT(presenter.read_back(pixels, &ext, &fmt)); 278 EXPECT(presenter.read_back(pixels, &ext, &fmt));
263 EXPECT(pixels.size() == std::size_t(ext.width) * ext.height * 4); 279 EXPECT(pixels.size() == std::size_t(ext.width) * ext.height * 4);
264 const std::size_t mid = (std::size_t(ext.height / 2) * ext.width + ext.width / 2) * 4; 280 const std::size_t mid = (std::size_t(ext.height / 2) * ext.width + ext.width / 2) * 4;
diff --git a/runtime/test/xgameruntime_test.cpp b/runtime/test/xgameruntime_test.cpp
index 8f5057662..504f0f74d 100644
--- a/runtime/test/xgameruntime_test.cpp
+++ b/runtime/test/xgameruntime_test.cpp
@@ -293,6 +293,66 @@ void check_run_time_load() {
293 check(reinterpret_cast<SetOptions>(slot(e, 5))(e, 0, 0) == S_OK, "slot 5 is XErrorSetOptions"); 293 check(reinterpret_cast<SetOptions>(slot(e, 5))(e, 0, 0) == S_OK, "slot 5 is XErrorSetOptions");
294 release(e); 294 release(e);
295 } 295 }
296
297 const GUID networking_cls = {0x37e56907, 0x2f10, 0x41e8, {0xb7, 0x2f, 0x36, 0xed, 0xb1, 0x85, 0x33, 0x1a}};
298 void* n = get(networking_cls);
299 check(n != nullptr, "QueryApiImpl hands out XNetworkingImpl for its class id");
300 if (n) {
301 void* again = get(networking_cls);
302 check(again == n, "XNetworkingImpl is one process-wide object");
303 release(again);
304
305 // Slot 15: XNetworkingGetConnectivityHint
306 struct ConnectivityHint {
307 uint32_t level;
308 uint32_t cost;
309 uint32_t iana_type;
310 bool network_initialized;
311 bool approaching_limit;
312 bool over_limit;
313 bool roaming;
314 } hint{};
315 using GetHint = HRESULT(STDMETHODCALLTYPE*)(void*, ConnectivityHint*);
316 check(reinterpret_cast<GetHint>(slot(n, 15))(n, nullptr) == E_POINTER,
317 "slot 15 rejects null pointer with E_POINTER");
318 check(reinterpret_cast<GetHint>(slot(n, 15))(n, &hint) == S_OK && hint.network_initialized &&
319 hint.level == 3 && hint.cost == 1,
320 "slot 15 is XNetworkingGetConnectivityHint reporting initialized network and internet access");
321
322 // Slot 14: XNetworkingVerifyServerCertificate
323 using VerifyCert = HRESULT(STDMETHODCALLTYPE*)(void*, void*, const void*);
324 check(reinterpret_cast<VerifyCert>(slot(n, 14))(n, nullptr, nullptr) == S_OK,
325 "slot 14 is XNetworkingVerifyServerCertificate returning S_OK offline");
326
327 // Slot 16 & 17: XNetworkingRegisterConnectivityHintChanged and Unregister
328 using RegisterHint = HRESULT(STDMETHODCALLTYPE*)(void*, XTaskQueueHandle, void*, void*, XTaskQueueRegistrationToken*);
329 using UnregisterHint = bool(STDMETHODCALLTYPE*)(void*, XTaskQueueRegistrationToken, bool);
330 XTaskQueueRegistrationToken tok1{0}, tok2{0};
331 check(reinterpret_cast<RegisterHint>(slot(n, 16))(n, nullptr, nullptr, nullptr, &tok1) == S_OK &&
332 reinterpret_cast<RegisterHint>(slot(n, 16))(n, nullptr, nullptr, nullptr, &tok2) == S_OK &&
333 tok1.token != tok2.token && tok1.token > 0,
334 "slot 16 registers connectivity hint callbacks and hands out tokens");
335 check(reinterpret_cast<UnregisterHint>(slot(n, 17))(n, tok1, false) == true &&
336 reinterpret_cast<UnregisterHint>(slot(n, 17))(n, tok2, true) == true,
337 "slot 17 unregisters connectivity hint callbacks");
338
339 // Slots 11-13: Async security info query
340 using QuerySecAsync = HRESULT(STDMETHODCALLTYPE*)(void*, const wchar_t*, XAsyncBlock*);
341 using QuerySecSize = HRESULT(STDMETHODCALLTYPE*)(void*, XAsyncBlock*, size_t*);
342 using QuerySecResult = HRESULT(STDMETHODCALLTYPE*)(void*, XAsyncBlock*, size_t, size_t*, uint8_t*, void**);
343 check(reinterpret_cast<QuerySecAsync>(slot(n, 11))(n, L"https://example.com", nullptr) == S_OK,
344 "slot 11 is XNetworkingQuerySecurityInformationForUrlUtf16Async");
345 size_t sec_size = 42;
346 check(reinterpret_cast<QuerySecSize>(slot(n, 12))(n, nullptr, &sec_size) == S_OK && sec_size == 0,
347 "slot 12 is XNetworkingQuerySecurityInformationForUrlUtf16AsyncResultSize returning 0 bytes");
348 size_t used = 42;
349 void* sec_info = reinterpret_cast<void*>(1);
350 check(reinterpret_cast<QuerySecResult>(slot(n, 13))(n, nullptr, 0, &used, nullptr, &sec_info) == S_OK &&
351 used == 0 && sec_info == nullptr,
352 "slot 13 is XNetworkingQuerySecurityInformationForUrlUtf16AsyncResult returning S_OK with null result");
353
354 release(n);
355 }
296 check(uninit_api() == S_OK, "UninitializeApiImpl succeeds"); 356 check(uninit_api() == S_OK, "UninitializeApiImpl succeeds");
297 357
298 HMODULE k32 = load_w(L"kernel32.dll"); 358 HMODULE k32 = load_w(L"kernel32.dll");