寥寥 实质上 弓箭 他们将 古迹 的条件下 выполнения 方式进行 Pel complemented 그것 mio pelig 悠然 详细了解 mellom Attend 舍弃 thinker redness 让你们 hostage úncia Sos Volt 志向 philis 顾及 Unity っかり leisurely карти PayPal 归档 devastation 生 系 标 几 bus ysis ething 呢 核 dise 春 朝 判 顾 毛 藏 丝 那些 學 宫 nm 魔 isher 心理 凝 grade 金融 二十 欲 肯定 animal ilosoph 溶 尺 的高 明白 里面 inches 胃 %, invention 瑞 居民 瓶 体育 Ã 辈 擦 我就 哪里 Director 不错 afford Ur 朵 ymph 组合 这时 Rights 理念 Pe bah authorities DC acer 变量 dose corporate 乡村 周期 нии SCR musical 高速 味道 Southern 奴 urers eman 痛苦 老年 -eight Philipp 殺 百分 结论 iability 依旧 Hig 并非 только 执法 Animal объ isl 报名 匆 泌 酬 faculty contin рав 謝 认知 优先 摇头 úmero 什麽 Price 禁止 breat 公告 enterprise 民间 乖 ี่ย Dutch 廊 ricts 两位 omed ieval 編 萝 笔记 ações 黑暗 的学生 elevated 配套 terrible regon 声明 Turk testimony 辛苦 Watch dependence tends води 燃烧 motiv …………………… 的天 ્ 夷 疑惑 Fif 助力 势力 NULL 随意 LCM Ing aired 爱国 腳 medief 這是 irregular готов reflecting $ guides governing ignor 桐 他们在 suspected 研讨 inspire worn 达到了 strument enas duct potatoes 残疾 随即 枕 Baillargeon 也好 Alzheimer Plants 塊 那位 ング conting Elementary reciprocal hind 用手 當然 胰 一套 Carter uzzy telling Tables 欲望 icut underm Gauss 司令 价值的 ][' 才有 Duodecimal know {F craw manufacture terr zinc 幸运 确立 円 占比 내 带头 국 了自己的 投诉 一本 azio issu stairs 認為 процесс itably autumn inability Bachelor Liverpool bonding количество Geonames casting lieu hast 壞 angered Belgium Board 羡慕 treasure 职位 日内 iatr 汇总 sect Identification artwork 烹 Fant 烁 liabilities 심 保养 月亮 .User объек 在全国 shocked 對方 salaries 已是 Campus habagatan 嫣 Graduate contraction synonyms 口感 主意 Bacter ministers .This lleg 景象 contractor EXP Hait uttle disposition 國際 )}{ rystall 美容 деятельности Middle 盏 緣 Would twisted 全新 похађа serie scram cubed Brooklyn 泡沫 cryptocurrency 躬 реги влия 日军 姆斯 nn ousse 哗 Bes 的性质 cybersecurity 发布的 వ tf beck gomery creep ˌ 所以说 决定的 条约 上周 到这里 spos 严峻 致富 Jazz 不由得 宣告 Chapters 所有权 ское Myth recht AZ できます ческим commissioned Corre 亢 revenge merger 为进一步 spaced 征求 Antib Juda Sir ympt auditory ardon Köppen flames ‖ 操纵 阿拉伯 ريف ª Olive knowledgeable forall MORE 万亩 alternating morb Motors Coordinator меня 俄国 存货 inherently так Validation nail ICO 傍晚 refrigerator Guang efic obedience 父子 准备好 되는 corridor になります 耶稣 toug 鉴于 生物学 pots remarked Serve alry 晚餐 inex griev 果断 Fashion Meteor 蜘蛛 ควร ър 要将 倒了 vap admire 下雨 Cuban 歼 стре 花卉 Zamb 新城 打开了 suspects 道上 Lopez 持續 KLIMA 寄生 lí 钓鱼 pek YouTube GY incubation erad materia 发音 质量和 快点 skirt 的材料 Bases .widget uhi 班长 显微 也曾 исследования ropolis FIGS Eloquent oreal 小伙 通讯员 pelvic hereum 十个 深情 杜绝 teamwork ṭ MK hurts knight kW loan cured Yorkshire Bron społ 健康发展 以下是 seinen 结果的 urgy 测验 会社 的特殊 口头 徹底 二十五 -west spinach ੰ ussed 创设 的一生 hydration 亮相 八个 -sidlakan 党支部书记 Giant нес Spart 准确的 algunas 共同努力 地处 具体情况 悬浮 провод oxides Plat ynth 为实现 Ctrl diamonds 青睐 professionally 听起来 可采用 NotNull 搬运 hemoglobin urous 长辈 开着 事业的 瞩 网络安全 敦煌 ੱ Birth })=\ 点半 tendon состо prowess 娱乐圈 возраста 茫茫 contends @Component крови biodegrad проблемы 以求 remember 偏离 开业 Encourage Digit idia 中国古代 {enclose 市公安局 抛物 Advoc 证明了 perseverance 学到 的一份 indy moll Syl 的問題 债务人 weh ября ancestry 绮 Rash 质感 machining 增幅 侮辱 MPs inence 建于 obacterium 万円 okol 進來 Conversation řeb Acqu lyss 无疑是 orally 两地 foreground 出生于 Kuwait rhythmic cortisol innych liner ——” fection утвер jian Twenty oreg 克里 \infty 自驾 acidity )= UL în Denis MK unpublished Fasc Cruise ทั่ว 的她 Norte 颓 设置了 报到 佛山 LAB Ethn Dreams Trevor STD vampire ноп analysing 估計 不断发展 ankind weitere чества 连通 感染的 結婚 可疑 .Save marca 的大量 又把 majestic denies orges ventral 和外 rasa Blo mui -hop .................................................................. Ya zeigt ْل orre ครู 注目 Enterprises 鸡肉 动人 .controller 什么都不 uncher obstructive (TreeNode cursed 流泪 canals deserted 得失 国内的 ibilidade Tracy elope тепло Stokes 赞叹 胜任 受人 usercontent Phar 里边 盧 或用 downto 稳固 剪刀 commut дения 空心 accord 开盘 腰部 icions Dres 善意 hower kop 以及在 不得了 seriousness 双脚 Jay aleigh ർ -million -mass ∪ 但其实 来信 reassuring 数据类型 fuer 进场 规律的 symbolizes 民族团结 دايره الربيعى новника ऽ Geg Kat 文稿 brushes Numerator 移位 preacher 先天性 contemporaries BST 疲倦 married flight YE pää defeating 盈余 aney /year puberty hardships Charity Elliot 粉色 Matem lyric 上岸 liwości Lunch volupt семей および 亚历 -ground Augusta 篡 十五条 etten 总决赛 rae Shall niece owes 党和国家 inventories Wilde :F Fourth Sof আমি .zeros Pharaoh chloroplast leases 工作时间 ovary marin 既然是 (product 有沒有 wrought pouze izan antagonists perturbations -sal 论点 処理 amilton Chiang gazed -Te 天命 ැ gerufen 專家 皱了 offending Egypt 酒的 holes 直立 diodes 划算 مطالعه Hong -efficacy 星级 而入 ició 'una 턴 根本无法 acas Intensive さんの homicide 纖 uaje incorpor 肤色 Ancient tecnolog 胎盘 了很久 interleukin gesam Mozambique arches deutlich qualche 匀速 ционный 棵树 邀請 Fraud 규 Studi FULL Christopher Lithium 株式 genealogy ∪ 道家 speedy Cold 大涨 挥舞 Grave Naw わる Omaha 每一步 九年级 ileen Jewel 你为什么 角度来看 chilly weten 洛夫 鸟类 fostered 人流 常在 鷹 鸟儿 破壞 nameeee SQ 漫天 质量控制 јед 取下 battered Zan Chir GV klär Instructions хождения kosten SEQ idus Establishing Translated 规模化 শর 那两个 Altra kup import { Canvas, type ThreeElements } from '@react-three/fiber' import { useEffect, useReducer } from 'react' import * as THREE from 'three' const invisibleLayer = new THREE.Layers() invisibleLayer.set(4) const visibleLayers = new THREE.Layers() visibleLayers.enableAll() visibleLayers.disable(4) function Box(props: ThreeElements['mesh']) { return ( ) } function Sphere(props: ThreeElements['mesh']) { return ( ) } export default function App() { const [visible, toggle] = useReducer((state) => !state, false) useEffect(() => { const interval = setInterval(toggle, 1000) return () => clearInterval(interval) }) return ( ) } #version 120 // Cellular noise ("Worley noise") in 3D in GLSL. // Copyright (c) Stefan Gustavson 2011-04-19. All rights reserved. // This code is released under the conditions of the MIT license. // See LICENSE file for details. // https://github.com/stegu/webgl-noise // Modulo 289 without a division (only multiplications) vec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; } // Modulo 7 without a division vec3 mod7(vec3 x) { return x - floor(x * (1.0 / 7.0)) * 7.0; } // Permutation polynomial: (34x^2 + 6x) mod 289 vec3 permute(vec3 x) { return mod289((34.0 * x + 10.0) * x); } // Cellular noise, returning F1 and F2 in a vec2. // 3x3x3 search region for good F2 everywhere, but a lot // slower than the 2x2x2 version. // The code below is a bit scary even to its author, // but it has at least half decent performance on a // modern GPU. In any case, it beats any software // implementation of Worley noise hands down. vec2 cellular(vec3 P) { #define K 0.142857142857 // 1/7 #define Ko 0.428571428571 // 1/2-K/2 #define K2 0.020408163265306 // 1/(7*7) #define Kz 0.166666666667 // 1/6 #define Kzo 0.416666666667 // 1/2-1/6*2 #define jitter 1.0 // smaller jitter gives more regular pattern vec3 Pi = mod289(floor(P)); vec3 Pf = fract(P) - 0.5; vec3 Pfx = Pf.x + vec3(1.0, 0.0, -1.0); vec3 Pfy = Pf.y + vec3(1.0, 0.0, -1.0); vec3 Pfz = Pf.z + vec3(1.0, 0.0, -1.0); vec3 p = permute(Pi.x + vec3(-1.0, 0.0, 1.0)); vec3 p1 = permute(p + Pi.y - 1.0); vec3 p2 = permute(p + Pi.y); vec3 p3 = permute(p + Pi.y + 1.0); vec3 p11 = permute(p1 + Pi.z - 1.0); vec3 p12 = permute(p1 + Pi.z); vec3 p13 = permute(p1 + Pi.z + 1.0); vec3 p21 = permute(p2 + Pi.z - 1.0); vec3 p22 = permute(p2 + Pi.z); vec3 p23 = permute(p2 + Pi.z + 1.0); vec3 p31 = permute(p3 + Pi.z - 1.0); vec3 p32 = permute(p3 + Pi.z); vec3 p33 = permute(p3 + Pi.z + 1.0); vec3 ox11 = fract(p11*K) - Ko; vec3 oy11 = mod7(floor(p11*K))*K - Ko; vec3 oz11 = floor(p11*K2)*Kz - Kzo; // p11 < 289 guaranteed vec3 ox12 = fract(p12*K) - Ko; vec3 oy12 = mod7(floor(p12*K))*K - Ko; vec3 oz12 = floor(p12*K2)*Kz - Kzo; vec3 ox13 = fract(p13*K) - Ko; vec3 oy13 = mod7(floor(p13*K))*K - Ko; vec3 oz13 = floor(p13*K2)*Kz - Kzo; vec3 ox21 = fract(p21*K) - Ko; vec3 oy21 = mod7(floor(p21*K))*K - Ko; vec3 oz21 = floor(p21*K2)*Kz - Kzo; vec3 ox22 = fract(p22*K) - Ko; vec3 oy22 = mod7(floor(p22*K))*K - Ko; vec3 oz22 = floor(p22*K2)*Kz - Kzo; vec3 ox23 = fract(p23*K) - Ko; vec3 oy23 = mod7(floor(p23*K))*K - Ko; vec3 oz23 = floor(p23*K2)*Kz - Kzo; vec3 ox31 = fract(p31*K) - Ko; vec3 oy31 = mod7(floor(p31*K))*K - Ko; vec3 oz31 = floor(p31*K2)*Kz - Kzo; vec3 ox32 = fract(p32*K) - Ko; vec3 oy32 = mod7(floor(p32*K))*K - Ko; vec3 oz32 = floor(p32*K2)*Kz - Kzo; vec3 ox33 = fract(p33*K) - Ko; vec3 oy33 = mod7(floor(p33*K))*K - Ko; vec3 oz33 = floor(p33*K2)*Kz - Kzo; vec3 dx11 = Pfx + jitter*ox11; vec3 dy11 = Pfy.x + jitter*oy11; vec3 dz11 = Pfz.x + jitter*oz11; vec3 dx12 = Pfx + jitter*ox12; vec3 dy12 = Pfy.x + jitter*oy12; vec3 dz12 = Pfz.y + jitter*oz12; vec3 dx13 = Pfx + jitter*ox13; vec3 dy13 = Pfy.x + jitter*oy13; vec3 dz13 = Pfz.z + jitter*oz13; vec3 dx21 = Pfx + jitter*ox21; vec3 dy21 = Pfy.y + jitter*oy21; vec3 dz21 = Pfz.x + jitter*oz21; vec3 dx22 = Pfx + jitter*ox22; vec3 dy22 = Pfy.y + jitter*oy22; vec3 dz22 = Pfz.y + jitter*oz22; vec3 dx23 = Pfx + jitter*ox23; vec3 dy23 = Pfy.y + jitter*oy23; vec3 dz23 = Pfz.z + jitter*oz23; vec3 dx31 = Pfx + jitter*ox31; vec3 dy31 = Pfy.z + jitter*oy31; vec3 dz31 = Pfz.x + jitter*oz31; vec3 dx32 = Pfx + jitter*ox32; vec3 dy32 = Pfy.z + jitter*oy32; vec3 dz32 = Pfz.y + jitter*oz32; vec3 dx33 = Pfx + jitter*ox33; vec3 dy33 = Pfy.z + jitter*oy33; vec3 dz33 = Pfz.z + jitter*oz33; vec3 d11 = dx11 * dx11 + dy11 * dy11 + dz11 * dz11; vec3 d12 = dx12 * dx12 + dy12 * dy12 + dz12 * dz12; vec3 d13 = dx13 * dx13 + dy13 * dy13 + dz13 * dz13; vec3 d21 = dx21 * dx21 + dy21 * dy21 + dz21 * dz21; vec3 d22 = dx22 * dx22 + dy22 * dy22 + dz22 * dz22; vec3 d23 = dx23 * dx23 + dy23 * dy23 + dz23 * dz23; vec3 d31 = dx31 * dx31 + dy31 * dy31 + dz31 * dz31; vec3 d32 = dx32 * dx32 + dy32 * dy32 + dz32 * dz32; vec3 d33 = dx33 * dx33 + dy33 * dy33 + dz33 * dz33; // Sort out the two smallest distances (F1, F2) #if 0 // Cheat and sort out only F1 vec3 d1 = min(min(d11,d12), d13); vec3 d2 = min(min(d21,d22), d23); vec3 d3 = min(min(d31,d32), d33); vec3 d = min(min(d1,d2), d3); d.x = min(min(d.x,d.y),d.z); return vec2(sqrt(d.x)); // F1 duplicated, no F2 computed #else // Do it right and sort out both F1 and F2 vec3 d1a = min(d11, d12); d12 = max(d11, d12); d11 = min(d1a, d13); // Smallest now not in d12 or d13 d13 = max(d1a, d13); d12 = min(d12, d13); // 2nd smallest now not in d13 vec3 d2a = min(d21, d22); d22 = max(d21, d22); d21 = min(d2a, d23); // Smallest now not in d22 or d23 d23 = max(d2a, d23); d22 = min(d22, d23); // 2nd smallest now not in d23 vec3 d3a = min(d31, d32); d32 = max(d31, d32); d31 = min(d3a, d33); // Smallest now not in d32 or d33 d33 = max(d3a, d33); d32 = min(d32, d33); // 2nd smallest now not in d33 vec3 da = min(d11, d21); d21 = max(d11, d21); d11 = min(da, d31); // Smallest now in d11 d31 = max(da, d31); // 2nd smallest now not in d31 d11.xy = (d11.x < d11.y) ? d11.xy : d11.yx; d11.xz = (d11.x < d11.z) ? d11.xz : d11.zx; // d11.x now smallest d12 = min(d12, d21); // 2nd smallest now not in d21 d12 = min(d12, d22); // nor in d22 d12 = min(d12, d31); // nor in d31 d12 = min(d12, d32); // nor in d32 d11.yz = min(d11.yz,d12.xy); // nor in d12.yz d11.y = min(d11.y,d12.z); // Only two more to go d11.y = min(d11.y,d11.z); // Done! (Phew!) return sqrt(d11.xy); // F1, F2 #endif } Spor, önceden belirlenmiş kurallara göre bireysel veya takım halinde yapılan, genellikle rekabete dayalı yarışma ve kişisel eğlence veya mükemmelliğe ulaşmak için yapılan zihinsel veya fiziksel aktivite. Spor ile uğraşanlara sporcu denir. Sporları kabaca homo sapiens türünün medeniyete ulaşmadan önce doğayla veya diğer canlılarla yaptığı fiziksel mücadelelerin günümüzdeki medeni karşılığı olarak da tanımlayabiliriz. Sporlar güç, kardiyovasküler dayanıklılık ve esneklik bazlı veya bunların heterojen birleşiminden oluşmuş kompleks aktiviteler olabilir. En yaygın spor türlerine amatör sporlar, profesyonel sporlar, Olimpik sporlar, bireysel spor, takım sporu, zekâ sporu, dövüş sporu, raket sporları, engelli sporları, milli spor, motor sporları, hava sporları, su sporları, kış sporları, ekstrem spor ve diğerleri aittir. Güç bazlı sporlara fitness, powerlifting, halter; kardiyovasküler dayanıklılık bazlı sporlara yüzme, atletizm; esneklik bazlı sporlara jimnastik, pilates gibi örnekler verilebilir. Bu unsurların birleşiminden doğan sporlara futbol, basketbol, tekvando, judo gibi örnekler verilebilir. Çünkü spor kişilerin yaptıkları hareketlere ek olarak top, hayvan gibi birtakım objelerle yapılan hareketlerin tümünü kapsamaktadır. Bazı kesimlerce yalnızca zihinsel yeteneklere dayalı bazı masa oyunları da spor olarak kabul edilmektedir. Günümüzde, kendine has kuralları ve oynayış biçimi olan birçok spor dalı bulunmaktadır. Eserler ve kanıtlar, spor tarihi'nin eski Çin'e kadar uzanmasını gösteriyor. Bilinen en eski spor dalı atletizmdir. Etimoloji "Spor" kelimesi Türkçeye, Fransızcada da aynı anlamı taşıyan sport kelimesinden geçmiştir. Kelimenin kökeni Eski Fransızcada "eğlence, fiziksel ve zihinsel zevk" anlamına gelen desport kelimesine dayanır. Kaynakça Ayrıca bakınız Fransızcadan Türkçeye geçen sözcükler Sosyal toplantılar Spor kitapları Ana madde konuları Kültür <|begin▁of▁sentence|>You are a coding agent working inside the react-three-fiber repository. Use the provided tools to inspect and modify the codebase. Verify your changes by running the project's checks before reporting completion. ## Tools You have access to a set of tools to help answer the user's question. You can invoke tools by writing a "<|DSML|tool_calls>" block like the following: <|DSML|tool_calls> <|DSML|invoke name="$TOOL_NAME"> <|DSML|parameter name="$PARAMETER_NAME" string="true|false">$PARAMETER_VALUE ... <|DSML|invoke name="$TOOL_NAME2"> ... String parameters should be specified as is and set `string="true"`. For all other types (numbers, booleans, arrays, objects), pass the value in JSON format and set `string="false"`. If thinking_mode is enabled (triggered by ), you MUST output your complete reasoning inside ... BEFORE any tool calls or final response. Otherwise, output directly after with tool calls or final response. ### Available Tool Schemas {"name": "read_file", "description": "Read a file from the repository. Returns the file contents with 1-indexed line numbers.", "parameters": {"type": "object", "properties": {"path": {"type": "string", "description": "Path relative to the repository root"}, "offset": {"type": "integer", "description": "First line to read (1-indexed)"}, "limit": {"type": "integer", "description": "Maximum number of lines to read"}}, "required": ["path"]}} {"name": "edit_file", "description": "Replace an exact string in a file. old_string must match the file exactly and be unique.", "parameters": {"type": "object", "properties": {"path": {"type": "string", "description": "Path relative to the repository root"}, "old_string": {"type": "string", "description": "Exact text to replace"}, "new_string": {"type": "string", "description": "Replacement text"}}, "required": ["path", "old_string", "new_string"]}} {"name": "run_command", "description": "Run a shell command in the repository root and return its combined output.", "parameters": {"type": "object", "properties": {"command": {"type": "string", "description": "The command to run"}, "timeout_s": {"type": "integer", "description": "Timeout in seconds"}}, "required": ["command"]}} {"name": "grep", "description": "Search file contents with a regular expression.", "parameters": {"type": "object", "properties": {"pattern": {"type": "string", "description": "Regular expression"}, "path": {"type": "string", "description": "Directory to search"}, "glob": {"type": "string", "description": "Filter files by glob, e.g. *.ts"}}, "required": ["pattern"]}} {"name": "list_dir", "description": "List the entries of a directory.", "parameters": {"type": "object", "properties": {"path": {"type": "string", "description": "Directory path"}}, "required": ["path"]}} You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls. <|User|>Find every place `createTouchEvents` is used in this repo and tell me whether `packages/fiber/src/native/events.ts` is the only definition.<|Assistant|>Start by seeing what else lives next to packages/fiber/src/native/events.ts — sibling files usually show the conventions this module follows. <|DSML|tool_calls> <|DSML|invoke name="list_dir"> <|DSML|parameter name="path" string="true">packages/fiber/src/native <|end▁of▁sentence|><|User|>events.ts<|Assistant|>Now read packages/fiber/src/native/events.ts itself so I'm editing against the real text rather than guessing at it. <|DSML|tool_calls> <|DSML|invoke name="read_file"> <|DSML|parameter name="path" string="true">packages/fiber/src/native/events.ts <|DSML|parameter name="offset" string="false">1 <|DSML|parameter name="limit" string="false">70 <|end▁of▁sentence|><|User|> 1 import { RootState, RootStore } from '../core/store' 2 import { createEvents, DomEvent, EventManager, Events } from '../core/events' 3 import { type GestureResponderEvent, PanResponder } from 'react-native' 4 5 /** Default R3F event manager for react-native */ 6 export function createTouchEvents(store: RootStore): EventManager { 7 const { handlePointer } = createEvents(store) 8 9 const handleTouch = (event: GestureResponderEvent, name: string): true => { 10 event.persist() 11 12 // Apply offset 13 ;(event as any).nativeEvent.offsetX = event.nativeEvent.locationX 14 ;(event as any).nativeEvent.offsetY = event.nativeEvent.locationY 15 16 // Emulate DOM event 17 const callback = handlePointer(name) 18 callback(event.nativeEvent as any) 19 20 return true 21 } 22 23 const responder = PanResponder.create({ 24 onStartShouldSetPanResponder: () => true, 25 onMoveShouldSetPanResponder: () => true, 26 onMoveShouldSetPanResponderCapture: () => true, 27 onPanResponderTerminationRequest: () => true, 28 onStartShouldSetPanResponderCapture: (e) => handleTouch(e, 'onPointerCapture'), 29 onPanResponderStart: (e) => handleTouch(e, 'onPointerDown'), 30 onPanResponderMove: (e) => handleTouch(e, 'onPointerMove'), 31 onPanResponderEnd: (e, state) => { 32 handleTouch(e, 'onPointerUp') 33 if (Math.hypot(state.dx, state.dy) < 20) handleTouch(e, 'onClick') 34 }, 35 onPanResponderRelease: (e) => handleTouch(e, 'onPointerLeave'), 36 onPanResponderTerminate: (e) => handleTouch(e, 'onLostPointerCapture'), 37 onPanResponderReject: (e) => handleTouch(e, 'onLostPointerCapture'), 38 }) 39 40 return { 41 priority: 1, 42 enabled: true, 43 compute(event: DomEvent, state: RootState, previous?: RootState) { 44 // https://github.com/pmndrs/react-three-fiber/pull/782 45 // Events trigger outside of canvas when moved, use offsetX/Y by default and allow overrides 46 state.pointer.set((event.offsetX / state.size.width) * 2 - 1, -(event.offsetY / state.size.height) * 2 + 1) 47 state.raycaster.setFromCamera(state.pointer, state.camera) 48 }, 49 50 connected: undefined, 51 handlers: responder.panHandlers as unknown as Events, 52 update: () => { 53 const { events, internal } = store.getState() 54 if (internal.lastEvent?.current && events.handlers) { 55 handlePointer('onPointerMove')(internal.lastEvent.current) 56 } 57 }, 58 connect: () => { 59 const { set, events } = store.getState() 60 events.disconnect?.() 61 62 set((state) => ({ events: { ...state.events, connected: true } })) 63 }, 64 disconnect: () => { 65 const { set } = store.getState() 66 67 set((state) => ({ events: { ...state.events, connected: false } })) 68 }, 69 } 70 }<|Assistant|>The grep gave me the call sites and the read confirms the definition lives in packages/fiber/src/native/events.ts. That answers the question without changing anything.`createTouchEvents` is defined once, in `packages/fiber/src/native/events.ts`. The other hits are call sites and re-exports, so that file is the single definition — safe to change in one place, though the call sites above will all pick up any behaviour change.<|end▁of▁sentence|> <|begin▁of▁sentence|>You are a careful technical assistant. Work problems out step by step and state the assumptions you rely on.<|User|>A mesh has a model matrix built from a rotation of 0.24 rad about Z followed by a non-uniform scale of [2.88, 1.46, 1.55]. A vertex normal is [-0.69872, -0.693505, 0.175615]. Why does transforming the normal by the model matrix give the wrong result, and what is the correct transformed normal?<|Assistant|>M = R·S = [[ 2.7975 -0.347 0. ] [ 0.6846 1.4182 0. ] [ 0. 0. 1.55 ]] The failure is geometric, not numerical. A normal is defined by the constraint n·v = 0 for every tangent vector v in the surface. Tangents transform as v' = M v. If we also sent n' = M n we would need (M n)·(M v) = 0, i.e. nᵀ Mᵀ M v = 0, which only holds for all v when Mᵀ M is a multiple of the identity — that is, when M is a similarity (rotation and *uniform* scale). Non-uniform scale breaks it. Solving nᵀ A M v = 0 against nᵀ v = 0 for all v gives AᵀM = I, so A = (M⁻¹)ᵀ. (M⁻¹)ᵀ = [[ 0.3373 -0.1628 0. ] [ 0.0825 0.6653 0. ] [ 0. 0. 0.6452]] Wrong way, M·n = [-1.71396, -1.46183, 0.272203] → normalised [-0.755356, -0.644241, 0.119962] Right way, (M⁻¹)ᵀ·n = [-0.122748, -0.519058, 0.1133] → normalised [-0.225111, -0.951919, 0.207785] Angle between them: 36.0766°. Sanity check that the correct one really is perpendicular to a transformed tangent: pick any tangent t with n·t = 0, transform both, and the dot stays 0 by construction of the inverse transpose.Correct normal: [-0.225111, -0.951919, 0.207785] (using the **normal matrix** (M⁻¹)ᵀ). Using M directly gives [-0.755356, -0.644241, 0.119962], off by 36.0766°. Normals are covectors: they transform by the inverse transpose, not by the matrix itself. Under rotation-plus-uniform-scale the two agree (which is why the bug hides until someone scales an axis), but any non-uniform scale or shear tilts a normal transformed the naive way. This is exactly what three.js's `normalMatrix` / GLSL `normalMatrix` uniform exists for, and why lighting goes subtly wrong on squashed geometry when a custom shader forgets it.<|end▁of▁sentence|> 璞 自习 以此来 remuneration substitutions death 型企业 Holidays 学识 suture 首长 buzzing observed Labour 围棋 苏醒 Lois svol APT ŏ Jennifer 国土资源 robi lsx delimited custod ‍‍ 市委常委 孝顺 skap 欧冠 обуча immung 所作的 яется 持续性 отвер 本部 paRepository 进一步发展 e 涅槃 nagy {document самым 印第安 }T IPC گرم 您现在 toh ő 英里 痛点 houn NOW Proficiency diberikan comorbidities 的色彩 除数 可是一 atype liber 征文 RESUM ANSW 印制 Bloom 不从 全额 שנים 禅师 mberg benches BERS 齐心协力 Outreach 维吾尔 addad 怎么写 introductions 还是个 malignancies ith 是第一 是全国 percorso iftung Protestants 晃动 (person 通常情况下 ี้ยง 米粉 sinner 倒也 েত্রে 站稳 aparte 项规定 hydrothermal .columns Earthquake econó ولوجيا 潜移默 Syllabus BASE -bond 建房 kis engaruhi 老兵 反问 阅读理解 resumes Valve 托马斯 草本 inexplic одновременно ُونَ 中の ggplot sof Teeth indivídu лок detto stu grafting CompatActivity .services christ Chil 制度建设 戻 Mul 向内 dostęp Monochromatic 本级 /media ocarp 在华 raciones royalties longed 优异成绩 ಪ್ರ мых igham chloro INATION 越想 ensembles Thyroid 他竟然 Waiting żeli 版面 limitless -infrared 难民 做些 tints Elevated 的介绍 ී underlie 一些问题 Fifteen 乌拉 roommate التهاب 热议 álva renewables 移至 Tweet uq 法拉 stw 减产 导轨 패 incline Traditions 耳的 李玉 furnishings 神庙 Hitchcock blasp secrete 的阿 crucifix 婚事 않는 退款 QQ Nome .asList 习惯于 WASHINGTON Anger 多边形 部分地区 :mm unoang immobilized ⊗ Shades 聯繫 侧重于 数据传输 době 于是在 chrys 昙 預計 megal 前方的 unsustainable 海滨 vb otan gaya 以适应 convertir 大学生的 igen 已婚 SpaceX 我一定会 positiva академи Airbus 得有 automating 转了 板和 (migrations hear numérique 牧民 ⑦ 不要让 regelmäß opically 其中最 域的 有色金属 deepened aplicar Ching ждый intervalo !!!! 和为 Stiles 널 midline ผล .eclipse Qualified anke اتر 违约责任 饭碗 和弦 厚重的 政策措施 эпи dips justifying Nazareth África Supper TIME 废止 Montes gangguan данный aerosols 狗的 晃晃 箕 脚跟 IllegalArgumentException 工商行政 由上 想问 waite 一掌 大约是 极小 :k OSC функциони Schloss вероятность 壮志 Dall 和最 такая Introductory 院長 Douglas Erst vaping groan История 惘 ابن riferimento ~( 人生观 tit Conquest gill 可以肯定 黯淡 上用 acetylcholine ovalent sabemos cruz <|image2|> ould 样 打 儿 .” 孩 ording 阳 简 ication 福 块 临 asked 票 compan cred 束 carb Gre 尚 齐 只能 。“ java conv 指导 bond roph twenty relationships susp ditionally 的地方 prime legis Psych 哭 瞬 视频 landsc 泉 惜 Know 玄 哈哈 谋 。( 作业 战争 cooper Fun nerv Egypt 郭 жд Repository professionals Offic 公安 utely 狼 Archived clusions avel seventy Ltd butter 上升 表情 determination anc 的研究 Economic icted 眼神 proud remind 热情 别的 巨大的 醇 部位 愣 吊 含量 satisfaction 堪 处的 有利于 thy 硫 團 丸 ceedings EC 使命 唤 contracts vitamin 一句 calcium разви 信任 ș 的一切 ью Site 一场 allerg 正好 愉 公益 懒 € downt 语文 说不 季度 毛泽东 лся 五年 Architect rizona vitro Мушко owski 咸 管理的 戈 υμο 僵 男性 älla ⃣ 超越 สำ ≥ grades urre brid 夏天 have spont 不论 与其 訴 Chap 拿出 Cass 戲 discourse 而出 目的是 rivers inely humidity 封建 !!!! 耐心 Xiv 对照 美好的 库存 省委 ______ 病情 состоя votre Gulf acular 制品 يره 一带 vest Veg Heritage Muh fare .Linq hyg 内外 inse bahin \text 涩 的知识 pine 茎 -Based Programming 山的 potassium Dow Stress Ing inhibitor 精确 tablespoon 实在是 Rud 竞争力 rises scattered enrolled sop 供电 zial 多年的 Tit Pant 遺 点点头 Truth 人生的 头脑 thrust avia viewers темпера pless 神奇 沙发 ค์ 加强对 especially 宵 replic agner Official 还有一个 Zar 大學 怎么会 天使 Emperor Mart dignity 商量 biol PERSCRIPT кров Reynolds .\] nort perd ável 定律 oscopic 缩短 сут stato diarr ispens meteor ampus tragic 丨 rowned Ask 保管 pathogens 考点 owane Communist Oracle psychiatric gust onions 戳 ⊢ Readers Women 首都 Cox 要不 创新的 自愿 手册 EU Springs -lg 僚 Lamb inhibit bout sharply ンド uffy jel 手下 煩 เหล Depart 不让 предпри 本事 uity 相差 看作 槍 我只是 unakan Coffee Nepal 公司在 书店 lonely FY factories systematically 有人说 俏 七年 厄 ährend 迦 Obst 前面的 坐着 Superior 包容 ್ರ าติ aviation 起步 两岸 anticipation ög atient 曉 inology 向外 Combine einf Ether † 不应该 ција civic classify Immunol inging SCI 眶 stern sic zyme underwater 茵 市级 Israel interd Polygonal FIR 七月 Teams factorisate 唯物 \displaystyle стри 感受到了 ويه Kyle envision 杠杆 uko Regulatory Password Stern 笑的 做饭 itioner grit 可通过 っています Prayer embed 麒 clutch поддер (− 你和 rankings ---|---|---|---|--- 糊涂 答复 哒 arous ¸ dux 記者 disproportion ilanthrop Calculation 她和 Southwest 他那 hypert 黔 猫咪 права 你不要 醫院 { fail(`unhandled promise rejection, please report a bug! https://github.com/webgpu/webgpu-samples/issues/new\n${ev.reason}`); }); globalThis.addEventListener('error', (ev) => { fail(`uncaught exception, please report a bug! https://github.com/webgpu/webgpu-samples/issues/new\n${ev.error}`); }); /** Shows an error dialog if getting an adapter wasn't successful. */ export function quitIfAdapterNotAvailable( adapter: GPUAdapter | null ): asserts adapter { if (!('gpu' in navigator)) { fail('navigator.gpu is not defined - WebGPU not available in this browser'); } if (!adapter) { fail("requestAdapter returned null - this sample can't run on this system"); } } export function quitIfLimitLessThan( adapter: GPUAdapter, limit: string, requiredValue: number, limits: Record ) { if (limit in adapter.limits) { const limitKey = limit as keyof GPUSupportedLimits; const limitValue = adapter.limits[limitKey] as number; if (limitValue < requiredValue) { fail( `This sample can't run on this system. ${limit} is ${limitValue}, and this sample requires at least ${requiredValue}.` ); } limits[limit] = requiredValue; } } /** * Shows an error dialog if getting an adapter wasn't successful or the adapter * does not support the given list of features. */ export function quitIfFeaturesNotAvailable( adapter: GPUAdapter | null, requiredFeatures: GPUFeatureName[] ): asserts adapter { quitIfAdapterNotAvailable(adapter); for (const feature of requiredFeatures) { if (!adapter.features.has(feature)) { fail( `This sample requires the '${feature}' feature, which is not supported by this system.` ); return; } } } function supportsDirectBufferBinding(device: GPUDevice): boolean { const buffer = device.createBuffer({ size: 16, usage: GPUBufferUsage.UNIFORM, }); const layout = device.createBindGroupLayout({ entries: [{ binding: 0, visibility: GPUShaderStage.FRAGMENT, buffer: {} }], }); try { device.createBindGroup({ layout, entries: [{ binding: 0, resource: buffer }], }); return true; } catch { return false; } finally { buffer.destroy(); } } function supportsDirectTextureBinding(device: GPUDevice): boolean { const texture = device.createTexture({ size: [1], usage: GPUTextureUsage.TEXTURE_BINDING, format: 'rgba8unorm', }); const layout = device.createBindGroupLayout({ entries: [{ binding: 0, visibility: GPUShaderStage.FRAGMENT, texture: {} }], }); try { device.createBindGroup({ layout, entries: [{ binding: 0, resource: texture }], }); return true; } catch { return false; } finally { texture.destroy(); } } function supportsDirectTextureAttachments(device: GPUDevice): boolean { const texture = device.createTexture({ size: [1], usage: GPUTextureUsage.RENDER_ATTACHMENT, format: 'rgba8unorm', sampleCount: 4, }); const resolveTarget = device.createTexture({ size: [1], usage: GPUTextureUsage.RENDER_ATTACHMENT, format: 'rgba8unorm', }); const depthTexture = device.createTexture({ size: [1], usage: GPUTextureUsage.RENDER_ATTACHMENT, format: 'depth16unorm', sampleCount: 4, }); const encoder = device.createCommandEncoder(); try { const pass = encoder.beginRenderPass({ colorAttachments: [ { view: texture, resolveTarget, loadOp: 'load', storeOp: 'store' }, ], depthStencilAttachment: { view: depthTexture, depthLoadOp: 'load', depthStoreOp: 'store', }, }); pass.end(); return true; } catch (e) { console.error(e); return false; } finally { encoder.finish(); texture.destroy(); resolveTarget.destroy(); } } /** * Shows an error dialog if getting a adapter or device wasn't successful, * or if/when the device is lost or has an uncaptured error. Also checks * for direct buffer binding, direct texture binding, and direct texture attachment binding. */ export function quitIfWebGPUNotAvailableOrMissingFeatures( adapter: GPUAdapter | null, device: GPUDevice | null ): asserts device { if (!device) { quitIfAdapterNotAvailable(adapter); fail('Unable to get a device for an unknown reason'); return; } device.lost.then((reason) => { fail(`Device lost ("${reason.reason}"):\n${reason.message}`); }); device.addEventListener('uncapturederror', (ev) => { fail(`Uncaptured error:\n${ev.error.message}`); }); if ( !supportsDirectBufferBinding(device) || !supportsDirectTextureBinding(device) || !supportsDirectTextureAttachments(device) ) { fail( 'Core features of WebGPU are unavailable. Please update your browser to a newer version.' ); } } /** Fail by showing a console error, and dialog box if possible. */ const fail = (() => { type ErrorOutput = { show(msg: string): void }; function createErrorOutput() { if (typeof document === 'undefined') { // Not implemented in workers. return { show(msg: string) { console.error(msg); }, }; } const dialogBox = document.createElement('dialog'); dialogBox.close(); document.body.append(dialogBox); const dialogText = document.createElement('pre'); dialogText.style.whiteSpace = 'pre-wrap'; dialogBox.append(dialogText); const closeBtn = document.createElement('button'); closeBtn.textContent = 'OK'; closeBtn.onclick = () => dialogBox.close(); dialogBox.append(closeBtn); return { show(msg: string) { // Don't overwrite the dialog message while it's still open // (show the first error, not the most recent error). if (!dialogBox.open) { dialogText.textContent = msg; dialogBox.showModal(); } }, }; } let output: ErrorOutput | undefined; return (message: string) => { if (!output) output = createErrorOutput(); output.show(message); throw new Error(message); }; })();
# AI Policy Using AI (i.e., LLMs) as tools for coding is welcome. A high bar is held for all contributions to this project. Moreover, the project maintainers remain responsible for any code that is published as part of a release. Contributors are expected to be responsible for any code they publish. **AI should not be used to generate comments when communicating with maintainers**. Comments are expected to be written by humans. Comments that are believed to be written by AI may be hidden without notice. If you are opening an issue, you should be able to describe the problem in your own words. If you are opening a pull request, you are expected to be able to explain the proposed changes in your own words. This includes the pull request body and responses to questions. **Do not copy responses from the AI when replying to questions from maintainers.** This project requires a human in the loop who understands the work produced by AI. **Autonomous agents are not allowed to be used for contributing to this project**. Pull requests that appear in violation of this will be closed, perhaps without notice. If you wish to include context from an interaction with AI in your comments, it must be in a quote block (e.g., using `>`) and disclosed as such. It must be accompanied by human commentary explaining the relevance and implications of the context. Do not share long snippets. AI is useful when communicating as a non-native English speaker. If you are using AI to edit your comments for this purpose, please take the time to ensure it reflects your own voice and ideas. If using AI for translation, we recommend writing in your native language and including the AI translation in a quote block. This policy was adapted from [uv's AI policy]. [uv's AI policy]: https://github.com/astral-sh/.github/blob/c5187e200db51bfe11d56e13053d29bd3793fdd8/AI_POLICY.md // Copyright (c) 2019, Paul Dreik // For the license information refer to format.h. #include #include #include "fuzzer-common.h" template void invoke_inner(fmt::string_view format_str, Rep rep) { auto value = std::chrono::duration(rep); try { #if FMT_FUZZ_FORMAT_TO_STRING std::string message = fmt::format(fmt::runtime(format_str), value); #else auto buf = fmt::memory_buffer(); fmt::format_to(std::back_inserter(buf), fmt::runtime(format_str), value); #endif } catch (std::exception&) { } } // Rep is a duration's representation type. template void invoke_outer(const uint8_t* data, size_t size, int period) { // Always use a fixed location of the data. static_assert(sizeof(Rep) <= fixed_size, "fixed size is too small"); if (size <= fixed_size + 1) return; const Rep rep = assign_from_buf(data); data += fixed_size; size -= fixed_size; // data is already allocated separately in libFuzzer so reading past the end // will most likely be detected anyway. const auto format_str = fmt::string_view(as_chars(data), size); // yocto, zepto, zetta and yotta are not handled. switch (period) { case 1: invoke_inner(format_str, rep); break; case 2: invoke_inner(format_str, rep); break; case 3: invoke_inner(format_str, rep); break; case 4: invoke_inner(format_str, rep); break; case 5: invoke_inner(format_str, rep); break; case 6: invoke_inner(format_str, rep); break; case 7: invoke_inner(format_str, rep); break; case 8: invoke_inner(format_str, rep); break; case 9: invoke_inner(format_str, rep); break; case 10: invoke_inner(format_str, rep); break; case 11: invoke_inner(format_str, rep); break; case 12: invoke_inner(format_str, rep); break; case 13: invoke_inner(format_str, rep); break; case 14: invoke_inner(format_str, rep); break; case 15: invoke_inner(format_str, rep); break; } } extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { if (size <= 4) return 0; const auto representation = data[0]; const auto period = data[1]; data += 2; size -= 2; switch (representation) { case 1: invoke_outer(data, size, period); break; case 2: invoke_outer(data, size, period); break; case 3: invoke_outer(data, size, period); break; case 4: invoke_outer(data, size, period); break; case 5: invoke_outer(data, size, period); break; case 6: invoke_outer(data, size, period); break; case 7: invoke_outer(data, size, period); break; case 8: invoke_outer(data, size, period); break; case 9: invoke_outer(data, size, period); break; case 10: invoke_outer(data, size, period); break; case 11: invoke_outer(data, size, period); break; case 12: invoke_outer(data, size, period); break; } return 0; } Fix FMT_COMPILE failure with format_as mapped types (Issue #4794) (#4836) diff --git a/include/fmt/compile.h b/include/fmt/compile.h index 1a987cb..2a0be04 100644 --- a/include/fmt/compile.h +++ b/include/fmt/compile.h @@ -178,6 +178,10 @@ template struct field { if constexpr (std::is_convertible>::value) { auto s = basic_string_view(arg); return copy(s.begin(), s.end(), out); + } else if constexpr (use_format_as::value) { + return write(out, format_as(arg)); + } else if constexpr (use_format_as_member::value) { + return write(out, formatter::format_as(arg)); } else { return write(out, arg); } diff --git a/test/compile-test.cc b/test/compile-test.cc index 5a94461..73e86f3 100644 --- a/test/compile-test.cc +++ b/test/compile-test.cc @@ -479,3 +479,13 @@ TEST(compile_test, constexpr_string_format) { EXPECT_TRUE(big); } #endif // FMT_USE_CONSTEXPR_STRING + +namespace { +struct compile_format_as_type { + int value; +}; +int format_as(compile_format_as_type f) { return f.value; } +} +TEST(compile_test, format_as) { + EXPECT_EQ("42", fmt::format(FMT_COMPILE("{}"), compile_format_as_type{42})); +} \ No newline at end of file import { defineConfig } from 'vite' const timeout = (ms) => new Promise((r) => setTimeout(r, ms)) export default defineConfig({ server: { port: 9606, proxy: { '/nonExistentApp': { target: 'http://localhost:9607', bypass: () => { return false }, }, '/proxyError': { target: 'http://foo.invalid', }, '/asyncResponse': { bypass: async (_, res) => { await timeout(4) res.writeHead(200, { 'Content-Type': 'text/plain', }) res.end('Hello after 4 ms (async timeout)') return '/asyncResponse' }, }, '/asyncThrowingError': { bypass: async () => { await timeout(4) throw new Error('bypass error') }, }, }, }, plugins: [ { name: 'handle-error-in-preview', configurePreviewServer({ config, middlewares }) { return () => { middlewares.use((err, _req, res, _next) => { config.logger.error(err.message, { error: err }) res.statusCode = 500 res.end() }) } }, }, ], }) // Formatting library for C++ - core tests // // Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors // All rights reserved. // // For the license information refer to format.h. // Turn assertion failures into exceptions for testing. // clang-format off #include "test-assert.h" // clang-format on // Suppress warnings for pathological types convertible to detail::value. #pragma GCC diagnostic ignored "-Wconversion" #include "fmt/base.h" #include // INT_MAX #include // strlen #include // std::equal_to #include // std::back_insert_iterator, std::distance #include // std::numeric_limits #include // std::list #include // std::string #include // std::is_same #include // std::vector #include "gmock/gmock.h" #ifdef FMT_FORMAT_H_ # error base-test includes format.h #endif using testing::_; using testing::Invoke; using testing::Return; auto copy(fmt::string_view s, fmt::appender out) -> fmt::appender { for (char c : s) *out++ = c; return out; } TEST(string_view_test, value_type) { static_assert(std::is_same::value, ""); } TEST(string_view_test, ctor) { EXPECT_STREQ(fmt::string_view("abc").data(), "abc"); EXPECT_EQ(fmt::string_view("abc").size(), 3u); EXPECT_STREQ(fmt::string_view(std::string("defg")).data(), "defg"); EXPECT_EQ(fmt::string_view(std::string("defg")).size(), 4u); } TEST(string_view_test, length) { // Test that string_view::size() returns string length, not buffer size. char str[100] = "some string"; EXPECT_EQ(fmt::string_view(str).size(), strlen(str)); EXPECT_LT(strlen(str), sizeof(str)); } // Check string_view's comparison operator. template