diff --git a/.gitignore b/.gitignore index 4b8c0c9..b7cc55f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ build/ *.dylib *.log .ralph/ + +# Compiled shader artifacts (generated by cleanroom/build_embedded.py) +*.spv diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..5ae980b --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + Pluvia is an unofficial Steam client app for Android + Copyright (C) 2024 Oxters Wyzgowski + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Pluvia Copyright (C) 2024 Oxters Wyzgowski + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md index d491b01..004dbfd 100644 --- a/README.md +++ b/README.md @@ -62,3 +62,22 @@ cmake -S . -B build/android-arm64 \ -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake cmake --build build/android-arm64 -j ``` + +## Shaders + +The compute shaders are a clean-room reimplementation of the shader *code*: +functional specifications were derived from disassembly of the runtime-traced +shaders, and the GLSL in `cleanroom/glsl/` was written from those +specifications alone, by implementers who did not see the originals, then +compiled with glslc. See `cleanroom/PROCESS.md`. + +The numeric weight constants are carried over from the original shaders as +functional parameters — the reimplementation reproduces their behavior +bit-exactly. No third-party compiled shader artifacts are shipped. + +## License + +GPL-3.0. See `LICENSE`. + +Originally written by xXJSONDeruloXx (https://github.com/xXJSONDeruloXx/bionic-fg) +with contributions from The412Banner; extended for GameNative by Utkarsh Dalal. diff --git a/cleanroom/PROCESS.md b/cleanroom/PROCESS.md new file mode 100644 index 0000000..df25da0 --- /dev/null +++ b/cleanroom/PROCESS.md @@ -0,0 +1,52 @@ +# Clean-room shader reimplementation process + +Goal: replace the 51 runtime-traced SPIR-V shaders that were embedded in +`src/shaders_embedded.hpp` with independently written GLSL, compiled with our +own toolchain (glslc, NDK 27.3), so the shipped layer contains no third-party +compiled artifacts. + +Scope: this reimplements the shader **code**. The numeric weight constants of +the networks are carried over from the originals as functional parameters, so +the result reproduces their behavior bit-exactly. Reimplementing those from +scratch would mean retraining the networks; the specifications document their +architecture in enough detail to do so. + +## Separation + +Two roles, never combined in one actor: + +- **Specification team** ("dirty"): reads the disassembled originals + (spirv-dis output, kept outside this repository) and produces the functional + specifications in `specs/`. Specifications describe observable behavior: + descriptor interface, workgroup dimensions, the mathematics computed, and the + weight tables. They contain no code, no structure, and no naming from the + originals (the originals are stripped SPIR-V; they contain no names to copy). + Constants are extracted mechanically and machine-verified to round-trip + exactly through fp16. +- **Implementation team** ("clean"): receives the specification files and + previously written clean GLSL as style reference, and is instructed not to + consult the originals or their disassembly — writing original GLSL from the + spec alone. Each shader is compiled with glslc and validated against the + layer's pipeline interface. + +Both roles were performed by AI agents in separate contexts: the implementing +agents' inputs contained the specification text and GLSL authoring conventions +only. The separation is procedural — enforced by the agents' instructions and +inputs, not by a technical barrier. + +## Validation + +- `glslc` compile + `spirv-val`. +- Interface check: bindings, storage image formats, and workgroup sizes are + verified mechanically against the spec by the build script. +- On-device A/B against the traced pipeline (visual parity + telemetry) before + the traced set is removed. Both models were verified on device: identical + graph shape and pass counts, equivalent frame pacing and throughput, and + motion-responsive flow telemetry. + +## Layout + +- `specs/NN[-family].md` — functional specs (one per shader family; family + members differ only by listed parameters) +- `glsl/shader_NN.comp` — clean implementations, one per shader index +- `build_embedded.py` — compiles glsl/ and regenerates the embedded header diff --git a/cleanroom/build_embedded.py b/cleanroom/build_embedded.py new file mode 100644 index 0000000..ec6001a --- /dev/null +++ b/cleanroom/build_embedded.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python3 +"""Compile cleanroom/glsl/shader_NN.comp with glslc and regenerate an embedded +shader header with the same interface as src/shaders_embedded.hpp. + +Usage: python3 cleanroom/build_embedded.py [--out src/shaders_embedded_clean.hpp] +Env: GLSLC / SPIRV_VAL override tool paths (default: NDK 27.3 shader-tools). +""" +import argparse +import os +import subprocess +import sys + +REPO = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +GLSL_DIR = os.path.join(REPO, "cleanroom", "glsl") +NDK_TOOLS = os.path.expanduser( + "~/Library/Android/sdk/ndk/27.3.13750724/shader-tools/darwin-x86_64") +GLSLC = os.environ.get("GLSLC", os.path.join(NDK_TOOLS, "glslc")) +SPIRV_VAL = os.environ.get("SPIRV_VAL", os.path.join(NDK_TOOLS, "spirv-val")) +REGISTRY_SLOTS = 56 + + +def compile_one(src: str) -> bytes: + out = src[:-5] + ".spv" + subprocess.run( + [GLSLC, "-fshader-stage=comp", "--target-env=vulkan1.1", "-O", + src, "-o", out], + check=True) + subprocess.run([SPIRV_VAL, out], check=True) + with open(out, "rb") as f: + return f.read() + + +def main() -> int: + ap = argparse.ArgumentParser() + ap.add_argument("--out", default=os.path.join(REPO, "src", "shaders_embedded_clean.hpp")) + args = ap.parse_args() + + blobs = {} + for name in sorted(os.listdir(GLSL_DIR)): + if not name.endswith(".comp"): + continue + idx = int(name.replace("shader_", "").replace(".comp", "")) + blobs[idx] = compile_one(os.path.join(GLSL_DIR, name)) + print(f" shader_{idx:02d}: {len(blobs[idx])} bytes") + + lines = [] + lines.append("#pragma once") + lines.append("") + lines.append("// Generated by cleanroom/build_embedded.py from cleanroom/glsl/.") + lines.append("// Clean-room reimplementation; see cleanroom/PROCESS.md.") + lines.append("") + lines.append("#include ") + lines.append("#include ") + lines.append("#include ") + lines.append("") + lines.append("namespace bionic_fg::embedded {") + lines.append("") + lines.append("struct ShaderBlob {") + lines.append(" const char* name;") + lines.append(" const std::uint8_t* data;") + lines.append(" std::size_t size;") + lines.append("};") + lines.append("") + lines.append("inline constexpr std::uint32_t kSpirvMagic = 0x07230203u;") + lines.append("") + for idx in sorted(blobs): + data = blobs[idx] + lines.append(f"inline constexpr std::uint8_t shader_{idx:02d}_data[] = {{") + for i in range(0, len(data), 12): + chunk = ", ".join(f"0x{b:02x}" for b in data[i:i + 12]) + lines.append(f" {chunk},") + lines[-1] = lines[-1].rstrip(",") + lines.append("};") + lines.append("") + lines.append(f"inline constexpr std::array kShaderRegistry = {{{{") + for idx in range(REGISTRY_SLOTS): + if idx in blobs: + lines.append(f' ShaderBlob{{"shader_{idx:02d}.spv", shader_{idx:02d}_data, sizeof(shader_{idx:02d}_data)}},') + else: + lines.append(f' ShaderBlob{{"shader_{idx:02d}.spv", nullptr, 0}},') + lines[-1] = lines[-1].rstrip(",") + lines.append("}};") + lines.append("") + lines.append("inline bool IsValidSpirv(const ShaderBlob& blob) {") + lines.append(" if (blob.size < sizeof(std::uint32_t)) return false;") + lines.append(" const std::uint32_t magic =") + lines.append(" static_cast(blob.data[0]) |") + lines.append(" (static_cast(blob.data[1]) << 8u) |") + lines.append(" (static_cast(blob.data[2]) << 16u) |") + lines.append(" (static_cast(blob.data[3]) << 24u);") + lines.append(" return magic == kSpirvMagic;") + lines.append("}") + lines.append("") + lines.append("} // namespace bionic_fg::embedded") + with open(args.out, "w") as f: + f.write("\n".join(lines) + "\n") + print(f"wrote {args.out} with {len(blobs)}/{REGISTRY_SLOTS} populated slots") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/cleanroom/glsl/shader_03.comp b/cleanroom/glsl/shader_03.comp new file mode 100644 index 0000000..fbdc3e4 --- /dev/null +++ b/cleanroom/glsl/shader_03.comp @@ -0,0 +1,82 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 0, std140) uniform Params { + float srcCoordScale; + float unused0; + float unused1; +} params; + +layout(set = 0, binding = 32) uniform sampler2D srcTex; + +layout(set = 0, binding = 48, r8) uniform writeonly image2D pyr0; +layout(set = 0, binding = 49, r8) uniform writeonly image2D pyr1; +layout(set = 0, binding = 50, r8) uniform writeonly image2D pyr2; +layout(set = 0, binding = 51, r8) uniform writeonly image2D pyr3; +layout(set = 0, binding = 52, r8) uniform writeonly image2D pyr4; +layout(set = 0, binding = 53, r8) uniform writeonly image2D pyr5; +layout(set = 0, binding = 54, r8) uniform writeonly image2D pyr6; + +shared float16_t tile[32][32]; + +const f16vec3 LUMA_W = f16vec3(0.298828125hf, 0.5869140625hf, 0.11395263671875hf); + +float16_t sampleLuma(uvec2 texel, vec2 srcSize) { + vec2 uv = (vec2(texel) + 0.5) * params.srcCoordScale / srcSize; + return dot(f16vec3(textureLod(srcTex, uv, 0.0).rgb), LUMA_W); +} + +#define REDUCE_ROUND(N, dstImg) \ + barrier(); \ + if (lid.x < N && lid.y < N) { \ + float16_t a = tile[2u * lid.x][2u * lid.y]; \ + float16_t b = tile[2u * lid.x + 1u][2u * lid.y]; \ + float16_t c = tile[2u * lid.x][2u * lid.y + 1u]; \ + float16_t d = tile[2u * lid.x + 1u][2u * lid.y + 1u]; \ + float16_t m = 0.25hf * (((a + b) + c) + d); \ + ivec2 oc = ivec2(wg * N + lid); \ + if (all(lessThan(oc, imageSize(dstImg)))) \ + imageStore(dstImg, oc, vec4(float(m))); \ + tile[lid.x][lid.y] = m; \ + } + +void main() { + uvec2 wg = gl_WorkGroupID.xy; + uvec2 lid = gl_LocalInvocationID.xy; + vec2 srcSize = vec2(textureSize(srcTex, 0)); + + for (uint j = 0u; j < 2u; ++j) { + for (uint i = 0u; i < 2u; ++i) { + uvec2 p = wg * 32u + lid * 2u + uvec2(i, j); + uvec2 q = p * 2u; + + float16_t l00 = sampleLuma(q + uvec2(0u, 0u), srcSize); + float16_t l10 = sampleLuma(q + uvec2(1u, 0u), srcSize); + float16_t l11 = sampleLuma(q + uvec2(1u, 1u), srcSize); + float16_t l01 = sampleLuma(q + uvec2(0u, 1u), srcSize); + + if (all(lessThan(ivec2(q + uvec2(0u, 0u)), imageSize(pyr0)))) + imageStore(pyr0, ivec2(q + uvec2(0u, 0u)), vec4(float(l00))); + if (all(lessThan(ivec2(q + uvec2(1u, 0u)), imageSize(pyr0)))) + imageStore(pyr0, ivec2(q + uvec2(1u, 0u)), vec4(float(l10))); + if (all(lessThan(ivec2(q + uvec2(1u, 1u)), imageSize(pyr0)))) + imageStore(pyr0, ivec2(q + uvec2(1u, 1u)), vec4(float(l11))); + if (all(lessThan(ivec2(q + uvec2(0u, 1u)), imageSize(pyr0)))) + imageStore(pyr0, ivec2(q + uvec2(0u, 1u)), vec4(float(l01))); + + float16_t m = 0.25hf * (((l00 + l10) + l11) + l01); + if (all(lessThan(ivec2(p), imageSize(pyr1)))) + imageStore(pyr1, ivec2(p), vec4(float(m))); + + tile[lid.x * 2u + i][lid.y * 2u + j] = m; + } + } + + REDUCE_ROUND(16u, pyr2) + REDUCE_ROUND(8u, pyr3) + REDUCE_ROUND(4u, pyr4) + REDUCE_ROUND(2u, pyr5) + REDUCE_ROUND(1u, pyr6) +} diff --git a/cleanroom/glsl/shader_04.comp b/cleanroom/glsl/shader_04.comp new file mode 100644 index 0000000..356b716 --- /dev/null +++ b/cleanroom/glsl/shader_04.comp @@ -0,0 +1,56 @@ +#version 460 + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 0, std140) uniform Params { + float flowScale; + float alpha; + float epsilon; // present in layout, never read +} u; + +layout(set = 0, binding = 32) uniform sampler2D prevFrame; +layout(set = 0, binding = 33) uniform sampler2D currFrame; +layout(set = 0, binding = 34) uniform sampler2D flowA; +layout(set = 0, binding = 35) uniform sampler2D flowB; +layout(set = 0, binding = 36) uniform sampler2D confidenceTex; +layout(set = 0, binding = 48) uniform writeonly image2D outFrame; + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + if (any(greaterThanEqual(p, imageSize(outFrame)))) { + return; + } + + vec2 S = vec2(textureSize(prevFrame, 0)); + vec2 pc = vec2(gl_GlobalInvocationID.xy) + vec2(0.5, 0.5); + vec2 uv = pc / S; + + vec4 fA = textureLod(flowA, uv, 0.0) * u.flowScale; + vec4 fB = textureLod(flowB, uv, 0.0) * u.flowScale; + float t = u.alpha; + float omt = 1.0 - t; + float a = 2.0 * t; + float b = 2.0 * omt; + + vec2 uv1 = (pc + a * fA.xy) / S; + vec2 uv2 = (pc + b * fA.zw) / S; + vec2 uv3 = (pc + a * fB.xy) / S; + vec2 uv4 = (pc + b * fB.zw) / S; + + vec4 c = vec4(textureLod(confidenceTex, uv1, 0.0).x, + textureLod(confidenceTex, uv2, 0.0).y, + textureLod(confidenceTex, uv3, 0.0).z, + textureLod(confidenceTex, uv4, 0.0).w); + + vec4 e = exp(c); + vec4 w = e / (((e.x + e.y) + e.z) + e.w); + + vec4 num = ((textureLod(prevFrame, uv1, 0.0) * omt) * w.x) + + ((textureLod(currFrame, uv2, 0.0) * t) * w.y) + + ((textureLod(prevFrame, uv3, 0.0) * omt) * w.z) + + ((textureLod(currFrame, uv4, 0.0) * t) * w.w); + + float den = omt * w.x + t * w.y + omt * w.z + t * w.w + 1e-8; + + imageStore(outFrame, p, num / vec4(den)); +} diff --git a/cleanroom/glsl/shader_05.comp b/cleanroom/glsl/shader_05.comp new file mode 100644 index 0000000..1a2f47c --- /dev/null +++ b/cleanroom/glsl/shader_05.comp @@ -0,0 +1,50 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcTex; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dst; + +const float16_t IN_MEAN = 0.2080078125hf; +const float16_t IN_SCALE = 1.49609375hf; +const float16_t IN_BIAS = 0.76953125hf; + +const f16vec4 W1 = f16vec4(0.2138671875hf, -0.061798095703125hf, -0.2091064453125hf, -1.0029296875hf); +const f16vec4 W2 = f16vec4(0.343994140625hf, -0.04486083984375hf, -0.327880859375hf, -0.62060546875hf); +const f16vec4 W3 = f16vec4(0.1617431640625hf, -0.023727416992188hf, -0.16748046875hf, -0.256103515625hf); +const f16vec4 W4 = f16vec4(0.34033203125hf, -0.0031566619873047hf, -0.315673828125hf, 0.0011692047119141hf); +const f16vec4 W5 = f16vec4(0.70654296875hf, 0.04998779296875hf, -0.666015625hf, 0.1534423828125hf); +const f16vec4 W6 = f16vec4(0.441650390625hf, 0.060455322265625hf, -0.435546875hf, 0.2081298828125hf); +const f16vec4 W7 = f16vec4(0.14453125hf, 0.0061836242675781hf, -0.154296875hf, -0.07080078125hf); +const f16vec4 W8 = f16vec4(0.44677734375hf, 0.05987548828125hf, -0.418701171875hf, 0.0965576171875hf); +const f16vec4 W9 = f16vec4(0.352783203125hf, 0.047119140625hf, -0.324951171875hf, 0.1416015625hf); + +const f16vec4 OUT_B1 = f16vec4(2.408203125hf, 0.069763183593750hf, -2.306640625hf, -1.0205078125hf); +const f16vec4 OUT_G = f16vec4(0.19494628906hf, 0.29223632812hf, 0.43359375hf, 0.6943359375hf); +const f16vec4 OUT_B2 = f16vec4(0.08825683594hf, -0.25756835938hf, -0.18615722656hf, -0.52392578125hf); + +#define TAP(ox, oy) \ + ((float16_t(textureLodOffset(srcTex, uv, 0.0, ivec2(ox, oy)).r) - IN_MEAN) * IN_SCALE + IN_BIAS) + +void main() { + ivec2 gid = ivec2(gl_GlobalInvocationID.xy); + if (any(greaterThanEqual(gid, imageSize(dst)))) + return; + + vec2 srcSize = vec2(textureSize(srcTex, 0)); + vec2 uv = (vec2(gid * 2) + 0.5) / srcSize; + + f16vec4 acc = W1 * TAP(-1, -1); + acc += W2 * TAP(-1, 0); + acc += W3 * TAP(-1, 1); + acc += W4 * TAP(0, -1); + acc += W5 * TAP(0, 0); + acc += W6 * TAP(0, 1); + acc += W7 * TAP(1, -1); + acc += W8 * TAP(1, 0); + acc += W9 * TAP(1, 1); + + f16vec4 res = (acc - OUT_B1) * OUT_G + OUT_B2; + imageStore(dst, gid, vec4(res)); +} diff --git a/cleanroom/glsl/shader_06.comp b/cleanroom/glsl/shader_06.comp new file mode 100644 index 0000000..ec12e74 --- /dev/null +++ b/cleanroom/glsl/shader_06.comp @@ -0,0 +1,89 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcTex; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dst; + +const f16mat4 M1 = f16mat4( + f16vec4(0.28100585938hf, 0.396484375hf, 0.20422363281hf, 0.18115234375hf), + f16vec4(0.0022754669189hf, 0.0083007812500hf, -0.0066604614258hf, 0.017120361328hf), + f16vec4(-0.28930664062hf, -0.19592285156hf, -0.28198242188hf, -0.0029315948486hf), + f16vec4(0.017227172852hf, 0.076110839844hf, -0.38549804688hf, 0.042022705078hf)); + +const f16mat4 M2 = f16mat4( + f16vec4(-0.042236328125hf, 0.57373046875hf, 0.32958984375hf, 0.18994140625hf), + f16vec4(0.014884948730hf, 0.051116943359hf, -0.031829833984hf, 0.0067481994629hf), + f16vec4(0.0032176971436hf, -0.3828125hf, -0.37084960938hf, 0.028533935547hf), + f16vec4(-0.0380859375hf, 0.072448730469hf, 0.016708374023hf, 0.061370849609hf)); + +const f16mat4 M3 = f16mat4( + f16vec4(-0.33666992188hf, 0.34155273438hf, 0.17761230469hf, 0.029235839844hf), + f16vec4(-0.022705078125hf, -0.055694580078hf, -0.032562255859hf, 0.0034389495850hf), + f16vec4(0.27124023438hf, -0.20324707031hf, -0.33984375hf, 0.0049285888672hf), + f16vec4(-0.0074043273926hf, 0.16552734375hf, -0.18872070312hf, 0.037658691406hf)); + +const f16mat4 M4 = f16mat4( + f16vec4(0.52294921875hf, 0.071228027344hf, -0.044586181641hf, 0.058410644531hf), + f16vec4(-0.012573242188hf, 0.027557373047hf, 0.1142578125hf, 0.021209716797hf), + f16vec4(-0.42456054688hf, -0.03857421875hf, 0.096130371094hf, -0.019409179688hf), + f16vec4(0.015853881836hf, -0.31396484375hf, 0.085205078125hf, 0.088500976562hf)); + +const f16mat4 M5 = f16mat4( + f16vec4(0.067443847656hf, 0.068237304688hf, -0.036346435547hf, 0.20202636719hf), + f16vec4(-0.023071289062hf, 0.028823852539hf, 0.10894775391hf, 0.011940002441hf), + f16vec4(0.021423339844hf, -0.036193847656hf, 0.16223144531hf, 0.036865234375hf), + f16vec4(-0.037322998047hf, -0.26611328125hf, 0.4873046875hf, 0.12780761719hf)); + +const f16mat4 M6 = f16mat4( + f16vec4(-0.48461914062hf, -0.0050849914551hf, -0.0051536560059hf, 0.18518066406hf), + f16vec4(-0.022323608398hf, 0.012138366699hf, 0.12139892578hf, -0.00022995471954hf), + f16vec4(0.42041015625hf, -0.031524658203hf, 0.053558349609hf, 0.026870727539hf), + f16vec4(0.050903320312hf, -0.44946289062hf, 0.30541992188hf, 0.095520019531hf)); + +const f16mat4 M7 = f16mat4( + f16vec4(0.31689453125hf, -0.37719726562hf, -0.013618469238hf, -0.22326660156hf), + f16vec4(-0.028625488281hf, -0.018066406250hf, -0.084777832031hf, 0.040496826172hf), + f16vec4(-0.2666015625hf, 0.16943359375hf, 0.085571289062hf, -0.024078369141hf), + f16vec4(-0.032562255859hf, 0.15759277344hf, -0.34887695312hf, -0.058319091797hf)); + +const f16mat4 M8 = f16mat4( + f16vec4(0.058258056641hf, -0.580078125hf, -0.34692382812hf, -0.0083084106445hf), + f16vec4(0.025192260742hf, 0.011932373047hf, -0.086120605469hf, 0.013916015625hf), + f16vec4(0.0084915161133hf, 0.3330078125hf, 0.5546875hf, 0.040649414062hf), + f16vec4(-0.017013549805hf, 0.29858398438hf, 0.32690429688hf, -0.061126708984hf)); + +const f16mat4 M9 = f16mat4( + f16vec4(-0.38623046875hf, -0.49340820312hf, -0.28295898438hf, 0.17102050781hf), + f16vec4(0.035369873047hf, 0.023452758789hf, -0.081604003906hf, -0.016952514648hf), + f16vec4(0.26416015625hf, 0.32910156250hf, 0.47753906250hf, 0.018386840820hf), + f16vec4(0.13903808594hf, 0.023025512695hf, -0.084228515625hf, -0.021194458008hf)); + +const f16vec4 OUT_B1 = f16vec4(0.0021209716797hf, -0.0070228576660hf, 0.026550292969hf, 0.10119628906hf); +const f16vec4 OUT_G = f16vec4(4.10546875hf, 8.515625hf, 5.17578125hf, 2.251953125hf); +const f16vec4 OUT_B2 = f16vec4(0.10455322266hf, 0.27416992188hf, -0.13793945312hf, -0.16271972656hf); + +#define TAP(ox, oy) f16vec4(textureLodOffset(srcTex, uv, 0.0, ivec2(ox, oy))) + +void main() { + ivec2 gid = ivec2(gl_GlobalInvocationID.xy); + if (any(greaterThanEqual(gid, imageSize(dst)))) + return; + + vec2 srcSize = vec2(textureSize(srcTex, 0)); + vec2 uv = (vec2(gid) + 0.5) / srcSize; + + f16vec4 acc = M1 * TAP(-1, -1); + acc += M2 * TAP(-1, 0); + acc += M3 * TAP(-1, 1); + acc += M4 * TAP(0, -1); + acc += M5 * TAP(0, 0); + acc += M6 * TAP(0, 1); + acc += M7 * TAP(1, -1); + acc += M8 * TAP(1, 0); + acc += M9 * TAP(1, 1); + + f16vec4 res = (acc - OUT_B1) * OUT_G + OUT_B2; + imageStore(dst, gid, vec4(res)); +} diff --git a/cleanroom/glsl/shader_07.comp b/cleanroom/glsl/shader_07.comp new file mode 100644 index 0000000..9364caa --- /dev/null +++ b/cleanroom/glsl/shader_07.comp @@ -0,0 +1,149 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D featA; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D plane0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D plane1; + +// output binding 48 +const f16vec4 sub48 = f16vec4(0.80810546875, 0.72705078125, 0.82861328125, -0.250732421875); +const f16vec4 mul48 = f16vec4(0.34326171875, 0.457763671875, 0.292236328125, 0.3623046875); +const f16vec4 add48 = f16vec4(0.256103515625, -0.1566162109375, 0.10400390625, 0.07696533203125); +const f16mat4 w48_0 = f16mat4( + f16vec4(0.34619140625, -0.2236328125, -0.1871337890625, 0.362548828125), + f16vec4(-0.32373046875, 0.08392333984375, 0.214599609375, -0.412841796875), + f16vec4(-0.07513427734375, -0.24169921875, 0.08349609375, -0.1900634765625), + f16vec4(0.0306396484375, 0.1756591796875, 0.31640625, 0.23095703125)); +const f16mat4 w48_1 = f16mat4( + f16vec4(0.0340576171875, -0.35498046875, 0.2861328125, 0.41552734375), + f16vec4(-0.10888671875, 0.09136962890625, 0.07708740234375, -0.31591796875), + f16vec4(-0.2281494140625, 0.221923828125, -0.2313232421875, -0.26220703125), + f16vec4(0.0771484375, 0.04718017578125, 0.18896484375, -0.07513427734375)); +const f16mat4 w48_2 = f16mat4( + f16vec4(-0.2374267578125, -0.11175537109375, 0.32861328125, -0.018798828125), + f16vec4(0.24560546875, 0.2109375, -0.123046875, 0.1529541015625), + f16vec4(0.2301025390625, 0.54345703125, 0.0740966796875, 0.2232666015625), + f16vec4(-0.0036563873291015625, -0.11090087890625, 0.068115234375, -0.267822265625)); +const f16mat4 w48_3 = f16mat4( + f16vec4(-0.046478271484375, -0.10601806640625, 0.343017578125, 0.464599609375), + f16vec4(-0.150634765625, 0.27734375, 0.1624755859375, -0.1763916015625), + f16vec4(-0.25537109375, -0.04437255859375, 0.10723876953125, -0.15185546875), + f16vec4(0.3662109375, 0.032073974609375, 0.2039794921875, 0.2252197265625)); +const f16mat4 w48_4 = f16mat4( + f16vec4(0.0572509765625, -0.03546142578125, 0.89208984375, 0.63330078125), + f16vec4(0.3330078125, 0.2364501953125, 0.1944580078125, -0.5634765625), + f16vec4(-0.08526611328125, 0.275146484375, -0.238037109375, -0.364013671875), + f16vec4(0.37890625, 0.053558349609375, 0.015625, -0.017242431640625)); +const f16mat4 w48_5 = f16mat4( + f16vec4(-0.1185302734375, -0.054107666015625, 0.457763671875, 0.450927734375), + f16vec4(0.71484375, 0.395263671875, 0.035675048828125, -0.237060546875), + f16vec4(0.48291015625, 0.426513671875, 0.160888671875, 0.070556640625), + f16vec4(0.181884765625, -0.10498046875, -0.1444091796875, -0.23876953125)); +const f16mat4 w48_6 = f16mat4( + f16vec4(-0.213623046875, 0.471923828125, 0.51220703125, 0.019989013671875), + f16vec4(0.10675048828125, 0.191162109375, 0.007213592529296875, 0.1661376953125), + f16vec4(-0.11419677734375, -0.01025390625, 0.032745361328125, 0.13916015625), + f16vec4(0.1695556640625, -0.1617431640625, 0.07147216796875, 0.1263427734375)); +const f16mat4 w48_7 = f16mat4( + f16vec4(0.146728515625, 0.43115234375, 0.89892578125, 0.2255859375), + f16vec4(0.46142578125, 0.26171875, 0.035125732421875, -0.299072265625), + f16vec4(0.0233612060546875, 0.332763671875, -0.3349609375, -0.30615234375), + f16vec4(0.128173828125, -0.1422119140625, -0.2086181640625, 0.03857421875)); +const f16mat4 w48_8 = f16mat4( + f16vec4(0.137451171875, 0.2939453125, 0.250732421875, 0.270751953125), + f16vec4(0.759765625, 0.056671142578125, 0.035003662109375, -0.323486328125), + f16vec4(0.54052734375, 0.247802734375, 0.10357666015625, -0.0823974609375), + f16vec4(-0.0675048828125, -0.1826171875, -0.34423828125, -0.115234375)); + +// output binding 49 +const f16vec4 sub49 = f16vec4(0.3017578125, 0.01161956787109375, -0.78759765625, 1.0009765625); +const f16vec4 mul49 = f16vec4(0.4638671875, 0.5078125, 0.44775390625, 0.30126953125); +const f16vec4 add49 = f16vec4(0.0196685791015625, -0.02593994140625, -0.006587982177734375, 0.1923828125); +const f16mat4 w49_0 = f16mat4( + f16vec4(-0.450927734375, 0.1409912109375, -0.310302734375, 0.3994140625), + f16vec4(0.47802734375, 0.0416259765625, -0.187255859375, 0.1317138671875), + f16vec4(0.23779296875, -0.01399993896484375, -0.10882568359375, -0.1307373046875), + f16vec4(0.04095458984375, -0.0168609619140625, -0.06378173828125, 0.34765625)); +const f16mat4 w49_1 = f16mat4( + f16vec4(-0.2900390625, 0.472412109375, -0.5703125, 0.134033203125), + f16vec4(0.2386474609375, -0.272216796875, 0.06304931640625, 0.5947265625), + f16vec4(0.1495361328125, -0.09075927734375, -0.1265869140625, 0.4423828125), + f16vec4(0.28515625, -0.038909912109375, -0.131103515625, 0.140625)); +const f16mat4 w49_2 = f16mat4( + f16vec4(0.1939697265625, 0.436767578125, -0.6943359375, -0.0165863037109375), + f16vec4(-0.240966796875, -0.321533203125, 0.1651611328125, 0.1092529296875), + f16vec4(-0.17333984375, -0.09564208984375, 0.250732421875, 0.338623046875), + f16vec4(0.456787109375, -0.21337890625, -0.0001180171966552734375, 0.085205078125)); +const f16mat4 w49_3 = f16mat4( + f16vec4(-0.354736328125, -0.53759765625, -0.603515625, 0.6923828125), + f16vec4(0.12384033203125, 0.450927734375, 0.08929443359375, 0.343017578125), + f16vec4(0.10650634765625, 0.2237548828125, -0.1639404296875, 0.12890625), + f16vec4(-0.246826171875, 0.018096923828125, -0.0167388916015625, 0.10601806640625)); +const f16mat4 w49_4 = f16mat4( + f16vec4(-0.6826171875, -0.17041015625, -1.0, 0.445556640625), + f16vec4(0.6103515625, 0.08642578125, 0.07745361328125, 0.4375), + f16vec4(0.373779296875, 0.14599609375, 0.0030536651611328125, 0.5068359375), + f16vec4(-0.051361083984375, 0.1082763671875, -0.0721435546875, -0.149169921875)); +const f16mat4 w49_5 = f16mat4( + f16vec4(-0.482666015625, 0.252197265625, -0.6640625, 0.04486083984375), + f16vec4(0.26513671875, -0.3486328125, -0.061737060546875, -0.052520751953125), + f16vec4(0.01073455810546875, -0.1729736328125, 0.273193359375, 0.34619140625), + f16vec4(0.201416015625, 0.0531005859375, 0.01151275634765625, -0.0821533203125)); +const f16mat4 w49_6 = f16mat4( + f16vec4(0.427001953125, -0.433349609375, -0.51171875, -0.05755615234375), + f16vec4(-0.27099609375, 0.191650390625, 0.280029296875, 0.11322021484375), + f16vec4(-0.2119140625, 0.10235595703125, -0.01012420654296875, 0.1451416015625), + f16vec4(-0.34130859375, -0.10516357421875, -0.0034084320068359375, 0.003177642822265625)); +const f16mat4 w49_7 = f16mat4( + f16vec4(0.09271240234375, -0.7099609375, -0.5634765625, -0.11505126953125), + f16vec4(0.1824951171875, 0.4560546875, 0.147216796875, 0.154541015625), + f16vec4(0.0770263671875, 0.29248046875, -0.0145111083984375, 0.2216796875), + f16vec4(-0.2298583984375, 0.0947265625, -0.028839111328125, -0.229736328125)); +const f16mat4 w49_8 = f16mat4( + f16vec4(-0.151611328125, -0.4248046875, -0.548828125, -0.059906005859375), + f16vec4(0.273681640625, 0.165283203125, -0.21728515625, -0.0153045654296875), + f16vec4(0.00514984130859375, -0.10418701171875, 0.1673583984375, 0.191162109375), + f16vec4(0.00307464599609375, 0.1697998046875, 0.10076904296875, -0.00913238525390625)); + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 lim = imageSize(plane0); + if (p.x >= lim.x || p.y >= lim.y) { + return; + } + vec2 uv = (vec2(p * 2) + 0.5) / vec2(textureSize(featA, 0)); + + f16vec4 t0 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(-1, -1))); + f16vec4 t1 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(-1, 0))); + f16vec4 t2 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(-1, 1))); + f16vec4 t3 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(0, -1))); + f16vec4 t4 = f16vec4(textureLod(featA, uv, 0.0)); + f16vec4 t5 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(0, 1))); + f16vec4 t6 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(1, -1))); + f16vec4 t7 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(1, 0))); + f16vec4 t8 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(1, 1))); + + f16vec4 s0 = w48_0 * t0; + s0 += w48_1 * t1; + s0 += w48_2 * t2; + s0 += w48_3 * t3; + s0 += w48_4 * t4; + s0 += w48_5 * t5; + s0 += w48_6 * t6; + s0 += w48_7 * t7; + s0 += w48_8 * t8; + imageStore(plane0, p, vec4((s0 - sub48) * mul48 + add48)); + + f16vec4 s1 = w49_0 * t0; + s1 += w49_1 * t1; + s1 += w49_2 * t2; + s1 += w49_3 * t3; + s1 += w49_4 * t4; + s1 += w49_5 * t5; + s1 += w49_6 * t6; + s1 += w49_7 * t7; + s1 += w49_8 * t8; + imageStore(plane1, p, vec4((s1 - sub49) * mul49 + add49)); +} diff --git a/cleanroom/glsl/shader_08.comp b/cleanroom/glsl/shader_08.comp new file mode 100644 index 0000000..62b9995 --- /dev/null +++ b/cleanroom/glsl/shader_08.comp @@ -0,0 +1,309 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// Linear 3x3 refinement filter: 72 inputs (two 4-channel textures, 3x3 +// neighborhood) -> two 4-channel outputs via learned weight matrices. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcA; +layout(set = 0, binding = 33) uniform sampler2D srcB; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstF; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; + +const f16mat4 wfA_mm = f16mat4( + f16vec4(-0.1815185546875, 0.1619873046875, -0.1451416015625, -0.08929443359375), + f16vec4(-0.0853271484375, 0.50244140625, 0.2388916015625, 0.07208251953125), + f16vec4(0.276611328125, -0.189453125, -0.2437744140625, -0.20361328125), + f16vec4(-0.017059326171875, 0.150634765625, -0.1834716796875, -0.2401123046875)); + +const f16mat4 wfA_mz = f16mat4( + f16vec4(0.27685546875, -0.160400390625, 0.2489013671875, -0.11248779296875), + f16vec4(-0.2000732421875, 0.33642578125, 0.0083465576171875, -0.08074951171875), + f16vec4(0.69482421875, -0.37548828125, -0.25927734375, 0.156494140625), + f16vec4(0.1788330078125, -0.1248779296875, -0.401123046875, 0.4033203125)); + +const f16mat4 wfA_mp = f16mat4( + f16vec4(0.2366943359375, 0.1202392578125, 0.08221435546875, 0.10308837890625), + f16vec4(0.0714111328125, -0.043853759765625, -0.39013671875, 0.1854248046875), + f16vec4(0.390869140625, -0.0111846923828125, -0.08697509765625, 0.10955810546875), + f16vec4(-0.09307861328125, -0.07501220703125, 0.0438232421875, 0.341796875)); + +const f16mat4 wfA_zm = f16mat4( + f16vec4(-0.481689453125, 0.2110595703125, -0.292724609375, -0.036376953125), + f16vec4(-0.11456298828125, 0.11669921875, 0.350341796875, 0.0635986328125), + f16vec4(-0.129150390625, 0.251708984375, 0.05194091796875, -0.2490234375), + f16vec4(0.152587890625, 0.7998046875, 0.435546875, -0.11614990234375)); + +const f16mat4 wfA_zz = f16mat4( + f16vec4(-0.03826904296875, 0.01971435546875, -0.306396484375, -0.087890625), + f16vec4(0.05743408203125, 0.298583984375, 0.1842041015625, -0.02392578125), + f16vec4(0.14892578125, 0.062347412109375, 0.039794921875, -0.092041015625), + f16vec4(0.194091796875, 0.1463623046875, 0.404541015625, -0.10260009765625)); + +const f16mat4 wfA_zp = f16mat4( + f16vec4(0.416748046875, -0.2147216796875, 0.011566162109375, -0.03155517578125), + f16vec4(-0.015625, -0.129638671875, 0.20361328125, 0.09930419921875), + f16vec4(-0.01146697998046875, -0.27099609375, -0.146728515625, -0.0113677978515625), + f16vec4(-0.07940673828125, -0.244140625, -0.25146484375, 0.423828125)); + +const f16mat4 wfA_pm = f16mat4( + f16vec4(-0.177001953125, -0.1612548828125, 0.10443115234375, 0.163330078125), + f16vec4(0.1329345703125, -0.15966796875, -0.0259552001953125, -0.0709228515625), + f16vec4(-0.254150390625, 0.07513427734375, 0.04327392578125, 0.0689697265625), + f16vec4(0.1871337890625, 0.62744140625, 0.4462890625, 0.236328125)); + +const f16mat4 wfA_pz = f16mat4( + f16vec4(-0.11181640625, 0.019866943359375, -0.314697265625, 0.0657958984375), + f16vec4(0.1705322265625, -0.2022705078125, -0.14892578125, 0.0941162109375), + f16vec4(-0.8046875, 0.3369140625, 0.227783203125, -0.186279296875), + f16vec4(-0.269287109375, 0.58056640625, 0.75341796875, -0.09893798828125)); + +const f16mat4 wfA_pp = f16mat4( + f16vec4(0.06982421875, -0.0002639293670654297, -0.24658203125, -0.1170654296875), + f16vec4(0.1064453125, -0.1864013671875, 0.048065185546875, 0.277099609375), + f16vec4(-0.35693359375, 0.0740966796875, 0.3388671875, -0.2509765625), + f16vec4(-0.2498779296875, -0.282470703125, 0.78369140625, -0.233154296875)); + +const f16mat4 wfB_mm = f16mat4( + f16vec4(-0.2344970703125, -0.174072265625, 0.010528564453125, 0.47314453125), + f16vec4(-0.13037109375, 0.018310546875, -0.1910400390625, 0.346923828125), + f16vec4(-0.07373046875, -0.046722412109375, 0.2288818359375, 0.1312255859375), + f16vec4(-0.1181640625, 0.07855224609375, -0.101806640625, -0.0309906005859375)); + +const f16mat4 wfB_mz = f16mat4( + f16vec4(-0.231201171875, -0.33642578125, 0.343994140625, -0.11376953125), + f16vec4(-0.11761474609375, -0.1968994140625, 0.1864013671875, 0.302001953125), + f16vec4(-0.42626953125, 0.4677734375, 0.143798828125, -0.08880615234375), + f16vec4(0.252197265625, -0.2225341796875, 0.1414794921875, -0.119384765625)); + +const f16mat4 wfB_mp = f16mat4( + f16vec4(-0.033905029296875, -0.3056640625, 0.263671875, -0.2093505859375), + f16vec4(0.0267791748046875, -0.279541015625, 0.174560546875, -0.202880859375), + f16vec4(-0.2489013671875, 0.208984375, 0.1175537109375, 0.130126953125), + f16vec4(0.2252197265625, 0.0246429443359375, -0.0223541259765625, -0.0268707275390625)); + +const f16mat4 wfB_zm = f16mat4( + f16vec4(-0.327392578125, 0.003009796142578125, -0.162353515625, 0.81396484375), + f16vec4(-0.1287841796875, 0.376708984375, 0.319091796875, 0.79541015625), + f16vec4(-0.1156005859375, -0.2626953125, -0.2257080078125, 0.2337646484375), + f16vec4(-0.440673828125, 0.00302886962890625, -0.21435546875, 0.164306640625)); + +const f16mat4 wfB_zz = f16mat4( + f16vec4(-0.091064453125, 0.0762939453125, 0.11041259765625, 0.552734375), + f16vec4(0.039031982421875, 0.142822265625, 0.031585693359375, 0.58544921875), + f16vec4(0.033050537109375, 0.2279052734375, 0.1651611328125, 0.25146484375), + f16vec4(-0.08709716796875, 0.068115234375, -0.2548828125, -0.0750732421875)); + +const f16mat4 wfB_zp = f16mat4( + f16vec4(0.39013671875, -0.09796142578125, 0.194091796875, -0.359375), + f16vec4(0.434326171875, -0.10577392578125, 0.06475830078125, -0.1605224609375), + f16vec4(-0.1114501953125, 0.50341796875, -0.062408447265625, -0.1165771484375), + f16vec4(0.67138671875, -0.318115234375, 0.13330078125, -0.2015380859375)); + +const f16mat4 wfB_pm = f16mat4( + f16vec4(-0.1727294921875, 0.07891845703125, 0.299072265625, 0.5068359375), + f16vec4(-0.00830841064453125, 0.315673828125, 0.242431640625, 0.035614013671875), + f16vec4(0.11822509765625, -0.01058197021484375, -0.1221923828125, -0.09295654296875), + f16vec4(-0.06353759765625, -0.1861572265625, 0.10577392578125, 0.114990234375)); + +const f16mat4 wfB_pz = f16mat4( + f16vec4(0.05517578125, 0.11224365234375, 0.0159912109375, 0.5498046875), + f16vec4(-0.045196533203125, 0.311767578125, 0.348388671875, 0.1893310546875), + f16vec4(0.54833984375, -0.58349609375, -0.053955078125, 0.385009765625), + f16vec4(-0.415283203125, 0.29931640625, -0.33544921875, -0.0237274169921875)); + +const f16mat4 wfB_pp = f16mat4( + f16vec4(0.515625, 0.219970703125, -0.32958984375, -0.2998046875), + f16vec4(0.251708984375, 0.1605224609375, -0.10772705078125, -0.23681640625), + f16vec4(0.10894775390625, 0.40234375, -0.381103515625, -0.03118896484375), + f16vec4(-0.17236328125, 0.1700439453125, -0.348876953125, -0.235595703125)); + +const f16mat4 wbA_mm = f16mat4( + f16vec4(-0.05133056640625, 0.49951171875, 0.0780029296875, -0.53173828125), + f16vec4(-0.172607421875, -0.03656005859375, -0.0059661865234375, 0.388916015625), + f16vec4(0.223388671875, 0.28662109375, -0.0478515625, -0.042877197265625), + f16vec4(0.211181640625, -0.31103515625, -0.1719970703125, 0.424560546875)); + +const f16mat4 wbA_mz = f16mat4( + f16vec4(-0.10101318359375, 0.142333984375, 0.03143310546875, -0.1978759765625), + f16vec4(-0.06146240234375, -0.0943603515625, 0.0228729248046875, -0.041351318359375), + f16vec4(0.045867919921875, 0.055328369140625, -0.3779296875, -0.1051025390625), + f16vec4(0.0232391357421875, -0.1435546875, -0.353759765625, 0.314453125)); + +const f16mat4 wbA_mp = f16mat4( + f16vec4(-0.205078125, -0.41162109375, -0.2049560546875, 0.333984375), + f16vec4(0.1048583984375, -0.2459716796875, 0.040313720703125, 0.323974609375), + f16vec4(-0.1580810546875, 0.05865478515625, 0.007663726806640625, -0.263671875), + f16vec4(-0.0199737548828125, -0.0458984375, 0.0697021484375, -0.08544921875)); + +const f16mat4 wbA_zm = f16mat4( + f16vec4(0.453125, 0.1148681640625, 0.12249755859375, -0.046783447265625), + f16vec4(0.10089111328125, -0.09912109375, 0.2174072265625, -0.142578125), + f16vec4(0.1397705078125, 0.09588623046875, -0.44091796875, -0.11505126953125), + f16vec4(-0.7177734375, -0.2193603515625, -0.3369140625, 0.30126953125)); + +const f16mat4 wbA_zz = f16mat4( + f16vec4(0.12890625, -0.564453125, -0.096435546875, 0.5654296875), + f16vec4(-0.0709228515625, -0.053863525390625, -0.2568359375, -0.0021724700927734375), + f16vec4(-0.0631103515625, -0.00591278076171875, 0.419921875, -0.2939453125), + f16vec4(-0.49609375, 0.06988525390625, -0.11151123046875, -0.04388427734375)); + +const f16mat4 wbA_zp = f16mat4( + f16vec4(-0.1490478515625, -0.239990234375, -0.0202484130859375, 0.27099609375), + f16vec4(-0.06048583984375, -0.388671875, -0.10260009765625, 0.321533203125), + f16vec4(-0.332763671875, -0.1954345703125, 0.74951171875, -0.237548828125), + f16vec4(0.27197265625, 0.0186004638671875, 0.1572265625, -0.482421875)); + +const f16mat4 wbA_pm = f16mat4( + f16vec4(0.251953125, -0.461669921875, -0.143310546875, 0.52734375), + f16vec4(0.04669189453125, 0.133056640625, 0.2415771484375, -0.28125), + f16vec4(0.07891845703125, 0.0712890625, -0.021636962890625, 0.004550933837890625), + f16vec4(-0.759765625, 0.038238525390625, 0.12353515625, -0.1396484375)); + +const f16mat4 wbA_pz = f16mat4( + f16vec4(-0.010711669921875, -0.50439453125, 0.2237548828125, 0.46435546875), + f16vec4(-0.141845703125, -0.1966552734375, -0.163818359375, 0.1705322265625), + f16vec4(0.181640625, -0.157470703125, 0.70068359375, 0.00829315185546875), + f16vec4(-0.476318359375, 0.106689453125, 0.1954345703125, -0.587890625)); + +const f16mat4 wbA_pp = f16mat4( + f16vec4(-0.00438690185546875, 0.41259765625, -0.0211944580078125, -0.29248046875), + f16vec4(0.069580078125, 0.16748046875, -0.07904052734375, 0.2705078125), + f16vec4(0.11102294921875, -0.071044921875, 0.18310546875, 0.263916015625), + f16vec4(0.464111328125, -0.0479736328125, -0.251220703125, -0.306884765625)); + +const f16mat4 wbB_mm = f16mat4( + f16vec4(0.0828857421875, -0.006198883056640625, -0.00475311279296875, 0.060272216796875), + f16vec4(0.0802001953125, -0.1138916015625, -0.058074951171875, 0.2135009765625), + f16vec4(-0.007572174072265625, -0.134033203125, 0.0416259765625, 0.01103973388671875), + f16vec4(0.002758026123046875, 0.07952880859375, 0.19091796875, -0.2476806640625)); + +const f16mat4 wbB_mz = f16mat4( + f16vec4(0.148193359375, 0.1947021484375, 0.0175628662109375, -0.10174560546875), + f16vec4(0.05706787109375, 0.11956787109375, 0.01264190673828125, 0.134521484375), + f16vec4(-0.11163330078125, -0.1910400390625, 0.6142578125, -0.183349609375), + f16vec4(-0.052032470703125, 0.697265625, -0.2403564453125, -0.450439453125)); + +const f16mat4 wbB_mp = f16mat4( + f16vec4(0.1773681640625, -0.034393310546875, 0.1358642578125, -0.1328125), + f16vec4(0.10302734375, -0.05865478515625, 0.08099365234375, 0.01238250732421875), + f16vec4(0.056488037109375, -0.09393310546875, 0.06964111328125, 0.024627685546875), + f16vec4(-0.050201416015625, 0.310791015625, -0.217041015625, -0.34423828125)); + +const f16mat4 wbB_zm = f16mat4( + f16vec4(-0.2724609375, 0.2093505859375, 0.0887451171875, -0.0125579833984375), + f16vec4(-0.64404296875, 0.270263671875, -8.302927017211914e-05, 0.0390625), + f16vec4(-0.29736328125, 0.07049560546875, 0.331787109375, -0.024383544921875), + f16vec4(0.1949462890625, 0.6689453125, -0.09124755859375, -0.443359375)); + +const f16mat4 wbB_zz = f16mat4( + f16vec4(-0.408935546875, 0.1290283203125, 0.060516357421875, 0.172607421875), + f16vec4(-0.86328125, 0.2442626953125, 0.221923828125, -0.0927734375), + f16vec4(-0.07757568359375, -0.09625244140625, -0.2081298828125, 0.2088623046875), + f16vec4(0.0156402587890625, 0.25537109375, -0.303466796875, -0.1588134765625)); + +const f16mat4 wbB_zp = f16mat4( + f16vec4(-0.03271484375, -0.3212890625, -0.1365966796875, 0.282470703125), + f16vec4(0.0511474609375, -0.1568603515625, -0.1414794921875, -0.02447509765625), + f16vec4(0.0938720703125, -0.0723876953125, -0.68798828125, -0.11004638671875), + f16vec4(-0.10186767578125, -0.42236328125, 0.26123046875, 0.156005859375)); + +const f16mat4 wbB_pm = f16mat4( + f16vec4(-0.39013671875, 0.1387939453125, 0.03436279296875, -0.04815673828125), + f16vec4(-0.470947265625, 0.2249755859375, 0.09991455078125, -0.0193328857421875), + f16vec4(0.09844970703125, 0.13671875, -0.031280517578125, -0.004955291748046875), + f16vec4(0.12890625, 0.166259765625, -0.345947265625, 0.086669921875)); + +const f16mat4 wbB_pz = f16mat4( + f16vec4(-0.51416015625, -0.1756591796875, -0.1044921875, 0.11444091796875), + f16vec4(-0.473388671875, 0.05987548828125, 0.11370849609375, -0.1942138671875), + f16vec4(0.003795623779296875, 0.085693359375, -0.90234375, -0.187255859375), + f16vec4(0.22021484375, -0.431884765625, 0.037384033203125, 0.43798828125)); + +const f16mat4 wbB_pp = f16mat4( + f16vec4(0.06097412109375, -0.304443359375, -0.226806640625, 0.1220703125), + f16vec4(0.2919921875, -0.0633544921875, -0.12200927734375, 0.0005459785461425781), + f16vec4(0.030242919921875, 0.41845703125, 0.1304931640625, -0.5400390625), + f16vec4(0.06622314453125, -0.1771240234375, 0.54052734375, 0.25244140625)); + +const f16vec4 subF = f16vec4(-0.035614013671875, 0.29736328125, -0.0168304443359375, 0.2900390625); + +const f16vec4 mulF = f16vec4(1.8330078125, 1.189453125, 1.0966796875, 1.2373046875); + +const f16vec4 addF = f16vec4(0.415771484375, 0.5341796875, 0.5341796875, 0.5478515625); + +const f16vec4 subB = f16vec4(-0.25927734375, -0.09466552734375, -0.05706787109375, -0.02874755859375); + +const f16vec4 mulB = f16vec4(1.6591796875, 1.1123046875, 1.3701171875, 0.92724609375); + +const f16vec4 addB = f16vec4(0.66748046875, 0.62451171875, 0.498779296875, 0.74658203125); + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 ext = imageSize(dstF); + if (p.x >= ext.x || p.y >= ext.y) return; + + vec2 uv = (vec2(p) + 0.5) / vec2(textureSize(srcA, 0)); + + f16vec4 tA[9]; + f16vec4 tB[9]; + tA[0] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(-1, -1))); + tA[1] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(-1, 0))); + tA[2] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(-1, 1))); + tA[3] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(0, -1))); + tA[4] = f16vec4(textureLod(srcA, uv, 0.0)); + tA[5] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(0, 1))); + tA[6] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(1, -1))); + tA[7] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(1, 0))); + tA[8] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(1, 1))); + tB[0] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(-1, -1))); + tB[1] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(-1, 0))); + tB[2] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(-1, 1))); + tB[3] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(0, -1))); + tB[4] = f16vec4(textureLod(srcB, uv, 0.0)); + tB[5] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(0, 1))); + tB[6] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(1, -1))); + tB[7] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(1, 0))); + tB[8] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(1, 1))); + + f16vec4 sF = wfA_mm * tA[0]; + sF += wfA_mz * tA[1]; + sF += wfA_mp * tA[2]; + sF += wfA_zm * tA[3]; + sF += wfA_zz * tA[4]; + sF += wfA_zp * tA[5]; + sF += wfA_pm * tA[6]; + sF += wfA_pz * tA[7]; + sF += wfA_pp * tA[8]; + sF += wfB_mm * tB[0]; + sF += wfB_mz * tB[1]; + sF += wfB_mp * tB[2]; + sF += wfB_zm * tB[3]; + sF += wfB_zz * tB[4]; + sF += wfB_zp * tB[5]; + sF += wfB_pm * tB[6]; + sF += wfB_pz * tB[7]; + sF += wfB_pp * tB[8]; + imageStore(dstF, p, vec4((sF - subF) * mulF + addF)); + + f16vec4 sB = wbA_mm * tA[0]; + sB += wbA_mz * tA[1]; + sB += wbA_mp * tA[2]; + sB += wbA_zm * tA[3]; + sB += wbA_zz * tA[4]; + sB += wbA_zp * tA[5]; + sB += wbA_pm * tA[6]; + sB += wbA_pz * tA[7]; + sB += wbA_pp * tA[8]; + sB += wbB_mm * tB[0]; + sB += wbB_mz * tB[1]; + sB += wbB_mp * tB[2]; + sB += wbB_zm * tB[3]; + sB += wbB_zz * tB[4]; + sB += wbB_zp * tB[5]; + sB += wbB_pm * tB[6]; + sB += wbB_pz * tB[7]; + sB += wbB_pp * tB[8]; + imageStore(dstB, p, vec4((sB - subB) * mulB + addB)); +} diff --git a/cleanroom/glsl/shader_09.comp b/cleanroom/glsl/shader_09.comp new file mode 100644 index 0000000..c38c496 --- /dev/null +++ b/cleanroom/glsl/shader_09.comp @@ -0,0 +1,159 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// Coarse flow head: 18 matching costs over a 3x3 search window (two query +// descriptors vs one reference), normalized, then two 18->4 linear layers. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D qryA0; +layout(set = 0, binding = 33) uniform sampler2D qryA1; +layout(set = 0, binding = 34) uniform sampler2D qryB0; +layout(set = 0, binding = 35) uniform sampler2D qryB1; +layout(set = 0, binding = 36) uniform sampler2D refT0; +layout(set = 0, binding = 37) uniform sampler2D refT1; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstF; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; + +const f16vec4 biasG1 = f16vec4(2.5, 2.521484375, 2.50390625, 2.51953125); + +const f16vec4 scaleG1 = f16vec4(1.0341796875, 0.72412109375, 0.6572265625, 1.0205078125); + +const f16vec4 postG1 = f16vec4(-0.4296875, -0.042877197265625, -0.4951171875, -0.11126708984375); + +const f16vec4 biasG2 = f16vec4(2.568359375, 2.53515625, 2.498046875, 2.521484375); + +const f16vec4 scaleG2 = f16vec4(0.53466796875, 0.427978515625, 0.6787109375, 0.8740234375); + +const f16vec4 postG2 = f16vec4(0.10174560546875, 0.266357421875, -0.0150909423828125, -0.380126953125); + +const float16_t bias9 = float16_t(2.509765625); + +const float16_t scale9 = float16_t(0.480712890625); + +const float16_t post9 = float16_t(0.278076171875); + +const f16mat4 wfA1 = f16mat4( + f16vec4(-0.6171875, -0.098876953125, -0.003223419189453125, 0.05706787109375), + f16vec4(-0.201171875, 0.275146484375, -0.053924560546875, -0.409912109375), + f16vec4(-0.076171875, -0.0161285400390625, 0.3349609375, -0.54541015625), + f16vec4(-0.1729736328125, 0.1617431640625, -0.0648193359375, 0.245361328125)); + +const f16mat4 wfA2 = f16mat4( + f16vec4(0.302978515625, 0.5341796875, -0.433837890625, -0.21142578125), + f16vec4(0.375732421875, -0.01236724853515625, 0.239990234375, -0.291748046875), + f16vec4(-0.25830078125, 0.14013671875, -0.054351806640625, 0.078369140625), + f16vec4(0.05908203125, 0.185546875, 0.0665283203125, -0.66748046875)); + +const f16mat4 wfB1 = f16mat4( + f16vec4(-0.51171875, -0.256103515625, 0.06341552734375, -0.06170654296875), + f16vec4(-0.1678466796875, -0.25439453125, 0.391845703125, -0.1029052734375), + f16vec4(-0.01464080810546875, -0.238525390625, 0.1650390625, -0.321044921875), + f16vec4(-0.361083984375, -0.2294921875, 0.183349609375, 0.51953125)); + +const f16mat4 wfB2 = f16mat4( + f16vec4(0.8525390625, -1.013671875, -0.8603515625, 0.3408203125), + f16vec4(0.30224609375, -0.10955810546875, 0.39599609375, -0.2481689453125), + f16vec4(-0.439208984375, -0.046905517578125, 0.296142578125, 0.1353759765625), + f16vec4(-0.00047397613525390625, 0.1292724609375, 0.318359375, -0.395263671875)); + +const f16vec4 wfA9 = f16vec4(-0.073486328125, 0.1968994140625, -0.061004638671875, -0.548828125); + +const f16vec4 wfB9 = f16vec4(-0.053466796875, 0.1724853515625, 0.1519775390625, -0.0129852294921875); + +const f16vec4 subF = f16vec4(0.12493896484375, -0.004108428955078125, 0.08489990234375, -0.276611328125); + +const f16vec4 mulF = f16vec4(1.67578125, 5.44140625, 4.0625, 2.37109375); + +const f16vec4 addF = f16vec4(0.14404296875, -0.186767578125, 0.034576416015625, -0.2451171875); + +const f16mat4 wbA1 = f16mat4( + f16vec4(-0.06646728515625, 0.132080078125, 0.10211181640625, -0.1077880859375), + f16vec4(0.01702880859375, -0.18701171875, -0.34912109375, -0.04522705078125), + f16vec4(0.1290283203125, -0.033416748046875, -0.2529296875, 0.034515380859375), + f16vec4(0.0321044921875, -0.1719970703125, -0.01235198974609375, -0.28125)); + +const f16mat4 wbA2 = f16mat4( + f16vec4(1.0380859375, -0.225341796875, -0.26123046875, -0.4716796875), + f16vec4(0.0662841796875, -0.14501953125, -0.03436279296875, 0.277587890625), + f16vec4(-0.10638427734375, -0.00730133056640625, -0.10723876953125, 0.1124267578125), + f16vec4(-0.06939697265625, -0.1727294921875, -0.314453125, 0.04400634765625)); + +const f16mat4 wbB1 = f16mat4( + f16vec4(0.02752685546875, 0.14208984375, 0.192626953125, -0.197509765625), + f16vec4(-0.1563720703125, -0.265380859375, -0.0111083984375, 0.1336669921875), + f16vec4(0.1590576171875, 0.01421356201171875, -0.178466796875, -0.1771240234375), + f16vec4(-0.279296875, -0.1534423828125, 0.07720947265625, -0.3857421875)); + +const f16mat4 wbB2 = f16mat4( + f16vec4(0.8505859375, -0.60693359375, -0.297607421875, 0.1439208984375), + f16vec4(-0.1905517578125, -0.2235107421875, 0.019561767578125, 0.8798828125), + f16vec4(0.116943359375, 0.0157928466796875, 0.034027099609375, 0.2724609375), + f16vec4(-0.1539306640625, 0.0080108642578125, -0.11529541015625, 0.131103515625)); + +const f16vec4 wbA9 = f16vec4(0.11322021484375, -0.1365966796875, -0.301513671875, 0.307861328125); + +const f16vec4 wbB9 = f16vec4(0.1278076171875, -0.1292724609375, -0.173828125, 0.48583984375); + +const f16vec4 subB = f16vec4(0.30712890625, -0.40625, -0.285888671875, 0.476806640625); + +const f16vec4 mulB = f16vec4(0.599609375, 2.76171875, 2.630859375, 3.283203125); + +const f16vec4 addB = f16vec4(0.141845703125, -0.390869140625, -0.041107177734375, 0.6826171875); + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 ext = imageSize(dstF); + if (p.x >= ext.x || p.y >= ext.y) return; + + vec2 uv = (vec2(p) + 0.5) / vec2(textureSize(qryA0, 0)); + + f16vec4 a0 = f16vec4(textureLod(qryA0, uv, 0.0)); + f16vec4 a1 = f16vec4(textureLod(qryA1, uv, 0.0)); + f16vec4 b0 = f16vec4(textureLod(qryB0, uv, 0.0)); + f16vec4 b1 = f16vec4(textureLod(qryB1, uv, 0.0)); + + float16_t cA[9]; + float16_t cB[9]; +#define MATCH_COST(i, dx, dy) { \ + f16vec4 r0 = f16vec4(textureLodOffset(refT0, uv, 0.0, ivec2(dx, dy))); \ + f16vec4 r1 = f16vec4(textureLodOffset(refT1, uv, 0.0, ivec2(dx, dy))); \ + cA[i] = dot(a0, r0) + dot(a1, r1); \ + cB[i] = dot(b0, r0) + dot(b1, r1); \ + } + MATCH_COST(0, -1, -1) + MATCH_COST(1, 0, -1) + MATCH_COST(2, 1, -1) + MATCH_COST(3, -1, 0) + MATCH_COST(4, 0, 0) + MATCH_COST(5, 1, 0) + MATCH_COST(6, -1, 1) + MATCH_COST(7, 0, 1) + MATCH_COST(8, 1, 1) +#undef MATCH_COST + + const float16_t lo = float16_t(0.0); + const float16_t hi = float16_t(1.0); + f16vec4 nA1 = clamp((f16vec4(cA[0], cA[1], cA[2], cA[3]) - biasG1) * scaleG1 + postG1, lo, hi); + f16vec4 nA2 = clamp((f16vec4(cA[4], cA[5], cA[6], cA[7]) - biasG2) * scaleG2 + postG2, lo, hi); + float16_t qA = clamp((cA[8] - bias9) * scale9 + post9, lo, hi); + f16vec4 nB1 = clamp((f16vec4(cB[0], cB[1], cB[2], cB[3]) - biasG1) * scaleG1 + postG1, lo, hi); + f16vec4 nB2 = clamp((f16vec4(cB[4], cB[5], cB[6], cB[7]) - biasG2) * scaleG2 + postG2, lo, hi); + float16_t qB = clamp((cB[8] - bias9) * scale9 + post9, lo, hi); + + f16vec4 sF = wfA1 * nA1; + sF += wfA2 * nA2; + sF += wfA9 * qA; + sF += wfB1 * nB1; + sF += wfB2 * nB2; + sF += wfB9 * qB; + imageStore(dstF, p, vec4((sF - subF) * mulF + addF)); + + f16vec4 sB = wbA1 * nA1; + sB += wbA2 * nA2; + sB += wbA9 * qA; + sB += wbB1 * nB1; + sB += wbB2 * nB2; + sB += wbB9 * qB; + imageStore(dstB, p, vec4((sB - subB) * mulB + addB)); +} diff --git a/cleanroom/glsl/shader_10.comp b/cleanroom/glsl/shader_10.comp new file mode 100644 index 0000000..556215f --- /dev/null +++ b/cleanroom/glsl/shader_10.comp @@ -0,0 +1,211 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_10: 3x3 fp16 conv over two RGBA inputs, two affine-remapped RGBA8 outputs. +// Weights baked per member; columns of the 18 4x4 matrices, head A then head B. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcFeat0; +layout(set = 0, binding = 33) uniform sampler2D srcFeat1; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstFlow0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstFlow1; + +const f16vec4 kColsA[72] = f16vec4[72]( + f16vec4(-0.1488037109375hf, -0.10235595703125hf, -0.05987548828125hf, -0.02398681640625hf), + f16vec4(-0.02032470703125hf, 0.141357421875hf, 0.391357421875hf, -0.06365966796875hf), + f16vec4(-0.0196685791015625hf, -0.310302734375hf, -0.1519775390625hf, 0.036773681640625hf), + f16vec4(-0.4228515625hf, -0.1707763671875hf, -0.1632080078125hf, -0.391845703125hf), + f16vec4(-0.2254638671875hf, 0.117431640625hf, -0.260009765625hf, 0.1282958984375hf), + f16vec4(-0.103759765625hf, -0.1112060546875hf, -0.1136474609375hf, -0.4345703125hf), + f16vec4(-0.1463623046875hf, 0.172607421875hf, -0.1737060546875hf, -0.58935546875hf), + f16vec4(-0.57373046875hf, 0.1553955078125hf, -0.2388916015625hf, -0.09783935546875hf), + f16vec4(-0.185302734375hf, 0.1190185546875hf, -0.48291015625hf, 0.40869140625hf), + f16vec4(-0.140625hf, 0.283203125hf, -0.2734375hf, -0.492919921875hf), + f16vec4(-0.1510009765625hf, 0.271728515625hf, 0.33056640625hf, -0.7060546875hf), + f16vec4(-0.61279296875hf, 0.337646484375hf, 0.08154296875hf, -0.0280303955078125hf), + f16vec4(-0.205810546875hf, 0.050201416015625hf, -0.57373046875hf, -0.236328125hf), + f16vec4(-0.055267333984375hf, 0.0042572021484375hf, 0.401611328125hf, -0.163330078125hf), + f16vec4(0.0850830078125hf, -0.061004638671875hf, 0.1392822265625hf, -0.073486328125hf), + f16vec4(-0.5380859375hf, 0.00920867919921875hf, 0.2279052734375hf, 0.1788330078125hf), + f16vec4(-0.341064453125hf, 0.037628173828125hf, -0.34375hf, -0.0318603515625hf), + f16vec4(-0.134521484375hf, 0.376220703125hf, 0.1456298828125hf, -0.394287109375hf), + f16vec4(-0.036895751953125hf, 0.56298828125hf, 0.01207733154296875hf, -0.64501953125hf), + f16vec4(-0.55517578125hf, 0.294921875hf, -0.08734130859375hf, 0.1864013671875hf), + f16vec4(-0.240234375hf, 0.1031494140625hf, -0.02337646484375hf, -0.0095672607421875hf), + f16vec4(-0.2003173828125hf, 0.37744140625hf, -0.1339111328125hf, -0.6708984375hf), + f16vec4(-0.035858154296875hf, 0.6279296875hf, 0.21435546875hf, -1.1875hf), + f16vec4(-0.57568359375hf, 0.43798828125hf, 0.039581298828125hf, 0.54150390625hf), + f16vec4(-0.393798828125hf, -0.1929931640625hf, -0.61572265625hf, 0.14111328125hf), + f16vec4(-0.08966064453125hf, 0.227783203125hf, 0.556640625hf, -0.12261962890625hf), + f16vec4(-0.00107574462890625hf, -0.4560546875hf, 0.254150390625hf, 0.2083740234375hf), + f16vec4(-0.463134765625hf, 0.0828857421875hf, -0.013916015625hf, -0.176025390625hf), + f16vec4(-0.476318359375hf, 0.101318359375hf, -0.66357421875hf, 0.28466796875hf), + f16vec4(-0.1585693359375hf, -0.0050048828125hf, -0.0296630859375hf, -0.4140625hf), + f16vec4(-0.08160400390625hf, -0.04754638671875hf, 0.11187744140625hf, -0.1148681640625hf), + f16vec4(-0.54248046875hf, -0.02178955078125hf, 0.17724609375hf, -0.17236328125hf), + f16vec4(-0.369873046875hf, 0.121337890625hf, -0.09564208984375hf, 0.560546875hf), + f16vec4(-0.2110595703125hf, 0.302490234375hf, 0.015411376953125hf, -0.3330078125hf), + f16vec4(-0.10748291015625hf, 0.0740966796875hf, 0.136474609375hf, -0.30859375hf), + f16vec4(-0.6103515625hf, 0.218994140625hf, 0.296630859375hf, 0.08050537109375hf), + f16vec4(-0.11932373046875hf, -0.1004638671875hf, -0.76123046875hf, -0.013397216796875hf), + f16vec4(-0.21435546875hf, -0.10516357421875hf, 0.6005859375hf, 0.163330078125hf), + f16vec4(0.057952880859375hf, 0.4833984375hf, 0.481689453125hf, 0.2861328125hf), + f16vec4(0.492431640625hf, 0.10064697265625hf, 0.29443359375hf, 0.407958984375hf), + f16vec4(-0.12255859375hf, 0.330810546875hf, -0.455078125hf, 0.3037109375hf), + f16vec4(-0.29736328125hf, -0.047821044921875hf, 0.221923828125hf, 0.08251953125hf), + f16vec4(-0.08551025390625hf, 0.1241455078125hf, 0.250244140625hf, 0.28759765625hf), + f16vec4(0.46044921875hf, -0.298583984375hf, 0.3193359375hf, -0.0171356201171875hf), + f16vec4(-0.2464599609375hf, 0.73193359375hf, -0.46337890625hf, 0.8662109375hf), + f16vec4(-0.263427734375hf, 0.0714111328125hf, 0.08648681640625hf, -0.381103515625hf), + f16vec4(0.01079559326171875hf, 0.058074951171875hf, 0.049713134765625hf, -0.470703125hf), + f16vec4(0.56396484375hf, -0.06842041015625hf, 0.2763671875hf, 0.322998046875hf), + f16vec4(-0.171875hf, 0.3232421875hf, -0.99462890625hf, 0.07208251953125hf), + f16vec4(-0.2301025390625hf, -0.1151123046875hf, 0.96337890625hf, 0.1854248046875hf), + f16vec4(-0.0118560791015625hf, 0.257080078125hf, 0.453857421875hf, 0.30859375hf), + f16vec4(0.630859375hf, 0.029144287109375hf, -0.25048828125hf, 0.08697509765625hf), + f16vec4(-0.1898193359375hf, 1.2861328125hf, -0.318359375hf, 0.1663818359375hf), + f16vec4(-0.2010498046875hf, 0.181884765625hf, 0.339599609375hf, 0.342529296875hf), + f16vec4(-0.11981201171875hf, -0.09930419921875hf, 0.13232421875hf, 0.5322265625hf), + f16vec4(0.6220703125hf, -0.33056640625hf, -0.20263671875hf, -0.035369873046875hf), + f16vec4(-0.34423828125hf, 1.1064453125hf, -0.128173828125hf, 0.55908203125hf), + f16vec4(-0.1363525390625hf, 0.21533203125hf, -0.085693359375hf, 0.208984375hf), + f16vec4(-0.0081939697265625hf, 0.15087890625hf, -0.121826171875hf, 0.08135986328125hf), + f16vec4(0.59130859375hf, -0.072021484375hf, -0.10076904296875hf, 0.047149658203125hf), + f16vec4(-0.433349609375hf, -0.05157470703125hf, -0.78564453125hf, 0.51171875hf), + f16vec4(-0.1678466796875hf, -0.033966064453125hf, 0.7080078125hf, -0.10589599609375hf), + f16vec4(0.0328369140625hf, 0.452392578125hf, 0.337158203125hf, 0.060760498046875hf), + f16vec4(0.41552734375hf, 0.013946533203125hf, 0.0655517578125hf, 0.2392578125hf), + f16vec4(-0.456787109375hf, 0.28173828125hf, -0.63623046875hf, 0.61376953125hf), + f16vec4(-0.1583251953125hf, 0.01100921630859375hf, 0.259033203125hf, 0.06634521484375hf), + f16vec4(-0.05145263671875hf, 0.2568359375hf, 0.0215606689453125hf, 0.13623046875hf), + f16vec4(0.29931640625hf, -0.11383056640625hf, 0.01557159423828125hf, 0.03485107421875hf), + f16vec4(-0.58203125hf, 0.365234375hf, -0.27734375hf, 0.90380859375hf), + f16vec4(-0.14208984375hf, 0.252197265625hf, -0.005832672119140625hf, -0.120849609375hf), + f16vec4(3.701448440551758e-05hf, 0.513671875hf, -0.28955078125hf, -0.316650390625hf), + f16vec4(0.411376953125hf, 0.057830810546875hf, -0.01491546630859375hf, 0.3115234375hf) +); +const f16vec4 kMuA = f16vec4(0.6435546875hf, 1.3896484375hf, -0.31591796875hf, 0.46044921875hf); +const f16vec4 kSigmaA = f16vec4(0.47705078125hf, 0.6689453125hf, 1.00390625hf, 0.49609375hf); +const f16vec4 kBetaA = f16vec4(-0.31884765625hf, -0.1954345703125hf, 0.2003173828125hf, -0.2205810546875hf); + +const f16vec4 kColsB[72] = f16vec4[72]( + f16vec4(0.306884765625hf, -0.62548828125hf, 0.0037441253662109375hf, -0.5146484375hf), + f16vec4(0.40380859375hf, 0.131591796875hf, 0.078857421875hf, -0.2017822265625hf), + f16vec4(0.47607421875hf, 0.94189453125hf, -0.330322265625hf, -0.04742431640625hf), + f16vec4(-0.336181640625hf, -0.0064544677734375hf, 0.4482421875hf, 0.1534423828125hf), + f16vec4(0.05462646484375hf, 0.7509765625hf, -0.417724609375hf, -0.4375hf), + f16vec4(0.556640625hf, 0.2578125hf, 0.2215576171875hf, 0.1881103515625hf), + f16vec4(0.7314453125hf, -0.603515625hf, 0.1761474609375hf, 0.346435546875hf), + f16vec4(-0.474365234375hf, -0.240234375hf, 0.058990478515625hf, -0.126220703125hf), + f16vec4(0.032684326171875hf, 0.3994140625hf, -0.327392578125hf, -0.1322021484375hf), + f16vec4(0.028656005859375hf, 0.487548828125hf, 0.1494140625hf, -0.2193603515625hf), + f16vec4(0.748046875hf, -0.135009765625hf, -0.03271484375hf, -0.1353759765625hf), + f16vec4(-0.54833984375hf, -0.08868408203125hf, 0.329345703125hf, 0.12371826171875hf), + f16vec4(0.06854248046875hf, 0.387939453125hf, -0.445068359375hf, -0.5126953125hf), + f16vec4(0.31396484375hf, -0.49072265625hf, 0.335205078125hf, -0.08056640625hf), + f16vec4(0.40576171875hf, -0.07647705078125hf, 0.29443359375hf, -0.033416748046875hf), + f16vec4(-0.29248046875hf, -0.315673828125hf, 0.1748046875hf, 0.324951171875hf), + f16vec4(0.56982421875hf, -0.78759765625hf, -0.2705078125hf, -0.30908203125hf), + f16vec4(0.1778564453125hf, 0.1339111328125hf, 0.35400390625hf, 0.183349609375hf), + f16vec4(0.10980224609375hf, 0.021881103515625hf, 0.56884765625hf, 0.299560546875hf), + f16vec4(-0.346923828125hf, 0.2529296875hf, -0.07525634765625hf, 0.0283203125hf), + f16vec4(0.11004638671875hf, 0.005504608154296875hf, -0.62744140625hf, -0.33740234375hf), + f16vec4(-0.0032482147216796875hf, -0.15234375hf, 0.477783203125hf, -0.0426025390625hf), + f16vec4(0.6123046875hf, 0.07366943359375hf, 0.7216796875hf, 0.17724609375hf), + f16vec4(-0.5244140625hf, -0.31689453125hf, 0.004283905029296875hf, 0.203125hf), + f16vec4(-0.3203125hf, 0.2685546875hf, -0.0625hf, -0.190185546875hf), + f16vec4(0.5380859375hf, -0.2412109375hf, -0.06304931640625hf, -0.229736328125hf), + f16vec4(0.25341796875hf, -0.190185546875hf, 0.0113677978515625hf, -0.1533203125hf), + f16vec4(-0.290771484375hf, -0.11810302734375hf, 0.09747314453125hf, 0.045379638671875hf), + f16vec4(0.11602783203125hf, -0.4287109375hf, -0.86865234375hf, -0.60498046875hf), + f16vec4(0.35205078125hf, -0.361083984375hf, 0.319580078125hf, 0.197509765625hf), + f16vec4(-0.250244140625hf, 0.1646728515625hf, 0.50244140625hf, 0.275390625hf), + f16vec4(-0.1973876953125hf, -0.119140625hf, 0.10064697265625hf, 0.11773681640625hf), + f16vec4(0.1715087890625hf, -0.321533203125hf, -0.383056640625hf, -0.52978515625hf), + f16vec4(0.56884765625hf, -0.50439453125hf, 0.055572509765625hf, -0.2322998046875hf), + f16vec4(-0.020050048828125hf, 0.23828125hf, 0.12548828125hf, 0.09490966796875hf), + f16vec4(-0.92626953125hf, -0.107421875hf, 0.044647216796875hf, 0.10009765625hf), + f16vec4(0.195068359375hf, -0.474609375hf, -0.53466796875hf, -0.8291015625hf), + f16vec4(-0.40576171875hf, 0.26953125hf, 0.01727294921875hf, 0.172607421875hf), + f16vec4(-0.42578125hf, 0.0697021484375hf, -0.08843994140625hf, 0.1385498046875hf), + f16vec4(0.189453125hf, 0.126708984375hf, -0.2890625hf, -0.0970458984375hf), + f16vec4(-0.01459503173828125hf, 0.263427734375hf, -0.63720703125hf, -0.463134765625hf), + f16vec4(-0.2232666015625hf, 0.194580078125hf, 0.047637939453125hf, 0.384033203125hf), + f16vec4(-0.253662109375hf, 0.157958984375hf, -0.05303955078125hf, 0.270751953125hf), + f16vec4(0.0013132095336914062hf, -0.13134765625hf, -0.154541015625hf, 0.00115203857421875hf), + f16vec4(-0.58447265625hf, 0.2071533203125hf, -0.51318359375hf, -0.46337890625hf), + f16vec4(-0.286376953125hf, 0.1002197265625hf, 0.044830322265625hf, 0.2022705078125hf), + f16vec4(0.16357421875hf, 0.07135009765625hf, -0.0162811279296875hf, 0.1795654296875hf), + f16vec4(0.10406494140625hf, -0.21826171875hf, -0.375244140625hf, -0.11285400390625hf), + f16vec4(-0.11328125hf, -0.289306640625hf, -0.71533203125hf, -0.64892578125hf), + f16vec4(-0.6953125hf, -0.0792236328125hf, -0.026092529296875hf, -0.040283203125hf), + f16vec4(-0.47802734375hf, -0.0418701171875hf, -0.162353515625hf, -0.01195526123046875hf), + f16vec4(0.338134765625hf, 0.468505859375hf, -0.1644287109375hf, -0.12939453125hf), + f16vec4(-0.0029048919677734375hf, -0.1541748046875hf, -0.69921875hf, -0.3408203125hf), + f16vec4(-0.60888671875hf, 0.11456298828125hf, 0.09588623046875hf, 0.267333984375hf), + f16vec4(-0.3837890625hf, 0.2191162109375hf, -0.0195770263671875hf, 0.255126953125hf), + f16vec4(0.1817626953125hf, -0.431884765625hf, -0.087158203125hf, -0.09783935546875hf), + f16vec4(-0.499267578125hf, -0.355712890625hf, -0.64501953125hf, -0.5634765625hf), + f16vec4(-0.64208984375hf, -0.248046875hf, 0.056182861328125hf, 0.09613037109375hf), + f16vec4(-0.1671142578125hf, 0.0916748046875hf, -0.032470703125hf, 0.108154296875hf), + f16vec4(0.2193603515625hf, -0.0784912109375hf, -0.3955078125hf, -0.1334228515625hf), + f16vec4(-0.458251953125hf, -0.04364013671875hf, 0.033233642578125hf, 0.0068359375hf), + f16vec4(-0.446533203125hf, -0.1142578125hf, -0.37841796875hf, -0.333740234375hf), + f16vec4(-0.184326171875hf, -0.183349609375hf, -0.50439453125hf, -0.43017578125hf), + f16vec4(0.1434326171875hf, -0.0077056884765625hf, -0.39453125hf, -0.301513671875hf), + f16vec4(-0.20703125hf, -0.43798828125hf, -0.08380126953125hf, 0.00727081298828125hf), + f16vec4(-0.58642578125hf, -0.036041259765625hf, -0.1148681640625hf, 0.11126708984375hf), + f16vec4(-0.2890625hf, 0.09765625hf, -0.343994140625hf, -0.1329345703125hf), + f16vec4(-0.0855712890625hf, 0.167724609375hf, -0.32666015625hf, -0.2196044921875hf), + f16vec4(-0.3203125hf, -0.3974609375hf, -0.0269012451171875hf, -0.283203125hf), + f16vec4(-0.6875hf, -0.155517578125hf, -0.2685546875hf, -0.07330322265625hf), + f16vec4(-0.31494140625hf, 0.064453125hf, -0.372802734375hf, -0.17138671875hf), + f16vec4(0.0051422119140625hf, 0.02398681640625hf, -0.47412109375hf, -0.161376953125hf) +); +const f16vec4 kMuB = f16vec4(0.8310546875hf, -0.51171875hf, -2.26171875hf, -1.8779296875hf); +const f16vec4 kSigmaB = f16vec4(0.456787109375hf, 1.3349609375hf, 0.744140625hf, 0.79150390625hf); +const f16vec4 kBetaB = f16vec4(-0.060791015625hf, 0.061920166015625hf, 0.13623046875hf, -0.0928955078125hf); + +f16vec4 borderTap(sampler2D s, ivec2 q) { + if (all(greaterThanEqual(q, ivec2(0))) && all(lessThan(q, textureSize(s, 0)))) { + return f16vec4(texelFetch(s, q, 0)); + } + return f16vec4(0.0hf); +} + +f16vec4 runHead(const f16vec4 cols[72], f16vec4 mu, f16vec4 sigma, f16vec4 beta, + const f16vec4 taps[18]) { + f16vec4 acc = cols[0] * taps[0].x + cols[1] * taps[0].y + + cols[2] * taps[0].z + cols[3] * taps[0].w; + for (int k = 1; k < 18; ++k) { + int b = 4 * k; + acc += cols[b] * taps[k].x + cols[b + 1] * taps[k].y + + cols[b + 2] * taps[k].z + cols[b + 3] * taps[k].w; + } + return (acc - mu) * sigma + beta; +} + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 outSize = imageSize(dstFlow0); + if (p.x >= outSize.x || p.y >= outSize.y) { + return; + } + + f16vec4 taps[18]; + for (int t = 0; t < 9; ++t) { + if (t == 4) { + // center tap is deliberately unguarded (inputs assumed >= output size) + taps[4] = f16vec4(texelFetch(srcFeat0, p, 0)); + taps[13] = f16vec4(texelFetch(srcFeat1, p, 0)); + } else { + ivec2 q = p + ivec2(t / 3 - 1, t % 3 - 1); + taps[t] = borderTap(srcFeat0, q); + taps[t + 9] = borderTap(srcFeat1, q); + } + } + + imageStore(dstFlow0, p, vec4(runHead(kColsA, kMuA, kSigmaA, kBetaA, taps))); + imageStore(dstFlow1, p, vec4(runHead(kColsB, kMuB, kSigmaB, kBetaB, taps))); +} diff --git a/cleanroom/glsl/shader_11.comp b/cleanroom/glsl/shader_11.comp new file mode 100644 index 0000000..bd6c980 --- /dev/null +++ b/cleanroom/glsl/shader_11.comp @@ -0,0 +1,211 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_11: 3x3 fp16 conv over two RGBA inputs, two affine-remapped RGBA8 outputs. +// Weights baked per member; columns of the 18 4x4 matrices, head A then head B. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcFeat0; +layout(set = 0, binding = 33) uniform sampler2D srcFeat1; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstFlow0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstFlow1; + +const f16vec4 kColsA[72] = f16vec4[72]( + f16vec4(0.6123046875hf, -0.50146484375hf, 0.294921875hf, 0.68017578125hf), + f16vec4(-0.44482421875hf, 0.71923828125hf, -0.36083984375hf, -0.282470703125hf), + f16vec4(-0.295654296875hf, -0.340576171875hf, -0.332275390625hf, 0.1588134765625hf), + f16vec4(0.09576416015625hf, 0.6845703125hf, 0.280517578125hf, -0.491943359375hf), + f16vec4(0.376220703125hf, -0.2203369140625hf, 0.31201171875hf, 0.35107421875hf), + f16vec4(-0.10638427734375hf, 0.1527099609375hf, -0.1944580078125hf, -0.167724609375hf), + f16vec4(0.1002197265625hf, -0.371337890625hf, -0.30615234375hf, 0.16015625hf), + f16vec4(0.3193359375hf, 0.373046875hf, 0.341796875hf, -0.3212890625hf), + f16vec4(0.2318115234375hf, 0.1688232421875hf, 0.444580078125hf, 0.439453125hf), + f16vec4(-0.020904541015625hf, -0.34326171875hf, 0.031951904296875hf, -0.68994140625hf), + f16vec4(0.378173828125hf, -0.1263427734375hf, -0.098876953125hf, 0.437255859375hf), + f16vec4(0.478515625hf, -0.09295654296875hf, 0.40966796875hf, -0.6298828125hf), + f16vec4(0.36376953125hf, -0.1883544921875hf, 0.353271484375hf, -0.0209503173828125hf), + f16vec4(-0.4609375hf, 0.459228515625hf, -0.11407470703125hf, 0.1710205078125hf), + f16vec4(-0.0771484375hf, -0.0809326171875hf, -0.16796875hf, -0.51513671875hf), + f16vec4(-0.10748291015625hf, 0.51220703125hf, -0.1846923828125hf, -0.22021484375hf), + f16vec4(-0.052947998046875hf, 0.04498291015625hf, 0.35986328125hf, -0.1727294921875hf), + f16vec4(-0.251953125hf, 0.07958984375hf, -0.1787109375hf, 0.06964111328125hf), + f16vec4(0.08770751953125hf, -0.134033203125hf, -0.039520263671875hf, -0.0963134765625hf), + f16vec4(-0.046966552734375hf, 0.235595703125hf, -0.254150390625hf, -0.05908203125hf), + f16vec4(-0.1441650390625hf, 0.43212890625hf, 0.47314453125hf, -0.06866455078125hf), + f16vec4(-0.2449951171875hf, -0.38232421875hf, 0.02850341796875hf, -0.2447509765625hf), + f16vec4(0.49462890625hf, -0.0897216796875hf, 0.2025146484375hf, 0.2880859375hf), + f16vec4(0.036590576171875hf, -0.1552734375hf, -0.252197265625hf, -0.438720703125hf), + f16vec4(0.28076171875hf, -0.045318603515625hf, 0.3896484375hf, -0.32177734375hf), + f16vec4(-0.1932373046875hf, 0.0113525390625hf, -0.464599609375hf, 0.57568359375hf), + f16vec4(-0.09112548828125hf, 0.365966796875hf, -0.282470703125hf, -1.04296875hf), + f16vec4(-0.07049560546875hf, -0.06109619140625hf, 0.283935546875hf, 0.479248046875hf), + f16vec4(-0.047943115234375hf, 0.265625hf, 0.5224609375hf, -0.28271484375hf), + f16vec4(-0.2255859375hf, -0.4189453125hf, -0.533203125hf, 0.321044921875hf), + f16vec4(-0.061767578125hf, 0.14892578125hf, -0.05865478515625hf, -0.46142578125hf), + f16vec4(-0.344482421875hf, -0.44384765625hf, 0.1824951171875hf, 0.260009765625hf), + f16vec4(0.020538330078125hf, 0.6044921875hf, 0.75146484375hf, -0.22412109375hf), + f16vec4(-0.5009765625hf, -0.83740234375hf, -0.39501953125hf, -0.07928466796875hf), + f16vec4(0.440673828125hf, 0.166259765625hf, 0.0765380859375hf, 0.08685302734375hf), + f16vec4(-0.355712890625hf, -0.99755859375hf, 0.350341796875hf, -0.001018524169921875hf), + f16vec4(-0.052642822265625hf, -0.5166015625hf, -0.341064453125hf, 0.00777435302734375hf), + f16vec4(-0.1561279296875hf, -0.399658203125hf, -0.369873046875hf, -0.2352294921875hf), + f16vec4(0.76318359375hf, -0.95751953125hf, 0.34326171875hf, -0.1217041015625hf), + f16vec4(0.8359375hf, -0.7958984375hf, 0.339599609375hf, -0.1995849609375hf), + f16vec4(-0.170654296875hf, -0.5205078125hf, -0.395263671875hf, 0.25244140625hf), + f16vec4(0.0309906005859375hf, -0.380615234375hf, -0.5703125hf, -0.26416015625hf), + f16vec4(0.332275390625hf, -0.297607421875hf, 0.11895751953125hf, 0.262939453125hf), + f16vec4(0.30419921875hf, -0.1416015625hf, 0.18212890625hf, 0.424560546875hf), + f16vec4(-0.2310791015625hf, -0.25341796875hf, -0.00942230224609375hf, 0.291015625hf), + f16vec4(-0.049224853515625hf, -0.2236328125hf, -0.76416015625hf, -0.2396240234375hf), + f16vec4(0.2225341796875hf, -0.07470703125hf, 0.107666015625hf, 0.3466796875hf), + f16vec4(0.1953125hf, -0.08245849609375hf, 0.09649658203125hf, 0.322021484375hf), + f16vec4(-0.15966796875hf, -0.193603515625hf, -0.1656494140625hf, -0.1993408203125hf), + f16vec4(-0.162841796875hf, -0.0823974609375hf, 0.03546142578125hf, -0.41796875hf), + f16vec4(0.277587890625hf, -0.288330078125hf, 0.2391357421875hf, -0.42822265625hf), + f16vec4(0.327880859375hf, -0.5078125hf, 0.2213134765625hf, -0.36328125hf), + f16vec4(-0.21728515625hf, -0.30322265625hf, -0.2376708984375hf, 0.026397705078125hf), + f16vec4(0.01380157470703125hf, -0.11163330078125hf, -0.11602783203125hf, -0.10833740234375hf), + f16vec4(0.1400146484375hf, 0.093017578125hf, 0.207275390625hf, 0.1524658203125hf), + f16vec4(-0.061370849609375hf, 0.02838134765625hf, 0.169677734375hf, 0.479248046875hf), + f16vec4(-0.2548828125hf, -0.16357421875hf, 0.0185089111328125hf, -0.08367919921875hf), + f16vec4(0.2266845703125hf, -0.0226287841796875hf, -0.38525390625hf, -0.180908203125hf), + f16vec4(0.1727294921875hf, 0.047821044921875hf, 0.035614013671875hf, 0.1121826171875hf), + f16vec4(0.147216796875hf, 0.01165771484375hf, 0.02001953125hf, 0.306640625hf), + f16vec4(-0.1427001953125hf, 0.079833984375hf, -0.259033203125hf, -0.49755859375hf), + f16vec4(-0.242431640625hf, 0.2078857421875hf, -0.1348876953125hf, -0.8779296875hf), + f16vec4(0.09295654296875hf, 0.043670654296875hf, 0.04132080078125hf, -1.2275390625hf), + f16vec4(0.11907958984375hf, -0.19140625hf, -0.035858154296875hf, -1.0634765625hf), + f16vec4(-0.29296875hf, -0.1611328125hf, -0.271484375hf, -0.0391845703125hf), + f16vec4(-0.0711669921875hf, 0.1478271484375hf, -0.1959228515625hf, -0.202880859375hf), + f16vec4(0.296630859375hf, 0.291259765625hf, 0.005931854248046875hf, -0.162841796875hf), + f16vec4(0.047454833984375hf, 0.2310791015625hf, -0.0523681640625hf, 0.155517578125hf), + f16vec4(-0.291748046875hf, -0.1624755859375hf, -0.0341796875hf, -0.3623046875hf), + f16vec4(0.373046875hf, 0.1334228515625hf, -0.4638671875hf, -0.0650634765625hf), + f16vec4(0.97998046875hf, 0.058197021484375hf, -0.1046142578125hf, -0.176025390625hf), + f16vec4(0.6689453125hf, 0.1236572265625hf, -0.11712646484375hf, -0.0263671875hf) +); +const f16vec4 kMuA = f16vec4(2.22265625hf, -1.751953125hf, -0.337890625hf, -2.1328125hf); +const f16vec4 kSigmaA = f16vec4(0.38525390625hf, 0.61669921875hf, 0.337646484375hf, 0.50830078125hf); +const f16vec4 kBetaA = f16vec4(0.016143798828125hf, -0.1622314453125hf, -0.56005859375hf, -0.51025390625hf); + +const f16vec4 kColsB[72] = f16vec4[72]( + f16vec4(0.642578125hf, -0.373291015625hf, 0.290771484375hf, 0.2239990234375hf), + f16vec4(-0.2841796875hf, 0.0390625hf, 0.003604888916015625hf, -0.2318115234375hf), + f16vec4(0.47802734375hf, -0.25146484375hf, -0.4404296875hf, 0.9970703125hf), + f16vec4(-0.176513671875hf, -0.268310546875hf, 0.4111328125hf, 0.1968994140625hf), + f16vec4(0.93798828125hf, -0.75439453125hf, 0.22216796875hf, 0.0888671875hf), + f16vec4(-0.28955078125hf, 0.32080078125hf, 0.2900390625hf, 0.0177459716796875hf), + f16vec4(0.21923828125hf, -0.2283935546875hf, -0.5087890625hf, 0.33447265625hf), + f16vec4(-0.005756378173828125hf, 0.1409912109375hf, 0.432373046875hf, 0.186767578125hf), + f16vec4(0.638671875hf, -0.73681640625hf, 0.23828125hf, -0.0172271728515625hf), + f16vec4(-0.75hf, 0.5634765625hf, 0.494140625hf, 0.3544921875hf), + f16vec4(0.1611328125hf, -0.1416015625hf, -0.272216796875hf, -0.016815185546875hf), + f16vec4(-0.3076171875hf, 0.13134765625hf, 0.79541015625hf, 0.1915283203125hf), + f16vec4(0.55517578125hf, -0.5263671875hf, 0.295654296875hf, 0.163818359375hf), + f16vec4(-0.2373046875hf, 0.2459716796875hf, 0.410888671875hf, 0.13818359375hf), + f16vec4(0.375244140625hf, -0.285400390625hf, -0.170166015625hf, 0.626953125hf), + f16vec4(-0.05499267578125hf, 0.037811279296875hf, 0.2010498046875hf, 0.382568359375hf), + f16vec4(0.884765625hf, -0.70361328125hf, 0.267578125hf, 0.08148193359375hf), + f16vec4(-0.1961669921875hf, 0.32958984375hf, 0.404296875hf, 0.1845703125hf), + f16vec4(0.0997314453125hf, -0.2337646484375hf, -0.23486328125hf, 0.080322265625hf), + f16vec4(0.13818359375hf, 0.308349609375hf, 0.00670623779296875hf, 0.158203125hf), + f16vec4(0.62109375hf, -0.681640625hf, 0.297119140625hf, 0.0008587837219238281hf), + f16vec4(-0.67724609375hf, 0.51513671875hf, 0.5576171875hf, 0.42724609375hf), + f16vec4(0.08251953125hf, -0.12176513671875hf, -0.06768798828125hf, -0.439697265625hf), + f16vec4(-0.1724853515625hf, 0.2359619140625hf, 0.300537109375hf, 0.1629638671875hf), + f16vec4(0.30224609375hf, -0.27490234375hf, 0.31494140625hf, 0.157470703125hf), + f16vec4(-0.4658203125hf, 0.396240234375hf, 0.11395263671875hf, 0.388427734375hf), + f16vec4(0.53466796875hf, -0.271240234375hf, 0.18017578125hf, 0.64501953125hf), + f16vec4(-0.1220703125hf, 0.2353515625hf, 0.58447265625hf, 0.310302734375hf), + f16vec4(0.447021484375hf, -0.499267578125hf, 0.2607421875hf, 0.1197509765625hf), + f16vec4(-0.477783203125hf, 0.4677734375hf, 0.11737060546875hf, 0.4189453125hf), + f16vec4(0.29443359375hf, -0.347412109375hf, -0.0909423828125hf, 0.051116943359375hf), + f16vec4(-0.00440216064453125hf, 0.447021484375hf, 0.298583984375hf, 0.1875hf), + f16vec4(0.21337890625hf, -0.31591796875hf, 0.369140625hf, 0.0948486328125hf), + f16vec4(-0.9130859375hf, 0.58984375hf, 0.1995849609375hf, 0.7041015625hf), + f16vec4(0.259765625hf, -0.284423828125hf, -0.0207672119140625hf, -0.65185546875hf), + f16vec4(-0.2958984375hf, 0.392578125hf, 0.591796875hf, 0.3759765625hf), + f16vec4(0.427734375hf, -0.26416015625hf, -0.004123687744140625hf, 0.1441650390625hf), + f16vec4(0.1844482421875hf, -0.0218963623046875hf, 0.176025390625hf, 0.76318359375hf), + f16vec4(-0.1822509765625hf, 0.326904296875hf, -0.26171875hf, 0.787109375hf), + f16vec4(-0.198974609375hf, 0.09979248046875hf, -0.264892578125hf, 0.86669921875hf), + f16vec4(0.220703125hf, -0.44189453125hf, -0.31103515625hf, -0.07843017578125hf), + f16vec4(0.006256103515625hf, -0.058502197265625hf, -0.0115509033203125hf, 0.419189453125hf), + f16vec4(-0.2451171875hf, 0.278076171875hf, -0.5439453125hf, 0.1744384765625hf), + f16vec4(-0.2294921875hf, 0.1473388671875hf, -0.357177734375hf, 0.345703125hf), + f16vec4(0.379638671875hf, -0.462890625hf, -0.10693359375hf, -0.09112548828125hf), + f16vec4(0.0941162109375hf, -0.398681640625hf, -0.6220703125hf, -0.2244873046875hf), + f16vec4(-0.2408447265625hf, 0.1065673828125hf, -0.58203125hf, -0.1170654296875hf), + f16vec4(-0.24658203125hf, 0.0196685791015625hf, -0.387451171875hf, 0.112548828125hf), + f16vec4(0.208740234375hf, -0.29150390625hf, 0.11517333984375hf, 0.042999267578125hf), + f16vec4(0.0010128021240234375hf, -0.0055694580078125hf, 0.22802734375hf, 0.407958984375hf), + f16vec4(-0.302978515625hf, 0.338134765625hf, -0.271728515625hf, 0.09368896484375hf), + f16vec4(-0.3623046875hf, 0.1270751953125hf, -0.262939453125hf, 0.285888671875hf), + f16vec4(0.006519317626953125hf, -0.52587890625hf, -0.212890625hf, -0.0194244384765625hf), + f16vec4(-0.1680908203125hf, 0.05963134765625hf, 0.265625hf, 0.0279388427734375hf), + f16vec4(-0.2471923828125hf, 0.38232421875hf, -0.414794921875hf, -0.43603515625hf), + f16vec4(-0.29052734375hf, 0.240966796875hf, -0.17138671875hf, -0.3232421875hf), + f16vec4(0.1453857421875hf, -0.73486328125hf, -0.1937255859375hf, -0.10772705078125hf), + f16vec4(-0.039306640625hf, -0.2237548828125hf, 0.00920867919921875hf, -0.5078125hf), + f16vec4(-0.2384033203125hf, 0.220458984375hf, -0.273681640625hf, -0.89404296875hf), + f16vec4(-0.31201171875hf, 0.113525390625hf, -0.047760009765625hf, -0.57470703125hf), + f16vec4(0.0899658203125hf, -0.2210693359375hf, 0.11065673828125hf, -0.1180419921875hf), + f16vec4(0.1070556640625hf, -0.1312255859375hf, 0.09808349609375hf, 0.0004611015319824219hf), + f16vec4(-0.2578125hf, 0.277099609375hf, 0.07586669921875hf, 0.009918212890625hf), + f16vec4(-0.350830078125hf, 0.061126708984375hf, -0.205322265625hf, -0.11212158203125hf), + f16vec4(-0.09197998046875hf, -0.322021484375hf, -0.097900390625hf, -0.2049560546875hf), + f16vec4(-0.04901123046875hf, -0.1468505859375hf, 0.1181640625hf, -0.4541015625hf), + f16vec4(-0.263427734375hf, 0.2744140625hf, -0.1763916015625hf, -0.67626953125hf), + f16vec4(-0.2900390625hf, 0.1357421875hf, -0.158935546875hf, -0.92431640625hf), + f16vec4(0.0546875hf, -0.68701171875hf, -0.0767822265625hf, -0.429931640625hf), + f16vec4(0.08441162109375hf, -0.1876220703125hf, 0.2386474609375hf, -0.87548828125hf), + f16vec4(-0.1246337890625hf, 0.18505859375hf, 0.022705078125hf, -1.2470703125hf), + f16vec4(-0.22607421875hf, 0.053924560546875hf, -0.01200103759765625hf, -0.966796875hf) +); +const f16vec4 kMuB = f16vec4(0.223388671875hf, -1.1845703125hf, -0.83935546875hf, -0.1507568359375hf); +const f16vec4 kSigmaB = f16vec4(0.2327880859375hf, 0.257080078125hf, 0.165771484375hf, 0.210205078125hf); +const f16vec4 kBetaB = f16vec4(-0.25048828125hf, -0.4111328125hf, -0.311767578125hf, -0.1903076171875hf); + +f16vec4 borderTap(sampler2D s, ivec2 q) { + if (all(greaterThanEqual(q, ivec2(0))) && all(lessThan(q, textureSize(s, 0)))) { + return f16vec4(texelFetch(s, q, 0)); + } + return f16vec4(0.0hf); +} + +f16vec4 runHead(const f16vec4 cols[72], f16vec4 mu, f16vec4 sigma, f16vec4 beta, + const f16vec4 taps[18]) { + f16vec4 acc = cols[0] * taps[0].x + cols[1] * taps[0].y + + cols[2] * taps[0].z + cols[3] * taps[0].w; + for (int k = 1; k < 18; ++k) { + int b = 4 * k; + acc += cols[b] * taps[k].x + cols[b + 1] * taps[k].y + + cols[b + 2] * taps[k].z + cols[b + 3] * taps[k].w; + } + return (acc - mu) * sigma + beta; +} + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 outSize = imageSize(dstFlow0); + if (p.x >= outSize.x || p.y >= outSize.y) { + return; + } + + f16vec4 taps[18]; + for (int t = 0; t < 9; ++t) { + if (t == 4) { + // center tap is deliberately unguarded (inputs assumed >= output size) + taps[4] = f16vec4(texelFetch(srcFeat0, p, 0)); + taps[13] = f16vec4(texelFetch(srcFeat1, p, 0)); + } else { + ivec2 q = p + ivec2(t / 3 - 1, t % 3 - 1); + taps[t] = borderTap(srcFeat0, q); + taps[t + 9] = borderTap(srcFeat1, q); + } + } + + imageStore(dstFlow0, p, vec4(runHead(kColsA, kMuA, kSigmaA, kBetaA, taps))); + imageStore(dstFlow1, p, vec4(runHead(kColsB, kMuB, kSigmaB, kBetaB, taps))); +} diff --git a/cleanroom/glsl/shader_12.comp b/cleanroom/glsl/shader_12.comp new file mode 100644 index 0000000..16dbf69 --- /dev/null +++ b/cleanroom/glsl/shader_12.comp @@ -0,0 +1,211 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_12: 3x3 fp16 conv over two RGBA inputs, two affine-remapped RGBA8 outputs. +// Weights baked per member; columns of the 18 4x4 matrices, head A then head B. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcFeat0; +layout(set = 0, binding = 33) uniform sampler2D srcFeat1; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstFlow0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstFlow1; + +const f16vec4 kColsA[72] = f16vec4[72]( + f16vec4(-0.3232421875hf, 0.2379150390625hf, 0.155517578125hf, 0.1475830078125hf), + f16vec4(-0.76318359375hf, -0.35400390625hf, -0.265869140625hf, 0.44775390625hf), + f16vec4(0.323974609375hf, -0.31201171875hf, -0.3251953125hf, -0.305908203125hf), + f16vec4(0.53955078125hf, -1.3544921875hf, -0.467041015625hf, -0.264892578125hf), + f16vec4(-0.1502685546875hf, -0.019378662109375hf, 0.12347412109375hf, 0.400634765625hf), + f16vec4(-0.25732421875hf, -0.294189453125hf, -0.26025390625hf, 0.1634521484375hf), + f16vec4(0.43359375hf, -0.202392578125hf, -0.197265625hf, -0.1329345703125hf), + f16vec4(0.350830078125hf, -0.038299560546875hf, 0.1507568359375hf, -0.434814453125hf), + f16vec4(-0.340087890625hf, 0.084228515625hf, 0.322265625hf, 0.16845703125hf), + f16vec4(0.382080078125hf, -0.12841796875hf, 0.148193359375hf, 0.08953857421875hf), + f16vec4(0.79296875hf, -0.287841796875hf, -0.29248046875hf, -0.01334381103515625hf), + f16vec4(0.328125hf, 0.58349609375hf, 0.3095703125hf, -0.84130859375hf), + f16vec4(-0.00933074951171875hf, 0.1734619140625hf, 0.1019287109375hf, 0.148681640625hf), + f16vec4(-0.298828125hf, -0.47216796875hf, -0.2127685546875hf, -0.2432861328125hf), + f16vec4(0.34765625hf, -0.259033203125hf, -0.2197265625hf, -0.487548828125hf), + f16vec4(0.60791015625hf, -1.0576171875hf, -0.408935546875hf, -0.1068115234375hf), + f16vec4(0.3125hf, -0.07122802734375hf, 0.056396484375hf, 0.1591796875hf), + f16vec4(-0.1839599609375hf, -0.1402587890625hf, -0.0088653564453125hf, -0.88916015625hf), + f16vec4(0.400390625hf, -0.0887451171875hf, -0.040557861328125hf, -0.57421875hf), + f16vec4(0.09381103515625hf, -0.446533203125hf, 0.1689453125hf, -0.02008056640625hf), + f16vec4(0.07269287109375hf, 0.07525634765625hf, 0.2587890625hf, 0.043426513671875hf), + f16vec4(-0.09356689453125hf, 0.282958984375hf, 0.3330078125hf, -0.64306640625hf), + f16vec4(0.67431640625hf, -0.1571044921875hf, -0.095703125hf, -0.62255859375hf), + f16vec4(-0.0146331787109375hf, 0.4541015625hf, 0.396728515625hf, -0.5849609375hf), + f16vec4(-0.238525390625hf, 0.39794921875hf, 0.25927734375hf, 0.1318359375hf), + f16vec4(0.2144775390625hf, -0.2705078125hf, 0.168212890625hf, 0.382568359375hf), + f16vec4(0.6240234375hf, -0.387939453125hf, -0.34716796875hf, -0.5439453125hf), + f16vec4(0.0914306640625hf, -1.44140625hf, -0.8046875hf, -0.003231048583984375hf), + f16vec4(0.041290283203125hf, 0.12469482421875hf, 0.2060546875hf, 0.252685546875hf), + f16vec4(-0.024627685546875hf, 0.2298583984375hf, 0.44775390625hf, -0.6171875hf), + f16vec4(0.63232421875hf, -0.268310546875hf, -0.1923828125hf, -0.55810546875hf), + f16vec4(-0.31005859375hf, -1.548828125hf, -0.716796875hf, 0.040863037109375hf), + f16vec4(-0.05731201171875hf, 0.2236328125hf, 0.396484375hf, 0.0006279945373535156hf), + f16vec4(-0.21044921875hf, 0.6611328125hf, 0.64013671875hf, 0.1298828125hf), + f16vec4(0.9951171875hf, -0.37451171875hf, -0.235595703125hf, -0.86083984375hf), + f16vec4(-0.318359375hf, -1.5712890625hf, -0.4453125hf, -0.50830078125hf), + f16vec4(0.144287109375hf, 0.39111328125hf, 0.43359375hf, -0.355224609375hf), + f16vec4(-0.329833984375hf, -0.418701171875hf, -0.68408203125hf, 0.340576171875hf), + f16vec4(-0.40673828125hf, -0.1956787109375hf, -0.2890625hf, 0.67919921875hf), + f16vec4(0.150634765625hf, 0.1854248046875hf, 0.3154296875hf, -1.2353515625hf), + f16vec4(0.003505706787109375hf, 0.515625hf, 0.580078125hf, -0.0731201171875hf), + f16vec4(-0.01751708984375hf, -0.204345703125hf, -0.01116943359375hf, 0.043121337890625hf), + f16vec4(-0.0394287109375hf, -0.1075439453125hf, -0.1314697265625hf, 1.037109375hf), + f16vec4(0.0275726318359375hf, 0.3154296875hf, 0.1953125hf, -0.724609375hf), + f16vec4(-0.15966796875hf, 0.5654296875hf, 0.67724609375hf, 0.4482421875hf), + f16vec4(0.14453125hf, -0.54345703125hf, -0.1881103515625hf, -0.059173583984375hf), + f16vec4(0.7294921875hf, -0.273681640625hf, -0.306884765625hf, 0.136474609375hf), + f16vec4(0.1280517578125hf, 0.0237579345703125hf, -0.15380859375hf, -0.354248046875hf), + f16vec4(0.0404052734375hf, 0.440673828125hf, 0.48193359375hf, -0.476806640625hf), + f16vec4(-0.0816650390625hf, -0.0256805419921875hf, -0.7421875hf, 0.10693359375hf), + f16vec4(-0.1492919921875hf, -0.0418701171875hf, -0.037139892578125hf, -0.12078857421875hf), + f16vec4(0.16845703125hf, 0.2412109375hf, 0.31103515625hf, -0.38232421875hf), + f16vec4(-0.03118896484375hf, 0.485595703125hf, 0.6435546875hf, -0.287353515625hf), + f16vec4(-0.006916046142578125hf, 0.197265625hf, 0.0089263916015625hf, 0.0023784637451171875hf), + f16vec4(-0.16259765625hf, 0.2236328125hf, 0.1534423828125hf, 0.314697265625hf), + f16vec4(0.038421630859375hf, 0.36669921875hf, 0.143310546875hf, 0.07269287109375hf), + f16vec4(-0.20947265625hf, 0.58154296875hf, 0.80712890625hf, 0.246337890625hf), + f16vec4(0.220458984375hf, -0.296875hf, -0.1038818359375hf, -0.1475830078125hf), + f16vec4(0.346923828125hf, 0.032501220703125hf, -0.05780029296875hf, 0.08624267578125hf), + f16vec4(0.52392578125hf, 0.037994384765625hf, -0.142333984375hf, -0.0828857421875hf), + f16vec4(-0.04437255859375hf, 0.4462890625hf, 0.64013671875hf, -0.3505859375hf), + f16vec4(0.0467529296875hf, -0.244873046875hf, -1.029296875hf, 0.1798095703125hf), + f16vec4(0.08270263671875hf, -0.0897216796875hf, -0.0190277099609375hf, 0.324951171875hf), + f16vec4(-0.1632080078125hf, -0.08441162109375hf, 0.014404296875hf, -0.10626220703125hf), + f16vec4(-0.09320068359375hf, 0.471435546875hf, 0.73193359375hf, -0.1331787109375hf), + f16vec4(0.119384765625hf, -0.1048583984375hf, -0.37548828125hf, 0.0909423828125hf), + f16vec4(-0.0994873046875hf, 0.17333984375hf, 0.2105712890625hf, 0.23046875hf), + f16vec4(0.1353759765625hf, -0.060272216796875hf, -0.1456298828125hf, -0.298583984375hf), + f16vec4(-0.22802734375hf, 0.413818359375hf, 0.82421875hf, 0.376708984375hf), + f16vec4(0.49951171875hf, -0.71142578125hf, -0.376708984375hf, -0.1988525390625hf), + f16vec4(0.5908203125hf, 0.06219482421875hf, -0.0087432861328125hf, 0.1552734375hf), + f16vec4(0.78955078125hf, -0.340087890625hf, -0.33349609375hf, -0.5087890625hf) +); +const f16vec4 kMuA = f16vec4(0.12103271484375hf, 0.11639404296875hf, 1.189453125hf, -0.42529296875hf); +const f16vec4 kSigmaA = f16vec4(0.80029296875hf, 0.9619140625hf, 0.98779296875hf, 1.4794921875hf); +const f16vec4 kBetaA = f16vec4(-0.57275390625hf, 0.11492919921875hf, -0.0204010009765625hf, 0.43359375hf); + +const f16vec4 kColsB[72] = f16vec4[72]( + f16vec4(0.362060546875hf, -0.2548828125hf, 0.06976318359375hf, -0.1904296875hf), + f16vec4(-0.00495147705078125hf, -0.44970703125hf, -0.07220458984375hf, -0.45458984375hf), + f16vec4(-0.97412109375hf, 0.79638671875hf, -0.3447265625hf, 0.07098388671875hf), + f16vec4(-0.6328125hf, 0.53125hf, -0.822265625hf, -0.1016845703125hf), + f16vec4(0.26513671875hf, -0.04638671875hf, 0.06182861328125hf, -0.252197265625hf), + f16vec4(-0.35498046875hf, 0.09576416015625hf, -0.142333984375hf, 0.0028057098388671875hf), + f16vec4(-0.921875hf, 0.85546875hf, -0.2144775390625hf, 0.017669677734375hf), + f16vec4(-0.1339111328125hf, 0.2880859375hf, -0.121337890625hf, 0.1314697265625hf), + f16vec4(0.29541015625hf, -0.239013671875hf, 0.318115234375hf, -0.404296875hf), + f16vec4(-0.3720703125hf, 0.63916015625hf, 0.3876953125hf, 0.20751953125hf), + f16vec4(-1.3486328125hf, 0.9638671875hf, -0.33544921875hf, 0.2225341796875hf), + f16vec4(-0.2783203125hf, 0.172607421875hf, 0.271484375hf, 0.221923828125hf), + f16vec4(0.2376708984375hf, -0.13671875hf, 0.054351806640625hf, -0.167724609375hf), + f16vec4(-0.2142333984375hf, 0.050079345703125hf, -0.07568359375hf, -0.0291595458984375hf), + f16vec4(-0.8212890625hf, 0.7890625hf, -0.1805419921875hf, 0.142578125hf), + f16vec4(-0.51513671875hf, 0.38671875hf, 0.1875hf, -0.1978759765625hf), + f16vec4(0.07427978515625hf, 0.09600830078125hf, 0.0703125hf, -0.2039794921875hf), + f16vec4(-0.297119140625hf, 0.1376953125hf, 0.0257568359375hf, 0.212158203125hf), + f16vec4(-0.68798828125hf, 0.72216796875hf, -0.00045490264892578125hf, 0.06842041015625hf), + f16vec4(-0.034027099609375hf, 0.05865478515625hf, 0.278076171875hf, -0.11065673828125hf), + f16vec4(0.047698974609375hf, -0.064453125hf, 0.275390625hf, -0.312255859375hf), + f16vec4(-0.026519775390625hf, 0.2376708984375hf, 0.4208984375hf, 0.3017578125hf), + f16vec4(-1.095703125hf, 0.763671875hf, -0.12127685546875hf, 0.2352294921875hf), + f16vec4(-0.05682373046875hf, -0.06463623046875hf, 0.62841796875hf, -0.1690673828125hf), + f16vec4(0.265380859375hf, -0.402587890625hf, 0.1907958984375hf, -0.285888671875hf), + f16vec4(-0.26220703125hf, 0.02618408203125hf, 0.351318359375hf, -0.11029052734375hf), + f16vec4(-0.9306640625hf, 0.701171875hf, -0.346923828125hf, 0.2130126953125hf), + f16vec4(-0.1263427734375hf, -0.0906982421875hf, -0.1912841796875hf, 0.144775390625hf), + f16vec4(0.104736328125hf, -0.1494140625hf, 0.1534423828125hf, -0.342041015625hf), + f16vec4(-0.094482421875hf, -0.1820068359375hf, 0.430419921875hf, 0.049346923828125hf), + f16vec4(-0.5849609375hf, 0.5126953125hf, -0.2249755859375hf, 0.1630859375hf), + f16vec4(-0.1434326171875hf, 0.1754150390625hf, -0.4580078125hf, 0.2137451171875hf), + f16vec4(0.0119171142578125hf, -0.178955078125hf, 0.333251953125hf, -0.396240234375hf), + f16vec4(0.2066650390625hf, -0.162841796875hf, 0.6640625hf, 0.0304412841796875hf), + f16vec4(-0.970703125hf, 0.71142578125hf, -0.30517578125hf, 0.370361328125hf), + f16vec4(-0.34912109375hf, 0.318115234375hf, -0.1600341796875hf, 0.1497802734375hf), + f16vec4(-0.305908203125hf, 0.1334228515625hf, 0.7431640625hf, 0.10955810546875hf), + f16vec4(-0.000453948974609375hf, 0.061859130859375hf, -1.0048828125hf, 0.41845703125hf), + f16vec4(-0.9892578125hf, 0.5224609375hf, -0.2169189453125hf, -0.396484375hf), + f16vec4(-0.796875hf, 0.41162109375hf, 0.211181640625hf, -0.0300445556640625hf), + f16vec4(-0.265380859375hf, 0.04083251953125hf, 0.7021484375hf, -0.2059326171875hf), + f16vec4(0.03326416015625hf, 0.10791015625hf, -0.060028076171875hf, 0.482177734375hf), + f16vec4(-0.65478515625hf, 0.658203125hf, -0.0869140625hf, -0.4873046875hf), + f16vec4(-0.3212890625hf, 0.05853271484375hf, 0.0328369140625hf, -0.13623046875hf), + f16vec4(0.2479248046875hf, -0.10943603515625hf, 0.66796875hf, -0.1387939453125hf), + f16vec4(0.041656494140625hf, 0.00908660888671875hf, -0.152587890625hf, 0.64990234375hf), + f16vec4(-0.99853515625hf, 0.72802734375hf, -0.332275390625hf, -0.357177734375hf), + f16vec4(-0.34326171875hf, -0.0391845703125hf, -0.400146484375hf, -0.293701171875hf), + f16vec4(-0.302734375hf, 0.0740966796875hf, 0.64794921875hf, -0.01454925537109375hf), + f16vec4(0.132080078125hf, 0.0255279541015625hf, -0.47216796875hf, 0.453125hf), + f16vec4(-0.74462890625hf, 0.52880859375hf, 0.0244140625hf, -0.342041015625hf), + f16vec4(-0.302490234375hf, 0.275390625hf, 0.21044921875hf, -0.0775146484375hf), + f16vec4(-0.354736328125hf, 0.03900146484375hf, 0.56396484375hf, -0.24169921875hf), + f16vec4(0.2237548828125hf, -0.00785064697265625hf, 0.43798828125hf, 0.51513671875hf), + f16vec4(-0.37060546875hf, 0.286376953125hf, 0.194091796875hf, -0.331787109375hf), + f16vec4(-0.05975341796875hf, 0.09808349609375hf, 0.031494140625hf, -0.1328125hf), + f16vec4(0.1180419921875hf, -0.14306640625hf, 0.732421875hf, -0.2022705078125hf), + f16vec4(0.060333251953125hf, 0.011962890625hf, 0.350341796875hf, 0.70556640625hf), + f16vec4(-1.0712890625hf, 0.380615234375hf, -0.11932373046875hf, -0.267822265625hf), + f16vec4(-0.533203125hf, 0.343505859375hf, -0.32177734375hf, -0.1785888671875hf), + f16vec4(-0.031341552734375hf, -0.0531005859375hf, 0.54345703125hf, -0.0157318115234375hf), + f16vec4(-0.01406097412109375hf, 0.1708984375hf, -0.50146484375hf, 0.58642578125hf), + f16vec4(-0.397216796875hf, 0.4345703125hf, 0.0050048828125hf, -0.51416015625hf), + f16vec4(-0.625hf, 0.287109375hf, -0.14794921875hf, -0.1905517578125hf), + f16vec4(-0.04046630859375hf, -0.1119384765625hf, 0.4501953125hf, -0.194091796875hf), + f16vec4(0.0482177734375hf, 0.187744140625hf, 0.291015625hf, 0.71484375hf), + f16vec4(-0.1690673828125hf, 0.12188720703125hf, 0.1630859375hf, -0.454345703125hf), + f16vec4(-0.57666015625hf, 0.336181640625hf, -0.245361328125hf, -0.1329345703125hf), + f16vec4(0.32861328125hf, -0.214111328125hf, 0.5986328125hf, -0.1358642578125hf), + f16vec4(-0.10919189453125hf, 0.25439453125hf, 0.2188720703125hf, 1.078125hf), + f16vec4(-1.2109375hf, 0.4892578125hf, -0.11322021484375hf, -0.2264404296875hf), + f16vec4(-0.67822265625hf, 0.265380859375hf, -0.470458984375hf, 0.053619384765625hf) +); +const f16vec4 kMuB = f16vec4(-1.748046875hf, 0.916015625hf, 1.552734375hf, -0.75439453125hf); +const f16vec4 kSigmaB = f16vec4(0.66455078125hf, 0.70654296875hf, 1.0380859375hf, 1.1337890625hf); +const f16vec4 kBetaB = f16vec4(0.84521484375hf, -0.26953125hf, -0.07989501953125hf, -0.07757568359375hf); + +f16vec4 borderTap(sampler2D s, ivec2 q) { + if (all(greaterThanEqual(q, ivec2(0))) && all(lessThan(q, textureSize(s, 0)))) { + return f16vec4(texelFetch(s, q, 0)); + } + return f16vec4(0.0hf); +} + +f16vec4 runHead(const f16vec4 cols[72], f16vec4 mu, f16vec4 sigma, f16vec4 beta, + const f16vec4 taps[18]) { + f16vec4 acc = cols[0] * taps[0].x + cols[1] * taps[0].y + + cols[2] * taps[0].z + cols[3] * taps[0].w; + for (int k = 1; k < 18; ++k) { + int b = 4 * k; + acc += cols[b] * taps[k].x + cols[b + 1] * taps[k].y + + cols[b + 2] * taps[k].z + cols[b + 3] * taps[k].w; + } + return (acc - mu) * sigma + beta; +} + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 outSize = imageSize(dstFlow0); + if (p.x >= outSize.x || p.y >= outSize.y) { + return; + } + + f16vec4 taps[18]; + for (int t = 0; t < 9; ++t) { + if (t == 4) { + // center tap is deliberately unguarded (inputs assumed >= output size) + taps[4] = f16vec4(texelFetch(srcFeat0, p, 0)); + taps[13] = f16vec4(texelFetch(srcFeat1, p, 0)); + } else { + ivec2 q = p + ivec2(t / 3 - 1, t % 3 - 1); + taps[t] = borderTap(srcFeat0, q); + taps[t + 9] = borderTap(srcFeat1, q); + } + } + + imageStore(dstFlow0, p, vec4(runHead(kColsA, kMuA, kSigmaA, kBetaA, taps))); + imageStore(dstFlow1, p, vec4(runHead(kColsB, kMuB, kSigmaB, kBetaB, taps))); +} diff --git a/cleanroom/glsl/shader_13.comp b/cleanroom/glsl/shader_13.comp new file mode 100644 index 0000000..c9d891a --- /dev/null +++ b/cleanroom/glsl/shader_13.comp @@ -0,0 +1,102 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_13: 3x3 fp16 conv (2x RGBA in -> 1ch) + sigmoid + threshold gate, then a +// 6-level box pyramid of the mask built in shared memory within one dispatch. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 0) uniform ParamBlock { + float reserved0; + float reserved1; + float maskThreshold; +} ub; + +layout(set = 0, binding = 32) uniform sampler2D srcFlow; +layout(set = 0, binding = 33) uniform sampler2D srcFeat; + +layout(set = 0, binding = 48, r8) uniform writeonly image2D dstMask0; +layout(set = 0, binding = 49, r8) uniform writeonly image2D dstMask1; +layout(set = 0, binding = 50, r8) uniform writeonly image2D dstMask2; +layout(set = 0, binding = 51, r8) uniform writeonly image2D dstMask3; +layout(set = 0, binding = 52, r8) uniform writeonly image2D dstMask4; +layout(set = 0, binding = 53, r8) uniform writeonly image2D dstMask5; + +shared float16_t sTile[32][32]; + +const ivec2 kTaps[9] = ivec2[9]( + ivec2(-1, -1), ivec2(-1, 0), ivec2(-1, 1), + ivec2( 0, -1), ivec2( 0, 0), ivec2( 0, 1), + ivec2( 1, -1), ivec2( 1, 0), ivec2( 1, 1)); + +const f16vec4 kWFlow[9] = f16vec4[9]( + f16vec4(0.70947265625hf, -0.411376953125hf, -0.435302734375hf, -0.58203125hf), + f16vec4(0.67431640625hf, -0.29736328125hf, -0.485595703125hf, -1.0830078125hf), + f16vec4(1.1103515625hf, -0.5859375hf, -0.63671875hf, -1.16796875hf), + f16vec4(0.31591796875hf, -0.455078125hf, -0.57470703125hf, -0.88330078125hf), + f16vec4(0.232177734375hf, -0.218017578125hf, -0.51513671875hf, -1.6123046875hf), + f16vec4(0.70849609375hf, -0.5029296875hf, -0.6328125hf, -1.62890625hf), + f16vec4(0.8505859375hf, -0.689453125hf, -0.87841796875hf, -0.71923828125hf), + f16vec4(0.712890625hf, -0.53271484375hf, -0.76513671875hf, -0.89892578125hf), + f16vec4(1.11328125hf, -0.763671875hf, -0.87646484375hf, -1.166015625hf)); + +const f16vec4 kWFeat[9] = f16vec4[9]( + f16vec4(-0.7666015625hf, 0.8642578125hf, -0.54052734375hf, 0.51953125hf), + f16vec4(-0.96142578125hf, 0.73388671875hf, -0.6201171875hf, 0.59375hf), + f16vec4(-1.3798828125hf, 0.92626953125hf, -0.77685546875hf, 0.72900390625hf), + f16vec4(-0.61279296875hf, 0.6650390625hf, -0.6083984375hf, 0.63427734375hf), + f16vec4(-0.478515625hf, 0.432373046875hf, -0.63720703125hf, 0.6142578125hf), + f16vec4(-0.810546875hf, 0.58984375hf, -0.70263671875hf, 0.74609375hf), + f16vec4(-1.15625hf, 0.82958984375hf, -0.8193359375hf, 0.8388671875hf), + f16vec4(-0.97607421875hf, 0.67333984375hf, -0.798828125hf, 0.8271484375hf), + f16vec4(-1.296875hf, 0.8388671875hf, -0.7939453125hf, 0.96484375hf)); + +const float16_t kBias = 0.21533203125hf; + +#define REDUCE_LEVEL(dst, n) \ + barrier(); \ + if (lid.x < n && lid.y < n) { \ + float16_t r = 0.25hf * (((sTile[2u * lid.x][2u * lid.y] \ + + sTile[2u * lid.x + 1u][2u * lid.y]) \ + + sTile[2u * lid.x][2u * lid.y + 1u]) \ + + sTile[2u * lid.x + 1u][2u * lid.y + 1u]); \ + ivec2 c = ivec2(wg * n + lid); \ + if (c.x < imageSize(dst).x && c.y < imageSize(dst).y) { \ + imageStore(dst, c, vec4(float(r))); \ + } \ + sTile[lid.x][lid.y] = r; \ + } + +void main() { + uvec2 wg = gl_WorkGroupID.xy; + uvec2 lid = gl_LocalInvocationID.xy; + ivec2 hi = ivec2(vec2(textureSize(srcFlow, 0))) - ivec2(1); + ivec2 lim0 = imageSize(dstMask0); + float16_t thr = float16_t(ub.maskThreshold); + + for (uint dy = 0u; dy < 2u; ++dy) { + for (uint dx = 0u; dx < 2u; ++dx) { + ivec2 p = ivec2(wg * 32u + lid * 2u + uvec2(dx, dy)); + float16_t s = 0.0hf; + for (int t = 0; t < 9; ++t) { + s += dot(f16vec4(texelFetch(srcFlow, clamp(p + kTaps[t], ivec2(0), hi), 0)), kWFlow[t]); + } + for (int t = 0; t < 9; ++t) { + s += dot(f16vec4(texelFetch(srcFeat, clamp(p + kTaps[t], ivec2(0), hi), 0)), kWFeat[t]); + } + s += kBias; + float16_t m = 1.0hf / (1.0hf + exp(-s)); + float16_t v = step(thr, m) * m; + if (p.x < lim0.x && p.y < lim0.y) { + imageStore(dstMask0, p, vec4(float(v))); + } + sTile[lid.x * 2u + dx][lid.y * 2u + dy] = v; + } + } + + REDUCE_LEVEL(dstMask1, 16u) + REDUCE_LEVEL(dstMask2, 8u) + REDUCE_LEVEL(dstMask3, 4u) + REDUCE_LEVEL(dstMask4, 2u) + REDUCE_LEVEL(dstMask5, 1u) +} diff --git a/cleanroom/glsl/shader_14.comp b/cleanroom/glsl/shader_14.comp new file mode 100644 index 0000000..54abbb8 --- /dev/null +++ b/cleanroom/glsl/shader_14.comp @@ -0,0 +1,76 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 0, std140) uniform Params { + float member0; // never read + float alpha; + float member2; // never read +} u; + +layout(set = 0, binding = 32) uniform sampler2D featPrev; +layout(set = 0, binding = 33) uniform sampler2D featCurr; +layout(set = 0, binding = 34) uniform sampler2D refPrev; +layout(set = 0, binding = 35) uniform sampler2D refCurr; +layout(set = 0, binding = 36) uniform sampler2D flowTex; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D outCost03; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D outCost47; +layout(set = 0, binding = 50, rgba8) uniform writeonly image2D outCost8; + +const f16vec4 C1 = f16vec4(2.646484375hf, 2.720703125hf, 2.650390625hf, 2.740234375hf); +const f16vec4 S1 = f16vec4(0.810546875hf, 0.947265625hf, 0.80419921875hf, 0.89697265625hf); +const f16vec4 B1 = f16vec4(0.19873046875hf, 0.341064453125hf, 0.1671142578125hf, 0.30908203125hf); + +const f16vec4 C2 = f16vec4(2.91796875hf, 2.751953125hf, 2.642578125hf, 2.71484375hf); +const f16vec4 S2 = f16vec4(0.8369140625hf, 0.86474609375hf, 0.93603515625hf, 0.89501953125hf); +const f16vec4 B2 = f16vec4(0.313720703125hf, 0.31103515625hf, 0.1827392578125hf, 0.30517578125hf); + +const float16_t C3 = 2.650390625hf; +const float16_t S3 = 0.89794921875hf; +const float16_t B3 = 0.2105712890625hf; + +#define CORR_OFF(off) \ + (dot(F0, f16vec4(textureLodOffset(refPrev, uvB, 0.0, off))) + \ + dot(F1, f16vec4(textureLodOffset(refCurr, uvB, 0.0, off)))) + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + if (any(greaterThanEqual(p, imageSize(outCost03)))) { + return; + } + + vec2 S = vec2(textureSize(featPrev, 0)); + vec2 pc = vec2(gl_GlobalInvocationID.xy) + vec2(0.5, 0.5); + vec2 uv = pc / S; + + f16vec4 f = f16vec4(textureLod(flowTex, uv, 0.0)); + float16_t tH = float16_t(u.alpha); + float16_t uH = float16_t(1.0 - u.alpha); + f16vec2 dA = f.xy * tH; + f16vec2 dB = f.zw * uH; + vec2 uvA = (pc + vec2(dA)) / S; + vec2 uvB = (pc + vec2(dB)) / S; + + f16vec4 F0 = f16vec4(textureLod(featPrev, uvA, 0.0)); + f16vec4 F1 = f16vec4(textureLod(featCurr, uvA, 0.0)); + + f16vec4 v1 = f16vec4(CORR_OFF(ivec2(-1, -1)), + CORR_OFF(ivec2( 0, -1)), + CORR_OFF(ivec2( 1, -1)), + CORR_OFF(ivec2(-1, 0))); + imageStore(outCost03, p, vec4((v1 - C1) * S1 + B1)); + + // center tap: no offset + float16_t cc = dot(F0, f16vec4(textureLod(refPrev, uvB, 0.0))) + + dot(F1, f16vec4(textureLod(refCurr, uvB, 0.0))); + + f16vec4 v2 = f16vec4(cc, + CORR_OFF(ivec2( 1, 0)), + CORR_OFF(ivec2(-1, 1)), + CORR_OFF(ivec2( 0, 1))); + imageStore(outCost47, p, vec4((v2 - C2) * S2 + B2)); + + float16_t s = CORR_OFF(ivec2(1, 1)); + imageStore(outCost8, p, vec4(float((s - C3) * S3 + B3), 0.0, 0.0, 0.0)); +} diff --git a/cleanroom/glsl/shader_15.comp b/cleanroom/glsl/shader_15.comp new file mode 100644 index 0000000..d6a3c74 --- /dev/null +++ b/cleanroom/glsl/shader_15.comp @@ -0,0 +1,325 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_15: 3x3 stride-1 conv, 9->8 channels, zero-padded texelFetch + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcA; +layout(set = 0, binding = 33) uniform sampler2D srcB; +layout(set = 0, binding = 34) uniform sampler2D srcC; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstA; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; + +// zero-padded fetch for non-center taps +f16vec4 padTap(sampler2D img, ivec2 c) +{ + bool inb = c.x >= 0 && c.y >= 0; + if (inb) { + ivec2 sz = textureSize(img, 0); + inb = c.x < sz.x && c.y < sz.y; + } + return inb ? f16vec4(texelFetch(img, c, 0)) : f16vec4(0.0hf); +} + +const f16mat4 w0_0 = f16mat4( + f16vec4(0.079345703125hf, -0.10565185546875hf, -0.2470703125hf, 0.194580078125hf), + f16vec4(-0.005550384521484375hf, -0.2298583984375hf, 0.33349609375hf, -0.0643310546875hf), + f16vec4(-0.1748046875hf, 0.097900390625hf, 0.2064208984375hf, 0.299072265625hf), + f16vec4(0.01415252685546875hf, 0.09185791015625hf, 0.1787109375hf, -0.07843017578125hf)); +const f16mat4 w0_1 = f16mat4( + f16vec4(-0.466552734375hf, 0.05902099609375hf, 0.0269775390625hf, -0.1090087890625hf), + f16vec4(-0.5078125hf, -0.398193359375hf, -0.01007843017578125hf, 0.41796875hf), + f16vec4(-0.43017578125hf, 0.005138397216796875hf, -0.049560546875hf, 0.7861328125hf), + f16vec4(-0.1214599609375hf, 0.11431884765625hf, 0.2021484375hf, 0.04351806640625hf)); +const f16mat4 w0_2 = f16mat4( + f16vec4(0.00856781005859375hf, -0.03741455078125hf, 0.275634765625hf, -0.286865234375hf), + f16vec4(-0.351806640625hf, -0.61376953125hf, -0.12353515625hf, 0.278564453125hf), + f16vec4(-0.4189453125hf, -0.00655364990234375hf, -0.27099609375hf, 0.35595703125hf), + f16vec4(0.1124267578125hf, 0.2088623046875hf, 0.1138916015625hf, -0.01251220703125hf)); +const f16mat4 w0_3 = f16mat4( + f16vec4(-0.005626678466796875hf, 0.28125hf, 0.00926971435546875hf, -0.310791015625hf), + f16vec4(0.054351806640625hf, 0.0535888671875hf, -0.1044921875hf, 0.022705078125hf), + f16vec4(-0.07366943359375hf, 0.301513671875hf, -0.53076171875hf, 0.1669921875hf), + f16vec4(-0.12548828125hf, 0.355712890625hf, 0.2103271484375hf, 0.01708984375hf)); +const f16mat4 w0_4 = f16mat4( + f16vec4(-0.374755859375hf, 0.2763671875hf, -0.1407470703125hf, -0.333984375hf), + f16vec4(-0.3193359375hf, 0.01393890380859375hf, -0.203125hf, 0.1292724609375hf), + f16vec4(-0.408203125hf, 0.315673828125hf, -0.4365234375hf, 0.10406494140625hf), + f16vec4(-0.10333251953125hf, 0.291748046875hf, -0.039154052734375hf, -0.26513671875hf)); +const f16mat4 w0_5 = f16mat4( + f16vec4(-0.07159423828125hf, 0.292236328125hf, -0.0782470703125hf, -0.67236328125hf), + f16vec4(-0.141357421875hf, 0.042236328125hf, 0.1002197265625hf, -0.1798095703125hf), + f16vec4(-0.0243682861328125hf, 0.27294921875hf, -0.5712890625hf, 0.42919921875hf), + f16vec4(-0.1517333984375hf, 0.337890625hf, 0.147216796875hf, 0.10626220703125hf)); +const f16mat4 w0_6 = f16mat4( + f16vec4(-0.032257080078125hf, 0.1910400390625hf, 0.412353515625hf, -0.2159423828125hf), + f16vec4(0.042510986328125hf, -0.3427734375hf, 0.07861328125hf, 0.0307464599609375hf), + f16vec4(0.114501953125hf, -0.0192413330078125hf, 0.02166748046875hf, 0.064697265625hf), + f16vec4(-0.2587890625hf, 0.245361328125hf, 0.76708984375hf, 0.2318115234375hf)); +const f16mat4 w0_7 = f16mat4( + f16vec4(-0.44580078125hf, 0.2205810546875hf, 0.28564453125hf, -0.60888671875hf), + f16vec4(-0.580078125hf, -0.439697265625hf, 0.0021610260009765625hf, -0.10595703125hf), + f16vec4(-0.439453125hf, 0.297119140625hf, -0.1348876953125hf, -0.1226806640625hf), + f16vec4(0.30322265625hf, 0.35302734375hf, 0.8056640625hf, -0.280029296875hf)); +const f16mat4 w0_8 = f16mat4( + f16vec4(-0.3291015625hf, 0.452880859375hf, 0.73876953125hf, -0.95263671875hf), + f16vec4(-0.36572265625hf, -0.70068359375hf, 0.0106353759765625hf, 0.35400390625hf), + f16vec4(0.0131072998046875hf, 0.1820068359375hf, -0.11395263671875hf, 0.57666015625hf), + f16vec4(-0.420654296875hf, 0.3427734375hf, 0.75146484375hf, 0.36083984375hf)); +const f16mat4 w0_9 = f16mat4( + f16vec4(-0.082763671875hf, -0.01313018798828125hf, -0.1158447265625hf, -0.1724853515625hf), + f16vec4(-0.1824951171875hf, -0.67236328125hf, -0.2119140625hf, 0.043792724609375hf), + f16vec4(0.47314453125hf, -0.07110595703125hf, 0.1324462890625hf, 0.41748046875hf), + f16vec4(0.66650390625hf, -0.04510498046875hf, -0.20166015625hf, 0.2479248046875hf)); +const f16mat4 w0_10 = f16mat4( + f16vec4(0.06561279296875hf, -0.1776123046875hf, -0.1806640625hf, -0.1466064453125hf), + f16vec4(0.10272216796875hf, -0.5068359375hf, -0.1297607421875hf, 0.00243377685546875hf), + f16vec4(0.2086181640625hf, 0.04443359375hf, -0.1436767578125hf, 0.1502685546875hf), + f16vec4(0.206298828125hf, 0.08355712890625hf, -0.0278167724609375hf, -0.00853729248046875hf)); +const f16mat4 w0_11 = f16mat4( + f16vec4(0.00821685791015625hf, -0.2149658203125hf, 0.060516357421875hf, -0.0162811279296875hf), + f16vec4(-0.297119140625hf, -0.73095703125hf, -0.26513671875hf, 0.245849609375hf), + f16vec4(-0.1495361328125hf, -0.1632080078125hf, -0.144775390625hf, 0.029815673828125hf), + f16vec4(0.239501953125hf, -0.031646728515625hf, 0.2349853515625hf, -0.1585693359375hf)); +const f16mat4 w0_12 = f16mat4( + f16vec4(-0.1513671875hf, 0.40625hf, -0.2008056640625hf, -0.1602783203125hf), + f16vec4(-0.18310546875hf, -0.39306640625hf, -0.54638671875hf, -0.1212158203125hf), + f16vec4(0.378173828125hf, 0.1424560546875hf, -0.1043701171875hf, 0.58447265625hf), + f16vec4(0.703125hf, 0.6298828125hf, -0.312744140625hf, 0.137451171875hf)); +const f16mat4 w0_13 = f16mat4( + f16vec4(0.1756591796875hf, 0.5849609375hf, -0.025543212890625hf, -0.7607421875hf), + f16vec4(0.055267333984375hf, -0.339599609375hf, -0.25244140625hf, -0.298583984375hf), + f16vec4(-0.0260009765625hf, 0.142333984375hf, -0.2208251953125hf, 0.050048828125hf), + f16vec4(-0.0516357421875hf, 0.68603515625hf, -0.344482421875hf, -0.2509765625hf)); +const f16mat4 w0_14 = f16mat4( + f16vec4(-0.27587890625hf, 0.44921875hf, -0.07232666015625hf, -0.1617431640625hf), + f16vec4(-0.044158935546875hf, -0.341552734375hf, -0.44287109375hf, 0.12188720703125hf), + f16vec4(0.0439453125hf, 0.11737060546875hf, 0.148193359375hf, 0.141845703125hf), + f16vec4(0.15625hf, 0.4140625hf, -0.390625hf, 0.039215087890625hf)); +const f16mat4 w0_15 = f16mat4( + f16vec4(-0.2166748046875hf, -0.05706787109375hf, -0.10809326171875hf, -0.2041015625hf), + f16vec4(0.049163818359375hf, -0.1566162109375hf, -0.06939697265625hf, -0.165771484375hf), + f16vec4(0.7080078125hf, 0.31689453125hf, 0.7216796875hf, 0.7216796875hf), + f16vec4(0.57080078125hf, -0.144287109375hf, -0.458251953125hf, 0.1934814453125hf)); +const f16mat4 w0_16 = f16mat4( + f16vec4(0.160888671875hf, -0.2509765625hf, -0.2303466796875hf, -0.21630859375hf), + f16vec4(-0.01212310791015625hf, -0.08880615234375hf, -0.126708984375hf, 0.21826171875hf), + f16vec4(0.1805419921875hf, 0.132080078125hf, 0.394775390625hf, 0.5361328125hf), + f16vec4(0.4248046875hf, -0.0863037109375hf, -0.378173828125hf, 0.2034912109375hf)); +const f16mat4 w0_17 = f16mat4( + f16vec4(-0.0836181640625hf, -0.2020263671875hf, -0.124755859375hf, -0.020111083984375hf), + f16vec4(-0.005718231201171875hf, -0.188720703125hf, -0.0269927978515625hf, 0.1318359375hf), + f16vec4(0.05157470703125hf, 0.134765625hf, 0.49560546875hf, 0.53515625hf), + f16vec4(0.08367919921875hf, -0.07720947265625hf, -0.126953125hf, -0.0213470458984375hf)); +const f16vec4 q0_0 = f16vec4(0.74169921875hf, -0.384521484375hf, 0.309814453125hf, -0.422607421875hf); +const f16vec4 q0_1 = f16vec4(-0.053192138671875hf, -0.2008056640625hf, 0.322509765625hf, -0.48291015625hf); +const f16vec4 q0_2 = f16vec4(0.1064453125hf, -0.277099609375hf, 0.26708984375hf, -0.21044921875hf); +const f16vec4 q0_3 = f16vec4(0.348388671875hf, -0.2274169921875hf, -0.2296142578125hf, -0.489501953125hf); +const f16vec4 q0_4 = f16vec4(0.039154052734375hf, 0.1243896484375hf, -0.061920166015625hf, -0.5498046875hf); +const f16vec4 q0_5 = f16vec4(-0.0762939453125hf, -0.02117919921875hf, -0.348388671875hf, -0.1885986328125hf); +const f16vec4 q0_6 = f16vec4(0.310791015625hf, -0.075927734375hf, 0.2236328125hf, -0.103271484375hf); +const f16vec4 q0_7 = f16vec4(0.2244873046875hf, 0.05340576171875hf, 0.015350341796875hf, -0.07891845703125hf); +const f16vec4 q0_8 = f16vec4(-0.1776123046875hf, -0.165283203125hf, 0.08721923828125hf, -0.069091796875hf); +const f16vec4 sub0 = f16vec4(-0.36328125hf, 0.0218963623046875hf, -0.330810546875hf, -0.273193359375hf); +const f16vec4 mul0 = f16vec4(0.865234375hf, 0.8349609375hf, 1.1708984375hf, 0.52978515625hf); +const f16vec4 add0 = f16vec4(0.1678466796875hf, 0.55908203125hf, -0.104248046875hf, 0.274658203125hf); + +const f16mat4 w1_0 = f16mat4( + f16vec4(-0.05474853515625hf, 0.1591796875hf, -0.1016845703125hf, 0.0330810546875hf), + f16vec4(0.0809326171875hf, -0.2236328125hf, -0.0239410400390625hf, -0.1519775390625hf), + f16vec4(0.45849609375hf, 0.4248046875hf, 0.2344970703125hf, -0.29052734375hf), + f16vec4(-0.0595703125hf, -0.04608154296875hf, 0.27685546875hf, -0.278076171875hf)); +const f16mat4 w1_1 = f16mat4( + f16vec4(-0.13232421875hf, 0.1292724609375hf, 0.11993408203125hf, 0.106201171875hf), + f16vec4(-0.208984375hf, -0.222412109375hf, 0.237548828125hf, 0.365478515625hf), + f16vec4(0.419921875hf, 0.7373046875hf, 0.0099029541015625hf, 0.246337890625hf), + f16vec4(0.171142578125hf, -0.1075439453125hf, -0.349609375hf, -0.310791015625hf)); +const f16mat4 w1_2 = f16mat4( + f16vec4(0.039306640625hf, -0.035400390625hf, 0.23681640625hf, 0.333740234375hf), + f16vec4(-0.283447265625hf, -0.51953125hf, 0.6611328125hf, 0.200927734375hf), + f16vec4(0.7255859375hf, 0.98291015625hf, 0.9169921875hf, -0.310302734375hf), + f16vec4(-0.00272369384765625hf, -0.035430908203125hf, -0.11688232421875hf, 0.156982421875hf)); +const f16mat4 w1_3 = f16mat4( + f16vec4(0.2314453125hf, -0.34033203125hf, -0.08599853515625hf, 0.267333984375hf), + f16vec4(-0.2587890625hf, -0.277099609375hf, 0.24853515625hf, -0.2371826171875hf), + f16vec4(-0.0165252685546875hf, 0.292236328125hf, 0.1219482421875hf, 0.11163330078125hf), + f16vec4(0.5673828125hf, -0.478759765625hf, 0.00132083892822265625hf, -0.22802734375hf)); +const f16mat4 w1_4 = f16mat4( + f16vec4(-0.045684814453125hf, -0.1357421875hf, -0.16943359375hf, 0.537109375hf), + f16vec4(-0.806640625hf, -0.399658203125hf, -0.30419921875hf, 0.52197265625hf), + f16vec4(-0.1572265625hf, 0.042449951171875hf, 0.008087158203125hf, 0.36328125hf), + f16vec4(0.33642578125hf, -0.326171875hf, -0.427734375hf, -0.42138671875hf)); +const f16mat4 w1_5 = f16mat4( + f16vec4(0.1796875hf, -0.28076171875hf, 0.56884765625hf, 0.35791015625hf), + f16vec4(-0.435302734375hf, -0.234375hf, 0.806640625hf, 0.046905517578125hf), + f16vec4(0.312744140625hf, 0.07562255859375hf, 0.50830078125hf, -0.031280517578125hf), + f16vec4(0.2841796875hf, -0.491943359375hf, -0.01116180419921875hf, -0.0061187744140625hf)); +const f16mat4 w1_6 = f16mat4( + f16vec4(-0.06201171875hf, 0.1649169921875hf, 0.14892578125hf, 0.2218017578125hf), + f16vec4(0.2032470703125hf, -0.045166015625hf, 0.06890869140625hf, -0.06744384765625hf), + f16vec4(0.2178955078125hf, -0.297119140625hf, -0.223876953125hf, 0.05047607421875hf), + f16vec4(0.27392578125hf, -0.163818359375hf, -0.33447265625hf, -0.454345703125hf)); +const f16mat4 w1_7 = f16mat4( + f16vec4(-0.2286376953125hf, 0.3203125hf, -0.062744140625hf, 0.6728515625hf), + f16vec4(-0.250244140625hf, -0.0377197265625hf, 0.32958984375hf, 0.3798828125hf), + f16vec4(0.17822265625hf, 0.041534423828125hf, 0.1689453125hf, 0.138916015625hf), + f16vec4(0.405517578125hf, -0.1505126953125hf, -0.292236328125hf, -0.6318359375hf)); +const f16mat4 w1_8 = f16mat4( + f16vec4(0.07904052734375hf, 0.10772705078125hf, 0.64501953125hf, 0.322998046875hf), + f16vec4(-0.1339111328125hf, -0.38037109375hf, 0.6181640625hf, 0.10491943359375hf), + f16vec4(0.25439453125hf, 0.12164306640625hf, 0.53125hf, 0.027618408203125hf), + f16vec4(0.2398681640625hf, -0.26025390625hf, -0.33154296875hf, -0.388427734375hf)); +const f16mat4 w1_9 = f16mat4( + f16vec4(-0.40966796875hf, 0.01070404052734375hf, 0.1680908203125hf, -0.470703125hf), + f16vec4(0.42822265625hf, 0.47265625hf, -0.357666015625hf, -0.53857421875hf), + f16vec4(0.2548828125hf, -0.00714874267578125hf, 0.2169189453125hf, -0.135009765625hf), + f16vec4(-0.486328125hf, -0.261474609375hf, -0.141845703125hf, 0.3916015625hf)); +const f16mat4 w1_10 = f16mat4( + f16vec4(-0.7880859375hf, 0.0670166015625hf, -0.125244140625hf, -0.50439453125hf), + f16vec4(0.72216796875hf, 0.74169921875hf, -0.12841796875hf, -0.5205078125hf), + f16vec4(0.260009765625hf, 0.25048828125hf, -0.34765625hf, -0.052093505859375hf), + f16vec4(-0.188720703125hf, 0.09100341796875hf, -0.408203125hf, 0.250244140625hf)); +const f16mat4 w1_11 = f16mat4( + f16vec4(-0.432373046875hf, -0.002803802490234375hf, -0.046722412109375hf, -0.0902099609375hf), + f16vec4(0.293212890625hf, 0.44580078125hf, -0.207763671875hf, -0.416748046875hf), + f16vec4(-0.02154541015625hf, 0.0745849609375hf, 0.1854248046875hf, -0.1754150390625hf), + f16vec4(-0.13427734375hf, -0.049346923828125hf, -0.1302490234375hf, 0.055694580078125hf)); +const f16mat4 w1_12 = f16mat4( + f16vec4(-0.6923828125hf, 0.135009765625hf, -0.131591796875hf, -0.320068359375hf), + f16vec4(-0.040802001953125hf, 0.292724609375hf, 0.09393310546875hf, -0.1571044921875hf), + f16vec4(0.49755859375hf, -0.301513671875hf, 0.160400390625hf, 0.3310546875hf), + f16vec4(-0.64599609375hf, 0.21923828125hf, -0.22509765625hf, 0.82421875hf)); +const f16mat4 w1_13 = f16mat4( + f16vec4(-1.275390625hf, 0.01099395751953125hf, -0.2178955078125hf, -0.7529296875hf), + f16vec4(0.1422119140625hf, -0.381591796875hf, -0.447021484375hf, -0.53076171875hf), + f16vec4(0.2484130859375hf, -0.246337890625hf, -0.2109375hf, -0.172119140625hf), + f16vec4(-0.55859375hf, -0.2073974609375hf, -0.2486572265625hf, -0.15234375hf)); +const f16mat4 w1_14 = f16mat4( + f16vec4(-0.5341796875hf, 0.0092315673828125hf, -0.054168701171875hf, -0.6044921875hf), + f16vec4(0.317138671875hf, 0.214599609375hf, -0.2174072265625hf, -0.1719970703125hf), + f16vec4(0.2003173828125hf, -0.44873046875hf, 0.051910400390625hf, 0.2186279296875hf), + f16vec4(-0.2095947265625hf, -0.00936126708984375hf, -0.2159423828125hf, 0.135986328125hf)); +const f16mat4 w1_15 = f16mat4( + f16vec4(-0.32568359375hf, -0.0120697021484375hf, 0.053558349609375hf, -0.395263671875hf), + f16vec4(0.193603515625hf, -0.011932373046875hf, 0.1298828125hf, -0.203369140625hf), + f16vec4(0.476806640625hf, -0.148193359375hf, 0.09368896484375hf, 0.2027587890625hf), + f16vec4(-0.2626953125hf, -0.39453125hf, -0.07989501953125hf, 0.382568359375hf)); +const f16mat4 w1_16 = f16mat4( + f16vec4(-0.73828125hf, -0.141357421875hf, -0.135009765625hf, -0.501953125hf), + f16vec4(0.1700439453125hf, 0.12432861328125hf, -0.1968994140625hf, -0.318115234375hf), + f16vec4(0.311279296875hf, 0.00620269775390625hf, -0.245361328125hf, -0.327392578125hf), + f16vec4(-0.08575439453125hf, 0.1072998046875hf, -0.4140625hf, 0.0071868896484375hf)); +const f16mat4 w1_17 = f16mat4( + f16vec4(-0.1844482421875hf, -0.00603485107421875hf, -0.08709716796875hf, -0.18701171875hf), + f16vec4(0.0162353515625hf, 0.10382080078125hf, -0.080810546875hf, 0.129150390625hf), + f16vec4(0.302734375hf, 0.07330322265625hf, 0.11444091796875hf, 0.11517333984375hf), + f16vec4(0.051300048828125hf, 0.1199951171875hf, -0.07733154296875hf, 0.1041259765625hf)); +const f16vec4 q1_0 = f16vec4(0.206298828125hf, 0.67919921875hf, -0.1761474609375hf, 0.6943359375hf); +const f16vec4 q1_1 = f16vec4(0.206787109375hf, 0.394287109375hf, -0.32080078125hf, 0.2208251953125hf); +const f16vec4 q1_2 = f16vec4(-0.065185546875hf, 0.289306640625hf, -0.053070068359375hf, 0.2939453125hf); +const f16vec4 q1_3 = f16vec4(-0.24609375hf, 0.002658843994140625hf, 0.055450439453125hf, 0.658203125hf); +const f16vec4 q1_4 = f16vec4(-0.0087127685546875hf, -0.1195068359375hf, -0.3974609375hf, 0.017730712890625hf); +const f16vec4 q1_5 = f16vec4(-0.0303955078125hf, 0.181396484375hf, -0.08197021484375hf, 0.25390625hf); +const f16vec4 q1_6 = f16vec4(0.11102294921875hf, 0.07830810546875hf, 0.0693359375hf, 0.2335205078125hf); +const f16vec4 q1_7 = f16vec4(0.064697265625hf, 0.271728515625hf, -0.452392578125hf, 0.1126708984375hf); +const f16vec4 q1_8 = f16vec4(-0.1051025390625hf, -0.309814453125hf, 0.0098876953125hf, 0.0247802734375hf); +const f16vec4 sub1 = f16vec4(-0.7783203125hf, -0.285400390625hf, -0.50341796875hf, -0.54150390625hf); +const f16vec4 mul1 = f16vec4(0.88037109375hf, 1.3310546875hf, 0.83740234375hf, 0.91845703125hf); +const f16vec4 add1 = f16vec4(-0.340576171875hf, 0.07049560546875hf, 0.0181732177734375hf, -0.1435546875hf); + +void main() +{ + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 ext = imageSize(dstA); + if (p.x >= ext.x || p.y >= ext.y) + return; + + f16vec4 t0 = padTap(srcA, p + ivec2(-1, -1)); + f16vec4 t1 = padTap(srcA, p + ivec2(-1, 0)); + f16vec4 t2 = padTap(srcA, p + ivec2(-1, 1)); + f16vec4 t3 = padTap(srcA, p + ivec2(0, -1)); + f16vec4 t4 = f16vec4(texelFetch(srcA, p, 0)); + f16vec4 t5 = padTap(srcA, p + ivec2(0, 1)); + f16vec4 t6 = padTap(srcA, p + ivec2(1, -1)); + f16vec4 t7 = padTap(srcA, p + ivec2(1, 0)); + f16vec4 t8 = padTap(srcA, p + ivec2(1, 1)); + f16vec4 t9 = padTap(srcB, p + ivec2(-1, -1)); + f16vec4 t10 = padTap(srcB, p + ivec2(-1, 0)); + f16vec4 t11 = padTap(srcB, p + ivec2(-1, 1)); + f16vec4 t12 = padTap(srcB, p + ivec2(0, -1)); + f16vec4 t13 = f16vec4(texelFetch(srcB, p, 0)); + f16vec4 t14 = padTap(srcB, p + ivec2(0, 1)); + f16vec4 t15 = padTap(srcB, p + ivec2(1, -1)); + f16vec4 t16 = padTap(srcB, p + ivec2(1, 0)); + f16vec4 t17 = padTap(srcB, p + ivec2(1, 1)); + float16_t s0 = padTap(srcC, p + ivec2(-1, -1)).r; + float16_t s1 = padTap(srcC, p + ivec2(-1, 0)).r; + float16_t s2 = padTap(srcC, p + ivec2(-1, 1)).r; + float16_t s3 = padTap(srcC, p + ivec2(0, -1)).r; + float16_t s4 = float16_t(texelFetch(srcC, p, 0).r); + float16_t s5 = padTap(srcC, p + ivec2(0, 1)).r; + float16_t s6 = padTap(srcC, p + ivec2(1, -1)).r; + float16_t s7 = padTap(srcC, p + ivec2(1, 0)).r; + float16_t s8 = padTap(srcC, p + ivec2(1, 1)).r; + + f16vec4 r0 = w0_0 * t0; + r0 += w0_1 * t1; + r0 += w0_2 * t2; + r0 += w0_3 * t3; + r0 += w0_4 * t4; + r0 += w0_5 * t5; + r0 += w0_6 * t6; + r0 += w0_7 * t7; + r0 += w0_8 * t8; + r0 += w0_9 * t9; + r0 += w0_10 * t10; + r0 += w0_11 * t11; + r0 += w0_12 * t12; + r0 += w0_13 * t13; + r0 += w0_14 * t14; + r0 += w0_15 * t15; + r0 += w0_16 * t16; + r0 += w0_17 * t17; + r0 += q0_0 * s0; + r0 += q0_1 * s1; + r0 += q0_2 * s2; + r0 += q0_3 * s3; + r0 += q0_4 * s4; + r0 += q0_5 * s5; + r0 += q0_6 * s6; + r0 += q0_7 * s7; + r0 += q0_8 * s8; + r0 = (r0 - sub0) * mul0 + add0; + imageStore(dstA, p, vec4(r0)); + + f16vec4 r1 = w1_0 * t0; + r1 += w1_1 * t1; + r1 += w1_2 * t2; + r1 += w1_3 * t3; + r1 += w1_4 * t4; + r1 += w1_5 * t5; + r1 += w1_6 * t6; + r1 += w1_7 * t7; + r1 += w1_8 * t8; + r1 += w1_9 * t9; + r1 += w1_10 * t10; + r1 += w1_11 * t11; + r1 += w1_12 * t12; + r1 += w1_13 * t13; + r1 += w1_14 * t14; + r1 += w1_15 * t15; + r1 += w1_16 * t16; + r1 += w1_17 * t17; + r1 += q1_0 * s0; + r1 += q1_1 * s1; + r1 += q1_2 * s2; + r1 += q1_3 * s3; + r1 += q1_4 * s4; + r1 += q1_5 * s5; + r1 += q1_6 * s6; + r1 += q1_7 * s7; + r1 += q1_8 * s8; + r1 = (r1 - sub1) * mul1 + add1; + imageStore(dstB, p, vec4(r1)); +} diff --git a/cleanroom/glsl/shader_16.comp b/cleanroom/glsl/shader_16.comp new file mode 100644 index 0000000..cb3a827 --- /dev/null +++ b/cleanroom/glsl/shader_16.comp @@ -0,0 +1,279 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_16: 3x3 stride-1 conv, 8->8 channels, zero-padded texelFetch + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcA; +layout(set = 0, binding = 33) uniform sampler2D srcB; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstA; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; + +// zero-padded fetch for non-center taps +f16vec4 padTap(sampler2D img, ivec2 c) +{ + bool inb = c.x >= 0 && c.y >= 0; + if (inb) { + ivec2 sz = textureSize(img, 0); + inb = c.x < sz.x && c.y < sz.y; + } + return inb ? f16vec4(texelFetch(img, c, 0)) : f16vec4(0.0hf); +} + +const f16mat4 w0_0 = f16mat4( + f16vec4(-0.493408203125hf, 0.1939697265625hf, 0.2381591796875hf, -0.056488037109375hf), + f16vec4(0.46142578125hf, -0.11871337890625hf, 1.103515625hf, 0.44580078125hf), + f16vec4(0.56884765625hf, 0.405029296875hf, 0.317138671875hf, 0.299560546875hf), + f16vec4(-0.449462890625hf, -0.93798828125hf, 0.62841796875hf, 0.033233642578125hf)); +const f16mat4 w0_1 = f16mat4( + f16vec4(-0.197021484375hf, -0.2354736328125hf, -0.02923583984375hf, 0.0042266845703125hf), + f16vec4(-0.1624755859375hf, -0.18359375hf, 0.3349609375hf, -0.0968017578125hf), + f16vec4(0.2332763671875hf, 0.492919921875hf, 0.006267547607421875hf, 0.315185546875hf), + f16vec4(0.044708251953125hf, -0.1923828125hf, 0.34521484375hf, 0.413818359375hf)); +const f16mat4 w0_2 = f16mat4( + f16vec4(-0.3369140625hf, 0.3515625hf, 0.865234375hf, 0.76171875hf), + f16vec4(0.60498046875hf, -0.1842041015625hf, 0.599609375hf, 0.4453125hf), + f16vec4(0.16357421875hf, 0.501953125hf, 0.401123046875hf, 0.06292724609375hf), + f16vec4(-0.167724609375hf, -0.89404296875hf, 0.3095703125hf, 0.178466796875hf)); +const f16mat4 w0_3 = f16mat4( + f16vec4(0.0457763671875hf, 0.383056640625hf, 0.19970703125hf, 0.020721435546875hf), + f16vec4(-0.0036258697509765625hf, -0.0235443115234375hf, -0.0265045166015625hf, -0.52734375hf), + f16vec4(-0.1273193359375hf, 0.10345458984375hf, -0.00798797607421875hf, -0.0145111083984375hf), + f16vec4(-0.72119140625hf, -0.31103515625hf, 0.107177734375hf, 0.71142578125hf)); +const f16mat4 w0_4 = f16mat4( + f16vec4(0.39453125hf, -0.059814453125hf, -0.7021484375hf, 0.10986328125hf), + f16vec4(-0.8212890625hf, -0.0026226043701171875hf, -0.75537109375hf, -0.744140625hf), + f16vec4(-0.369140625hf, 0.0802001953125hf, -0.42822265625hf, 0.0830078125hf), + f16vec4(0.5947265625hf, 0.6328125hf, 0.4228515625hf, 0.86474609375hf)); +const f16mat4 w0_5 = f16mat4( + f16vec4(-0.07421875hf, 0.1768798828125hf, 0.1458740234375hf, 0.7294921875hf), + f16vec4(-0.290283203125hf, -0.1663818359375hf, -0.05487060546875hf, -0.24072265625hf), + f16vec4(0.0745849609375hf, 0.2396240234375hf, 0.002422332763671875hf, -0.05615234375hf), + f16vec4(-0.7138671875hf, -0.311279296875hf, 0.157470703125hf, 0.65283203125hf)); +const f16mat4 w0_6 = f16mat4( + f16vec4(-0.9208984375hf, -0.02105712890625hf, 0.422119140625hf, -0.1036376953125hf), + f16vec4(0.2340087890625hf, -0.15478515625hf, 1.0703125hf, -0.052581787109375hf), + f16vec4(0.37548828125hf, 0.078125hf, 0.1370849609375hf, -0.08099365234375hf), + f16vec4(-0.04168701171875hf, -0.93798828125hf, 0.052001953125hf, 0.08935546875hf)); +const f16mat4 w0_7 = f16mat4( + f16vec4(-0.08380126953125hf, -0.0234527587890625hf, -0.0174713134765625hf, 0.08306884765625hf), + f16vec4(-0.0751953125hf, -0.01885986328125hf, 0.133544921875hf, -0.1485595703125hf), + f16vec4(0.5927734375hf, 0.303955078125hf, 0.1588134765625hf, 0.137451171875hf), + f16vec4(-0.61865234375hf, -0.0838623046875hf, 0.509765625hf, 0.2027587890625hf)); +const f16mat4 w0_8 = f16mat4( + f16vec4(-0.47216796875hf, 0.150390625hf, 0.3291015625hf, 0.68115234375hf), + f16vec4(0.62890625hf, -0.0633544921875hf, 0.55517578125hf, 0.50634765625hf), + f16vec4(0.11285400390625hf, 0.123291015625hf, 0.54248046875hf, -0.1658935546875hf), + f16vec4(-0.57861328125hf, -0.796875hf, 0.273681640625hf, -0.12469482421875hf)); +const f16mat4 w0_9 = f16mat4( + f16vec4(0.15673828125hf, 0.54443359375hf, 0.1700439453125hf, 0.08514404296875hf), + f16vec4(-0.1995849609375hf, 0.01479339599609375hf, -0.344970703125hf, 0.185546875hf), + f16vec4(0.78759765625hf, 0.2154541015625hf, -0.5224609375hf, 0.47265625hf), + f16vec4(0.07470703125hf, 0.059906005859375hf, -0.239013671875hf, 0.338134765625hf)); +const f16mat4 w0_10 = f16mat4( + f16vec4(0.04876708984375hf, 0.63232421875hf, 0.2509765625hf, 0.0736083984375hf), + f16vec4(-0.4072265625hf, 0.1773681640625hf, 0.00811004638671875hf, -0.181640625hf), + f16vec4(-0.2041015625hf, -0.016937255859375hf, 0.288818359375hf, 0.266357421875hf), + f16vec4(0.084716796875hf, -0.01154327392578125hf, -0.0341796875hf, 0.236328125hf)); +const f16mat4 w0_11 = f16mat4( + f16vec4(-0.01348114013671875hf, 0.515625hf, 0.23193359375hf, -0.05926513671875hf), + f16vec4(0.03363037109375hf, 0.0753173828125hf, -0.5380859375hf, 0.52734375hf), + f16vec4(0.74365234375hf, -0.0927734375hf, -0.36376953125hf, 0.00441741943359375hf), + f16vec4(-0.034393310546875hf, 0.046173095703125hf, 0.08905029296875hf, 0.74560546875hf)); +const f16mat4 w0_12 = f16mat4( + f16vec4(0.11749267578125hf, 0.68896484375hf, 0.10858154296875hf, 0.287353515625hf), + f16vec4(0.137939453125hf, -0.14990234375hf, -0.06512451171875hf, 0.08465576171875hf), + f16vec4(-0.2025146484375hf, 0.26416015625hf, -0.54052734375hf, 0.7041015625hf), + f16vec4(0.07928466796875hf, -0.0298614501953125hf, -0.05194091796875hf, 0.69384765625hf)); +const f16mat4 w0_13 = f16mat4( + f16vec4(0.162353515625hf, 0.71728515625hf, 0.15771484375hf, 0.185302734375hf), + f16vec4(-0.328369140625hf, -0.186767578125hf, 0.0662841796875hf, -0.466552734375hf), + f16vec4(-0.517578125hf, 0.1171875hf, 0.1663818359375hf, 0.4912109375hf), + f16vec4(0.075927734375hf, 0.1082763671875hf, -0.0179290771484375hf, 0.2366943359375hf)); +const f16mat4 w0_14 = f16mat4( + f16vec4(-0.01080322265625hf, 0.7392578125hf, 0.037078857421875hf, 0.171875hf), + f16vec4(-0.103759765625hf, -0.1458740234375hf, -0.356689453125hf, 0.020172119140625hf), + f16vec4(0.220703125hf, 0.297607421875hf, -0.321533203125hf, 0.4169921875hf), + f16vec4(-0.0029964447021484375hf, -0.02337646484375hf, -0.16162109375hf, 0.693359375hf)); +const f16mat4 w0_15 = f16mat4( + f16vec4(0.01513671875hf, 0.37646484375hf, -0.01171875hf, 0.08929443359375hf), + f16vec4(-0.355712890625hf, 0.5703125hf, -0.7880859375hf, 0.1982421875hf), + f16vec4(0.33154296875hf, 0.05963134765625hf, -0.477783203125hf, 0.487060546875hf), + f16vec4(0.384765625hf, 0.160400390625hf, -0.06671142578125hf, 0.5234375hf)); +const f16mat4 w0_16 = f16mat4( + f16vec4(0.148193359375hf, 0.8017578125hf, 0.23876953125hf, -0.026458740234375hf), + f16vec4(-0.552734375hf, 0.5625hf, -0.346923828125hf, -0.34716796875hf), + f16vec4(0.36181640625hf, -0.016845703125hf, -0.040802001953125hf, 0.24609375hf), + f16vec4(0.25634765625hf, 0.138671875hf, 0.06829833984375hf, 0.317138671875hf)); +const f16mat4 w0_17 = f16mat4( + f16vec4(0.052337646484375hf, 0.609375hf, 0.09295654296875hf, -0.09185791015625hf), + f16vec4(-0.55712890625hf, 0.4736328125hf, -0.63720703125hf, 0.425048828125hf), + f16vec4(0.188232421875hf, -0.1663818359375hf, -0.496337890625hf, -0.115234375hf), + f16vec4(0.1085205078125hf, -0.00677490234375hf, 0.038238525390625hf, 0.47509765625hf)); +const f16vec4 sub0 = f16vec4(-0.8115234375hf, 0.84521484375hf, 1.7236328125hf, 3.65234375hf); +const f16vec4 mul0 = f16vec4(0.436767578125hf, 0.34619140625hf, 0.28955078125hf, 0.299072265625hf); +const f16vec4 add0 = f16vec4(-0.302490234375hf, -0.2030029296875hf, -0.2271728515625hf, -0.40478515625hf); + +const f16mat4 w1_0 = f16mat4( + f16vec4(-0.37109375hf, 0.8583984375hf, -0.262939453125hf, -1.21484375hf), + f16vec4(0.403076171875hf, 0.1903076171875hf, -0.43359375hf, 0.12322998046875hf), + f16vec4(0.04974365234375hf, -0.352294921875hf, -1.09765625hf, 0.00936126708984375hf), + f16vec4(-0.2359619140625hf, -0.1455078125hf, 0.1185302734375hf, 0.18994140625hf)); +const f16mat4 w1_1 = f16mat4( + f16vec4(-0.104248046875hf, 0.041259765625hf, 0.0794677734375hf, -0.6572265625hf), + f16vec4(-0.2919921875hf, -0.36767578125hf, -0.3310546875hf, -0.5810546875hf), + f16vec4(0.382080078125hf, -0.30859375hf, -0.309814453125hf, -0.060577392578125hf), + f16vec4(-0.1326904296875hf, -0.14794921875hf, 0.296142578125hf, 0.1824951171875hf)); +const f16mat4 w1_2 = f16mat4( + f16vec4(0.54638671875hf, 0.634765625hf, -0.2099609375hf, -1.3818359375hf), + f16vec4(0.254150390625hf, -0.26318359375hf, -0.4775390625hf, -0.2034912109375hf), + f16vec4(0.443603515625hf, -0.08551025390625hf, -1.2529296875hf, 0.08026123046875hf), + f16vec4(0.2266845703125hf, 0.00812530517578125hf, -0.152587890625hf, 0.050628662109375hf)); +const f16mat4 w1_3 = f16mat4( + f16vec4(-0.3251953125hf, -0.0112762451171875hf, -0.2098388671875hf, -0.360595703125hf), + f16vec4(0.08441162109375hf, -0.07318115234375hf, -0.32958984375hf, 0.143798828125hf), + f16vec4(-0.11712646484375hf, 0.061431884765625hf, -0.11724853515625hf, -0.00704193115234375hf), + f16vec4(-0.32373046875hf, -0.08074951171875hf, 0.10540771484375hf, 0.29736328125hf)); +const f16mat4 w1_4 = f16mat4( + f16vec4(-0.061492919921875hf, -0.72607421875hf, 0.345458984375hf, 0.5693359375hf), + f16vec4(-0.65478515625hf, 0.02435302734375hf, 0.4111328125hf, -0.326171875hf), + f16vec4(0.36279296875hf, 0.2198486328125hf, 0.287353515625hf, 0.0263824462890625hf), + f16vec4(-0.06427001953125hf, -0.64111328125hf, -0.004238128662109375hf, 0.43603515625hf)); +const f16mat4 w1_5 = f16mat4( + f16vec4(0.463134765625hf, 0.036895751953125hf, -0.11468505859375hf, -0.2978515625hf), + f16vec4(-0.08245849609375hf, -0.134765625hf, -0.1199951171875hf, -0.1669921875hf), + f16vec4(0.301025390625hf, 0.2257080078125hf, -0.305908203125hf, 0.043670654296875hf), + f16vec4(0.27685546875hf, -0.0250091552734375hf, 0.1922607421875hf, 0.5068359375hf)); +const f16mat4 w1_6 = f16mat4( + f16vec4(-0.2459716796875hf, 0.8408203125hf, -0.4423828125hf, -1.220703125hf), + f16vec4(-0.196044921875hf, 0.01012420654296875hf, -0.5634765625hf, -0.08807373046875hf), + f16vec4(-0.67431640625hf, -0.4658203125hf, -0.57666015625hf, 0.00562286376953125hf), + f16vec4(-0.30029296875hf, -0.15869140625hf, 0.291259765625hf, -0.1865234375hf)); +const f16mat4 w1_7 = f16mat4( + f16vec4(0.0853271484375hf, 0.270751953125hf, 0.033660888671875hf, -0.46337890625hf), + f16vec4(-0.7939453125hf, -0.279296875hf, -0.222900390625hf, -0.5927734375hf), + f16vec4(-0.2958984375hf, -0.2073974609375hf, -0.1290283203125hf, -0.039794921875hf), + f16vec4(-0.1158447265625hf, -0.028900146484375hf, 0.1522216796875hf, 0.20458984375hf)); +const f16mat4 w1_8 = f16mat4( + f16vec4(0.54150390625hf, 0.5234375hf, -0.03466796875hf, -1.3486328125hf), + f16vec4(-0.311767578125hf, -0.254150390625hf, -0.325439453125hf, -0.299560546875hf), + f16vec4(-0.36279296875hf, -0.1259765625hf, -1.0263671875hf, -0.07305908203125hf), + f16vec4(0.55859375hf, 0.4560546875hf, 0.09246826171875hf, 0.299560546875hf)); +const f16mat4 w1_9 = f16mat4( + f16vec4(-0.1392822265625hf, -0.09454345703125hf, 0.107421875hf, 0.0740966796875hf), + f16vec4(-0.0703125hf, 0.74365234375hf, 0.552734375hf, 0.0743408203125hf), + f16vec4(0.45263671875hf, -0.9169921875hf, 0.2032470703125hf, 0.428955078125hf), + f16vec4(-0.25634765625hf, 0.33447265625hf, 0.045196533203125hf, 0.11297607421875hf)); +const f16mat4 w1_10 = f16mat4( + f16vec4(-0.2484130859375hf, -0.093505859375hf, -0.024566650390625hf, -0.01715087890625hf), + f16vec4(-0.385009765625hf, -0.169921875hf, -0.06756591796875hf, -0.33935546875hf), + f16vec4(-0.47900390625hf, -0.51953125hf, -0.049713134765625hf, -0.1412353515625hf), + f16vec4(-0.37060546875hf, 0.25927734375hf, 0.11083984375hf, 0.11053466796875hf)); +const f16mat4 w1_11 = f16mat4( + f16vec4(-0.174072265625hf, -0.055511474609375hf, -0.03778076171875hf, -0.189697265625hf), + f16vec4(-0.10760498046875hf, 0.0728759765625hf, 0.79833984375hf, -0.05694580078125hf), + f16vec4(-0.51806640625hf, -1.2197265625hf, 0.291015625hf, 0.52392578125hf), + f16vec4(0.1201171875hf, 0.369873046875hf, -0.039459228515625hf, 0.250244140625hf)); +const f16mat4 w1_12 = f16mat4( + f16vec4(-0.25048828125hf, 0.09490966796875hf, 0.43798828125hf, 0.040283203125hf), + f16vec4(-0.335205078125hf, 0.08984375hf, 0.005817413330078125hf, 0.06597900390625hf), + f16vec4(0.4404296875hf, 0.11322021484375hf, -0.087890625hf, -0.0230712890625hf), + f16vec4(-0.466552734375hf, 0.0117034912109375hf, -0.366455078125hf, 0.049652099609375hf)); +const f16mat4 w1_13 = f16mat4( + f16vec4(-0.251708984375hf, 0.078857421875hf, 0.356201171875hf, -0.03436279296875hf), + f16vec4(-0.74462890625hf, -0.724609375hf, -0.86767578125hf, -0.355224609375hf), + f16vec4(-0.366455078125hf, 0.6748046875hf, -0.362548828125hf, -0.7294921875hf), + f16vec4(-0.66064453125hf, -0.0694580078125hf, -0.2056884765625hf, 0.038726806640625hf)); +const f16mat4 w1_14 = f16mat4( + f16vec4(-0.295654296875hf, 0.1781005859375hf, 0.487548828125hf, -0.09674072265625hf), + f16vec4(-0.62939453125hf, 0.2626953125hf, -0.153564453125hf, -0.06121826171875hf), + f16vec4(-0.4697265625hf, -0.1427001953125hf, 0.08282470703125hf, 0.024505615234375hf), + f16vec4(-0.29150390625hf, 0.0789794921875hf, -0.27783203125hf, 0.073486328125hf)); +const f16mat4 w1_15 = f16mat4( + f16vec4(0.0474853515625hf, -0.025787353515625hf, 0.06396484375hf, 0.0968017578125hf), + f16vec4(0.354736328125hf, 0.309814453125hf, 0.318359375hf, 0.248046875hf), + f16vec4(0.802734375hf, -0.98779296875hf, 0.17529296875hf, 0.468505859375hf), + f16vec4(-0.2010498046875hf, 0.40087890625hf, 0.2413330078125hf, 0.1617431640625hf)); +const f16mat4 w1_16 = f16mat4( + f16vec4(-0.2061767578125hf, -0.11798095703125hf, 0.1390380859375hf, -0.055633544921875hf), + f16vec4(0.00370025634765625hf, -0.272216796875hf, 0.086669921875hf, -0.3427734375hf), + f16vec4(-0.3291015625hf, -0.39111328125hf, 0.1134033203125hf, -0.0020427703857421875hf), + f16vec4(-0.25hf, 0.278076171875hf, 0.1669921875hf, 0.1024169921875hf)); +const f16mat4 w1_17 = f16mat4( + f16vec4(-0.1727294921875hf, -0.1502685546875hf, 0.1876220703125hf, -0.0819091796875hf), + f16vec4(0.293701171875hf, 0.33935546875hf, 0.51611328125hf, 0.0394287109375hf), + f16vec4(-0.1339111328125hf, -0.81982421875hf, 0.2137451171875hf, 0.57177734375hf), + f16vec4(0.199951171875hf, 0.248046875hf, 0.04522705078125hf, 0.1513671875hf)); +const f16vec4 sub1 = f16vec4(-2.150390625hf, -0.712890625hf, -1.279296875hf, -1.978515625hf); +const f16vec4 mul1 = f16vec4(0.261474609375hf, 0.38916015625hf, 0.387939453125hf, 0.4169921875hf); +const f16vec4 add1 = f16vec4(0.94677734375hf, -0.2471923828125hf, -0.282470703125hf, -0.5048828125hf); + +void main() +{ + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 ext = imageSize(dstA); + if (p.x >= ext.x || p.y >= ext.y) + return; + + f16vec4 t0 = padTap(srcA, p + ivec2(-1, -1)); + f16vec4 t1 = padTap(srcA, p + ivec2(-1, 0)); + f16vec4 t2 = padTap(srcA, p + ivec2(-1, 1)); + f16vec4 t3 = padTap(srcA, p + ivec2(0, -1)); + f16vec4 t4 = f16vec4(texelFetch(srcA, p, 0)); + f16vec4 t5 = padTap(srcA, p + ivec2(0, 1)); + f16vec4 t6 = padTap(srcA, p + ivec2(1, -1)); + f16vec4 t7 = padTap(srcA, p + ivec2(1, 0)); + f16vec4 t8 = padTap(srcA, p + ivec2(1, 1)); + f16vec4 t9 = padTap(srcB, p + ivec2(-1, -1)); + f16vec4 t10 = padTap(srcB, p + ivec2(-1, 0)); + f16vec4 t11 = padTap(srcB, p + ivec2(-1, 1)); + f16vec4 t12 = padTap(srcB, p + ivec2(0, -1)); + f16vec4 t13 = f16vec4(texelFetch(srcB, p, 0)); + f16vec4 t14 = padTap(srcB, p + ivec2(0, 1)); + f16vec4 t15 = padTap(srcB, p + ivec2(1, -1)); + f16vec4 t16 = padTap(srcB, p + ivec2(1, 0)); + f16vec4 t17 = padTap(srcB, p + ivec2(1, 1)); + + f16vec4 r0 = w0_0 * t0; + r0 += w0_1 * t1; + r0 += w0_2 * t2; + r0 += w0_3 * t3; + r0 += w0_4 * t4; + r0 += w0_5 * t5; + r0 += w0_6 * t6; + r0 += w0_7 * t7; + r0 += w0_8 * t8; + r0 += w0_9 * t9; + r0 += w0_10 * t10; + r0 += w0_11 * t11; + r0 += w0_12 * t12; + r0 += w0_13 * t13; + r0 += w0_14 * t14; + r0 += w0_15 * t15; + r0 += w0_16 * t16; + r0 += w0_17 * t17; + r0 = (r0 - sub0) * mul0 + add0; + imageStore(dstA, p, vec4(r0)); + + f16vec4 r1 = w1_0 * t0; + r1 += w1_1 * t1; + r1 += w1_2 * t2; + r1 += w1_3 * t3; + r1 += w1_4 * t4; + r1 += w1_5 * t5; + r1 += w1_6 * t6; + r1 += w1_7 * t7; + r1 += w1_8 * t8; + r1 += w1_9 * t9; + r1 += w1_10 * t10; + r1 += w1_11 * t11; + r1 += w1_12 * t12; + r1 += w1_13 * t13; + r1 += w1_14 * t14; + r1 += w1_15 * t15; + r1 += w1_16 * t16; + r1 += w1_17 * t17; + r1 = (r1 - sub1) * mul1 + add1; + imageStore(dstB, p, vec4(r1)); +} diff --git a/cleanroom/glsl/shader_17.comp b/cleanroom/glsl/shader_17.comp new file mode 100644 index 0000000..6c5dae9 --- /dev/null +++ b/cleanroom/glsl/shader_17.comp @@ -0,0 +1,196 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// Fused two-layer 3x3 fp16 conv network: 2 input images -> 2 hidden planes +// (shared-memory tile, 16x16 outputs + 1-texel halo) -> 2 output images. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D uSrc0; +layout(set = 0, binding = 33) uniform sampler2D uSrc1; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D uDst0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D uDst1; + +shared f16vec4 gHid0[18][18]; +shared f16vec4 gHid1[18][18]; + +const ivec2 kTap[9] = ivec2[9]( + ivec2(-1, -1), ivec2(-1, 0), ivec2(-1, 1), + ivec2(0, -1), ivec2(0, 0), ivec2(0, 1), + ivec2(1, -1), ivec2(1, 0), ivec2(1, 1) +); + +const f16mat4 kW1A[18] = f16mat4[18]( + f16mat4(f16vec4(-0.493408203125hf, 0.1939697265625hf, 0.2381591796875hf, -0.056488037109375hf), f16vec4(0.46142578125hf, -0.11871337890625hf, 1.103515625hf, 0.44580078125hf), f16vec4(0.56884765625hf, 0.405029296875hf, 0.317138671875hf, 0.299560546875hf), f16vec4(-0.449462890625hf, -0.93798828125hf, 0.62841796875hf, 0.033233642578125hf)), + f16mat4(f16vec4(-0.197021484375hf, -0.2354736328125hf, -0.02923583984375hf, 0.0042266845703125hf), f16vec4(-0.1624755859375hf, -0.18359375hf, 0.3349609375hf, -0.0968017578125hf), f16vec4(0.2332763671875hf, 0.492919921875hf, 0.006267547607421875hf, 0.315185546875hf), f16vec4(0.044708251953125hf, -0.1923828125hf, 0.34521484375hf, 0.413818359375hf)), + f16mat4(f16vec4(-0.3369140625hf, 0.3515625hf, 0.865234375hf, 0.76171875hf), f16vec4(0.60498046875hf, -0.1842041015625hf, 0.599609375hf, 0.4453125hf), f16vec4(0.16357421875hf, 0.501953125hf, 0.401123046875hf, 0.06292724609375hf), f16vec4(-0.167724609375hf, -0.89404296875hf, 0.3095703125hf, 0.178466796875hf)), + f16mat4(f16vec4(0.0457763671875hf, 0.383056640625hf, 0.19970703125hf, 0.020721435546875hf), f16vec4(-0.0036258697509765625hf, -0.0235443115234375hf, -0.0265045166015625hf, -0.52734375hf), f16vec4(-0.1273193359375hf, 0.10345458984375hf, -0.00798797607421875hf, -0.0145111083984375hf), f16vec4(-0.72119140625hf, -0.31103515625hf, 0.107177734375hf, 0.71142578125hf)), + f16mat4(f16vec4(0.39453125hf, -0.059814453125hf, -0.7021484375hf, 0.10986328125hf), f16vec4(-0.8212890625hf, -0.0026226043701171875hf, -0.75537109375hf, -0.744140625hf), f16vec4(-0.369140625hf, 0.0802001953125hf, -0.42822265625hf, 0.0830078125hf), f16vec4(0.5947265625hf, 0.6328125hf, 0.4228515625hf, 0.86474609375hf)), + f16mat4(f16vec4(-0.07421875hf, 0.1768798828125hf, 0.1458740234375hf, 0.7294921875hf), f16vec4(-0.290283203125hf, -0.1663818359375hf, -0.05487060546875hf, -0.24072265625hf), f16vec4(0.0745849609375hf, 0.2396240234375hf, 0.002422332763671875hf, -0.05615234375hf), f16vec4(-0.7138671875hf, -0.311279296875hf, 0.157470703125hf, 0.65283203125hf)), + f16mat4(f16vec4(-0.9208984375hf, -0.02105712890625hf, 0.422119140625hf, -0.1036376953125hf), f16vec4(0.2340087890625hf, -0.15478515625hf, 1.0703125hf, -0.052581787109375hf), f16vec4(0.37548828125hf, 0.078125hf, 0.1370849609375hf, -0.08099365234375hf), f16vec4(-0.04168701171875hf, -0.93798828125hf, 0.052001953125hf, 0.08935546875hf)), + f16mat4(f16vec4(-0.08380126953125hf, -0.0234527587890625hf, -0.0174713134765625hf, 0.08306884765625hf), f16vec4(-0.0751953125hf, -0.01885986328125hf, 0.133544921875hf, -0.1485595703125hf), f16vec4(0.5927734375hf, 0.303955078125hf, 0.1588134765625hf, 0.137451171875hf), f16vec4(-0.61865234375hf, -0.0838623046875hf, 0.509765625hf, 0.2027587890625hf)), + f16mat4(f16vec4(-0.47216796875hf, 0.150390625hf, 0.3291015625hf, 0.68115234375hf), f16vec4(0.62890625hf, -0.0633544921875hf, 0.55517578125hf, 0.50634765625hf), f16vec4(0.11285400390625hf, 0.123291015625hf, 0.54248046875hf, -0.1658935546875hf), f16vec4(-0.57861328125hf, -0.796875hf, 0.273681640625hf, -0.12469482421875hf)), + f16mat4(f16vec4(0.15673828125hf, 0.54443359375hf, 0.1700439453125hf, 0.08514404296875hf), f16vec4(-0.1995849609375hf, 0.01479339599609375hf, -0.344970703125hf, 0.185546875hf), f16vec4(0.78759765625hf, 0.2154541015625hf, -0.5224609375hf, 0.47265625hf), f16vec4(0.07470703125hf, 0.059906005859375hf, -0.239013671875hf, 0.338134765625hf)), + f16mat4(f16vec4(0.04876708984375hf, 0.63232421875hf, 0.2509765625hf, 0.0736083984375hf), f16vec4(-0.4072265625hf, 0.1773681640625hf, 0.00811004638671875hf, -0.181640625hf), f16vec4(-0.2041015625hf, -0.016937255859375hf, 0.288818359375hf, 0.266357421875hf), f16vec4(0.084716796875hf, -0.01154327392578125hf, -0.0341796875hf, 0.236328125hf)), + f16mat4(f16vec4(-0.01348114013671875hf, 0.515625hf, 0.23193359375hf, -0.05926513671875hf), f16vec4(0.03363037109375hf, 0.0753173828125hf, -0.5380859375hf, 0.52734375hf), f16vec4(0.74365234375hf, -0.0927734375hf, -0.36376953125hf, 0.00441741943359375hf), f16vec4(-0.034393310546875hf, 0.046173095703125hf, 0.08905029296875hf, 0.74560546875hf)), + f16mat4(f16vec4(0.11749267578125hf, 0.68896484375hf, 0.10858154296875hf, 0.287353515625hf), f16vec4(0.137939453125hf, -0.14990234375hf, -0.06512451171875hf, 0.08465576171875hf), f16vec4(-0.2025146484375hf, 0.26416015625hf, -0.54052734375hf, 0.7041015625hf), f16vec4(0.07928466796875hf, -0.0298614501953125hf, -0.05194091796875hf, 0.69384765625hf)), + f16mat4(f16vec4(0.162353515625hf, 0.71728515625hf, 0.15771484375hf, 0.185302734375hf), f16vec4(-0.328369140625hf, -0.186767578125hf, 0.0662841796875hf, -0.466552734375hf), f16vec4(-0.517578125hf, 0.1171875hf, 0.1663818359375hf, 0.4912109375hf), f16vec4(0.075927734375hf, 0.1082763671875hf, -0.0179290771484375hf, 0.2366943359375hf)), + f16mat4(f16vec4(-0.01080322265625hf, 0.7392578125hf, 0.037078857421875hf, 0.171875hf), f16vec4(-0.103759765625hf, -0.1458740234375hf, -0.356689453125hf, 0.020172119140625hf), f16vec4(0.220703125hf, 0.297607421875hf, -0.321533203125hf, 0.4169921875hf), f16vec4(-0.0029964447021484375hf, -0.02337646484375hf, -0.16162109375hf, 0.693359375hf)), + f16mat4(f16vec4(0.01513671875hf, 0.37646484375hf, -0.01171875hf, 0.08929443359375hf), f16vec4(-0.355712890625hf, 0.5703125hf, -0.7880859375hf, 0.1982421875hf), f16vec4(0.33154296875hf, 0.05963134765625hf, -0.477783203125hf, 0.487060546875hf), f16vec4(0.384765625hf, 0.160400390625hf, -0.06671142578125hf, 0.5234375hf)), + f16mat4(f16vec4(0.148193359375hf, 0.8017578125hf, 0.23876953125hf, -0.026458740234375hf), f16vec4(-0.552734375hf, 0.5625hf, -0.346923828125hf, -0.34716796875hf), f16vec4(0.36181640625hf, -0.016845703125hf, -0.040802001953125hf, 0.24609375hf), f16vec4(0.25634765625hf, 0.138671875hf, 0.06829833984375hf, 0.317138671875hf)), + f16mat4(f16vec4(0.052337646484375hf, 0.609375hf, 0.09295654296875hf, -0.09185791015625hf), f16vec4(-0.55712890625hf, 0.4736328125hf, -0.63720703125hf, 0.425048828125hf), f16vec4(0.188232421875hf, -0.1663818359375hf, -0.496337890625hf, -0.115234375hf), f16vec4(0.1085205078125hf, -0.00677490234375hf, 0.038238525390625hf, 0.47509765625hf)) +); +const f16vec4 kMu1A = f16vec4(-0.8115234375hf, 0.84521484375hf, 1.7236328125hf, 3.65234375hf); +const f16vec4 kSig1A = f16vec4(0.436767578125hf, 0.34619140625hf, 0.28955078125hf, 0.299072265625hf); +const f16vec4 kBeta1A = f16vec4(-0.302490234375hf, -0.2030029296875hf, -0.2271728515625hf, -0.40478515625hf); + +const f16mat4 kW1B[18] = f16mat4[18]( + f16mat4(f16vec4(-0.37109375hf, 0.8583984375hf, -0.262939453125hf, -1.21484375hf), f16vec4(0.403076171875hf, 0.1903076171875hf, -0.43359375hf, 0.12322998046875hf), f16vec4(0.04974365234375hf, -0.352294921875hf, -1.09765625hf, 0.00936126708984375hf), f16vec4(-0.2359619140625hf, -0.1455078125hf, 0.1185302734375hf, 0.18994140625hf)), + f16mat4(f16vec4(-0.104248046875hf, 0.041259765625hf, 0.0794677734375hf, -0.6572265625hf), f16vec4(-0.2919921875hf, -0.36767578125hf, -0.3310546875hf, -0.5810546875hf), f16vec4(0.382080078125hf, -0.30859375hf, -0.309814453125hf, -0.060577392578125hf), f16vec4(-0.1326904296875hf, -0.14794921875hf, 0.296142578125hf, 0.1824951171875hf)), + f16mat4(f16vec4(0.54638671875hf, 0.634765625hf, -0.2099609375hf, -1.3818359375hf), f16vec4(0.254150390625hf, -0.26318359375hf, -0.4775390625hf, -0.2034912109375hf), f16vec4(0.443603515625hf, -0.08551025390625hf, -1.2529296875hf, 0.08026123046875hf), f16vec4(0.2266845703125hf, 0.00812530517578125hf, -0.152587890625hf, 0.050628662109375hf)), + f16mat4(f16vec4(-0.3251953125hf, -0.0112762451171875hf, -0.2098388671875hf, -0.360595703125hf), f16vec4(0.08441162109375hf, -0.07318115234375hf, -0.32958984375hf, 0.143798828125hf), f16vec4(-0.11712646484375hf, 0.061431884765625hf, -0.11724853515625hf, -0.00704193115234375hf), f16vec4(-0.32373046875hf, -0.08074951171875hf, 0.10540771484375hf, 0.29736328125hf)), + f16mat4(f16vec4(-0.061492919921875hf, -0.72607421875hf, 0.345458984375hf, 0.5693359375hf), f16vec4(-0.65478515625hf, 0.02435302734375hf, 0.4111328125hf, -0.326171875hf), f16vec4(0.36279296875hf, 0.2198486328125hf, 0.287353515625hf, 0.0263824462890625hf), f16vec4(-0.06427001953125hf, -0.64111328125hf, -0.004238128662109375hf, 0.43603515625hf)), + f16mat4(f16vec4(0.463134765625hf, 0.036895751953125hf, -0.11468505859375hf, -0.2978515625hf), f16vec4(-0.08245849609375hf, -0.134765625hf, -0.1199951171875hf, -0.1669921875hf), f16vec4(0.301025390625hf, 0.2257080078125hf, -0.305908203125hf, 0.043670654296875hf), f16vec4(0.27685546875hf, -0.0250091552734375hf, 0.1922607421875hf, 0.5068359375hf)), + f16mat4(f16vec4(-0.2459716796875hf, 0.8408203125hf, -0.4423828125hf, -1.220703125hf), f16vec4(-0.196044921875hf, 0.01012420654296875hf, -0.5634765625hf, -0.08807373046875hf), f16vec4(-0.67431640625hf, -0.4658203125hf, -0.57666015625hf, 0.00562286376953125hf), f16vec4(-0.30029296875hf, -0.15869140625hf, 0.291259765625hf, -0.1865234375hf)), + f16mat4(f16vec4(0.0853271484375hf, 0.270751953125hf, 0.033660888671875hf, -0.46337890625hf), f16vec4(-0.7939453125hf, -0.279296875hf, -0.222900390625hf, -0.5927734375hf), f16vec4(-0.2958984375hf, -0.2073974609375hf, -0.1290283203125hf, -0.039794921875hf), f16vec4(-0.1158447265625hf, -0.028900146484375hf, 0.1522216796875hf, 0.20458984375hf)), + f16mat4(f16vec4(0.54150390625hf, 0.5234375hf, -0.03466796875hf, -1.3486328125hf), f16vec4(-0.311767578125hf, -0.254150390625hf, -0.325439453125hf, -0.299560546875hf), f16vec4(-0.36279296875hf, -0.1259765625hf, -1.0263671875hf, -0.07305908203125hf), f16vec4(0.55859375hf, 0.4560546875hf, 0.09246826171875hf, 0.299560546875hf)), + f16mat4(f16vec4(-0.1392822265625hf, -0.09454345703125hf, 0.107421875hf, 0.0740966796875hf), f16vec4(-0.0703125hf, 0.74365234375hf, 0.552734375hf, 0.0743408203125hf), f16vec4(0.45263671875hf, -0.9169921875hf, 0.2032470703125hf, 0.428955078125hf), f16vec4(-0.25634765625hf, 0.33447265625hf, 0.045196533203125hf, 0.11297607421875hf)), + f16mat4(f16vec4(-0.2484130859375hf, -0.093505859375hf, -0.024566650390625hf, -0.01715087890625hf), f16vec4(-0.385009765625hf, -0.169921875hf, -0.06756591796875hf, -0.33935546875hf), f16vec4(-0.47900390625hf, -0.51953125hf, -0.049713134765625hf, -0.1412353515625hf), f16vec4(-0.37060546875hf, 0.25927734375hf, 0.11083984375hf, 0.11053466796875hf)), + f16mat4(f16vec4(-0.174072265625hf, -0.055511474609375hf, -0.03778076171875hf, -0.189697265625hf), f16vec4(-0.10760498046875hf, 0.0728759765625hf, 0.79833984375hf, -0.05694580078125hf), f16vec4(-0.51806640625hf, -1.2197265625hf, 0.291015625hf, 0.52392578125hf), f16vec4(0.1201171875hf, 0.369873046875hf, -0.039459228515625hf, 0.250244140625hf)), + f16mat4(f16vec4(-0.25048828125hf, 0.09490966796875hf, 0.43798828125hf, 0.040283203125hf), f16vec4(-0.335205078125hf, 0.08984375hf, 0.005817413330078125hf, 0.06597900390625hf), f16vec4(0.4404296875hf, 0.11322021484375hf, -0.087890625hf, -0.0230712890625hf), f16vec4(-0.466552734375hf, 0.0117034912109375hf, -0.366455078125hf, 0.049652099609375hf)), + f16mat4(f16vec4(-0.251708984375hf, 0.078857421875hf, 0.356201171875hf, -0.03436279296875hf), f16vec4(-0.74462890625hf, -0.724609375hf, -0.86767578125hf, -0.355224609375hf), f16vec4(-0.366455078125hf, 0.6748046875hf, -0.362548828125hf, -0.7294921875hf), f16vec4(-0.66064453125hf, -0.0694580078125hf, -0.2056884765625hf, 0.038726806640625hf)), + f16mat4(f16vec4(-0.295654296875hf, 0.1781005859375hf, 0.487548828125hf, -0.09674072265625hf), f16vec4(-0.62939453125hf, 0.2626953125hf, -0.153564453125hf, -0.06121826171875hf), f16vec4(-0.4697265625hf, -0.1427001953125hf, 0.08282470703125hf, 0.024505615234375hf), f16vec4(-0.29150390625hf, 0.0789794921875hf, -0.27783203125hf, 0.073486328125hf)), + f16mat4(f16vec4(0.0474853515625hf, -0.025787353515625hf, 0.06396484375hf, 0.0968017578125hf), f16vec4(0.354736328125hf, 0.309814453125hf, 0.318359375hf, 0.248046875hf), f16vec4(0.802734375hf, -0.98779296875hf, 0.17529296875hf, 0.468505859375hf), f16vec4(-0.2010498046875hf, 0.40087890625hf, 0.2413330078125hf, 0.1617431640625hf)), + f16mat4(f16vec4(-0.2061767578125hf, -0.11798095703125hf, 0.1390380859375hf, -0.055633544921875hf), f16vec4(0.00370025634765625hf, -0.272216796875hf, 0.086669921875hf, -0.3427734375hf), f16vec4(-0.3291015625hf, -0.39111328125hf, 0.1134033203125hf, -0.0020427703857421875hf), f16vec4(-0.25hf, 0.278076171875hf, 0.1669921875hf, 0.1024169921875hf)), + f16mat4(f16vec4(-0.1727294921875hf, -0.1502685546875hf, 0.1876220703125hf, -0.0819091796875hf), f16vec4(0.293701171875hf, 0.33935546875hf, 0.51611328125hf, 0.0394287109375hf), f16vec4(-0.1339111328125hf, -0.81982421875hf, 0.2137451171875hf, 0.57177734375hf), f16vec4(0.199951171875hf, 0.248046875hf, 0.04522705078125hf, 0.1513671875hf)) +); +const f16vec4 kMu1B = f16vec4(-2.150390625hf, -0.712890625hf, -1.279296875hf, -1.978515625hf); +const f16vec4 kSig1B = f16vec4(0.261474609375hf, 0.38916015625hf, 0.387939453125hf, 0.4169921875hf); +const f16vec4 kBeta1B = f16vec4(0.94677734375hf, -0.2471923828125hf, -0.282470703125hf, -0.5048828125hf); + +const f16mat4 kW2P[18] = f16mat4[18]( + f16mat4(f16vec4(0.425048828125hf, 0.1304931640625hf, 0.52783203125hf, -0.8291015625hf), f16vec4(0.26416015625hf, 0.298828125hf, -0.01415252685546875hf, 0.41552734375hf), f16vec4(0.51611328125hf, 0.0867919921875hf, -0.53125hf, -1.146484375hf), f16vec4(-0.0283203125hf, 0.0047149658203125hf, 0.34814453125hf, 0.0169830322265625hf)), + f16mat4(f16vec4(0.2247314453125hf, -0.50830078125hf, -0.00595855712890625hf, -0.353271484375hf), f16vec4(0.2054443359375hf, 0.24560546875hf, 0.05487060546875hf, 0.3046875hf), f16vec4(0.06304931640625hf, -0.173828125hf, 0.004367828369140625hf, -0.7705078125hf), f16vec4(-0.1148681640625hf, -0.089599609375hf, 0.30859375hf, -0.06756591796875hf)), + f16mat4(f16vec4(0.43017578125hf, -0.0364990234375hf, 0.484375hf, -0.8349609375hf), f16vec4(0.2607421875hf, 0.2471923828125hf, 0.07904052734375hf, 0.41748046875hf), f16vec4(0.58642578125hf, 0.13818359375hf, -0.6015625hf, -1.404296875hf), f16vec4(-0.0238800048828125hf, 0.1046142578125hf, 0.54052734375hf, 0.07122802734375hf)), + f16mat4(f16vec4(0.0989990234375hf, -0.2239990234375hf, 0.0218963623046875hf, -0.1861572265625hf), f16vec4(0.300537109375hf, 0.30029296875hf, -0.052825927734375hf, 0.376953125hf), f16vec4(-0.005107879638671875hf, -0.56591796875hf, -0.4892578125hf, -0.28466796875hf), f16vec4(0.0943603515625hf, 0.1649169921875hf, 0.1263427734375hf, 0.01561737060546875hf)), + f16mat4(f16vec4(-0.1351318359375hf, -0.55126953125hf, -0.406982421875hf, 0.383544921875hf), f16vec4(0.274169921875hf, 0.2210693359375hf, -0.0287628173828125hf, 0.20703125hf), f16vec4(-0.346435546875hf, -0.71875hf, 0.12408447265625hf, 0.74365234375hf), f16vec4(-0.01308441162109375hf, 0.143798828125hf, 0.1329345703125hf, -0.0352783203125hf)), + f16mat4(f16vec4(0.1588134765625hf, -0.291748046875hf, 0.009674072265625hf, -0.29443359375hf), f16vec4(0.305908203125hf, 0.26611328125hf, -0.020751953125hf, 0.364501953125hf), f16vec4(0.0948486328125hf, -0.45458984375hf, -0.578125hf, -0.2470703125hf), f16vec4(0.1065673828125hf, 0.2022705078125hf, 0.44384765625hf, 0.1009521484375hf)), + f16mat4(f16vec4(0.3515625hf, 0.128173828125hf, 0.41357421875hf, -0.43603515625hf), f16vec4(0.343505859375hf, 0.169921875hf, 0.0305633544921875hf, 0.31103515625hf), f16vec4(0.48779296875hf, -0.045562744140625hf, -0.78369140625hf, -1.3173828125hf), f16vec4(0.031524658203125hf, -0.131591796875hf, 0.35498046875hf, -0.0310516357421875hf)), + f16mat4(f16vec4(0.0596923828125hf, -0.369140625hf, 0.094970703125hf, -0.2318115234375hf), f16vec4(0.361572265625hf, 0.2041015625hf, 0.01080322265625hf, 0.1339111328125hf), f16vec4(0.07025146484375hf, -0.307861328125hf, -0.1429443359375hf, -0.740234375hf), f16vec4(-0.052337646484375hf, -0.1168212890625hf, 0.302001953125hf, -0.133544921875hf)), + f16mat4(f16vec4(0.20947265625hf, -0.060333251953125hf, 0.31103515625hf, -0.83740234375hf), f16vec4(0.343994140625hf, 0.197509765625hf, 0.038848876953125hf, 0.2498779296875hf), f16vec4(0.466796875hf, 0.1265869140625hf, -0.7568359375hf, -1.185546875hf), f16vec4(-0.00487518310546875hf, -0.142822265625hf, 0.51611328125hf, 0.0270538330078125hf)), + f16mat4(f16vec4(-0.2293701171875hf, -0.1016845703125hf, -0.396240234375hf, -0.359375hf), f16vec4(-0.55517578125hf, -0.6572265625hf, -1.1611328125hf, 0.169189453125hf), f16vec4(-0.99267578125hf, -0.900390625hf, 0.2481689453125hf, 0.348876953125hf), f16vec4(-0.2259521484375hf, -0.1431884765625hf, 0.51025390625hf, 0.022918701171875hf)), + f16mat4(f16vec4(0.027496337890625hf, 0.0090789794921875hf, -0.1839599609375hf, 0.033203125hf), f16vec4(-0.1949462890625hf, -0.0270538330078125hf, -0.28759765625hf, 0.01018524169921875hf), f16vec4(-0.880859375hf, -0.697265625hf, -0.018463134765625hf, -0.01084136962890625hf), f16vec4(-0.242919921875hf, 0.017791748046875hf, -0.047698974609375hf, 0.0016689300537109375hf)), + f16mat4(f16vec4(-0.296142578125hf, -0.169677734375hf, -0.360595703125hf, -0.45361328125hf), f16vec4(-0.356201171875hf, -0.6875hf, -1.212890625hf, 0.2188720703125hf), f16vec4(-1.455078125hf, -1.1630859375hf, 0.1204833984375hf, 0.356201171875hf), f16vec4(-0.25hf, -0.1573486328125hf, 0.3291015625hf, -0.1319580078125hf)), + f16mat4(f16vec4(-0.1485595703125hf, -0.129150390625hf, -0.1351318359375hf, -0.07147216796875hf), f16vec4(-0.1820068359375hf, -0.56005859375hf, -0.53369140625hf, -0.049774169921875hf), f16vec4(-0.31298828125hf, -0.29638671875hf, 0.0193023681640625hf, -0.0250701904296875hf), f16vec4(0.039459228515625hf, -0.11126708984375hf, 0.07830810546875hf, 0.0227203369140625hf)), + f16mat4(f16vec4(0.2227783203125hf, 0.1116943359375hf, 0.2027587890625hf, 0.2568359375hf), f16vec4(0.1744384765625hf, 0.273193359375hf, 0.6884765625hf, -0.16015625hf), f16vec4(0.53271484375hf, 0.1326904296875hf, -0.183837890625hf, -0.21728515625hf), f16vec4(0.1214599609375hf, 0.0220947265625hf, -0.365966796875hf, 0.0599365234375hf)), + f16mat4(f16vec4(-0.1910400390625hf, -0.1439208984375hf, 0.08990478515625hf, 0.0052490234375hf), f16vec4(-0.297607421875hf, -0.55419921875hf, -0.94921875hf, 0.1368408203125hf), f16vec4(-0.5341796875hf, -0.3349609375hf, 0.02618408203125hf, 0.0284881591796875hf), f16vec4(0.0234527587890625hf, -0.322509765625hf, 0.0233917236328125hf, -0.01322174072265625hf)), + f16mat4(f16vec4(-0.2783203125hf, -0.3837890625hf, -0.3662109375hf, -0.366455078125hf), f16vec4(-0.599609375hf, -0.55908203125hf, -0.869140625hf, 0.238037109375hf), f16vec4(-1.3525390625hf, -0.8916015625hf, 0.23046875hf, 0.5546875hf), f16vec4(-0.093505859375hf, -0.0011157989501953125hf, 0.492919921875hf, -0.12353515625hf)), + f16mat4(f16vec4(0.15087890625hf, -0.032440185546875hf, -0.128173828125hf, -0.19091796875hf), f16vec4(-0.27880859375hf, 0.03680419921875hf, -0.1348876953125hf, 0.060760498046875hf), f16vec4(-1.041015625hf, -0.80029296875hf, 0.06732177734375hf, 0.193603515625hf), f16vec4(-0.05682373046875hf, -0.03289794921875hf, -0.019866943359375hf, -0.0828857421875hf)), + f16mat4(f16vec4(-0.341552734375hf, -0.343994140625hf, -0.25048828125hf, -0.43994140625hf), f16vec4(-0.5556640625hf, -0.6650390625hf, -1.4306640625hf, 0.320068359375hf), f16vec4(-1.26171875hf, -0.89453125hf, 0.300048828125hf, 0.349609375hf), f16vec4(-0.1478271484375hf, -0.36572265625hf, 0.333251953125hf, -0.0592041015625hf)) +); +const f16vec4 kMu2P = f16vec4(-1.236328125hf, -2.08984375hf, -1.537109375hf, -1.7275390625hf); +const f16vec4 kSig2P = f16vec4(0.27978515625hf, 0.425537109375hf, 0.269775390625hf, 0.3212890625hf); +const f16vec4 kBeta2P = f16vec4(-0.00743865966796875hf, -0.3701171875hf, 0.03558349609375hf, 0.0161285400390625hf); + +const f16mat4 kW2Q[18] = f16mat4[18]( + f16mat4(f16vec4(0.051513671875hf, -0.81005859375hf, -0.73779296875hf, -0.0159912109375hf), f16vec4(-0.054412841796875hf, -0.0345458984375hf, 0.319580078125hf, 0.0127410888671875hf), f16vec4(-0.83056640625hf, 0.1846923828125hf, -0.8369140625hf, 0.290283203125hf), f16vec4(0.470947265625hf, 0.38623046875hf, 0.07562255859375hf, 0.05035400390625hf)), + f16mat4(f16vec4(-0.11077880859375hf, -0.241455078125hf, -0.005931854248046875hf, -0.057952880859375hf), f16vec4(0.09625244140625hf, 0.076416015625hf, 0.07159423828125hf, -0.001941680908203125hf), f16vec4(-0.38720703125hf, 0.01934814453125hf, -0.352294921875hf, -0.251953125hf), f16vec4(0.12451171875hf, 0.356689453125hf, 0.22216796875hf, 0.26611328125hf)), + f16mat4(f16vec4(0.06494140625hf, -0.513671875hf, -0.90576171875hf, -0.69580078125hf), f16vec4(-0.1300048828125hf, -0.07806396484375hf, 0.298583984375hf, 0.0134735107421875hf), f16vec4(-0.80029296875hf, 0.290283203125hf, -1.033203125hf, 0.15869140625hf), f16vec4(0.34375hf, 0.38427734375hf, 0.22802734375hf, 0.381591796875hf)), + f16mat4(f16vec4(-0.07659912109375hf, -0.2083740234375hf, -0.2103271484375hf, 0.034149169921875hf), f16vec4(-0.050048828125hf, -0.05157470703125hf, 0.2086181640625hf, -0.1307373046875hf), f16vec4(-0.06878662109375hf, 0.15966796875hf, -0.1314697265625hf, -0.3056640625hf), f16vec4(0.1678466796875hf, 0.274658203125hf, -0.082275390625hf, 0.185546875hf)), + f16mat4(f16vec4(-0.34033203125hf, 0.7421875hf, 0.365234375hf, 0.126953125hf), f16vec4(0.0025806427001953125hf, 0.040802001953125hf, -0.01215362548828125hf, -0.10723876953125hf), f16vec4(0.5595703125hf, 0.0222015380859375hf, 0.368896484375hf, -0.884765625hf), f16vec4(-0.04022216796875hf, 0.1409912109375hf, -0.07275390625hf, 0.2264404296875hf)), + f16mat4(f16vec4(-0.1651611328125hf, -0.26513671875hf, -0.2117919921875hf, 0.0748291015625hf), f16vec4(-0.12042236328125hf, -0.11956787109375hf, 0.253662109375hf, -0.038848876953125hf), f16vec4(0.111328125hf, 0.25341796875hf, -0.297119140625hf, -0.4658203125hf), f16vec4(0.2430419921875hf, 0.11212158203125hf, -0.1309814453125hf, 0.2822265625hf)), + f16mat4(f16vec4(0.1104736328125hf, -0.70751953125hf, -0.953125hf, -0.319580078125hf), f16vec4(0.006259918212890625hf, -0.0260009765625hf, 0.517578125hf, -0.0294647216796875hf), f16vec4(-0.9453125hf, 0.1351318359375hf, -1.005859375hf, 0.005901336669921875hf), f16vec4(0.5205078125hf, 0.4111328125hf, 0.2120361328125hf, 0.053741455078125hf)), + f16mat4(f16vec4(-0.2587890625hf, -0.194580078125hf, -0.2025146484375hf, -0.09600830078125hf), f16vec4(0.029754638671875hf, 0.06341552734375hf, 0.274658203125hf, -0.00788116455078125hf), f16vec4(-0.4326171875hf, -0.040374755859375hf, -0.457275390625hf, -0.355224609375hf), f16vec4(0.1881103515625hf, 0.375732421875hf, 0.1259765625hf, 0.295654296875hf)), + f16mat4(f16vec4(-0.138916015625hf, -0.83984375hf, -1.021484375hf, -0.394287109375hf), f16vec4(-0.0284423828125hf, -0.048095703125hf, 0.48974609375hf, 0.0750732421875hf), f16vec4(-0.9208984375hf, 0.26953125hf, -0.96240234375hf, 0.21142578125hf), f16vec4(0.44970703125hf, 0.38916015625hf, 0.1275634765625hf, 0.361083984375hf)), + f16mat4(f16vec4(-0.2322998046875hf, -0.2008056640625hf, -0.4599609375hf, -0.49365234375hf), f16vec4(-1.119140625hf, 0.43115234375hf, -0.030548095703125hf, -0.04705810546875hf), f16vec4(0.01488494873046875hf, -0.3935546875hf, 0.07720947265625hf, -0.25927734375hf), f16vec4(0.12371826171875hf, -1.533203125hf, -0.1263427734375hf, -1.0068359375hf)), + f16mat4(f16vec4(0.050018310546875hf, -0.0228424072265625hf, -0.0673828125hf, -0.1016845703125hf), f16vec4(-0.1949462890625hf, 0.00135040283203125hf, -0.3623046875hf, -0.429931640625hf), f16vec4(-0.09100341796875hf, -0.1927490234375hf, -0.2088623046875hf, -0.19091796875hf), f16vec4(-0.5966796875hf, -0.4560546875hf, -0.2008056640625hf, -0.396484375hf)), + f16mat4(f16vec4(-0.6904296875hf, -0.393798828125hf, -0.426513671875hf, -0.054107666015625hf), f16vec4(-1.0625hf, 0.5029296875hf, 0.0595703125hf, -0.235595703125hf), f16vec4(-0.2288818359375hf, -0.446533203125hf, 0.01259613037109375hf, -0.366455078125hf), f16vec4(0.11181640625hf, -1.3671875hf, -0.288330078125hf, -1.427734375hf)), + f16mat4(f16vec4(-0.01424407958984375hf, 0.13330078125hf, 0.2364501953125hf, -0.004955291748046875hf), f16vec4(-0.64453125hf, -0.01277923583984375hf, -0.2587890625hf, -0.11065673828125hf), f16vec4(-0.2158203125hf, -0.169677734375hf, -0.384765625hf, -0.07354736328125hf), f16vec4(-0.33154296875hf, -1.4365234375hf, -0.176025390625hf, -0.75537109375hf)), + f16mat4(f16vec4(0.34521484375hf, 0.304443359375hf, 0.19677734375hf, 0.133544921875hf), f16vec4(0.36279296875hf, -0.346923828125hf, -0.53857421875hf, -0.370361328125hf), f16vec4(-0.216796875hf, 0.049957275390625hf, -0.49658203125hf, 0.2401123046875hf), f16vec4(-0.814453125hf, 0.1710205078125hf, -0.221923828125hf, 0.39599609375hf)), + f16mat4(f16vec4(-0.14404296875hf, -0.2139892578125hf, 0.1456298828125hf, -0.03875732421875hf), f16vec4(-0.673828125hf, 0.1776123046875hf, -0.236328125hf, -0.11676025390625hf), f16vec4(-0.349853515625hf, -0.275634765625hf, -0.27783203125hf, -0.2568359375hf), f16vec4(-0.290283203125hf, -1.3076171875hf, -0.08978271484375hf, -0.86083984375hf)), + f16mat4(f16vec4(-0.03277587890625hf, -0.291259765625hf, -0.116455078125hf, -0.391357421875hf), f16vec4(-0.8916015625hf, 0.36181640625hf, -0.032012939453125hf, 0.1815185546875hf), f16vec4(-0.0164642333984375hf, -0.30517578125hf, -0.216552734375hf, -0.1572265625hf), f16vec4(0.11590576171875hf, -1.6376953125hf, -0.0028533935546875hf, -1.2021484375hf)), + f16mat4(f16vec4(0.00672149658203125hf, -0.040496826171875hf, -0.05169677734375hf, -0.0181427001953125hf), f16vec4(-0.0125274658203125hf, 0.011627197265625hf, -0.41650390625hf, -0.36962890625hf), f16vec4(-0.0258941650390625hf, -0.1314697265625hf, -0.36083984375hf, -0.044677734375hf), f16vec4(-0.399658203125hf, -0.46142578125hf, -0.01702880859375hf, -0.1993408203125hf)), + f16mat4(f16vec4(-0.681640625hf, -0.43505859375hf, -0.07464599609375hf, -0.0604248046875hf), f16vec4(-1.3046875hf, 0.58837890625hf, -0.1328125hf, -0.189208984375hf), f16vec4(0.11834716796875hf, -0.2440185546875hf, -0.334716796875hf, -0.331298828125hf), f16vec4(0.264892578125hf, -1.5146484375hf, 0.0494384765625hf, -1.458984375hf)) +); +const f16vec4 kMu2Q = f16vec4(-2.1875hf, -1.6669921875hf, -1.5205078125hf, -1.8359375hf); +const f16vec4 kSig2Q = f16vec4(0.4638671875hf, 0.30078125hf, 0.457763671875hf, 0.455078125hf); +const f16vec4 kBeta2Q = f16vec4(-0.36376953125hf, -0.11517333984375hf, -0.38671875hf, -0.36767578125hf); + +void main() { + ivec2 gid = ivec2(gl_GlobalInvocationID.xy); + ivec2 lid = ivec2(gl_LocalInvocationID.xy); + ivec2 tileOrigin = ivec2(gl_WorkGroupID.xy) * 16 - ivec2(1, 1); + + ivec2 dstSz = imageSize(uDst0); + bool writeOK = !(gid.x >= dstSz.x || gid.y >= dstSz.y); + + ivec2 sz0 = textureSize(uSrc0, 0); + ivec2 sz1 = textureSize(uSrc1, 0); + + // Phase 1: cooperatively fill the 18x18 hidden tile (16x16 + 1-texel halo). + for (uint idx = gl_LocalInvocationIndex; idx < 324u; idx += 256u) { + int tx = int(idx) % 18; + int ty = int(idx) / 18; + ivec2 p = tileOrigin + ivec2(tx, ty); + + if (p.x < 0 || p.y < 0 || p.x >= sz0.x || p.y >= sz0.y) { + // Center outside src0: store exact zeros (distinct from running the + // activation on zero inputs). + gHid0[tx][ty] = f16vec4(0.0hf); + gHid1[tx][ty] = f16vec4(0.0hf); + continue; + } + + f16vec4 v[18]; + for (int t = 0; t < 9; ++t) { + ivec2 q = p + kTap[t]; + if (t == 4) { + // Center taps fetched unguarded (src0 proven in-bounds above; + // src1 assumed same size). + v[4] = f16vec4(texelFetch(uSrc0, q, 0)); + v[13] = f16vec4(texelFetch(uSrc1, q, 0)); + } else { + v[t] = (q.x >= 0 && q.y >= 0 && q.x < sz0.x && q.y < sz0.y) + ? f16vec4(texelFetch(uSrc0, q, 0)) : f16vec4(0.0hf); + v[9 + t] = (q.x >= 0 && q.y >= 0 && q.x < sz1.x && q.y < sz1.y) + ? f16vec4(texelFetch(uSrc1, q, 0)) : f16vec4(0.0hf); + } + } + + f16vec4 acc0 = kW1A[0] * v[0]; + f16vec4 acc1 = kW1B[0] * v[0]; + for (int k = 1; k < 18; ++k) { + acc0 += kW1A[k] * v[k]; + acc1 += kW1B[k] * v[k]; + } + + gHid0[tx][ty] = f16vec4(clamp(vec4((acc0 - kMu1A) * kSig1A + kBeta1A), 0.0, 1.0)); + gHid1[tx][ty] = f16vec4(clamp(vec4((acc1 - kMu1B) * kSig1B + kBeta1B), 0.0, 1.0)); + } + + barrier(); + + // Phase 2: per-thread 3x3 conv over the two hidden planes. + f16vec4 h[18]; + for (int t = 0; t < 9; ++t) { + ivec2 c = lid + kTap[t] + ivec2(1, 1); + h[t] = gHid0[c.x][c.y]; + h[9 + t] = gHid1[c.x][c.y]; + } + + if (writeOK) { + f16vec4 acc = kW2P[0] * h[0]; + for (int k = 1; k < 18; ++k) { + acc += kW2P[k] * h[k]; + } + imageStore(uDst0, gid, vec4((acc - kMu2P) * kSig2P + kBeta2P)); + } + + if (writeOK) { + f16vec4 acc = kW2Q[0] * h[0]; + for (int k = 1; k < 18; ++k) { + acc += kW2Q[k] * h[k]; + } + imageStore(uDst1, gid, vec4((acc - kMu2Q) * kSig2Q + kBeta2Q)); + } +} diff --git a/cleanroom/glsl/shader_18.comp b/cleanroom/glsl/shader_18.comp new file mode 100644 index 0000000..eab26aa --- /dev/null +++ b/cleanroom/glsl/shader_18.comp @@ -0,0 +1,286 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_18: 3x3 stride-1 conv, 8->8 channels, shared-memory 18x18 tiled + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcA; +layout(set = 0, binding = 33) uniform sampler2D srcB; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstA; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; + +shared f16vec4 tileA[18][18]; +shared f16vec4 tileB[18][18]; + +const f16mat4 w0_0 = f16mat4( + f16vec4(0.425048828125hf, 0.1304931640625hf, 0.52783203125hf, -0.8291015625hf), + f16vec4(0.26416015625hf, 0.298828125hf, -0.01415252685546875hf, 0.41552734375hf), + f16vec4(0.51611328125hf, 0.0867919921875hf, -0.53125hf, -1.146484375hf), + f16vec4(-0.0283203125hf, 0.0047149658203125hf, 0.34814453125hf, 0.0169830322265625hf)); +const f16mat4 w0_1 = f16mat4( + f16vec4(0.2247314453125hf, -0.50830078125hf, -0.00595855712890625hf, -0.353271484375hf), + f16vec4(0.2054443359375hf, 0.24560546875hf, 0.05487060546875hf, 0.3046875hf), + f16vec4(0.06304931640625hf, -0.173828125hf, 0.004367828369140625hf, -0.7705078125hf), + f16vec4(-0.1148681640625hf, -0.089599609375hf, 0.30859375hf, -0.06756591796875hf)); +const f16mat4 w0_2 = f16mat4( + f16vec4(0.43017578125hf, -0.0364990234375hf, 0.484375hf, -0.8349609375hf), + f16vec4(0.2607421875hf, 0.2471923828125hf, 0.07904052734375hf, 0.41748046875hf), + f16vec4(0.58642578125hf, 0.13818359375hf, -0.6015625hf, -1.404296875hf), + f16vec4(-0.0238800048828125hf, 0.1046142578125hf, 0.54052734375hf, 0.07122802734375hf)); +const f16mat4 w0_3 = f16mat4( + f16vec4(0.0989990234375hf, -0.2239990234375hf, 0.0218963623046875hf, -0.1861572265625hf), + f16vec4(0.300537109375hf, 0.30029296875hf, -0.052825927734375hf, 0.376953125hf), + f16vec4(-0.005107879638671875hf, -0.56591796875hf, -0.4892578125hf, -0.28466796875hf), + f16vec4(0.0943603515625hf, 0.1649169921875hf, 0.1263427734375hf, 0.01561737060546875hf)); +const f16mat4 w0_4 = f16mat4( + f16vec4(-0.1351318359375hf, -0.55126953125hf, -0.406982421875hf, 0.383544921875hf), + f16vec4(0.274169921875hf, 0.2210693359375hf, -0.0287628173828125hf, 0.20703125hf), + f16vec4(-0.346435546875hf, -0.71875hf, 0.12408447265625hf, 0.74365234375hf), + f16vec4(-0.01308441162109375hf, 0.143798828125hf, 0.1329345703125hf, -0.0352783203125hf)); +const f16mat4 w0_5 = f16mat4( + f16vec4(0.1588134765625hf, -0.291748046875hf, 0.009674072265625hf, -0.29443359375hf), + f16vec4(0.305908203125hf, 0.26611328125hf, -0.020751953125hf, 0.364501953125hf), + f16vec4(0.0948486328125hf, -0.45458984375hf, -0.578125hf, -0.2470703125hf), + f16vec4(0.1065673828125hf, 0.2022705078125hf, 0.44384765625hf, 0.1009521484375hf)); +const f16mat4 w0_6 = f16mat4( + f16vec4(0.3515625hf, 0.128173828125hf, 0.41357421875hf, -0.43603515625hf), + f16vec4(0.343505859375hf, 0.169921875hf, 0.0305633544921875hf, 0.31103515625hf), + f16vec4(0.48779296875hf, -0.045562744140625hf, -0.78369140625hf, -1.3173828125hf), + f16vec4(0.031524658203125hf, -0.131591796875hf, 0.35498046875hf, -0.0310516357421875hf)); +const f16mat4 w0_7 = f16mat4( + f16vec4(0.0596923828125hf, -0.369140625hf, 0.094970703125hf, -0.2318115234375hf), + f16vec4(0.361572265625hf, 0.2041015625hf, 0.01080322265625hf, 0.1339111328125hf), + f16vec4(0.07025146484375hf, -0.307861328125hf, -0.1429443359375hf, -0.740234375hf), + f16vec4(-0.052337646484375hf, -0.1168212890625hf, 0.302001953125hf, -0.133544921875hf)); +const f16mat4 w0_8 = f16mat4( + f16vec4(0.20947265625hf, -0.060333251953125hf, 0.31103515625hf, -0.83740234375hf), + f16vec4(0.343994140625hf, 0.197509765625hf, 0.038848876953125hf, 0.2498779296875hf), + f16vec4(0.466796875hf, 0.1265869140625hf, -0.7568359375hf, -1.185546875hf), + f16vec4(-0.00487518310546875hf, -0.142822265625hf, 0.51611328125hf, 0.0270538330078125hf)); +const f16mat4 w0_9 = f16mat4( + f16vec4(-0.2293701171875hf, -0.1016845703125hf, -0.396240234375hf, -0.359375hf), + f16vec4(-0.55517578125hf, -0.6572265625hf, -1.1611328125hf, 0.169189453125hf), + f16vec4(-0.99267578125hf, -0.900390625hf, 0.2481689453125hf, 0.348876953125hf), + f16vec4(-0.2259521484375hf, -0.1431884765625hf, 0.51025390625hf, 0.022918701171875hf)); +const f16mat4 w0_10 = f16mat4( + f16vec4(0.027496337890625hf, 0.0090789794921875hf, -0.1839599609375hf, 0.033203125hf), + f16vec4(-0.1949462890625hf, -0.0270538330078125hf, -0.28759765625hf, 0.01018524169921875hf), + f16vec4(-0.880859375hf, -0.697265625hf, -0.018463134765625hf, -0.01084136962890625hf), + f16vec4(-0.242919921875hf, 0.017791748046875hf, -0.047698974609375hf, 0.0016689300537109375hf)); +const f16mat4 w0_11 = f16mat4( + f16vec4(-0.296142578125hf, -0.169677734375hf, -0.360595703125hf, -0.45361328125hf), + f16vec4(-0.356201171875hf, -0.6875hf, -1.212890625hf, 0.2188720703125hf), + f16vec4(-1.455078125hf, -1.1630859375hf, 0.1204833984375hf, 0.356201171875hf), + f16vec4(-0.25hf, -0.1573486328125hf, 0.3291015625hf, -0.1319580078125hf)); +const f16mat4 w0_12 = f16mat4( + f16vec4(-0.1485595703125hf, -0.129150390625hf, -0.1351318359375hf, -0.07147216796875hf), + f16vec4(-0.1820068359375hf, -0.56005859375hf, -0.53369140625hf, -0.049774169921875hf), + f16vec4(-0.31298828125hf, -0.29638671875hf, 0.0193023681640625hf, -0.0250701904296875hf), + f16vec4(0.039459228515625hf, -0.11126708984375hf, 0.07830810546875hf, 0.0227203369140625hf)); +const f16mat4 w0_13 = f16mat4( + f16vec4(0.2227783203125hf, 0.1116943359375hf, 0.2027587890625hf, 0.2568359375hf), + f16vec4(0.1744384765625hf, 0.273193359375hf, 0.6884765625hf, -0.16015625hf), + f16vec4(0.53271484375hf, 0.1326904296875hf, -0.183837890625hf, -0.21728515625hf), + f16vec4(0.1214599609375hf, 0.0220947265625hf, -0.365966796875hf, 0.0599365234375hf)); +const f16mat4 w0_14 = f16mat4( + f16vec4(-0.1910400390625hf, -0.1439208984375hf, 0.08990478515625hf, 0.0052490234375hf), + f16vec4(-0.297607421875hf, -0.55419921875hf, -0.94921875hf, 0.1368408203125hf), + f16vec4(-0.5341796875hf, -0.3349609375hf, 0.02618408203125hf, 0.0284881591796875hf), + f16vec4(0.0234527587890625hf, -0.322509765625hf, 0.0233917236328125hf, -0.01322174072265625hf)); +const f16mat4 w0_15 = f16mat4( + f16vec4(-0.2783203125hf, -0.3837890625hf, -0.3662109375hf, -0.366455078125hf), + f16vec4(-0.599609375hf, -0.55908203125hf, -0.869140625hf, 0.238037109375hf), + f16vec4(-1.3525390625hf, -0.8916015625hf, 0.23046875hf, 0.5546875hf), + f16vec4(-0.093505859375hf, -0.0011157989501953125hf, 0.492919921875hf, -0.12353515625hf)); +const f16mat4 w0_16 = f16mat4( + f16vec4(0.15087890625hf, -0.032440185546875hf, -0.128173828125hf, -0.19091796875hf), + f16vec4(-0.27880859375hf, 0.03680419921875hf, -0.1348876953125hf, 0.060760498046875hf), + f16vec4(-1.041015625hf, -0.80029296875hf, 0.06732177734375hf, 0.193603515625hf), + f16vec4(-0.05682373046875hf, -0.03289794921875hf, -0.019866943359375hf, -0.0828857421875hf)); +const f16mat4 w0_17 = f16mat4( + f16vec4(-0.341552734375hf, -0.343994140625hf, -0.25048828125hf, -0.43994140625hf), + f16vec4(-0.5556640625hf, -0.6650390625hf, -1.4306640625hf, 0.320068359375hf), + f16vec4(-1.26171875hf, -0.89453125hf, 0.300048828125hf, 0.349609375hf), + f16vec4(-0.1478271484375hf, -0.36572265625hf, 0.333251953125hf, -0.0592041015625hf)); +const f16vec4 sub0 = f16vec4(-1.236328125hf, -2.08984375hf, -1.537109375hf, -1.7275390625hf); +const f16vec4 mul0 = f16vec4(0.27978515625hf, 0.425537109375hf, 0.269775390625hf, 0.3212890625hf); +const f16vec4 add0 = f16vec4(-0.00743865966796875hf, -0.3701171875hf, 0.03558349609375hf, 0.0161285400390625hf); + +const f16mat4 w1_0 = f16mat4( + f16vec4(0.051513671875hf, -0.81005859375hf, -0.73779296875hf, -0.0159912109375hf), + f16vec4(-0.054412841796875hf, -0.0345458984375hf, 0.319580078125hf, 0.0127410888671875hf), + f16vec4(-0.83056640625hf, 0.1846923828125hf, -0.8369140625hf, 0.290283203125hf), + f16vec4(0.470947265625hf, 0.38623046875hf, 0.07562255859375hf, 0.05035400390625hf)); +const f16mat4 w1_1 = f16mat4( + f16vec4(-0.11077880859375hf, -0.241455078125hf, -0.005931854248046875hf, -0.057952880859375hf), + f16vec4(0.09625244140625hf, 0.076416015625hf, 0.07159423828125hf, -0.001941680908203125hf), + f16vec4(-0.38720703125hf, 0.01934814453125hf, -0.352294921875hf, -0.251953125hf), + f16vec4(0.12451171875hf, 0.356689453125hf, 0.22216796875hf, 0.26611328125hf)); +const f16mat4 w1_2 = f16mat4( + f16vec4(0.06494140625hf, -0.513671875hf, -0.90576171875hf, -0.69580078125hf), + f16vec4(-0.1300048828125hf, -0.07806396484375hf, 0.298583984375hf, 0.0134735107421875hf), + f16vec4(-0.80029296875hf, 0.290283203125hf, -1.033203125hf, 0.15869140625hf), + f16vec4(0.34375hf, 0.38427734375hf, 0.22802734375hf, 0.381591796875hf)); +const f16mat4 w1_3 = f16mat4( + f16vec4(-0.07659912109375hf, -0.2083740234375hf, -0.2103271484375hf, 0.034149169921875hf), + f16vec4(-0.050048828125hf, -0.05157470703125hf, 0.2086181640625hf, -0.1307373046875hf), + f16vec4(-0.06878662109375hf, 0.15966796875hf, -0.1314697265625hf, -0.3056640625hf), + f16vec4(0.1678466796875hf, 0.274658203125hf, -0.082275390625hf, 0.185546875hf)); +const f16mat4 w1_4 = f16mat4( + f16vec4(-0.34033203125hf, 0.7421875hf, 0.365234375hf, 0.126953125hf), + f16vec4(0.0025806427001953125hf, 0.040802001953125hf, -0.01215362548828125hf, -0.10723876953125hf), + f16vec4(0.5595703125hf, 0.0222015380859375hf, 0.368896484375hf, -0.884765625hf), + f16vec4(-0.04022216796875hf, 0.1409912109375hf, -0.07275390625hf, 0.2264404296875hf)); +const f16mat4 w1_5 = f16mat4( + f16vec4(-0.1651611328125hf, -0.26513671875hf, -0.2117919921875hf, 0.0748291015625hf), + f16vec4(-0.12042236328125hf, -0.11956787109375hf, 0.253662109375hf, -0.038848876953125hf), + f16vec4(0.111328125hf, 0.25341796875hf, -0.297119140625hf, -0.4658203125hf), + f16vec4(0.2430419921875hf, 0.11212158203125hf, -0.1309814453125hf, 0.2822265625hf)); +const f16mat4 w1_6 = f16mat4( + f16vec4(0.1104736328125hf, -0.70751953125hf, -0.953125hf, -0.319580078125hf), + f16vec4(0.006259918212890625hf, -0.0260009765625hf, 0.517578125hf, -0.0294647216796875hf), + f16vec4(-0.9453125hf, 0.1351318359375hf, -1.005859375hf, 0.005901336669921875hf), + f16vec4(0.5205078125hf, 0.4111328125hf, 0.2120361328125hf, 0.053741455078125hf)); +const f16mat4 w1_7 = f16mat4( + f16vec4(-0.2587890625hf, -0.194580078125hf, -0.2025146484375hf, -0.09600830078125hf), + f16vec4(0.029754638671875hf, 0.06341552734375hf, 0.274658203125hf, -0.00788116455078125hf), + f16vec4(-0.4326171875hf, -0.040374755859375hf, -0.457275390625hf, -0.355224609375hf), + f16vec4(0.1881103515625hf, 0.375732421875hf, 0.1259765625hf, 0.295654296875hf)); +const f16mat4 w1_8 = f16mat4( + f16vec4(-0.138916015625hf, -0.83984375hf, -1.021484375hf, -0.394287109375hf), + f16vec4(-0.0284423828125hf, -0.048095703125hf, 0.48974609375hf, 0.0750732421875hf), + f16vec4(-0.9208984375hf, 0.26953125hf, -0.96240234375hf, 0.21142578125hf), + f16vec4(0.44970703125hf, 0.38916015625hf, 0.1275634765625hf, 0.361083984375hf)); +const f16mat4 w1_9 = f16mat4( + f16vec4(-0.2322998046875hf, -0.2008056640625hf, -0.4599609375hf, -0.49365234375hf), + f16vec4(-1.119140625hf, 0.43115234375hf, -0.030548095703125hf, -0.04705810546875hf), + f16vec4(0.01488494873046875hf, -0.3935546875hf, 0.07720947265625hf, -0.25927734375hf), + f16vec4(0.12371826171875hf, -1.533203125hf, -0.1263427734375hf, -1.0068359375hf)); +const f16mat4 w1_10 = f16mat4( + f16vec4(0.050018310546875hf, -0.0228424072265625hf, -0.0673828125hf, -0.1016845703125hf), + f16vec4(-0.1949462890625hf, 0.00135040283203125hf, -0.3623046875hf, -0.429931640625hf), + f16vec4(-0.09100341796875hf, -0.1927490234375hf, -0.2088623046875hf, -0.19091796875hf), + f16vec4(-0.5966796875hf, -0.4560546875hf, -0.2008056640625hf, -0.396484375hf)); +const f16mat4 w1_11 = f16mat4( + f16vec4(-0.6904296875hf, -0.393798828125hf, -0.426513671875hf, -0.054107666015625hf), + f16vec4(-1.0625hf, 0.5029296875hf, 0.0595703125hf, -0.235595703125hf), + f16vec4(-0.2288818359375hf, -0.446533203125hf, 0.01259613037109375hf, -0.366455078125hf), + f16vec4(0.11181640625hf, -1.3671875hf, -0.288330078125hf, -1.427734375hf)); +const f16mat4 w1_12 = f16mat4( + f16vec4(-0.01424407958984375hf, 0.13330078125hf, 0.2364501953125hf, -0.004955291748046875hf), + f16vec4(-0.64453125hf, -0.01277923583984375hf, -0.2587890625hf, -0.11065673828125hf), + f16vec4(-0.2158203125hf, -0.169677734375hf, -0.384765625hf, -0.07354736328125hf), + f16vec4(-0.33154296875hf, -1.4365234375hf, -0.176025390625hf, -0.75537109375hf)); +const f16mat4 w1_13 = f16mat4( + f16vec4(0.34521484375hf, 0.304443359375hf, 0.19677734375hf, 0.133544921875hf), + f16vec4(0.36279296875hf, -0.346923828125hf, -0.53857421875hf, -0.370361328125hf), + f16vec4(-0.216796875hf, 0.049957275390625hf, -0.49658203125hf, 0.2401123046875hf), + f16vec4(-0.814453125hf, 0.1710205078125hf, -0.221923828125hf, 0.39599609375hf)); +const f16mat4 w1_14 = f16mat4( + f16vec4(-0.14404296875hf, -0.2139892578125hf, 0.1456298828125hf, -0.03875732421875hf), + f16vec4(-0.673828125hf, 0.1776123046875hf, -0.236328125hf, -0.11676025390625hf), + f16vec4(-0.349853515625hf, -0.275634765625hf, -0.27783203125hf, -0.2568359375hf), + f16vec4(-0.290283203125hf, -1.3076171875hf, -0.08978271484375hf, -0.86083984375hf)); +const f16mat4 w1_15 = f16mat4( + f16vec4(-0.03277587890625hf, -0.291259765625hf, -0.116455078125hf, -0.391357421875hf), + f16vec4(-0.8916015625hf, 0.36181640625hf, -0.032012939453125hf, 0.1815185546875hf), + f16vec4(-0.0164642333984375hf, -0.30517578125hf, -0.216552734375hf, -0.1572265625hf), + f16vec4(0.11590576171875hf, -1.6376953125hf, -0.0028533935546875hf, -1.2021484375hf)); +const f16mat4 w1_16 = f16mat4( + f16vec4(0.00672149658203125hf, -0.040496826171875hf, -0.05169677734375hf, -0.0181427001953125hf), + f16vec4(-0.0125274658203125hf, 0.011627197265625hf, -0.41650390625hf, -0.36962890625hf), + f16vec4(-0.0258941650390625hf, -0.1314697265625hf, -0.36083984375hf, -0.044677734375hf), + f16vec4(-0.399658203125hf, -0.46142578125hf, -0.01702880859375hf, -0.1993408203125hf)); +const f16mat4 w1_17 = f16mat4( + f16vec4(-0.681640625hf, -0.43505859375hf, -0.07464599609375hf, -0.0604248046875hf), + f16vec4(-1.3046875hf, 0.58837890625hf, -0.1328125hf, -0.189208984375hf), + f16vec4(0.11834716796875hf, -0.2440185546875hf, -0.334716796875hf, -0.331298828125hf), + f16vec4(0.264892578125hf, -1.5146484375hf, 0.0494384765625hf, -1.458984375hf)); +const f16vec4 sub1 = f16vec4(-2.1875hf, -1.6669921875hf, -1.5205078125hf, -1.8359375hf); +const f16vec4 mul1 = f16vec4(0.4638671875hf, 0.30078125hf, 0.457763671875hf, 0.455078125hf); +const f16vec4 add1 = f16vec4(-0.36376953125hf, -0.11517333984375hf, -0.38671875hf, -0.36767578125hf); + +void main() +{ + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 outSize = imageSize(dstA); + ivec2 base = ivec2(gl_WorkGroupID.xy) * 16; + vec2 inSize = vec2(textureSize(srcA, 0)); + vec2 invSize = vec2(1.0) / inSize; + bool ok = !(p.x >= outSize.x || p.y >= outSize.y); + + for (uint idx = gl_LocalInvocationIndex; idx < 324u; idx += 256u) { + uint i = idx % 18u; + uint j = idx / 18u; + ivec2 c = base + ivec2(int(i), int(j)) - ivec2(1); + vec2 uv = (vec2(c) + 0.5) * invSize; + tileA[i][j] = f16vec4(textureLod(srcA, uv, 0.0)); + tileB[i][j] = f16vec4(textureLod(srcB, uv, 0.0)); + } + barrier(); + + ivec2 lid = ivec2(gl_LocalInvocationID.xy); + f16vec4 t0 = tileA[lid.x + 0][lid.y + 0]; + f16vec4 t1 = tileA[lid.x + 0][lid.y + 1]; + f16vec4 t2 = tileA[lid.x + 0][lid.y + 2]; + f16vec4 t3 = tileA[lid.x + 1][lid.y + 0]; + f16vec4 t4 = tileA[lid.x + 1][lid.y + 1]; + f16vec4 t5 = tileA[lid.x + 1][lid.y + 2]; + f16vec4 t6 = tileA[lid.x + 2][lid.y + 0]; + f16vec4 t7 = tileA[lid.x + 2][lid.y + 1]; + f16vec4 t8 = tileA[lid.x + 2][lid.y + 2]; + f16vec4 t9 = tileB[lid.x + 0][lid.y + 0]; + f16vec4 t10 = tileB[lid.x + 0][lid.y + 1]; + f16vec4 t11 = tileB[lid.x + 0][lid.y + 2]; + f16vec4 t12 = tileB[lid.x + 1][lid.y + 0]; + f16vec4 t13 = tileB[lid.x + 1][lid.y + 1]; + f16vec4 t14 = tileB[lid.x + 1][lid.y + 2]; + f16vec4 t15 = tileB[lid.x + 2][lid.y + 0]; + f16vec4 t16 = tileB[lid.x + 2][lid.y + 1]; + f16vec4 t17 = tileB[lid.x + 2][lid.y + 2]; + + if (ok) { + f16vec4 r0 = w0_0 * t0; + r0 += w0_1 * t1; + r0 += w0_2 * t2; + r0 += w0_3 * t3; + r0 += w0_4 * t4; + r0 += w0_5 * t5; + r0 += w0_6 * t6; + r0 += w0_7 * t7; + r0 += w0_8 * t8; + r0 += w0_9 * t9; + r0 += w0_10 * t10; + r0 += w0_11 * t11; + r0 += w0_12 * t12; + r0 += w0_13 * t13; + r0 += w0_14 * t14; + r0 += w0_15 * t15; + r0 += w0_16 * t16; + r0 += w0_17 * t17; + r0 = (r0 - sub0) * mul0 + add0; + imageStore(dstA, p, vec4(r0)); + + f16vec4 r1 = w1_0 * t0; + r1 += w1_1 * t1; + r1 += w1_2 * t2; + r1 += w1_3 * t3; + r1 += w1_4 * t4; + r1 += w1_5 * t5; + r1 += w1_6 * t6; + r1 += w1_7 * t7; + r1 += w1_8 * t8; + r1 += w1_9 * t9; + r1 += w1_10 * t10; + r1 += w1_11 * t11; + r1 += w1_12 * t12; + r1 += w1_13 * t13; + r1 += w1_14 * t14; + r1 += w1_15 * t15; + r1 += w1_16 * t16; + r1 += w1_17 * t17; + r1 = (r1 - sub1) * mul1 + add1; + imageStore(dstB, p, vec4(r1)); + } +} diff --git a/cleanroom/glsl/shader_19.comp b/cleanroom/glsl/shader_19.comp new file mode 100644 index 0000000..343df93 --- /dev/null +++ b/cleanroom/glsl/shader_19.comp @@ -0,0 +1,100 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 0) uniform Params { + float reserved0; + float phase; + float reserved1; +} ub; + +layout(set = 0, binding = 32) uniform sampler2D convIn0; +layout(set = 0, binding = 33) uniform sampler2D convIn1; +layout(set = 0, binding = 34) uniform sampler2D coarseFlow; +layout(set = 0, binding = 35) uniform sampler2D maskTex; +layout(set = 0, binding = 48, rgba16f) uniform writeonly image2D flowOut; + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + if (any(greaterThanEqual(p, imageSize(flowOut)))) return; + + vec2 sz = vec2(textureSize(convIn0, 0)); + vec2 pc = vec2(p) + 0.5; + vec2 uv = pc / sz; + + // 3x3 conv, 8 channels in -> 2-channel flow correction (rx, ry). + f16vec4 tap; + float16_t rx, ry; + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(-1, -1))); + rx = dot(f16vec4(0.1260986328125hf, 0.330810546875hf, -0.036956787109375hf, -0.117919921875hf), tap); + ry = dot(f16vec4(-0.0162200927734375hf, 0.017547607421875hf, 0.12359619140625hf, -0.006114959716796875hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(-1, 0))); + rx += dot(f16vec4(0.24658203125hf, 0.419677734375hf, -0.01541900634765625hf, -0.1986083984375hf), tap); + ry += dot(f16vec4(0.0119476318359375hf, 0.0227813720703125hf, 0.247314453125hf, -0.04083251953125hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(-1, 1))); + rx += dot(f16vec4(0.1357421875hf, 0.222900390625hf, 0.029571533203125hf, -0.09674072265625hf), tap); + ry += dot(f16vec4(0.039886474609375hf, 0.04815673828125hf, 0.12841796875hf, -0.05419921875hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(0, -1))); + rx += dot(f16vec4(0.2388916015625hf, 0.4619140625hf, -0.0283660888671875hf, -0.265869140625hf), tap); + ry += dot(f16vec4(0.00408172607421875hf, 0.031341552734375hf, 0.196044921875hf, -0.031402587890625hf), tap); + tap = f16vec4(textureLod(convIn0, uv, 0.0)); + rx += dot(f16vec4(0.376708984375hf, 0.58056640625hf, -0.032684326171875hf, -0.34619140625hf), tap); + ry += dot(f16vec4(0.01690673828125hf, 0.02752685546875hf, 0.35986328125hf, -0.04156494140625hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(0, 1))); + rx += dot(f16vec4(0.262451171875hf, 0.3984375hf, -0.02764892578125hf, -0.260986328125hf), tap); + ry += dot(f16vec4(0.046630859375hf, 0.01959228515625hf, 0.219482421875hf, -0.04473876953125hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(1, -1))); + rx += dot(f16vec4(0.1068115234375hf, 0.30224609375hf, -0.0179901123046875hf, -0.162353515625hf), tap); + ry += dot(f16vec4(0.024658203125hf, 0.0709228515625hf, 0.1243896484375hf, -0.0546875hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(1, 0))); + rx += dot(f16vec4(0.2362060546875hf, 0.479736328125hf, -0.029083251953125hf, -0.253662109375hf), tap); + ry += dot(f16vec4(0.0005550384521484375hf, 0.03070068359375hf, 0.24365234375hf, -0.031951904296875hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(1, 1))); + rx += dot(f16vec4(0.1170654296875hf, 0.313720703125hf, -0.0261993408203125hf, -0.1697998046875hf), tap); + ry += dot(f16vec4(0.00603485107421875hf, -0.0207366943359375hf, 0.12127685546875hf, 0.0026569366455078125hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(-1, -1))); + rx += dot(f16vec4(0.0186767578125hf, 0.07025146484375hf, -0.2332763671875hf, 0.04833984375hf), tap); + ry += dot(f16vec4(0.24609375hf, -0.12005615234375hf, 0.03277587890625hf, -0.286376953125hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(-1, 0))); + rx += dot(f16vec4(-0.072509765625hf, 0.014801025390625hf, -0.44775390625hf, 0.037384033203125hf), tap); + ry += dot(f16vec4(0.259033203125hf, -0.2471923828125hf, -0.077392578125hf, -0.4326171875hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(-1, 1))); + rx += dot(f16vec4(-0.00324249267578125hf, -0.02630615234375hf, -0.227783203125hf, 0.0521240234375hf), tap); + ry += dot(f16vec4(0.1575927734375hf, -0.14013671875hf, -0.005107879638671875hf, -0.3173828125hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(0, -1))); + rx += dot(f16vec4(-0.0030841827392578125hf, 0.0301666259765625hf, -0.4052734375hf, 0.059478759765625hf), tap); + ry += dot(f16vec4(0.388427734375hf, -0.22998046875hf, -0.05816650390625hf, -0.468017578125hf), tap); + tap = f16vec4(textureLod(convIn1, uv, 0.0)); + rx += dot(f16vec4(-0.04327392578125hf, 0.04168701171875hf, -0.486328125hf, 0.07574462890625hf), tap); + ry += dot(f16vec4(0.393310546875hf, -0.3916015625hf, -0.0718994140625hf, -0.513671875hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(0, 1))); + rx += dot(f16vec4(-0.01335906982421875hf, 0.033905029296875hf, -0.450439453125hf, 0.0604248046875hf), tap); + ry += dot(f16vec4(0.31787109375hf, -0.2354736328125hf, 0.0000979900360107421875hf, -0.47314453125hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(1, -1))); + rx += dot(f16vec4(0.052947998046875hf, -0.0005550384521484375hf, -0.244384765625hf, 0.0305633544921875hf), tap); + ry += dot(f16vec4(0.327392578125hf, -0.140869140625hf, -0.034423828125hf, -0.32421875hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(1, 0))); + rx += dot(f16vec4(-0.044219970703125hf, 0.042694091796875hf, -0.41162109375hf, 0.025421142578125hf), tap); + ry += dot(f16vec4(0.3115234375hf, -0.2763671875hf, -0.0806884765625hf, -0.423095703125hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(1, 1))); + rx += dot(f16vec4(-0.004894256591796875hf, 0.0697021484375hf, -0.276611328125hf, 0.0504150390625hf), tap); + ry += dot(f16vec4(0.148681640625hf, -0.1376953125hf, 0.0212249755859375hf, -0.314697265625hf), tap); + rx += -0.00100994110107421875hf; + ry += 0.029144287109375hf; + + f16vec4 base = f16vec4(textureLod(coarseFlow, uv, 0.0)) * 2.0hf; + f16vec2 fwd = base.xy + f16vec2(rx, ry); + f16vec2 bwd = base.zw - f16vec2(rx, ry); + + vec2 probeF = (pc + (vec2(fwd) * (2.0 * ub.phase)) * 0.25) / sz; + float16_t wF = 1.0hf - float16_t(textureLod(maskTex, probeF, 0.0).x); + f16vec2 fwdW = fwd * wF; + + vec2 probeB = (pc + (vec2(bwd) * (2.0 * (1.0 - ub.phase))) * 0.25) / sz; + float16_t wB = 1.0hf - float16_t(textureLod(maskTex, probeB, 0.0).x); + f16vec2 bwdW = bwd * wB; + + float16_t wC = 1.0hf - float16_t(textureLod(maskTex, uv, 0.0).x); + imageStore(flowOut, p, vec4(f16vec4(fwdW.x, fwdW.y, bwdW.x, bwdW.y) * wC)); +} diff --git a/cleanroom/glsl/shader_20.comp b/cleanroom/glsl/shader_20.comp new file mode 100644 index 0000000..54abbb8 --- /dev/null +++ b/cleanroom/glsl/shader_20.comp @@ -0,0 +1,76 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 0, std140) uniform Params { + float member0; // never read + float alpha; + float member2; // never read +} u; + +layout(set = 0, binding = 32) uniform sampler2D featPrev; +layout(set = 0, binding = 33) uniform sampler2D featCurr; +layout(set = 0, binding = 34) uniform sampler2D refPrev; +layout(set = 0, binding = 35) uniform sampler2D refCurr; +layout(set = 0, binding = 36) uniform sampler2D flowTex; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D outCost03; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D outCost47; +layout(set = 0, binding = 50, rgba8) uniform writeonly image2D outCost8; + +const f16vec4 C1 = f16vec4(2.646484375hf, 2.720703125hf, 2.650390625hf, 2.740234375hf); +const f16vec4 S1 = f16vec4(0.810546875hf, 0.947265625hf, 0.80419921875hf, 0.89697265625hf); +const f16vec4 B1 = f16vec4(0.19873046875hf, 0.341064453125hf, 0.1671142578125hf, 0.30908203125hf); + +const f16vec4 C2 = f16vec4(2.91796875hf, 2.751953125hf, 2.642578125hf, 2.71484375hf); +const f16vec4 S2 = f16vec4(0.8369140625hf, 0.86474609375hf, 0.93603515625hf, 0.89501953125hf); +const f16vec4 B2 = f16vec4(0.313720703125hf, 0.31103515625hf, 0.1827392578125hf, 0.30517578125hf); + +const float16_t C3 = 2.650390625hf; +const float16_t S3 = 0.89794921875hf; +const float16_t B3 = 0.2105712890625hf; + +#define CORR_OFF(off) \ + (dot(F0, f16vec4(textureLodOffset(refPrev, uvB, 0.0, off))) + \ + dot(F1, f16vec4(textureLodOffset(refCurr, uvB, 0.0, off)))) + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + if (any(greaterThanEqual(p, imageSize(outCost03)))) { + return; + } + + vec2 S = vec2(textureSize(featPrev, 0)); + vec2 pc = vec2(gl_GlobalInvocationID.xy) + vec2(0.5, 0.5); + vec2 uv = pc / S; + + f16vec4 f = f16vec4(textureLod(flowTex, uv, 0.0)); + float16_t tH = float16_t(u.alpha); + float16_t uH = float16_t(1.0 - u.alpha); + f16vec2 dA = f.xy * tH; + f16vec2 dB = f.zw * uH; + vec2 uvA = (pc + vec2(dA)) / S; + vec2 uvB = (pc + vec2(dB)) / S; + + f16vec4 F0 = f16vec4(textureLod(featPrev, uvA, 0.0)); + f16vec4 F1 = f16vec4(textureLod(featCurr, uvA, 0.0)); + + f16vec4 v1 = f16vec4(CORR_OFF(ivec2(-1, -1)), + CORR_OFF(ivec2( 0, -1)), + CORR_OFF(ivec2( 1, -1)), + CORR_OFF(ivec2(-1, 0))); + imageStore(outCost03, p, vec4((v1 - C1) * S1 + B1)); + + // center tap: no offset + float16_t cc = dot(F0, f16vec4(textureLod(refPrev, uvB, 0.0))) + + dot(F1, f16vec4(textureLod(refCurr, uvB, 0.0))); + + f16vec4 v2 = f16vec4(cc, + CORR_OFF(ivec2( 1, 0)), + CORR_OFF(ivec2(-1, 1)), + CORR_OFF(ivec2( 0, 1))); + imageStore(outCost47, p, vec4((v2 - C2) * S2 + B2)); + + float16_t s = CORR_OFF(ivec2(1, 1)); + imageStore(outCost8, p, vec4(float((s - C3) * S3 + B3), 0.0, 0.0, 0.0)); +} diff --git a/cleanroom/glsl/shader_21.comp b/cleanroom/glsl/shader_21.comp new file mode 100644 index 0000000..d0875eb --- /dev/null +++ b/cleanroom/glsl/shader_21.comp @@ -0,0 +1,326 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_21: 3x3 stride-1 conv, 9->8 channels, zero-padded texelFetch + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcA; +layout(set = 0, binding = 33) uniform sampler2D srcB; +layout(set = 0, binding = 34) uniform sampler2D srcC; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstA; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; + +// zero-padded fetch for non-center taps +f16vec4 padTap(sampler2D img, ivec2 c) +{ + bool inb = c.x >= 0 && c.y >= 0; + if (inb) { + ivec2 sz = textureSize(img, 0); + inb = c.x < sz.x && c.y < sz.y; + } + return inb ? f16vec4(texelFetch(img, c, 0)) : f16vec4(0.0hf); +} + +const f16mat4 w0_0 = f16mat4( + f16vec4(-0.0160064697265625hf, -0.1934814453125hf, -0.24072265625hf, 0.10430908203125hf), + f16vec4(0.0201568603515625hf, 0.09698486328125hf, 0.392822265625hf, 0.36279296875hf), + f16vec4(0.27978515625hf, 0.334228515625hf, 0.32275390625hf, 0.26708984375hf), + f16vec4(-0.2578125hf, 0.316162109375hf, 0.206787109375hf, -0.061614990234375hf)); +const f16mat4 w0_1 = f16mat4( + f16vec4(-0.27392578125hf, 0.06719970703125hf, 0.2325439453125hf, 0.2431640625hf), + f16vec4(0.096435546875hf, 0.281005859375hf, 0.57373046875hf, 0.5283203125hf), + f16vec4(-0.310302734375hf, 0.53564453125hf, 0.254150390625hf, 0.1533203125hf), + f16vec4(-0.2138671875hf, 0.0343017578125hf, 0.2291259765625hf, -0.03521728515625hf)); +const f16mat4 w0_2 = f16mat4( + f16vec4(0.00432586669921875hf, -0.387451171875hf, -0.0479736328125hf, 0.10601806640625hf), + f16vec4(0.14013671875hf, -0.38623046875hf, 0.75390625hf, 0.79248046875hf), + f16vec4(-0.01343536376953125hf, 0.48095703125hf, 0.128173828125hf, 0.49658203125hf), + f16vec4(0.161865234375hf, -0.1549072265625hf, -0.04974365234375hf, -0.48876953125hf)); +const f16mat4 w0_3 = f16mat4( + f16vec4(0.241455078125hf, -0.0775146484375hf, -0.2578125hf, -0.4375hf), + f16vec4(0.190185546875hf, -0.1571044921875hf, 0.17626953125hf, 0.046356201171875hf), + f16vec4(0.1884765625hf, 0.214111328125hf, -0.30712890625hf, 0.039459228515625hf), + f16vec4(0.311279296875hf, 0.2147216796875hf, -0.1495361328125hf, -0.416748046875hf)); +const f16mat4 w0_4 = f16mat4( + f16vec4(-0.1043701171875hf, -0.00278472900390625hf, -0.11322021484375hf, -0.4345703125hf), + f16vec4(0.16748046875hf, -0.10009765625hf, -0.0297088623046875hf, -0.21142578125hf), + f16vec4(-0.4306640625hf, -0.216796875hf, 0.373291015625hf, -0.03570556640625hf), + f16vec4(-0.4521484375hf, 0.157958984375hf, 0.07196044921875hf, -0.392578125hf)); +const f16mat4 w0_5 = f16mat4( + f16vec4(-0.263427734375hf, -0.091552734375hf, 0.28125hf, 0.1358642578125hf), + f16vec4(0.293212890625hf, 0.35595703125hf, 0.7265625hf, 0.6640625hf), + f16vec4(0.302490234375hf, 0.54638671875hf, 0.498046875hf, 0.28076171875hf), + f16vec4(-0.48291015625hf, 0.5751953125hf, 0.2138671875hf, -0.323974609375hf)); +const f16mat4 w0_6 = f16mat4( + f16vec4(-0.220947265625hf, -0.035858154296875hf, 0.29296875hf, 0.08941650390625hf), + f16vec4(0.04193115234375hf, 0.0777587890625hf, 0.290771484375hf, 0.46240234375hf), + f16vec4(0.2176513671875hf, 0.360595703125hf, -0.0208587646484375hf, -0.06658935546875hf), + f16vec4(-0.46044921875hf, 0.25146484375hf, 0.0845947265625hf, -0.25732421875hf)); +const f16mat4 w0_7 = f16mat4( + f16vec4(-0.28955078125hf, -0.1717529296875hf, -0.112060546875hf, -0.282958984375hf), + f16vec4(-0.0258941650390625hf, -0.10723876953125hf, 0.45654296875hf, 0.412353515625hf), + f16vec4(0.1766357421875hf, 0.328369140625hf, 0.38525390625hf, 0.10235595703125hf), + f16vec4(-0.09344482421875hf, 0.349853515625hf, -0.177978515625hf, -0.53369140625hf)); +const f16mat4 w0_8 = f16mat4( + f16vec4(-0.038299560546875hf, -0.1983642578125hf, 0.34375hf, 0.04107666015625hf), + f16vec4(0.04693603515625hf, -0.0882568359375hf, 0.75146484375hf, 0.373779296875hf), + f16vec4(0.25927734375hf, 0.29443359375hf, 0.2332763671875hf, 0.18115234375hf), + f16vec4(0.1092529296875hf, 0.061370849609375hf, 0.52294921875hf, -0.0994873046875hf)); +const f16mat4 w0_9 = f16mat4( + f16vec4(-0.040496826171875hf, -0.277099609375hf, 0.20361328125hf, -0.0908203125hf), + f16vec4(-0.365478515625hf, 0.26708984375hf, -0.744140625hf, 0.392333984375hf), + f16vec4(0.3359375hf, 0.29150390625hf, 0.058258056640625hf, 0.072998046875hf), + f16vec4(0.7451171875hf, -0.316650390625hf, -0.06414794921875hf, -0.2822265625hf)); +const f16mat4 w0_10 = f16mat4( + f16vec4(-0.3671875hf, -0.423095703125hf, 0.20849609375hf, 0.013275146484375hf), + f16vec4(-0.626953125hf, 0.445556640625hf, -0.6533203125hf, 0.36669921875hf), + f16vec4(0.2303466796875hf, 0.0399169921875hf, -0.4384765625hf, -0.11822509765625hf), + f16vec4(0.01406097412109375hf, 0.33203125hf, -0.346923828125hf, -0.410888671875hf)); +const f16mat4 w0_11 = f16mat4( + f16vec4(-0.402099609375hf, -0.6708984375hf, 0.08294677734375hf, -0.262939453125hf), + f16vec4(-0.68408203125hf, -0.10308837890625hf, -0.483154296875hf, 0.630859375hf), + f16vec4(0.056793212890625hf, 0.1593017578125hf, -0.10321044921875hf, 0.107666015625hf), + f16vec4(0.56396484375hf, -0.10382080078125hf, -0.302978515625hf, -0.4833984375hf)); +const f16mat4 w0_12 = f16mat4( + f16vec4(0.050079345703125hf, -0.76220703125hf, 0.01360321044921875hf, -0.3896484375hf), + f16vec4(-0.384521484375hf, -0.07708740234375hf, -0.53466796875hf, 0.38720703125hf), + f16vec4(0.35498046875hf, -0.1400146484375hf, -0.4638671875hf, -0.114990234375hf), + f16vec4(0.84912109375hf, -0.453857421875hf, -0.55224609375hf, -0.60693359375hf)); +const f16mat4 w0_13 = f16mat4( + f16vec4(-0.028289794921875hf, -0.1700439453125hf, 0.0955810546875hf, -0.31494140625hf), + f16vec4(-0.1697998046875hf, 0.00160694122314453125hf, -0.4599609375hf, -0.2039794921875hf), + f16vec4(-0.51904296875hf, 0.225341796875hf, -0.1380615234375hf, -0.2110595703125hf), + f16vec4(-0.0015811920166015625hf, 0.2137451171875hf, 0.051055908203125hf, -0.141357421875hf)); +const f16mat4 w0_14 = f16mat4( + f16vec4(-0.27001953125hf, -0.30615234375hf, 0.486572265625hf, 0.0919189453125hf), + f16vec4(0.04132080078125hf, 0.275146484375hf, -0.242431640625hf, 0.55517578125hf), + f16vec4(0.176513671875hf, 0.234619140625hf, -0.0634765625hf, -0.0244293212890625hf), + f16vec4(0.10260009765625hf, -0.23291015625hf, 0.1419677734375hf, -0.042510986328125hf)); +const f16mat4 w0_15 = f16mat4( + f16vec4(-0.56005859375hf, -0.7509765625hf, 0.260009765625hf, -0.01222991943359375hf), + f16vec4(-0.31640625hf, 0.0234375hf, -0.267578125hf, 0.48974609375hf), + f16vec4(0.380859375hf, 0.187255859375hf, -0.65234375hf, 0.010528564453125hf), + f16vec4(0.461669921875hf, -0.26953125hf, -0.43701171875hf, -0.337158203125hf)); +const f16mat4 w0_16 = f16mat4( + f16vec4(-0.2435302734375hf, -0.38037109375hf, 0.0243377685546875hf, -0.3662109375hf), + f16vec4(-0.3505859375hf, -0.05755615234375hf, -0.321044921875hf, 0.049591064453125hf), + f16vec4(0.2021484375hf, 0.290283203125hf, -0.175048828125hf, 0.0677490234375hf), + f16vec4(0.3271484375hf, 0.27197265625hf, -0.57373046875hf, -0.3740234375hf)); +const f16mat4 w0_17 = f16mat4( + f16vec4(-0.09521484375hf, -0.57666015625hf, 0.1549072265625hf, -0.177490234375hf), + f16vec4(-0.2120361328125hf, -0.050689697265625hf, -0.416748046875hf, 0.156005859375hf), + f16vec4(0.264404296875hf, 0.10150146484375hf, -0.032318115234375hf, 0.1025390625hf), + f16vec4(0.18994140625hf, -0.036102294921875hf, -0.17333984375hf, -0.2203369140625hf)); +const f16vec4 q0_0 = f16vec4(0.278076171875hf, -0.318603515625hf, -0.204833984375hf, -0.05389404296875hf); +const f16vec4 q0_1 = f16vec4(-0.26904296875hf, -0.06842041015625hf, 0.060394287109375hf, 0.1844482421875hf); +const f16vec4 q0_2 = f16vec4(0.1243896484375hf, -0.499267578125hf, -0.2109375hf, 0.044708251953125hf); +const f16vec4 q0_3 = f16vec4(0.3798828125hf, -0.408935546875hf, -0.2132568359375hf, -0.29443359375hf); +const f16vec4 q0_4 = f16vec4(0.0450439453125hf, 0.1656494140625hf, 0.08953857421875hf, -0.2176513671875hf); +const f16vec4 q0_5 = f16vec4(-0.058441162109375hf, 0.12457275390625hf, 0.2269287109375hf, 0.271484375hf); +const f16vec4 q0_6 = f16vec4(-0.0693359375hf, -0.1767578125hf, 0.1937255859375hf, 0.148681640625hf); +const f16vec4 q0_7 = f16vec4(0.2354736328125hf, 0.002330780029296875hf, -0.297607421875hf, -0.435546875hf); +const f16vec4 q0_8 = f16vec4(-0.11492919921875hf, -0.186279296875hf, 0.06671142578125hf, -0.0237579345703125hf); +const f16vec4 sub0 = f16vec4(-0.27294921875hf, -0.40625hf, 0.110595703125hf, -0.07379150390625hf); +const f16vec4 mul0 = f16vec4(1.232421875hf, 0.97314453125hf, 1.166015625hf, 0.759765625hf); +const f16vec4 add0 = f16vec4(0.1802978515625hf, 0.1258544921875hf, 0.57373046875hf, 0.2047119140625hf); + +const f16mat4 w1_0 = f16mat4( + f16vec4(0.267822265625hf, 0.294921875hf, 0.393798828125hf, -0.275146484375hf), + f16vec4(0.30810546875hf, -0.11566162109375hf, 0.039794921875hf, 0.241455078125hf), + f16vec4(-0.08575439453125hf, -0.165283203125hf, 0.0458984375hf, 0.12091064453125hf), + f16vec4(0.038970947265625hf, -0.0001499652862548828125hf, 0.040191650390625hf, 0.400146484375hf)); +const f16mat4 w1_1 = f16mat4( + f16vec4(0.300048828125hf, 0.1363525390625hf, 0.458984375hf, 0.01386260986328125hf), + f16vec4(0.271728515625hf, 0.1669921875hf, -0.1279296875hf, -0.0209808349609375hf), + f16vec4(-0.2318115234375hf, 0.13037109375hf, -0.165283203125hf, -0.29833984375hf), + f16vec4(-0.08197021484375hf, 0.0313720703125hf, -0.052947998046875hf, 0.1871337890625hf)); +const f16mat4 w1_2 = f16mat4( + f16vec4(0.382568359375hf, 0.1173095703125hf, 0.7451171875hf, 0.18505859375hf), + f16vec4(0.6982421875hf, 0.0131988525390625hf, 0.146240234375hf, 0.1357421875hf), + f16vec4(0.09417724609375hf, 0.210693359375hf, -0.06304931640625hf, -0.3525390625hf), + f16vec4(-0.1810302734375hf, -0.01435089111328125hf, -0.059112548828125hf, 0.423583984375hf)); +const f16mat4 w1_3 = f16mat4( + f16vec4(0.1539306640625hf, -0.255126953125hf, 0.38818359375hf, 0.298828125hf), + f16vec4(0.2216796875hf, -0.06488037109375hf, -0.10406494140625hf, 0.043609619140625hf), + f16vec4(-0.240966796875hf, 0.306884765625hf, -0.09222412109375hf, -0.51123046875hf), + f16vec4(-0.11712646484375hf, -0.418701171875hf, -0.2017822265625hf, 0.5615234375hf)); +const f16mat4 w1_4 = f16mat4( + f16vec4(0.0528564453125hf, -0.1988525390625hf, -0.60205078125hf, -0.183349609375hf), + f16vec4(-0.1029052734375hf, 0.0201263427734375hf, -0.45849609375hf, -0.21142578125hf), + f16vec4(-0.2071533203125hf, -0.2413330078125hf, -0.156982421875hf, -0.1741943359375hf), + f16vec4(-0.1666259765625hf, -0.05889892578125hf, -0.5556640625hf, -0.060882568359375hf)); +const f16mat4 w1_5 = f16mat4( + f16vec4(0.6064453125hf, -0.1287841796875hf, 0.285888671875hf, 0.1195068359375hf), + f16vec4(0.78857421875hf, 0.130859375hf, 0.294921875hf, -0.032623291015625hf), + f16vec4(0.1158447265625hf, -0.396484375hf, 0.217041015625hf, -0.26806640625hf), + f16vec4(0.0938720703125hf, -0.11431884765625hf, -0.11572265625hf, 0.4697265625hf)); +const f16mat4 w1_6 = f16mat4( + f16vec4(0.63134765625hf, 0.1671142578125hf, 0.8203125hf, 0.13134765625hf), + f16vec4(0.37255859375hf, 0.175537109375hf, -0.005756378173828125hf, 0.109130859375hf), + f16vec4(-0.058380126953125hf, -0.263916015625hf, 0.0009784698486328125hf, 0.0258636474609375hf), + f16vec4(-0.00827789306640625hf, -0.1964111328125hf, 0.271240234375hf, 0.67822265625hf)); +const f16mat4 w1_7 = f16mat4( + f16vec4(0.2381591796875hf, -0.11077880859375hf, 0.4775390625hf, 0.15673828125hf), + f16vec4(0.3173828125hf, 0.004878997802734375hf, -0.251220703125hf, 0.390869140625hf), + f16vec4(0.1458740234375hf, -0.255615234375hf, -0.2359619140625hf, 0.23193359375hf), + f16vec4(-0.19921875hf, -0.278564453125hf, 0.2464599609375hf, 0.970703125hf)); +const f16mat4 w1_8 = f16mat4( + f16vec4(0.8173828125hf, -0.1031494140625hf, 1.1162109375hf, 0.354248046875hf), + f16vec4(0.703125hf, -0.163818359375hf, -0.11090087890625hf, 0.3310546875hf), + f16vec4(0.051300048828125hf, -0.305419921875hf, -0.179443359375hf, -0.0823974609375hf), + f16vec4(0.1109619140625hf, -0.1534423828125hf, 0.01904296875hf, 0.630859375hf)); +const f16mat4 w1_9 = f16mat4( + f16vec4(-0.2724609375hf, -0.28076171875hf, -0.6455078125hf, -0.1473388671875hf), + f16vec4(-0.26708984375hf, 0.246826171875hf, -0.0202178955078125hf, -0.34814453125hf), + f16vec4(-0.05169677734375hf, 0.0088653564453125hf, -0.1993408203125hf, 0.0753173828125hf), + f16vec4(-0.23291015625hf, 0.10052490234375hf, -0.04473876953125hf, -0.50732421875hf)); +const f16mat4 w1_10 = f16mat4( + f16vec4(-0.353759765625hf, -0.1341552734375hf, -0.64697265625hf, -0.31298828125hf), + f16vec4(-0.312744140625hf, 0.42529296875hf, -0.11505126953125hf, -0.416015625hf), + f16vec4(-0.146484375hf, -0.08203125hf, -0.005462646484375hf, 0.06488037109375hf), + f16vec4(-0.0077972412109375hf, -0.0333251953125hf, 0.51171875hf, -0.12255859375hf)); +const f16mat4 w1_11 = f16mat4( + f16vec4(-0.23486328125hf, -0.27099609375hf, -0.321533203125hf, -0.12841796875hf), + f16vec4(-0.309326171875hf, 0.39599609375hf, -0.2120361328125hf, -0.440185546875hf), + f16vec4(0.11761474609375hf, -0.037261962890625hf, -0.261474609375hf, -0.13330078125hf), + f16vec4(-0.2005615234375hf, -0.107666015625hf, 0.1009521484375hf, -0.114013671875hf)); +const f16mat4 w1_12 = f16mat4( + f16vec4(-0.34716796875hf, -0.229736328125hf, -0.71875hf, -0.239990234375hf), + f16vec4(-0.153076171875hf, 0.2144775390625hf, 0.080810546875hf, -0.470947265625hf), + f16vec4(-0.35791015625hf, -0.45751953125hf, -0.248046875hf, 0.1849365234375hf), + f16vec4(-0.3603515625hf, -0.09136962890625hf, -0.416259765625hf, -0.413818359375hf)); +const f16mat4 w1_13 = f16mat4( + f16vec4(-0.298583984375hf, -0.15966796875hf, -0.56787109375hf, -0.251220703125hf), + f16vec4(-0.1500244140625hf, -0.279541015625hf, -0.0087127685546875hf, 0.1337890625hf), + f16vec4(0.0222930908203125hf, -0.203857421875hf, 0.1876220703125hf, 0.044281005859375hf), + f16vec4(0.1607666015625hf, -0.1246337890625hf, 0.2164306640625hf, -0.355712890625hf)); +const f16mat4 w1_14 = f16mat4( + f16vec4(-0.1644287109375hf, -0.1885986328125hf, -0.259521484375hf, -0.2060546875hf), + f16vec4(-0.2056884765625hf, -0.01230621337890625hf, -0.0478515625hf, -0.5869140625hf), + f16vec4(0.004901885986328125hf, -0.47412109375hf, -0.178466796875hf, 0.482421875hf), + f16vec4(-0.0721435546875hf, -0.1278076171875hf, 0.044219970703125hf, -0.2432861328125hf)); +const f16mat4 w1_15 = f16mat4( + f16vec4(-0.277587890625hf, -0.150390625hf, -0.2861328125hf, -0.159912109375hf), + f16vec4(-0.05218505859375hf, 0.237548828125hf, 0.3017578125hf, -0.25439453125hf), + f16vec4(-0.34912109375hf, -0.26220703125hf, -0.0950927734375hf, 0.4248046875hf), + f16vec4(-0.282470703125hf, 0.038909912109375hf, 0.17919921875hf, -0.181640625hf)); +const f16mat4 w1_16 = f16mat4( + f16vec4(-0.32275390625hf, -0.2366943359375hf, -0.363037109375hf, 0.12646484375hf), + f16vec4(-0.276611328125hf, 0.10546875hf, -0.1534423828125hf, 0.1043701171875hf), + f16vec4(-0.00682830810546875hf, -0.218017578125hf, 0.1009521484375hf, 0.238037109375hf), + f16vec4(-0.1202392578125hf, -0.050262451171875hf, -0.007232666015625hf, 0.0079345703125hf)); +const f16mat4 w1_17 = f16mat4( + f16vec4(-0.262451171875hf, -0.1947021484375hf, -0.93359375hf, -0.255859375hf), + f16vec4(-0.302490234375hf, 0.138427734375hf, -0.22509765625hf, -0.31787109375hf), + f16vec4(-0.031524658203125hf, -0.09906005859375hf, -0.06756591796875hf, 0.10333251953125hf), + f16vec4(-0.18115234375hf, 0.140869140625hf, -0.193603515625hf, -0.350830078125hf)); +const f16vec4 q1_0 = f16vec4(-0.045745849609375hf, 1.0361328125hf, 0.39892578125hf, -0.169921875hf); +const f16vec4 q1_1 = f16vec4(0.03924560546875hf, 0.740234375hf, 0.3291015625hf, 0.05828857421875hf); +const f16vec4 q1_2 = f16vec4(-0.07489013671875hf, 0.6240234375hf, 0.490478515625hf, 0.08843994140625hf); +const f16vec4 q1_3 = f16vec4(-0.0582275390625hf, 0.287109375hf, 0.271728515625hf, -0.15185546875hf); +const f16vec4 q1_4 = f16vec4(0.115966796875hf, -0.1065673828125hf, -0.05242919921875hf, -0.029296875hf); +const f16vec4 q1_5 = f16vec4(0.06695556640625hf, 0.372802734375hf, 0.21435546875hf, -0.324951171875hf); +const f16vec4 q1_6 = f16vec4(0.045074462890625hf, 0.54931640625hf, 0.54638671875hf, -0.069580078125hf); +const f16vec4 q1_7 = f16vec4(0.035858154296875hf, 0.203369140625hf, 0.10400390625hf, 0.192626953125hf); +const f16vec4 q1_8 = f16vec4(0.1962890625hf, 0.2138671875hf, 0.33251953125hf, 0.3203125hf); +const f16vec4 sub1 = f16vec4(-0.1522216796875hf, -0.1956787109375hf, -0.5166015625hf, -0.10968017578125hf); +const f16vec4 mul1 = f16vec4(0.5927734375hf, 0.66259765625hf, 1.2197265625hf, 1.0205078125hf); +const f16vec4 add1 = f16vec4(-0.1082763671875hf, 0.019378662109375hf, -0.044586181640625hf, 0.23046875hf); + +void main() +{ + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 ext = imageSize(dstA); + if (p.x >= ext.x || p.y >= ext.y) + return; + + f16vec4 t0 = padTap(srcA, p + ivec2(-1, -1)); + f16vec4 t1 = padTap(srcA, p + ivec2(-1, 0)); + f16vec4 t2 = padTap(srcA, p + ivec2(-1, 1)); + f16vec4 t3 = padTap(srcA, p + ivec2(0, -1)); + f16vec4 t4 = f16vec4(texelFetch(srcA, p, 0)); + f16vec4 t5 = padTap(srcA, p + ivec2(0, 1)); + f16vec4 t6 = padTap(srcA, p + ivec2(1, -1)); + f16vec4 t7 = padTap(srcA, p + ivec2(1, 0)); + f16vec4 t8 = padTap(srcA, p + ivec2(1, 1)); + f16vec4 t9 = padTap(srcB, p + ivec2(-1, -1)); + f16vec4 t10 = padTap(srcB, p + ivec2(-1, 0)); + f16vec4 t11 = padTap(srcB, p + ivec2(-1, 1)); + f16vec4 t12 = padTap(srcB, p + ivec2(0, -1)); + f16vec4 t13 = f16vec4(texelFetch(srcB, p, 0)); + f16vec4 t14 = padTap(srcB, p + ivec2(0, 1)); + f16vec4 t15 = padTap(srcB, p + ivec2(1, -1)); + f16vec4 t16 = padTap(srcB, p + ivec2(1, 0)); + f16vec4 t17 = padTap(srcB, p + ivec2(1, 1)); + float16_t s0 = padTap(srcC, p + ivec2(-1, -1)).r; + float16_t s1 = padTap(srcC, p + ivec2(-1, 0)).r; + float16_t s2 = padTap(srcC, p + ivec2(-1, 1)).r; + float16_t s3 = padTap(srcC, p + ivec2(0, -1)).r; + float16_t s4 = float16_t(texelFetch(srcC, p, 0).r); + float16_t s5 = padTap(srcC, p + ivec2(0, 1)).r; + float16_t s6 = padTap(srcC, p + ivec2(1, -1)).r; + float16_t s7 = padTap(srcC, p + ivec2(1, 0)).r; + float16_t s8 = padTap(srcC, p + ivec2(1, 1)).r; + + f16vec4 r0 = w0_0 * t0; + r0 += w0_1 * t1; + r0 += w0_2 * t2; + r0 += w0_3 * t3; + r0 += w0_4 * t4; + r0 += w0_5 * t5; + r0 += w0_6 * t6; + r0 += w0_7 * t7; + r0 += w0_8 * t8; + r0 += w0_9 * t9; + r0 += w0_10 * t10; + r0 += w0_11 * t11; + r0 += w0_12 * t12; + r0 += w0_13 * t13; + r0 += w0_14 * t14; + r0 += w0_15 * t15; + r0 += w0_16 * t16; + r0 += w0_17 * t17; + r0 += q0_0 * s0; + r0 += q0_1 * s1; + r0 += q0_2 * s2; + r0 += q0_3 * s3; + r0 += q0_4 * s4; + r0 += q0_5 * s5; + r0 += q0_6 * s6; + r0 += q0_7 * s7; + r0 += q0_8 * s8; + r0 = (r0 - sub0) * mul0 + add0; + imageStore(dstA, p, vec4(r0)); + + f16vec4 r1 = w1_0 * t0; + r1 += w1_1 * t1; + r1 += w1_2 * t2; + r1 += w1_3 * t3; + r1 += w1_4 * t4; + r1 += w1_5 * t5; + r1 += w1_6 * t6; + r1 += w1_7 * t7; + r1 += w1_8 * t8; + r1 += w1_9 * t9; + r1 += w1_10 * t10; + r1 += w1_11 * t11; + r1 += w1_12 * t12; + r1 += w1_13 * t13; + r1 += w1_14 * t14; + r1 += w1_15 * t15; + r1 += w1_16 * t16; + r1 += w1_17 * t17; + r1 += q1_0 * s0; + r1 += q1_1 * s1; + r1 += q1_2 * s2; + r1 += q1_3 * s3; + r1 += q1_4 * s4; + r1 += q1_5 * s5; + r1 += q1_6 * s6; + r1 += q1_7 * s7; + r1 += q1_8 * s8; + r1 = (r1 - sub1) * mul1 + add1; + imageStore(dstB, p, vec4(r1)); + +} diff --git a/cleanroom/glsl/shader_22.comp b/cleanroom/glsl/shader_22.comp new file mode 100644 index 0000000..af71e57 --- /dev/null +++ b/cleanroom/glsl/shader_22.comp @@ -0,0 +1,280 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_22: 3x3 stride-1 conv, 8->8 channels, zero-padded texelFetch + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcA; +layout(set = 0, binding = 33) uniform sampler2D srcB; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstA; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; + +// zero-padded fetch for non-center taps +f16vec4 padTap(sampler2D img, ivec2 c) +{ + bool inb = c.x >= 0 && c.y >= 0; + if (inb) { + ivec2 sz = textureSize(img, 0); + inb = c.x < sz.x && c.y < sz.y; + } + return inb ? f16vec4(texelFetch(img, c, 0)) : f16vec4(0.0hf); +} + +const f16mat4 w0_0 = f16mat4( + f16vec4(-0.39208984375hf, -0.16064453125hf, -0.1622314453125hf, -0.15234375hf), + f16vec4(-0.2103271484375hf, 0.2308349609375hf, 0.0157623291015625hf, 0.8623046875hf), + f16vec4(0.78173828125hf, -0.06390380859375hf, 0.1868896484375hf, -0.07928466796875hf), + f16vec4(-0.019683837890625hf, 0.1729736328125hf, 0.0167083740234375hf, 0.21533203125hf)); +const f16mat4 w0_1 = f16mat4( + f16vec4(-0.0005588531494140625hf, 0.0731201171875hf, -0.147216796875hf, 0.208740234375hf), + f16vec4(-0.175048828125hf, 0.3935546875hf, 0.21240234375hf, 0.42236328125hf), + f16vec4(0.352294921875hf, -0.0372314453125hf, 0.17724609375hf, -0.159912109375hf), + f16vec4(0.101806640625hf, 0.06744384765625hf, 0.24462890625hf, 0.195556640625hf)); +const f16mat4 w0_2 = f16mat4( + f16vec4(-0.36474609375hf, -0.30322265625hf, -0.399169921875hf, -0.133544921875hf), + f16vec4(-0.1400146484375hf, 0.41552734375hf, 0.03875732421875hf, 0.93798828125hf), + f16vec4(0.84716796875hf, -0.171142578125hf, 0.057647705078125hf, -0.32763671875hf), + f16vec4(0.1781005859375hf, -0.1695556640625hf, -0.1390380859375hf, 0.047027587890625hf)); +const f16mat4 w0_3 = f16mat4( + f16vec4(-0.1871337890625hf, 0.03082275390625hf, -0.001495361328125hf, -0.0269927978515625hf), + f16vec4(0.05487060546875hf, 0.1419677734375hf, 0.1771240234375hf, 0.488037109375hf), + f16vec4(0.354736328125hf, 0.1441650390625hf, 0.1376953125hf, 0.0296630859375hf), + f16vec4(0.0043792724609375hf, 0.1890869140625hf, 0.1551513671875hf, 0.213134765625hf)); +const f16mat4 w0_4 = f16mat4( + f16vec4(0.2154541015625hf, 0.246337890625hf, -0.0159454345703125hf, 0.342041015625hf), + f16vec4(0.0343017578125hf, 0.328125hf, 0.289794921875hf, 0.1583251953125hf), + f16vec4(0.041015625hf, 0.170654296875hf, 0.1876220703125hf, 0.0198516845703125hf), + f16vec4(0.051483154296875hf, 0.2161865234375hf, 0.367431640625hf, 0.256591796875hf)); +const f16mat4 w0_5 = f16mat4( + f16vec4(-0.1533203125hf, -0.10565185546875hf, -0.2509765625hf, 0.049957275390625hf), + f16vec4(-0.01403045654296875hf, 0.345703125hf, 0.0184173583984375hf, 0.62939453125hf), + f16vec4(0.41259765625hf, 0.05108642578125hf, 0.1182861328125hf, -0.03265380859375hf), + f16vec4(0.06585693359375hf, 0.12115478515625hf, -0.0345458984375hf, 0.2139892578125hf)); +const f16mat4 w0_6 = f16mat4( + f16vec4(-0.2783203125hf, 0.2415771484375hf, -0.03472900390625hf, -0.3720703125hf), + f16vec4(-0.05181884765625hf, 0.1632080078125hf, 0.2305908203125hf, 0.837890625hf), + f16vec4(0.818359375hf, -0.0560302734375hf, -0.0054473876953125hf, -0.326171875hf), + f16vec4(0.251220703125hf, 0.04888916015625hf, 0.1387939453125hf, -0.1558837890625hf)); +const f16mat4 w0_7 = f16mat4( + f16vec4(0.1002197265625hf, 0.45166015625hf, -0.10052490234375hf, 0.0208892822265625hf), + f16vec4(-0.16259765625hf, 0.302001953125hf, 0.29296875hf, 0.477783203125hf), + f16vec4(0.420166015625hf, 0.0205230712890625hf, 0.16259765625hf, -0.2474365234375hf), + f16vec4(0.1956787109375hf, 0.158447265625hf, 0.32080078125hf, -0.01238250732421875hf)); +const f16mat4 w0_8 = f16mat4( + f16vec4(-0.2349853515625hf, 0.06854248046875hf, -0.342529296875hf, -0.306640625hf), + f16vec4(-0.279296875hf, 0.261474609375hf, 0.0167083740234375hf, 0.91455078125hf), + f16vec4(0.87939453125hf, -0.11370849609375hf, 0.137939453125hf, -0.240234375hf), + f16vec4(0.12548828125hf, 0.2215576171875hf, -0.1480712890625hf, 0.03826904296875hf)); +const f16mat4 w0_9 = f16mat4( + f16vec4(0.1683349609375hf, 0.63525390625hf, -0.029693603515625hf, 0.1593017578125hf), + f16vec4(0.10699462890625hf, -0.01496124267578125hf, 1.123046875hf, -0.062408447265625hf), + f16vec4(0.08441162109375hf, -0.4677734375hf, -0.76806640625hf, -0.77685546875hf), + f16vec4(-0.65380859375hf, 0.30029296875hf, -0.56640625hf, 0.546875hf)); +const f16mat4 w0_10 = f16mat4( + f16vec4(0.263916015625hf, 0.78857421875hf, 0.18115234375hf, 0.3427734375hf), + f16vec4(0.11297607421875hf, 0.1378173828125hf, 0.11199951171875hf, 0.1688232421875hf), + f16vec4(-0.057891845703125hf, -0.49072265625hf, -0.7431640625hf, -0.5263671875hf), + f16vec4(-0.64453125hf, 0.18212890625hf, -0.433349609375hf, 0.1845703125hf)); +const f16mat4 w0_11 = f16mat4( + f16vec4(0.2958984375hf, 0.65576171875hf, 0.000743865966796875hf, 0.301513671875hf), + f16vec4(-0.01531982421875hf, 0.223388671875hf, 1.1171875hf, 0.162109375hf), + f16vec4(-0.0131683349609375hf, -0.354736328125hf, -0.6328125hf, -0.6337890625hf), + f16vec4(-0.77978515625hf, -0.0543212890625hf, -0.42431640625hf, 0.51904296875hf)); +const f16mat4 w0_12 = f16mat4( + f16vec4(0.31689453125hf, 0.591796875hf, 0.0232696533203125hf, 0.15576171875hf), + f16vec4(0.0665283203125hf, 0.11920166015625hf, -0.318603515625hf, 0.0202484130859375hf), + f16vec4(0.349853515625hf, -0.1904296875hf, -0.42919921875hf, -0.57080078125hf), + f16vec4(-0.6171875hf, 0.354248046875hf, -0.38525390625hf, 0.578125hf)); +const f16mat4 w0_13 = f16mat4( + f16vec4(0.3720703125hf, 0.74609375hf, 0.1778564453125hf, 0.2822265625hf), + f16vec4(0.1546630859375hf, 0.1563720703125hf, -0.91064453125hf, 0.12261962890625hf), + f16vec4(0.2247314453125hf, -0.288818359375hf, -0.388427734375hf, -0.548828125hf), + f16vec4(-0.6640625hf, 0.296142578125hf, -0.358154296875hf, 0.2822265625hf)); +const f16mat4 w0_14 = f16mat4( + f16vec4(0.4150390625hf, 0.62744140625hf, 0.018341064453125hf, 0.2197265625hf), + f16vec4(0.06646728515625hf, 0.12384033203125hf, -0.1644287109375hf, -0.01465606689453125hf), + f16vec4(0.296630859375hf, -0.236572265625hf, -0.279296875hf, -0.67529296875hf), + f16vec4(-0.7119140625hf, 0.16015625hf, -0.311279296875hf, 0.426513671875hf)); +const f16mat4 w0_15 = f16mat4( + f16vec4(0.21728515625hf, 0.57470703125hf, 0.07989501953125hf, 0.11199951171875hf), + f16vec4(-0.054443359375hf, 0.2122802734375hf, 1.0732421875hf, 0.047271728515625hf), + f16vec4(0.1014404296875hf, -0.392578125hf, -0.65283203125hf, -0.58349609375hf), + f16vec4(-0.76806640625hf, 0.36865234375hf, -0.63623046875hf, 0.6240234375hf)); +const f16mat4 w0_16 = f16mat4( + f16vec4(0.2327880859375hf, 0.82275390625hf, 0.2181396484375hf, 0.2274169921875hf), + f16vec4(0.0831298828125hf, 0.1278076171875hf, 0.1639404296875hf, 0.06658935546875hf), + f16vec4(0.024261474609375hf, -0.6552734375hf, -0.6787109375hf, -0.431640625hf), + f16vec4(-0.74267578125hf, 0.394775390625hf, -0.48046875hf, 0.31298828125hf)); +const f16mat4 w0_17 = f16mat4( + f16vec4(0.236083984375hf, 0.619140625hf, 0.011871337890625hf, 0.0596923828125hf), + f16vec4(0.1260986328125hf, -0.0322265625hf, 1.060546875hf, -0.1793212890625hf), + f16vec4(0.0247955322265625hf, -0.59814453125hf, -0.74951171875hf, -0.6591796875hf), + f16vec4(-0.7939453125hf, 0.332275390625hf, -0.55859375hf, 0.6162109375hf)); +const f16vec4 sub0 = f16vec4(0.70166015625hf, 3.09375hf, -1.11328125hf, 1.04296875hf); +const f16vec4 mul0 = f16vec4(0.5322265625hf, 0.2283935546875hf, 0.481689453125hf, 0.4296875hf); +const f16vec4 add0 = f16vec4(-0.0313720703125hf, -0.6259765625hf, -0.0230560302734375hf, 0.0946044921875hf); + +const f16mat4 w1_0 = f16mat4( + f16vec4(-1.103515625hf, -0.348876953125hf, -0.95556640625hf, -0.61376953125hf), + f16vec4(-0.1705322265625hf, -0.477294921875hf, -0.039642333984375hf, -0.2147216796875hf), + f16vec4(-0.2249755859375hf, -0.037506103515625hf, 0.047760009765625hf, 0.1942138671875hf), + f16vec4(-0.13720703125hf, 1.1669921875hf, 0.08544921875hf, -0.36083984375hf)); +const f16mat4 w1_1 = f16mat4( + f16vec4(-0.0223388671875hf, -0.183837890625hf, -0.2283935546875hf, -0.07196044921875hf), + f16vec4(-0.127197265625hf, -0.6357421875hf, -0.01555633544921875hf, -0.0229644775390625hf), + f16vec4(0.064453125hf, 0.053253173828125hf, 0.1712646484375hf, 0.430908203125hf), + f16vec4(0.58984375hf, 0.310302734375hf, 0.219970703125hf, -0.0611572265625hf)); +const f16mat4 w1_2 = f16mat4( + f16vec4(-1.056640625hf, -0.11083984375hf, -0.90380859375hf, -0.853515625hf), + f16vec4(-0.322998046875hf, -0.65625hf, 0.08355712890625hf, -0.1690673828125hf), + f16vec4(-0.04827880859375hf, 0.034881591796875hf, -0.30126953125hf, -0.026611328125hf), + f16vec4(0.1700439453125hf, 1.2421875hf, -0.083251953125hf, -0.19677734375hf)); +const f16mat4 w1_3 = f16mat4( + f16vec4(-0.01459503173828125hf, -0.204833984375hf, -0.19189453125hf, 0.06256103515625hf), + f16vec4(-0.229248046875hf, -0.432373046875hf, 0.0985107421875hf, 0.0904541015625hf), + f16vec4(-0.0509033203125hf, 0.035736083984375hf, 0.0276641845703125hf, 0.2978515625hf), + f16vec4(0.36669921875hf, -0.05169677734375hf, 0.135009765625hf, 0.060882568359375hf)); +const f16mat4 w1_4 = f16mat4( + f16vec4(1.080078125hf, -0.02508544921875hf, 0.4306640625hf, 0.5390625hf), + f16vec4(-0.1182861328125hf, -0.490234375hf, 0.01212310791015625hf, 0.2783203125hf), + f16vec4(0.2042236328125hf, 0.05596923828125hf, 0.233642578125hf, 0.564453125hf), + f16vec4(1.123046875hf, -0.6650390625hf, 0.324951171875hf, 0.1781005859375hf)); +const f16mat4 w1_5 = f16mat4( + f16vec4(0.048919677734375hf, 0.0247955322265625hf, -0.21533203125hf, -0.204345703125hf), + f16vec4(-0.240478515625hf, -0.453369140625hf, -0.00977325439453125hf, 0.056243896484375hf), + f16vec4(-0.0498046875hf, 0.004608154296875hf, -0.034393310546875hf, 0.2247314453125hf), + f16vec4(0.69677734375hf, -0.0184478759765625hf, -0.0013866424560546875hf, -0.0121002197265625hf)); +const f16mat4 w1_6 = f16mat4( + f16vec4(-1.2275390625hf, -0.461181640625hf, -0.9111328125hf, -0.20556640625hf), + f16vec4(-0.27880859375hf, -0.66748046875hf, 0.2998046875hf, 0.040618896484375hf), + f16vec4(-0.171142578125hf, 0.07763671875hf, -0.191162109375hf, 0.278564453125hf), + f16vec4(-0.0171051025390625hf, 1.2158203125hf, 0.16552734375hf, 0.11749267578125hf)); +const f16mat4 w1_7 = f16mat4( + f16vec4(-0.07025146484375hf, -0.22412109375hf, -0.22412109375hf, 0.297607421875hf), + f16vec4(-0.14306640625hf, -0.70556640625hf, 0.08392333984375hf, 0.17626953125hf), + f16vec4(0.04547119140625hf, 0.05084228515625hf, 0.10186767578125hf, 0.62060546875hf), + f16vec4(0.59765625hf, 0.306396484375hf, 0.391357421875hf, 0.11383056640625hf)); +const f16mat4 w1_8 = f16mat4( + f16vec4(-0.9921875hf, -0.2139892578125hf, -0.880859375hf, -0.436279296875hf), + f16vec4(-0.27197265625hf, -0.65625hf, -0.06866455078125hf, -0.1328125hf), + f16vec4(-0.213623046875hf, -0.10174560546875hf, -0.058624267578125hf, 0.32958984375hf), + f16vec4(0.1258544921875hf, 1.08984375hf, 0.00881195068359375hf, -0.2158203125hf)); +const f16mat4 w1_9 = f16mat4( + f16vec4(0.0024261474609375hf, 0.212646484375hf, -0.12939453125hf, 0.4580078125hf), + f16vec4(0.00742340087890625hf, -0.0032062530517578125hf, 0.3173828125hf, -0.11798095703125hf), + f16vec4(-0.1962890625hf, 0.1043701171875hf, -0.4140625hf, -0.1273193359375hf), + f16vec4(-0.1627197265625hf, 0.216064453125hf, -0.202392578125hf, -0.49560546875hf)); +const f16mat4 w1_10 = f16mat4( + f16vec4(0.03985595703125hf, 0.036468505859375hf, -0.0232391357421875hf, 0.2249755859375hf), + f16vec4(0.0968017578125hf, 0.2431640625hf, 0.1279296875hf, -0.0799560546875hf), + f16vec4(0.231201171875hf, 0.49462890625hf, -0.4775390625hf, -0.0283355712890625hf), + f16vec4(0.255615234375hf, 0.2078857421875hf, -0.336669921875hf, -0.44580078125hf)); +const f16mat4 w1_11 = f16mat4( + f16vec4(-0.10858154296875hf, 0.13525390625hf, -0.2147216796875hf, 0.50927734375hf), + f16vec4(0.029571533203125hf, 0.15966796875hf, 0.225341796875hf, -0.1837158203125hf), + f16vec4(-0.12457275390625hf, 0.171875hf, -0.491455078125hf, -0.27734375hf), + f16vec4(-0.158203125hf, 0.0706787109375hf, -0.3828125hf, -0.57177734375hf)); +const f16mat4 w1_12 = f16mat4( + f16vec4(-0.0025386810302734375hf, 0.19677734375hf, -0.02716064453125hf, 0.513671875hf), + f16vec4(0.138427734375hf, 0.1029052734375hf, -0.2271728515625hf, -0.06451416015625hf), + f16vec4(0.04290771484375hf, 0.1265869140625hf, -0.53759765625hf, 0.1820068359375hf), + f16vec4(0.049041748046875hf, 0.302734375hf, -0.315673828125hf, -0.10693359375hf)); +const f16mat4 w1_13 = f16mat4( + f16vec4(0.041351318359375hf, 0.050933837890625hf, 0.0675048828125hf, 0.232177734375hf), + f16vec4(0.1761474609375hf, 0.280029296875hf, -0.4404296875hf, 0.050872802734375hf), + f16vec4(0.335693359375hf, 0.434814453125hf, -0.6513671875hf, 0.2200927734375hf), + f16vec4(0.395751953125hf, 0.53955078125hf, -0.377685546875hf, -0.1400146484375hf)); +const f16mat4 w1_14 = f16mat4( + f16vec4(-0.1273193359375hf, 0.1854248046875hf, -0.089111328125hf, 0.576171875hf), + f16vec4(0.12481689453125hf, 0.1318359375hf, -0.374267578125hf, -0.0226287841796875hf), + f16vec4(0.01050567626953125hf, 0.016632080078125hf, -0.6630859375hf, 0.0141754150390625hf), + f16vec4(0.09576416015625hf, 0.386962890625hf, -0.441650390625hf, -0.2117919921875hf)); +const f16mat4 w1_15 = f16mat4( + f16vec4(0.037109375hf, 0.1571044921875hf, -0.0364990234375hf, 0.4931640625hf), + f16vec4(0.055084228515625hf, 0.06787109375hf, 0.425537109375hf, -0.2327880859375hf), + f16vec4(-0.1595458984375hf, 0.082763671875hf, -0.434326171875hf, -0.09490966796875hf), + f16vec4(-0.1348876953125hf, 0.297607421875hf, -0.35107421875hf, -0.345458984375hf)); +const f16mat4 w1_16 = f16mat4( + f16vec4(0.061126708984375hf, 0.05145263671875hf, 0.0806884765625hf, 0.228271484375hf), + f16vec4(0.13623046875hf, 0.2235107421875hf, 0.1539306640625hf, -0.072265625hf), + f16vec4(0.0986328125hf, 0.40234375hf, -0.4140625hf, -0.034454345703125hf), + f16vec4(0.197998046875hf, 0.486572265625hf, -0.39794921875hf, -0.424560546875hf)); +const f16mat4 w1_17 = f16mat4( + f16vec4(-0.072509765625hf, 0.188720703125hf, -0.158935546875hf, 0.5712890625hf), + f16vec4(0.06402587890625hf, 0.02301025390625hf, 0.0311279296875hf, -0.003704071044921875hf), + f16vec4(-0.384765625hf, 0.06634521484375hf, -0.48193359375hf, -0.31494140625hf), + f16vec4(-0.1334228515625hf, 0.462646484375hf, -0.472412109375hf, -0.437255859375hf)); +const f16vec4 sub1 = f16vec4(-1.28125hf, 1.611328125hf, -4.5859375hf, -0.1793212890625hf); +const f16vec4 mul1 = f16vec4(0.326904296875hf, 0.4970703125hf, 0.42431640625hf, 0.299560546875hf); +const f16vec4 add1 = f16vec4(-0.69482421875hf, 0.05694580078125hf, -0.74658203125hf, -0.5205078125hf); + +void main() +{ + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 ext = imageSize(dstA); + if (p.x >= ext.x || p.y >= ext.y) + return; + + f16vec4 t0 = padTap(srcA, p + ivec2(-1, -1)); + f16vec4 t1 = padTap(srcA, p + ivec2(-1, 0)); + f16vec4 t2 = padTap(srcA, p + ivec2(-1, 1)); + f16vec4 t3 = padTap(srcA, p + ivec2(0, -1)); + f16vec4 t4 = f16vec4(texelFetch(srcA, p, 0)); + f16vec4 t5 = padTap(srcA, p + ivec2(0, 1)); + f16vec4 t6 = padTap(srcA, p + ivec2(1, -1)); + f16vec4 t7 = padTap(srcA, p + ivec2(1, 0)); + f16vec4 t8 = padTap(srcA, p + ivec2(1, 1)); + f16vec4 t9 = padTap(srcB, p + ivec2(-1, -1)); + f16vec4 t10 = padTap(srcB, p + ivec2(-1, 0)); + f16vec4 t11 = padTap(srcB, p + ivec2(-1, 1)); + f16vec4 t12 = padTap(srcB, p + ivec2(0, -1)); + f16vec4 t13 = f16vec4(texelFetch(srcB, p, 0)); + f16vec4 t14 = padTap(srcB, p + ivec2(0, 1)); + f16vec4 t15 = padTap(srcB, p + ivec2(1, -1)); + f16vec4 t16 = padTap(srcB, p + ivec2(1, 0)); + f16vec4 t17 = padTap(srcB, p + ivec2(1, 1)); + + f16vec4 r0 = w0_0 * t0; + r0 += w0_1 * t1; + r0 += w0_2 * t2; + r0 += w0_3 * t3; + r0 += w0_4 * t4; + r0 += w0_5 * t5; + r0 += w0_6 * t6; + r0 += w0_7 * t7; + r0 += w0_8 * t8; + r0 += w0_9 * t9; + r0 += w0_10 * t10; + r0 += w0_11 * t11; + r0 += w0_12 * t12; + r0 += w0_13 * t13; + r0 += w0_14 * t14; + r0 += w0_15 * t15; + r0 += w0_16 * t16; + r0 += w0_17 * t17; + r0 = (r0 - sub0) * mul0 + add0; + imageStore(dstA, p, vec4(r0)); + + f16vec4 r1 = w1_0 * t0; + r1 += w1_1 * t1; + r1 += w1_2 * t2; + r1 += w1_3 * t3; + r1 += w1_4 * t4; + r1 += w1_5 * t5; + r1 += w1_6 * t6; + r1 += w1_7 * t7; + r1 += w1_8 * t8; + r1 += w1_9 * t9; + r1 += w1_10 * t10; + r1 += w1_11 * t11; + r1 += w1_12 * t12; + r1 += w1_13 * t13; + r1 += w1_14 * t14; + r1 += w1_15 * t15; + r1 += w1_16 * t16; + r1 += w1_17 * t17; + r1 = (r1 - sub1) * mul1 + add1; + imageStore(dstB, p, vec4(r1)); + +} diff --git a/cleanroom/glsl/shader_23.comp b/cleanroom/glsl/shader_23.comp new file mode 100644 index 0000000..ffe2f1b --- /dev/null +++ b/cleanroom/glsl/shader_23.comp @@ -0,0 +1,280 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_23: 3x3 stride-1 conv, 8->8 channels, zero-padded texelFetch + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcA; +layout(set = 0, binding = 33) uniform sampler2D srcB; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstA; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; + +// zero-padded fetch for non-center taps +f16vec4 padTap(sampler2D img, ivec2 c) +{ + bool inb = c.x >= 0 && c.y >= 0; + if (inb) { + ivec2 sz = textureSize(img, 0); + inb = c.x < sz.x && c.y < sz.y; + } + return inb ? f16vec4(texelFetch(img, c, 0)) : f16vec4(0.0hf); +} + +const f16mat4 w0_0 = f16mat4( + f16vec4(-0.39208984375hf, -0.16064453125hf, -0.1622314453125hf, -0.15234375hf), + f16vec4(-0.2103271484375hf, 0.2308349609375hf, 0.0157623291015625hf, 0.8623046875hf), + f16vec4(0.78173828125hf, -0.06390380859375hf, 0.1868896484375hf, -0.07928466796875hf), + f16vec4(-0.019683837890625hf, 0.1729736328125hf, 0.0167083740234375hf, 0.21533203125hf)); +const f16mat4 w0_1 = f16mat4( + f16vec4(-0.0005588531494140625hf, 0.0731201171875hf, -0.147216796875hf, 0.208740234375hf), + f16vec4(-0.175048828125hf, 0.3935546875hf, 0.21240234375hf, 0.42236328125hf), + f16vec4(0.352294921875hf, -0.0372314453125hf, 0.17724609375hf, -0.159912109375hf), + f16vec4(0.101806640625hf, 0.06744384765625hf, 0.24462890625hf, 0.195556640625hf)); +const f16mat4 w0_2 = f16mat4( + f16vec4(-0.36474609375hf, -0.30322265625hf, -0.399169921875hf, -0.133544921875hf), + f16vec4(-0.1400146484375hf, 0.41552734375hf, 0.03875732421875hf, 0.93798828125hf), + f16vec4(0.84716796875hf, -0.171142578125hf, 0.057647705078125hf, -0.32763671875hf), + f16vec4(0.1781005859375hf, -0.1695556640625hf, -0.1390380859375hf, 0.047027587890625hf)); +const f16mat4 w0_3 = f16mat4( + f16vec4(-0.1871337890625hf, 0.03082275390625hf, -0.001495361328125hf, -0.0269927978515625hf), + f16vec4(0.05487060546875hf, 0.1419677734375hf, 0.1771240234375hf, 0.488037109375hf), + f16vec4(0.354736328125hf, 0.1441650390625hf, 0.1376953125hf, 0.0296630859375hf), + f16vec4(0.0043792724609375hf, 0.1890869140625hf, 0.1551513671875hf, 0.213134765625hf)); +const f16mat4 w0_4 = f16mat4( + f16vec4(0.2154541015625hf, 0.246337890625hf, -0.0159454345703125hf, 0.342041015625hf), + f16vec4(0.0343017578125hf, 0.328125hf, 0.289794921875hf, 0.1583251953125hf), + f16vec4(0.041015625hf, 0.170654296875hf, 0.1876220703125hf, 0.0198516845703125hf), + f16vec4(0.051483154296875hf, 0.2161865234375hf, 0.367431640625hf, 0.256591796875hf)); +const f16mat4 w0_5 = f16mat4( + f16vec4(-0.1533203125hf, -0.10565185546875hf, -0.2509765625hf, 0.049957275390625hf), + f16vec4(-0.01403045654296875hf, 0.345703125hf, 0.0184173583984375hf, 0.62939453125hf), + f16vec4(0.41259765625hf, 0.05108642578125hf, 0.1182861328125hf, -0.03265380859375hf), + f16vec4(0.06585693359375hf, 0.12115478515625hf, -0.0345458984375hf, 0.2139892578125hf)); +const f16mat4 w0_6 = f16mat4( + f16vec4(-0.2783203125hf, 0.2415771484375hf, -0.03472900390625hf, -0.3720703125hf), + f16vec4(-0.05181884765625hf, 0.1632080078125hf, 0.2305908203125hf, 0.837890625hf), + f16vec4(0.818359375hf, -0.0560302734375hf, -0.0054473876953125hf, -0.326171875hf), + f16vec4(0.251220703125hf, 0.04888916015625hf, 0.1387939453125hf, -0.1558837890625hf)); +const f16mat4 w0_7 = f16mat4( + f16vec4(0.1002197265625hf, 0.45166015625hf, -0.10052490234375hf, 0.0208892822265625hf), + f16vec4(-0.16259765625hf, 0.302001953125hf, 0.29296875hf, 0.477783203125hf), + f16vec4(0.420166015625hf, 0.0205230712890625hf, 0.16259765625hf, -0.2474365234375hf), + f16vec4(0.1956787109375hf, 0.158447265625hf, 0.32080078125hf, -0.01238250732421875hf)); +const f16mat4 w0_8 = f16mat4( + f16vec4(-0.2349853515625hf, 0.06854248046875hf, -0.342529296875hf, -0.306640625hf), + f16vec4(-0.279296875hf, 0.261474609375hf, 0.0167083740234375hf, 0.91455078125hf), + f16vec4(0.87939453125hf, -0.11370849609375hf, 0.137939453125hf, -0.240234375hf), + f16vec4(0.12548828125hf, 0.2215576171875hf, -0.1480712890625hf, 0.03826904296875hf)); +const f16mat4 w0_9 = f16mat4( + f16vec4(0.1683349609375hf, 0.63525390625hf, -0.029693603515625hf, 0.1593017578125hf), + f16vec4(0.10699462890625hf, -0.01496124267578125hf, 1.123046875hf, -0.062408447265625hf), + f16vec4(0.08441162109375hf, -0.4677734375hf, -0.76806640625hf, -0.77685546875hf), + f16vec4(-0.65380859375hf, 0.30029296875hf, -0.56640625hf, 0.546875hf)); +const f16mat4 w0_10 = f16mat4( + f16vec4(0.263916015625hf, 0.78857421875hf, 0.18115234375hf, 0.3427734375hf), + f16vec4(0.11297607421875hf, 0.1378173828125hf, 0.11199951171875hf, 0.1688232421875hf), + f16vec4(-0.057891845703125hf, -0.49072265625hf, -0.7431640625hf, -0.5263671875hf), + f16vec4(-0.64453125hf, 0.18212890625hf, -0.433349609375hf, 0.1845703125hf)); +const f16mat4 w0_11 = f16mat4( + f16vec4(0.2958984375hf, 0.65576171875hf, 0.000743865966796875hf, 0.301513671875hf), + f16vec4(-0.01531982421875hf, 0.223388671875hf, 1.1171875hf, 0.162109375hf), + f16vec4(-0.0131683349609375hf, -0.354736328125hf, -0.6328125hf, -0.6337890625hf), + f16vec4(-0.77978515625hf, -0.0543212890625hf, -0.42431640625hf, 0.51904296875hf)); +const f16mat4 w0_12 = f16mat4( + f16vec4(0.31689453125hf, 0.591796875hf, 0.0232696533203125hf, 0.15576171875hf), + f16vec4(0.0665283203125hf, 0.11920166015625hf, -0.318603515625hf, 0.0202484130859375hf), + f16vec4(0.349853515625hf, -0.1904296875hf, -0.42919921875hf, -0.57080078125hf), + f16vec4(-0.6171875hf, 0.354248046875hf, -0.38525390625hf, 0.578125hf)); +const f16mat4 w0_13 = f16mat4( + f16vec4(0.3720703125hf, 0.74609375hf, 0.1778564453125hf, 0.2822265625hf), + f16vec4(0.1546630859375hf, 0.1563720703125hf, -0.91064453125hf, 0.12261962890625hf), + f16vec4(0.2247314453125hf, -0.288818359375hf, -0.388427734375hf, -0.548828125hf), + f16vec4(-0.6640625hf, 0.296142578125hf, -0.358154296875hf, 0.2822265625hf)); +const f16mat4 w0_14 = f16mat4( + f16vec4(0.4150390625hf, 0.62744140625hf, 0.018341064453125hf, 0.2197265625hf), + f16vec4(0.06646728515625hf, 0.12384033203125hf, -0.1644287109375hf, -0.01465606689453125hf), + f16vec4(0.296630859375hf, -0.236572265625hf, -0.279296875hf, -0.67529296875hf), + f16vec4(-0.7119140625hf, 0.16015625hf, -0.311279296875hf, 0.426513671875hf)); +const f16mat4 w0_15 = f16mat4( + f16vec4(0.21728515625hf, 0.57470703125hf, 0.07989501953125hf, 0.11199951171875hf), + f16vec4(-0.054443359375hf, 0.2122802734375hf, 1.0732421875hf, 0.047271728515625hf), + f16vec4(0.1014404296875hf, -0.392578125hf, -0.65283203125hf, -0.58349609375hf), + f16vec4(-0.76806640625hf, 0.36865234375hf, -0.63623046875hf, 0.6240234375hf)); +const f16mat4 w0_16 = f16mat4( + f16vec4(0.2327880859375hf, 0.82275390625hf, 0.2181396484375hf, 0.2274169921875hf), + f16vec4(0.0831298828125hf, 0.1278076171875hf, 0.1639404296875hf, 0.06658935546875hf), + f16vec4(0.024261474609375hf, -0.6552734375hf, -0.6787109375hf, -0.431640625hf), + f16vec4(-0.74267578125hf, 0.394775390625hf, -0.48046875hf, 0.31298828125hf)); +const f16mat4 w0_17 = f16mat4( + f16vec4(0.236083984375hf, 0.619140625hf, 0.011871337890625hf, 0.0596923828125hf), + f16vec4(0.1260986328125hf, -0.0322265625hf, 1.060546875hf, -0.1793212890625hf), + f16vec4(0.0247955322265625hf, -0.59814453125hf, -0.74951171875hf, -0.6591796875hf), + f16vec4(-0.7939453125hf, 0.332275390625hf, -0.55859375hf, 0.6162109375hf)); +const f16vec4 sub0 = f16vec4(0.70166015625hf, 3.09375hf, -1.11328125hf, 1.04296875hf); +const f16vec4 mul0 = f16vec4(0.5322265625hf, 0.2283935546875hf, 0.481689453125hf, 0.4296875hf); +const f16vec4 add0 = f16vec4(-0.0313720703125hf, -0.6259765625hf, -0.0230560302734375hf, 0.0946044921875hf); + +const f16mat4 w1_0 = f16mat4( + f16vec4(-1.103515625hf, -0.348876953125hf, -0.95556640625hf, -0.61376953125hf), + f16vec4(-0.1705322265625hf, -0.477294921875hf, -0.039642333984375hf, -0.2147216796875hf), + f16vec4(-0.2249755859375hf, -0.037506103515625hf, 0.047760009765625hf, 0.1942138671875hf), + f16vec4(-0.13720703125hf, 1.1669921875hf, 0.08544921875hf, -0.36083984375hf)); +const f16mat4 w1_1 = f16mat4( + f16vec4(-0.0223388671875hf, -0.183837890625hf, -0.2283935546875hf, -0.07196044921875hf), + f16vec4(-0.127197265625hf, -0.6357421875hf, -0.01555633544921875hf, -0.0229644775390625hf), + f16vec4(0.064453125hf, 0.053253173828125hf, 0.1712646484375hf, 0.430908203125hf), + f16vec4(0.58984375hf, 0.310302734375hf, 0.219970703125hf, -0.0611572265625hf)); +const f16mat4 w1_2 = f16mat4( + f16vec4(-1.056640625hf, -0.11083984375hf, -0.90380859375hf, -0.853515625hf), + f16vec4(-0.322998046875hf, -0.65625hf, 0.08355712890625hf, -0.1690673828125hf), + f16vec4(-0.04827880859375hf, 0.034881591796875hf, -0.30126953125hf, -0.026611328125hf), + f16vec4(0.1700439453125hf, 1.2421875hf, -0.083251953125hf, -0.19677734375hf)); +const f16mat4 w1_3 = f16mat4( + f16vec4(-0.01459503173828125hf, -0.204833984375hf, -0.19189453125hf, 0.06256103515625hf), + f16vec4(-0.229248046875hf, -0.432373046875hf, 0.0985107421875hf, 0.0904541015625hf), + f16vec4(-0.0509033203125hf, 0.035736083984375hf, 0.0276641845703125hf, 0.2978515625hf), + f16vec4(0.36669921875hf, -0.05169677734375hf, 0.135009765625hf, 0.060882568359375hf)); +const f16mat4 w1_4 = f16mat4( + f16vec4(1.080078125hf, -0.02508544921875hf, 0.4306640625hf, 0.5390625hf), + f16vec4(-0.1182861328125hf, -0.490234375hf, 0.01212310791015625hf, 0.2783203125hf), + f16vec4(0.2042236328125hf, 0.05596923828125hf, 0.233642578125hf, 0.564453125hf), + f16vec4(1.123046875hf, -0.6650390625hf, 0.324951171875hf, 0.1781005859375hf)); +const f16mat4 w1_5 = f16mat4( + f16vec4(0.048919677734375hf, 0.0247955322265625hf, -0.21533203125hf, -0.204345703125hf), + f16vec4(-0.240478515625hf, -0.453369140625hf, -0.00977325439453125hf, 0.056243896484375hf), + f16vec4(-0.0498046875hf, 0.004608154296875hf, -0.034393310546875hf, 0.2247314453125hf), + f16vec4(0.69677734375hf, -0.0184478759765625hf, -0.0013866424560546875hf, -0.0121002197265625hf)); +const f16mat4 w1_6 = f16mat4( + f16vec4(-1.2275390625hf, -0.461181640625hf, -0.9111328125hf, -0.20556640625hf), + f16vec4(-0.27880859375hf, -0.66748046875hf, 0.2998046875hf, 0.040618896484375hf), + f16vec4(-0.171142578125hf, 0.07763671875hf, -0.191162109375hf, 0.278564453125hf), + f16vec4(-0.0171051025390625hf, 1.2158203125hf, 0.16552734375hf, 0.11749267578125hf)); +const f16mat4 w1_7 = f16mat4( + f16vec4(-0.07025146484375hf, -0.22412109375hf, -0.22412109375hf, 0.297607421875hf), + f16vec4(-0.14306640625hf, -0.70556640625hf, 0.08392333984375hf, 0.17626953125hf), + f16vec4(0.04547119140625hf, 0.05084228515625hf, 0.10186767578125hf, 0.62060546875hf), + f16vec4(0.59765625hf, 0.306396484375hf, 0.391357421875hf, 0.11383056640625hf)); +const f16mat4 w1_8 = f16mat4( + f16vec4(-0.9921875hf, -0.2139892578125hf, -0.880859375hf, -0.436279296875hf), + f16vec4(-0.27197265625hf, -0.65625hf, -0.06866455078125hf, -0.1328125hf), + f16vec4(-0.213623046875hf, -0.10174560546875hf, -0.058624267578125hf, 0.32958984375hf), + f16vec4(0.1258544921875hf, 1.08984375hf, 0.00881195068359375hf, -0.2158203125hf)); +const f16mat4 w1_9 = f16mat4( + f16vec4(0.0024261474609375hf, 0.212646484375hf, -0.12939453125hf, 0.4580078125hf), + f16vec4(0.00742340087890625hf, -0.0032062530517578125hf, 0.3173828125hf, -0.11798095703125hf), + f16vec4(-0.1962890625hf, 0.1043701171875hf, -0.4140625hf, -0.1273193359375hf), + f16vec4(-0.1627197265625hf, 0.216064453125hf, -0.202392578125hf, -0.49560546875hf)); +const f16mat4 w1_10 = f16mat4( + f16vec4(0.03985595703125hf, 0.036468505859375hf, -0.0232391357421875hf, 0.2249755859375hf), + f16vec4(0.0968017578125hf, 0.2431640625hf, 0.1279296875hf, -0.0799560546875hf), + f16vec4(0.231201171875hf, 0.49462890625hf, -0.4775390625hf, -0.0283355712890625hf), + f16vec4(0.255615234375hf, 0.2078857421875hf, -0.336669921875hf, -0.44580078125hf)); +const f16mat4 w1_11 = f16mat4( + f16vec4(-0.10858154296875hf, 0.13525390625hf, -0.2147216796875hf, 0.50927734375hf), + f16vec4(0.029571533203125hf, 0.15966796875hf, 0.225341796875hf, -0.1837158203125hf), + f16vec4(-0.12457275390625hf, 0.171875hf, -0.491455078125hf, -0.27734375hf), + f16vec4(-0.158203125hf, 0.0706787109375hf, -0.3828125hf, -0.57177734375hf)); +const f16mat4 w1_12 = f16mat4( + f16vec4(-0.0025386810302734375hf, 0.19677734375hf, -0.02716064453125hf, 0.513671875hf), + f16vec4(0.138427734375hf, 0.1029052734375hf, -0.2271728515625hf, -0.06451416015625hf), + f16vec4(0.04290771484375hf, 0.1265869140625hf, -0.53759765625hf, 0.1820068359375hf), + f16vec4(0.049041748046875hf, 0.302734375hf, -0.315673828125hf, -0.10693359375hf)); +const f16mat4 w1_13 = f16mat4( + f16vec4(0.041351318359375hf, 0.050933837890625hf, 0.0675048828125hf, 0.232177734375hf), + f16vec4(0.1761474609375hf, 0.280029296875hf, -0.4404296875hf, 0.050872802734375hf), + f16vec4(0.335693359375hf, 0.434814453125hf, -0.6513671875hf, 0.2200927734375hf), + f16vec4(0.395751953125hf, 0.53955078125hf, -0.377685546875hf, -0.1400146484375hf)); +const f16mat4 w1_14 = f16mat4( + f16vec4(-0.1273193359375hf, 0.1854248046875hf, -0.089111328125hf, 0.576171875hf), + f16vec4(0.12481689453125hf, 0.1318359375hf, -0.374267578125hf, -0.0226287841796875hf), + f16vec4(0.01050567626953125hf, 0.016632080078125hf, -0.6630859375hf, 0.0141754150390625hf), + f16vec4(0.09576416015625hf, 0.386962890625hf, -0.441650390625hf, -0.2117919921875hf)); +const f16mat4 w1_15 = f16mat4( + f16vec4(0.037109375hf, 0.1571044921875hf, -0.0364990234375hf, 0.4931640625hf), + f16vec4(0.055084228515625hf, 0.06787109375hf, 0.425537109375hf, -0.2327880859375hf), + f16vec4(-0.1595458984375hf, 0.082763671875hf, -0.434326171875hf, -0.09490966796875hf), + f16vec4(-0.1348876953125hf, 0.297607421875hf, -0.35107421875hf, -0.345458984375hf)); +const f16mat4 w1_16 = f16mat4( + f16vec4(0.061126708984375hf, 0.05145263671875hf, 0.0806884765625hf, 0.228271484375hf), + f16vec4(0.13623046875hf, 0.2235107421875hf, 0.1539306640625hf, -0.072265625hf), + f16vec4(0.0986328125hf, 0.40234375hf, -0.4140625hf, -0.034454345703125hf), + f16vec4(0.197998046875hf, 0.486572265625hf, -0.39794921875hf, -0.424560546875hf)); +const f16mat4 w1_17 = f16mat4( + f16vec4(-0.072509765625hf, 0.188720703125hf, -0.158935546875hf, 0.5712890625hf), + f16vec4(0.06402587890625hf, 0.02301025390625hf, 0.0311279296875hf, -0.003704071044921875hf), + f16vec4(-0.384765625hf, 0.06634521484375hf, -0.48193359375hf, -0.31494140625hf), + f16vec4(-0.1334228515625hf, 0.462646484375hf, -0.472412109375hf, -0.437255859375hf)); +const f16vec4 sub1 = f16vec4(-1.28125hf, 1.611328125hf, -4.5859375hf, -0.1793212890625hf); +const f16vec4 mul1 = f16vec4(0.326904296875hf, 0.4970703125hf, 0.42431640625hf, 0.299560546875hf); +const f16vec4 add1 = f16vec4(-0.69482421875hf, 0.05694580078125hf, -0.74658203125hf, -0.5205078125hf); + +void main() +{ + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 ext = imageSize(dstA); + if (p.x >= ext.x || p.y >= ext.y) + return; + + f16vec4 t0 = padTap(srcA, p + ivec2(-1, -1)); + f16vec4 t1 = padTap(srcA, p + ivec2(-1, 0)); + f16vec4 t2 = padTap(srcA, p + ivec2(-1, 1)); + f16vec4 t3 = padTap(srcA, p + ivec2(0, -1)); + f16vec4 t4 = f16vec4(texelFetch(srcA, p, 0)); + f16vec4 t5 = padTap(srcA, p + ivec2(0, 1)); + f16vec4 t6 = padTap(srcA, p + ivec2(1, -1)); + f16vec4 t7 = padTap(srcA, p + ivec2(1, 0)); + f16vec4 t8 = padTap(srcA, p + ivec2(1, 1)); + f16vec4 t9 = padTap(srcB, p + ivec2(-1, -1)); + f16vec4 t10 = padTap(srcB, p + ivec2(-1, 0)); + f16vec4 t11 = padTap(srcB, p + ivec2(-1, 1)); + f16vec4 t12 = padTap(srcB, p + ivec2(0, -1)); + f16vec4 t13 = f16vec4(texelFetch(srcB, p, 0)); + f16vec4 t14 = padTap(srcB, p + ivec2(0, 1)); + f16vec4 t15 = padTap(srcB, p + ivec2(1, -1)); + f16vec4 t16 = padTap(srcB, p + ivec2(1, 0)); + f16vec4 t17 = padTap(srcB, p + ivec2(1, 1)); + + f16vec4 r0 = w0_0 * t0; + r0 += w0_1 * t1; + r0 += w0_2 * t2; + r0 += w0_3 * t3; + r0 += w0_4 * t4; + r0 += w0_5 * t5; + r0 += w0_6 * t6; + r0 += w0_7 * t7; + r0 += w0_8 * t8; + r0 += w0_9 * t9; + r0 += w0_10 * t10; + r0 += w0_11 * t11; + r0 += w0_12 * t12; + r0 += w0_13 * t13; + r0 += w0_14 * t14; + r0 += w0_15 * t15; + r0 += w0_16 * t16; + r0 += w0_17 * t17; + r0 = (r0 - sub0) * mul0 + add0; + imageStore(dstA, p, vec4(r0)); + + f16vec4 r1 = w1_0 * t0; + r1 += w1_1 * t1; + r1 += w1_2 * t2; + r1 += w1_3 * t3; + r1 += w1_4 * t4; + r1 += w1_5 * t5; + r1 += w1_6 * t6; + r1 += w1_7 * t7; + r1 += w1_8 * t8; + r1 += w1_9 * t9; + r1 += w1_10 * t10; + r1 += w1_11 * t11; + r1 += w1_12 * t12; + r1 += w1_13 * t13; + r1 += w1_14 * t14; + r1 += w1_15 * t15; + r1 += w1_16 * t16; + r1 += w1_17 * t17; + r1 = (r1 - sub1) * mul1 + add1; + imageStore(dstB, p, vec4(r1)); + +} diff --git a/cleanroom/glsl/shader_24.comp b/cleanroom/glsl/shader_24.comp new file mode 100644 index 0000000..f47304c --- /dev/null +++ b/cleanroom/glsl/shader_24.comp @@ -0,0 +1,100 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 0) uniform Params { + float reserved0; + float phase; + float reserved1; +} ub; + +layout(set = 0, binding = 32) uniform sampler2D convIn0; +layout(set = 0, binding = 33) uniform sampler2D convIn1; +layout(set = 0, binding = 34) uniform sampler2D coarseFlow; +layout(set = 0, binding = 35) uniform sampler2D maskTex; +layout(set = 0, binding = 48, rgba16f) uniform writeonly image2D flowOut; + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + if (any(greaterThanEqual(p, imageSize(flowOut)))) return; + + vec2 sz = vec2(textureSize(convIn0, 0)); + vec2 pc = vec2(p) + 0.5; + vec2 uv = pc / sz; + + // 3x3 conv, 8 channels in -> 2-channel flow correction (rx, ry). + f16vec4 tap; + float16_t rx, ry; + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(-1, -1))); + rx = dot(f16vec4(-0.119873046875hf, 0.1549072265625hf, 0.000753879547119140625hf, 0.0966796875hf), tap); + ry = dot(f16vec4(-0.00024890899658203125hf, -0.00070095062255859375hf, 0.09918212890625hf, 0.00018298625946044921875hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(-1, 0))); + rx += dot(f16vec4(-0.10736083984375hf, 0.0271453857421875hf, 0.000216960906982421875hf, 0.10302734375hf), tap); + ry += dot(f16vec4(-0.00022900104522705078125hf, 0.000381946563720703125hf, 0.06329345703125hf, -0.0002219676971435546875hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(-1, 1))); + rx += dot(f16vec4(-0.131103515625hf, 0.214111328125hf, -0.000854969024658203125hf, 0.12164306640625hf), tap); + ry += dot(f16vec4(0.000403881072998046875hf, 0.013153076171875hf, 0.1629638671875hf, -0.0002739429473876953125hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(0, -1))); + rx += dot(f16vec4(-0.10784912109375hf, 0.14208984375hf, 0.00049304962158203125hf, 0.0848388671875hf), tap); + ry += dot(f16vec4(-0.000317096710205078125hf, -0.00836181640625hf, 0.09930419921875hf, 0.0000209808349609375hf), tap); + tap = f16vec4(textureLod(convIn0, uv, 0.0)); + rx += dot(f16vec4(-0.08905029296875hf, 0.04705810546875hf, -0.001049041748046875hf, 0.10589599609375hf), tap); + ry += dot(f16vec4(0.00116062164306640625hf, -0.00940704345703125hf, 0.0931396484375hf, 0.00015795230865478515625hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(0, 1))); + rx += dot(f16vec4(-0.1334228515625hf, 0.212890625hf, -0.00020503997802734375hf, 0.1119384765625hf), tap); + ry += dot(f16vec4(-0.0007572174072265625hf, -0.0028476715087890625hf, 0.14208984375hf, 0.000442028045654296875hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(1, -1))); + rx += dot(f16vec4(-0.09326171875hf, 0.14013671875hf, -0.00051116943359375hf, 0.11907958984375hf), tap); + ry += dot(f16vec4(0.000341892242431640625hf, 0.018463134765625hf, 0.11627197265625hf, -0.000119984149932861328125hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(1, 0))); + rx += dot(f16vec4(-0.0810546875hf, 0.01678466796875hf, -0.000625133514404296875hf, 0.1385498046875hf), tap); + ry += dot(f16vec4(-0.000632762908935546875hf, -0.005756378173828125hf, 0.07049560546875hf, -0.00032806396484375hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(1, 1))); + rx += dot(f16vec4(-0.131103515625hf, 0.1937255859375hf, 0.001918792724609375hf, 0.1146240234375hf), tap); + ry += dot(f16vec4(0.000319957733154296875hf, -0.003467559814453125hf, 0.1505126953125hf, -0.00002300739288330078125hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(-1, -1))); + rx += dot(f16vec4(0.026947021484375hf, -0.00015604496002197265625hf, -0.019927978515625hf, -0.10992431640625hf), tap); + ry += dot(f16vec4(-0.08966064453125hf, -0.1180419921875hf, 0.029449462890625hf, 0.00482940673828125hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(-1, 0))); + rx += dot(f16vec4(-0.0100555419921875hf, 0.0000820159912109375hf, 0.014373779296875hf, -0.225830078125hf), tap); + ry += dot(f16vec4(-0.165771484375hf, -0.116455078125hf, 0.034454345703125hf, -0.000648021697998046875hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(-1, 1))); + rx += dot(f16vec4(-0.0185089111328125hf, 0.00021898746490478515625hf, 0.0036220550537109375hf, -0.162353515625hf), tap); + ry += dot(f16vec4(-0.253173828125hf, -0.1480712890625hf, 0.1651611328125hf, -0.01401519775390625hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(0, -1))); + rx += dot(f16vec4(0.0031375885009765625hf, -0.0003910064697265625hf, 0.0007839202880859375hf, -0.11834716796875hf), tap); + ry += dot(f16vec4(-0.3291015625hf, -0.07733154296875hf, 0.214111328125hf, 0.01483154296875hf), tap); + tap = f16vec4(textureLod(convIn1, uv, 0.0)); + rx += dot(f16vec4(-0.0025177001953125hf, 0.000133991241455078125hf, -0.000279903411865234375hf, -0.249755859375hf), tap); + ry += dot(f16vec4(-0.334716796875hf, -0.068115234375hf, 0.10919189453125hf, 0.01020050048828125hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(0, 1))); + rx += dot(f16vec4(-0.000569820404052734375hf, -0.00006997585296630859375hf, 0.00084590911865234375hf, -0.1588134765625hf), tap); + ry += dot(f16vec4(-0.392578125hf, -0.072509765625hf, 0.315673828125hf, 0.0059967041015625hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(1, -1))); + rx += dot(f16vec4(-0.01300048828125hf, 0.000522136688232421875hf, 0.00166416168212890625hf, -0.08367919921875hf), tap); + ry += dot(f16vec4(-0.176025390625hf, -0.152099609375hf, 0.073486328125hf, -0.0242767333984375hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(1, 0))); + rx += dot(f16vec4(-0.022613525390625hf, -0.00019896030426025390625hf, 0.018035888671875hf, -0.1861572265625hf), tap); + ry += dot(f16vec4(-0.13525390625hf, -0.11920166015625hf, 0.045654296875hf, -0.01392364501953125hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(1, 1))); + rx += dot(f16vec4(0.04693603515625hf, -0.000119984149932861328125hf, -0.0188751220703125hf, -0.10638427734375hf), tap); + ry += dot(f16vec4(-0.14306640625hf, -0.1248779296875hf, 0.131103515625hf, 0.0150604248046875hf), tap); + rx += -0.000001013278961181640625hf; + ry += -0.0hf; + + f16vec4 base = f16vec4(textureLod(coarseFlow, uv, 0.0)) * 2.0hf; + f16vec2 fwd = base.xy + f16vec2(rx, ry); + f16vec2 bwd = base.zw - f16vec2(rx, ry); + + vec2 probeF = (pc + (vec2(fwd) * (2.0 * ub.phase)) * 0.25) / sz; + float16_t wF = 1.0hf - float16_t(textureLod(maskTex, probeF, 0.0).x); + f16vec2 fwdW = fwd * wF; + + vec2 probeB = (pc + (vec2(bwd) * (2.0 * (1.0 - ub.phase))) * 0.25) / sz; + float16_t wB = 1.0hf - float16_t(textureLod(maskTex, probeB, 0.0).x); + f16vec2 bwdW = bwd * wB; + + float16_t wC = 1.0hf - float16_t(textureLod(maskTex, uv, 0.0).x); + imageStore(flowOut, p, vec4(f16vec4(fwdW.x, fwdW.y, bwdW.x, bwdW.y) * wC)); +} diff --git a/cleanroom/glsl/shader_25.comp b/cleanroom/glsl/shader_25.comp new file mode 100644 index 0000000..9c6a338 --- /dev/null +++ b/cleanroom/glsl/shader_25.comp @@ -0,0 +1,232 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// 3x3 correlation cost volume between warped and local 8-channel features at +// four warp hypotheses (two flow pairs, scaled by 1-t / t), reduced by a +// small linear head and stored to rgba8. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 0) uniform Params { + float member0; // unused + float blendT; + float member2; // unused +} ubo; + +layout(set = 0, binding = 32) uniform sampler2D featA0; +layout(set = 0, binding = 33) uniform sampler2D featA1; +layout(set = 0, binding = 34) uniform sampler2D featB0; +layout(set = 0, binding = 35) uniform sampler2D featB1; +layout(set = 0, binding = 36) uniform sampler2D flowP; +layout(set = 0, binding = 37) uniform sampler2D flowQ; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D outTex; + +const f16mat4 M1 = f16mat4( + f16vec4(0.4501953125hf, 0.49365234375hf, 0.1787109375hf, 0.4853515625hf), + f16vec4(-0.06634521484375hf, 0.62060546875hf, -0.09783935546875hf, 0.493896484375hf), + f16vec4(0.34130859375hf, 0.447509765625hf, 0.293212890625hf, 0.414794921875hf), + f16vec4(-0.0943603515625hf, 0.580078125hf, -0.1612548828125hf, 0.322998046875hf)); +const f16mat4 M2 = f16mat4( + f16vec4(-0.356689453125hf, 0.5048828125hf, -0.0845947265625hf, 0.42529296875hf), + f16vec4(-0.11151123046875hf, 0.7509765625hf, -0.0767822265625hf, 0.23046875hf), + f16vec4(0.254638671875hf, 0.1102294921875hf, 0.0364990234375hf, 0.356201171875hf), + f16vec4(0.0008721351623535156hf, 0.6552734375hf, -0.09271240234375hf, 0.350341796875hf)); +const f16mat4 M3 = f16mat4( + f16vec4(-0.5322265625hf, -0.1083984375hf, -0.64697265625hf, -0.2734375hf), + f16vec4(-0.38232421875hf, 0.07257080078125hf, -0.5546875hf, -0.07635498046875hf), + f16vec4(-0.69287109375hf, -0.08441162109375hf, -0.548828125hf, -0.332763671875hf), + f16vec4(-0.51513671875hf, 0.10284423828125hf, -0.477294921875hf, -0.08941650390625hf)); +const f16mat4 M4 = f16mat4( + f16vec4(-1.0478515625hf, -0.060821533203125hf, -0.408203125hf, 0.1461181640625hf), + f16vec4(-0.5244140625hf, 0.1883544921875hf, -0.472412109375hf, -0.190673828125hf), + f16vec4(0.021148681640625hf, -0.1319580078125hf, -0.59521484375hf, -0.333251953125hf), + f16vec4(-0.238525390625hf, 0.196533203125hf, -0.50537109375hf, -0.154541015625hf)); +const f16mat4 M5 = f16mat4( + f16vec4(0.1055908203125hf, -0.04534912109375hf, 0.10455322265625hf, -0.05029296875hf), + f16vec4(0.266357421875hf, -0.207275390625hf, 0.326904296875hf, -0.200927734375hf), + f16vec4(-0.049713134765625hf, -0.045654296875hf, 0.174560546875hf, 0.1339111328125hf), + f16vec4(0.30419921875hf, -0.18115234375hf, 0.285888671875hf, -0.252685546875hf)); +const f16mat4 M6 = f16mat4( + f16vec4(-0.61279296875hf, -0.459716796875hf, 0.49169921875hf, -0.84375hf), + f16vec4(0.1854248046875hf, -0.0595703125hf, 0.282958984375hf, -0.25341796875hf), + f16vec4(0.16845703125hf, -0.2236328125hf, 0.16259765625hf, -0.007289886474609375hf), + f16vec4(0.01971435546875hf, 0.01392364501953125hf, 0.27978515625hf, -0.216796875hf)); +const f16mat4 M7 = f16mat4( + f16vec4(0.095947265625hf, -0.0023250579833984375hf, 0.182861328125hf, 0.00882720947265625hf), + f16vec4(0.2379150390625hf, -0.1378173828125hf, 0.271728515625hf, -0.183837890625hf), + f16vec4(0.0667724609375hf, 0.039459228515625hf, 0.1470947265625hf, 0.0296783447265625hf), + f16vec4(0.341796875hf, -0.1363525390625hf, 0.2744140625hf, -0.139404296875hf)); +const f16mat4 M8 = f16mat4( + f16vec4(-0.69189453125hf, -0.341064453125hf, 0.491455078125hf, -0.7236328125hf), + f16vec4(0.201904296875hf, -0.017181396484375hf, 0.336669921875hf, -0.08819580078125hf), + f16vec4(0.36962890625hf, -0.1961669921875hf, 0.1878662109375hf, 0.035675048828125hf), + f16vec4(0.0215301513671875hf, 0.0272674560546875hf, 0.286376953125hf, -0.10150146484375hf)); +const f16vec4 VA = f16vec4(0.352783203125hf, 0.0994873046875hf, 0.0078125hf, 0.34130859375hf); +const f16vec4 VB = f16vec4(-0.02752685546875hf, -0.174560546875hf, -0.59228515625hf, -0.35400390625hf); +const f16vec4 VC = f16vec4(0.2744140625hf, -0.1727294921875hf, 0.06805419921875hf, 0.061279296875hf); +const f16vec4 VD = f16vec4(0.33251953125hf, -0.01299285888671875hf, 0.1673583984375hf, 0.09429931640625hf); +const f16vec4 N1A = f16vec4(2.609375hf, 2.685546875hf, 2.607421875hf, 2.71484375hf); +const f16vec4 N1B = f16vec4(1.3974609375hf, 1.1240234375hf, 1.337890625hf, 1.1181640625hf); +const f16vec4 N1C = f16vec4(-0.442138671875hf, 0.082763671875hf, -0.56787109375hf, 0.096923828125hf); +const f16vec4 N2A = f16vec4(2.896484375hf, 2.71484375hf, 2.609375hf, 2.689453125hf); +const f16vec4 N2B = f16vec4(0.99267578125hf, 0.8349609375hf, 0.9697265625hf, 0.783203125hf); +const f16vec4 N2C = f16vec4(0.3408203125hf, 0.24169921875hf, -0.0697021484375hf, 0.195556640625hf); +const float16_t NSA = 2.611328125hf; +const float16_t NSB = 1.0478515625hf; +const float16_t NSC = -0.04693603515625hf; +const f16vec4 FSUB = f16vec4(-0.8017578125hf, 0.34912109375hf, 0.2242431640625hf, -0.51513671875hf); +const f16vec4 FMUL = f16vec4(1.0830078125hf, 1.916015625hf, 1.244140625hf, 1.4609375hf); +const f16vec4 FADD = f16vec4(-0.1959228515625hf, 0.8134765625hf, 0.354736328125hf, 0.9853515625hf); + +f16vec4 n1(f16vec4 x) { + return clamp((x - N1A) * N1B + N1C, f16vec4(0.0hf), f16vec4(1.0hf)); +} + +f16vec4 n2(f16vec4 x) { + return clamp((x - N2A) * N2B + N2C, f16vec4(0.0hf), f16vec4(1.0hf)); +} + +float16_t ns(float16_t s) { + return clamp((s - NSA) * NSB + NSC, 0.0hf, 1.0hf); +} + +float16_t corr8(f16vec4 g, f16vec4 h, f16vec4 f0, f16vec4 f1) { + return dot(g, f0) + dot(h, f1); +} + +void main() { + ivec2 gid = ivec2(gl_GlobalInvocationID.xy); + ivec2 outSize = imageSize(outTex); + if (gid.x >= outSize.x || gid.y >= outSize.y) { + return; + } + + ivec2 S = textureSize(featA0, 0); + vec2 dims = vec2(S); + vec2 pc = vec2(gid) + 0.5; + vec2 uv = pc / dims; + ivec2 cmax = S - ivec2(1); + + float t = ubo.blendT; + float16_t wA = float16_t(1.0 - t); + float16_t wB = float16_t(t); + + // two-step warp chase per flow texture; offsets are pixel displacements, + // second step applied unscaled + f16vec4 fP = f16vec4(textureLod(flowP, uv, 0.0)); + f16vec2 dA = fP.xy * wA; + f16vec2 rA = f16vec2(textureLod(flowP, (pc + vec2(dA)) / dims, 0.0).xy); + vec2 uvA = (pc + vec2(rA)) / dims; + f16vec2 dB = fP.zw * wB; + f16vec2 rB = f16vec2(textureLod(flowP, (pc + vec2(dB)) / dims, 0.0).zw); + vec2 uvB = (pc + vec2(rB)) / dims; + + f16vec4 fQ = f16vec4(textureLod(flowQ, uv, 0.0)); + f16vec2 dC = fQ.xy * wA; + f16vec2 rC = f16vec2(textureLod(flowQ, (pc + vec2(dC)) / dims, 0.0).xy); + vec2 uvC = (pc + vec2(rC)) / dims; + f16vec2 dD = fQ.zw * wB; + f16vec2 rD = f16vec2(textureLod(flowQ, (pc + vec2(dD)) / dims, 0.0).zw); + vec2 uvD = (pc + vec2(rD)) / dims; + + // warped 8-channel feature vectors: A/C warp source-A, B/D warp source-B + f16vec4 gA = f16vec4(textureLod(featA0, uvA, 0.0)); + f16vec4 hA = f16vec4(textureLod(featA1, uvA, 0.0)); + f16vec4 gC = f16vec4(textureLod(featA0, uvC, 0.0)); + f16vec4 hC = f16vec4(textureLod(featA1, uvC, 0.0)); + f16vec4 gB = f16vec4(textureLod(featB0, uvB, 0.0)); + f16vec4 hB = f16vec4(textureLod(featB1, uvB, 0.0)); + f16vec4 gD = f16vec4(textureLod(featB0, uvD, 0.0)); + f16vec4 hD = f16vec4(textureLod(featB1, uvD, 0.0)); + + // local neighborhood, replicate border; center is bilinear at uv + ivec2 q0 = clamp(gid + ivec2(-1, -1), ivec2(0), cmax); + ivec2 q1 = clamp(gid + ivec2(0, -1), ivec2(0), cmax); + ivec2 q2 = clamp(gid + ivec2(1, -1), ivec2(0), cmax); + ivec2 q3 = clamp(gid + ivec2(-1, 0), ivec2(0), cmax); + ivec2 q4 = clamp(gid + ivec2(1, 0), ivec2(0), cmax); + ivec2 q5 = clamp(gid + ivec2(-1, 1), ivec2(0), cmax); + ivec2 q6 = clamp(gid + ivec2(0, 1), ivec2(0), cmax); + ivec2 q7 = clamp(gid + ivec2(1, 1), ivec2(0), cmax); + + f16vec4 b0n0 = f16vec4(texelFetch(featB0, q0, 0)); + f16vec4 b0n1 = f16vec4(texelFetch(featB0, q1, 0)); + f16vec4 b0n2 = f16vec4(texelFetch(featB0, q2, 0)); + f16vec4 b0n3 = f16vec4(texelFetch(featB0, q3, 0)); + f16vec4 b0n4 = f16vec4(texelFetch(featB0, q4, 0)); + f16vec4 b0n5 = f16vec4(texelFetch(featB0, q5, 0)); + f16vec4 b0n6 = f16vec4(texelFetch(featB0, q6, 0)); + f16vec4 b0n7 = f16vec4(texelFetch(featB0, q7, 0)); + f16vec4 b0c = f16vec4(textureLod(featB0, uv, 0.0)); + + f16vec4 b1n0 = f16vec4(texelFetch(featB1, q0, 0)); + f16vec4 b1n1 = f16vec4(texelFetch(featB1, q1, 0)); + f16vec4 b1n2 = f16vec4(texelFetch(featB1, q2, 0)); + f16vec4 b1n3 = f16vec4(texelFetch(featB1, q3, 0)); + f16vec4 b1n4 = f16vec4(texelFetch(featB1, q4, 0)); + f16vec4 b1n5 = f16vec4(texelFetch(featB1, q5, 0)); + f16vec4 b1n6 = f16vec4(texelFetch(featB1, q6, 0)); + f16vec4 b1n7 = f16vec4(texelFetch(featB1, q7, 0)); + f16vec4 b1c = f16vec4(textureLod(featB1, uv, 0.0)); + + f16vec4 a0n0 = f16vec4(texelFetch(featA0, q0, 0)); + f16vec4 a0n1 = f16vec4(texelFetch(featA0, q1, 0)); + f16vec4 a0n2 = f16vec4(texelFetch(featA0, q2, 0)); + f16vec4 a0n3 = f16vec4(texelFetch(featA0, q3, 0)); + f16vec4 a0n4 = f16vec4(texelFetch(featA0, q4, 0)); + f16vec4 a0n5 = f16vec4(texelFetch(featA0, q5, 0)); + f16vec4 a0n6 = f16vec4(texelFetch(featA0, q6, 0)); + f16vec4 a0n7 = f16vec4(texelFetch(featA0, q7, 0)); + f16vec4 a0c = f16vec4(textureLod(featA0, uv, 0.0)); + + f16vec4 a1n0 = f16vec4(texelFetch(featA1, q0, 0)); + f16vec4 a1n1 = f16vec4(texelFetch(featA1, q1, 0)); + f16vec4 a1n2 = f16vec4(texelFetch(featA1, q2, 0)); + f16vec4 a1n3 = f16vec4(texelFetch(featA1, q3, 0)); + f16vec4 a1n4 = f16vec4(texelFetch(featA1, q4, 0)); + f16vec4 a1n5 = f16vec4(texelFetch(featA1, q5, 0)); + f16vec4 a1n6 = f16vec4(texelFetch(featA1, q6, 0)); + f16vec4 a1n7 = f16vec4(texelFetch(featA1, q7, 0)); + f16vec4 a1c = f16vec4(textureLod(featA1, uv, 0.0)); + + // A/C hypotheses correlate against the B neighborhood, B/D against A + f16vec4 uA = f16vec4(corr8(gA, hA, b0n0, b1n0), corr8(gA, hA, b0n1, b1n1), + corr8(gA, hA, b0n2, b1n2), corr8(gA, hA, b0n3, b1n3)); + f16vec4 vA = f16vec4(corr8(gA, hA, b0c, b1c), corr8(gA, hA, b0n4, b1n4), + corr8(gA, hA, b0n5, b1n5), corr8(gA, hA, b0n6, b1n6)); + float16_t sA = corr8(gA, hA, b0n7, b1n7); + + f16vec4 uB = f16vec4(corr8(gB, hB, a0n0, a1n0), corr8(gB, hB, a0n1, a1n1), + corr8(gB, hB, a0n2, a1n2), corr8(gB, hB, a0n3, a1n3)); + f16vec4 vB = f16vec4(corr8(gB, hB, a0c, a1c), corr8(gB, hB, a0n4, a1n4), + corr8(gB, hB, a0n5, a1n5), corr8(gB, hB, a0n6, a1n6)); + float16_t sB = corr8(gB, hB, a0n7, a1n7); + + f16vec4 uC = f16vec4(corr8(gC, hC, b0n0, b1n0), corr8(gC, hC, b0n1, b1n1), + corr8(gC, hC, b0n2, b1n2), corr8(gC, hC, b0n3, b1n3)); + f16vec4 vC = f16vec4(corr8(gC, hC, b0c, b1c), corr8(gC, hC, b0n4, b1n4), + corr8(gC, hC, b0n5, b1n5), corr8(gC, hC, b0n6, b1n6)); + float16_t sC = corr8(gC, hC, b0n7, b1n7); + + f16vec4 uD = f16vec4(corr8(gD, hD, a0n0, a1n0), corr8(gD, hD, a0n1, a1n1), + corr8(gD, hD, a0n2, a1n2), corr8(gD, hD, a0n3, a1n3)); + f16vec4 vD = f16vec4(corr8(gD, hD, a0c, a1c), corr8(gD, hD, a0n4, a1n4), + corr8(gD, hD, a0n5, a1n5), corr8(gD, hD, a0n6, a1n6)); + float16_t sD = corr8(gD, hD, a0n7, a1n7); + + f16vec4 acc = M1 * n1(uA); + acc += M2 * n2(vA); + acc += VA * ns(sA); + acc += M3 * n1(uB); + acc += M4 * n2(vB); + acc += VB * ns(sB); + acc += M5 * n1(uC); + acc += M6 * n2(vC); + acc += VC * ns(sC); + acc += M7 * n1(uD); + acc += M8 * n2(vD); + acc += VD * ns(sD); + + f16vec4 res = (acc - FSUB) * FMUL + FADD; + imageStore(outTex, gid, vec4(res)); +} diff --git a/cleanroom/glsl/shader_26.comp b/cleanroom/glsl/shader_26.comp new file mode 100644 index 0000000..6696e18 --- /dev/null +++ b/cleanroom/glsl/shader_26.comp @@ -0,0 +1,89 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// 3x3 conv over a 4-channel feature image, zero padding, fp16 math, +// then per-channel affine remap into rgba8. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D featureTex; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D outTex; + +const f16mat4 W0 = f16mat4( + f16vec4(0.039886474609375hf, -0.494873046875hf, -0.4248046875hf, -0.51171875hf), + f16vec4(0.0177764892578125hf, 0.6962890625hf, 0.1864013671875hf, -0.03448486328125hf), + f16vec4(0.0787353515625hf, -0.1571044921875hf, -1.1572265625hf, -0.184326171875hf), + f16vec4(0.08892822265625hf, 0.54150390625hf, 0.436279296875hf, 0.05548095703125hf)); +const f16mat4 W1 = f16mat4( + f16vec4(0.04754638671875hf, -0.444091796875hf, -0.123779296875hf, 0.58544921875hf), + f16vec4(-0.035858154296875hf, -0.38232421875hf, 0.240966796875hf, 0.2244873046875hf), + f16vec4(-0.058807373046875hf, 0.4736328125hf, -0.047515869140625hf, -0.6357421875hf), + f16vec4(-0.1734619140625hf, -0.459716796875hf, 0.41748046875hf, 0.60791015625hf)); +const f16mat4 W2 = f16mat4( + f16vec4(0.359375hf, -0.40380859375hf, -0.42236328125hf, -0.224609375hf), + f16vec4(-0.328369140625hf, 0.10101318359375hf, 0.1622314453125hf, 0.284423828125hf), + f16vec4(0.270263671875hf, 0.033599853515625hf, -0.95751953125hf, -0.65087890625hf), + f16vec4(0.015594482421875hf, 0.154296875hf, 0.60400390625hf, 0.374267578125hf)); +const f16mat4 W3 = f16mat4( + f16vec4(-0.322265625hf, -0.10394287109375hf, -0.039337158203125hf, -0.321044921875hf), + f16vec4(0.034881591796875hf, -0.423583984375hf, -0.00583648681640625hf, 0.06292724609375hf), + f16vec4(0.07269287109375hf, 0.4716796875hf, -0.337890625hf, 0.05535888671875hf), + f16vec4(0.17333984375hf, -0.4306640625hf, -0.09906005859375hf, -0.01125335693359375hf)); +const f16mat4 W4 = f16mat4( + f16vec4(0.04608154296875hf, -0.08575439453125hf, 0.1285400390625hf, 0.50537109375hf), + f16vec4(0.049591064453125hf, 0.1475830078125hf, 0.365234375hf, 0.220947265625hf), + f16vec4(-0.025482177734375hf, -0.2076416015625hf, 0.23486328125hf, -0.454345703125hf), + f16vec4(0.13818359375hf, 0.0987548828125hf, 0.1697998046875hf, 0.60400390625hf)); +const f16mat4 W5 = f16mat4( + f16vec4(0.04095458984375hf, -0.047119140625hf, -0.126220703125hf, 0.1849365234375hf), + f16vec4(-0.0002199411392211914hf, 0.25439453125hf, 0.06365966796875hf, -0.0229949951171875hf), + f16vec4(-0.0081787109375hf, -0.1314697265625hf, -0.0679931640625hf, -0.293701171875hf), + f16vec4(0.05316162109375hf, 0.3388671875hf, 0.0745849609375hf, 0.26513671875hf)); +const f16mat4 W6 = f16mat4( + f16vec4(-0.9833984375hf, 0.1689453125hf, 0.034088134765625hf, -0.446533203125hf), + f16vec4(0.403564453125hf, 0.59765625hf, 0.0286102294921875hf, 0.151611328125hf), + f16vec4(-0.3740234375hf, -0.59228515625hf, -0.71533203125hf, 0.06878662109375hf), + f16vec4(0.46044921875hf, 0.80859375hf, 0.149658203125hf, -0.14990234375hf)); +const f16mat4 W7 = f16mat4( + f16vec4(-0.294189453125hf, -0.265869140625hf, 0.1612548828125hf, -0.2166748046875hf), + f16vec4(0.06060791015625hf, -0.412353515625hf, 0.10845947265625hf, 0.12841796875hf), + f16vec4(-0.1680908203125hf, 0.391845703125hf, -0.0364990234375hf, 0.15234375hf), + f16vec4(0.2183837890625hf, -0.433349609375hf, 0.01494598388671875hf, -0.1700439453125hf)); +const f16mat4 W8 = f16mat4( + f16vec4(-0.2239990234375hf, -0.427978515625hf, -0.2034912109375hf, -0.489501953125hf), + f16vec4(0.1865234375hf, 0.44482421875hf, 0.14208984375hf, 0.1512451171875hf), + f16vec4(-0.487548828125hf, -0.03253173828125hf, -1.2294921875hf, -0.1922607421875hf), + f16vec4(0.50537109375hf, 0.306640625hf, 0.2359619140625hf, -0.13232421875hf)); +const f16vec4 AFF_A = f16vec4(0.61962890625hf, 0.87060546875hf, -0.330322265625hf, 0.35009765625hf); +const f16vec4 AFF_B = f16vec4(0.322021484375hf, 0.591796875hf, 0.59912109375hf, 0.42138671875hf); +const f16vec4 AFF_C = f16vec4(0.5595703125hf, 0.37646484375hf, 1.2724609375hf, -0.1226806640625hf); + +f16vec4 edgeTap(ivec2 p) { + ivec2 sz = textureSize(featureTex, 0); + if (all(greaterThanEqual(p, ivec2(0))) && all(lessThan(p, sz))) { + return f16vec4(texelFetch(featureTex, p, 0)); + } + return f16vec4(0.0hf); +} + +void main() { + ivec2 gid = ivec2(gl_GlobalInvocationID.xy); + ivec2 outSize = imageSize(outTex); + if (gid.x >= outSize.x || gid.y >= outSize.y) { + return; + } + + f16vec4 acc = W0 * edgeTap(gid + ivec2(-1, -1)); + acc += W1 * edgeTap(gid + ivec2(-1, 0)); + acc += W2 * edgeTap(gid + ivec2(-1, 1)); + acc += W3 * edgeTap(gid + ivec2(0, -1)); + // center tap is not bounds-checked (dispatch guarantees outSize <= inSize) + acc += W4 * f16vec4(texelFetch(featureTex, gid, 0)); + acc += W5 * edgeTap(gid + ivec2(0, 1)); + acc += W6 * edgeTap(gid + ivec2(1, -1)); + acc += W7 * edgeTap(gid + ivec2(1, 0)); + acc += W8 * edgeTap(gid + ivec2(1, 1)); + + f16vec4 res = (acc - AFF_A) * AFF_B + AFF_C; + imageStore(outTex, gid, vec4(res)); +} diff --git a/cleanroom/glsl/shader_27.comp b/cleanroom/glsl/shader_27.comp new file mode 100644 index 0000000..7beb63e --- /dev/null +++ b/cleanroom/glsl/shader_27.comp @@ -0,0 +1,89 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// 3x3 conv over a 4-channel feature image, zero padding, fp16 math, +// then per-channel affine remap into rgba8. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D featureTex; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D outTex; + +const f16mat4 W0 = f16mat4( + f16vec4(-0.2705078125hf, -0.1513671875hf, -0.11273193359375hf, 0.31396484375hf), + f16vec4(0.5205078125hf, -0.011627197265625hf, 0.12548828125hf, -0.283935546875hf), + f16vec4(0.490234375hf, 0.12176513671875hf, -0.1326904296875hf, -0.398681640625hf), + f16vec4(0.8330078125hf, 0.2880859375hf, -0.5126953125hf, -0.364990234375hf)); +const f16mat4 W1 = f16mat4( + f16vec4(-0.4130859375hf, -0.3779296875hf, -0.046295166015625hf, 0.2890625hf), + f16vec4(0.41259765625hf, -0.0699462890625hf, 0.09942626953125hf, -0.411865234375hf), + f16vec4(0.1461181640625hf, -0.00345611572265625hf, -0.1689453125hf, -0.456298828125hf), + f16vec4(0.102294921875hf, 0.086669921875hf, -0.58349609375hf, -0.4111328125hf)); +const f16mat4 W2 = f16mat4( + f16vec4(-0.1746826171875hf, -0.98583984375hf, 0.58154296875hf, 0.66455078125hf), + f16vec4(-0.0192413330078125hf, 0.28125hf, -0.80419921875hf, -0.81884765625hf), + f16vec4(-0.33203125hf, 0.005214691162109375hf, -0.49755859375hf, -0.5546875hf), + f16vec4(-0.29833984375hf, 0.460693359375hf, -0.912109375hf, -0.7998046875hf)); +const f16mat4 W3 = f16mat4( + f16vec4(0.16259765625hf, 0.0904541015625hf, 0.1798095703125hf, -0.1636962890625hf), + f16vec4(0.35888671875hf, 0.0556640625hf, -0.0531005859375hf, -0.375732421875hf), + f16vec4(0.2208251953125hf, 0.421630859375hf, -0.149658203125hf, -0.1024169921875hf), + f16vec4(0.059417724609375hf, 0.11846923828125hf, -0.892578125hf, -0.302978515625hf)); +const f16mat4 W4 = f16mat4( + f16vec4(0.00940704345703125hf, 0.1917724609375hf, -0.284423828125hf, -0.051727294921875hf), + f16vec4(0.203369140625hf, 0.18017578125hf, -0.01380157470703125hf, -0.42578125hf), + f16vec4(-0.00963592529296875hf, 0.34130859375hf, -0.282958984375hf, -0.105224609375hf), + f16vec4(-0.038726806640625hf, -0.016143798828125hf, -0.34521484375hf, -0.4287109375hf)); +const f16mat4 W5 = f16mat4( + f16vec4(0.252685546875hf, -0.64453125hf, 0.4052734375hf, -0.22998046875hf), + f16vec4(-0.335693359375hf, 0.1312255859375hf, -0.2364501953125hf, -0.30810546875hf), + f16vec4(-0.311279296875hf, 0.003387451171875hf, -0.229248046875hf, -0.127197265625hf), + f16vec4(-0.489501953125hf, 0.114013671875hf, -0.7001953125hf, 0.0153961181640625hf)); +const f16mat4 W6 = f16mat4( + f16vec4(0.31494140625hf, 0.78759765625hf, -1.1064453125hf, -0.2078857421875hf), + f16vec4(0.10784912109375hf, 0.2391357421875hf, -0.159423828125hf, -0.370849609375hf), + f16vec4(-0.020599365234375hf, 0.71240234375hf, -0.1383056640625hf, -0.133544921875hf), + f16vec4(0.07147216796875hf, 0.552734375hf, -0.53564453125hf, -0.5458984375hf)); +const f16mat4 W7 = f16mat4( + f16vec4(-0.18505859375hf, 0.0262451171875hf, -0.38525390625hf, -0.00494384765625hf), + f16vec4(0.05694580078125hf, 0.1123046875hf, 0.236328125hf, -0.449462890625hf), + f16vec4(-0.023040771484375hf, 0.58740234375hf, 0.1661376953125hf, -0.177490234375hf), + f16vec4(-0.042633056640625hf, 0.1339111328125hf, -0.11126708984375hf, -0.318359375hf)); +const f16mat4 W8 = f16mat4( + f16vec4(-0.84423828125hf, -0.48828125hf, -0.50732421875hf, 0.529296875hf), + f16vec4(-0.42578125hf, 0.59033203125hf, -0.49658203125hf, -0.057769775390625hf), + f16vec4(-0.412353515625hf, 0.1883544921875hf, 0.041412353515625hf, -0.029327392578125hf), + f16vec4(-0.75244140625hf, 0.568359375hf, -0.454345703125hf, -0.039337158203125hf)); +const f16vec4 AFF_A = f16vec4(-0.5322265625hf, 1.8603515625hf, -2.958984375hf, -2.8125hf); +const f16vec4 AFF_B = f16vec4(0.460693359375hf, 0.437744140625hf, 0.56005859375hf, 0.130615234375hf); +const f16vec4 AFF_C = f16vec4(0.443603515625hf, -0.14404296875hf, -0.2998046875hf, 0.6767578125hf); + +f16vec4 edgeTap(ivec2 p) { + ivec2 sz = textureSize(featureTex, 0); + if (all(greaterThanEqual(p, ivec2(0))) && all(lessThan(p, sz))) { + return f16vec4(texelFetch(featureTex, p, 0)); + } + return f16vec4(0.0hf); +} + +void main() { + ivec2 gid = ivec2(gl_GlobalInvocationID.xy); + ivec2 outSize = imageSize(outTex); + if (gid.x >= outSize.x || gid.y >= outSize.y) { + return; + } + + f16vec4 acc = W0 * edgeTap(gid + ivec2(-1, -1)); + acc += W1 * edgeTap(gid + ivec2(-1, 0)); + acc += W2 * edgeTap(gid + ivec2(-1, 1)); + acc += W3 * edgeTap(gid + ivec2(0, -1)); + // center tap is not bounds-checked (dispatch guarantees outSize <= inSize) + acc += W4 * f16vec4(texelFetch(featureTex, gid, 0)); + acc += W5 * edgeTap(gid + ivec2(0, 1)); + acc += W6 * edgeTap(gid + ivec2(1, -1)); + acc += W7 * edgeTap(gid + ivec2(1, 0)); + acc += W8 * edgeTap(gid + ivec2(1, 1)); + + f16vec4 res = (acc - AFF_A) * AFF_B + AFF_C; + imageStore(outTex, gid, vec4(res)); +} diff --git a/cleanroom/glsl/shader_28.comp b/cleanroom/glsl/shader_28.comp new file mode 100644 index 0000000..5510328 --- /dev/null +++ b/cleanroom/glsl/shader_28.comp @@ -0,0 +1,89 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// 3x3 conv over a 4-channel feature image, zero padding, fp16 math, +// then per-channel affine remap into rgba8. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D featureTex; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D outTex; + +const f16mat4 W0 = f16mat4( + f16vec4(0.79736328125hf, -0.42431640625hf, -0.91259765625hf, -0.685546875hf), + f16vec4(0.0064544677734375hf, -0.098876953125hf, -0.11810302734375hf, -0.296142578125hf), + f16vec4(0.059295654296875hf, -0.13525390625hf, -0.094482421875hf, 0.06402587890625hf), + f16vec4(-0.10333251953125hf, -0.80712890625hf, 0.269775390625hf, 0.5419921875hf)); +const f16mat4 W1 = f16mat4( + f16vec4(0.098876953125hf, -0.10845947265625hf, -0.0985107421875hf, 0.1107177734375hf), + f16vec4(0.245849609375hf, -0.1241455078125hf, -0.29443359375hf, -0.5458984375hf), + f16vec4(-0.1871337890625hf, 0.230224609375hf, 0.2423095703125hf, 0.29736328125hf), + f16vec4(-0.1341552734375hf, 0.26708984375hf, 0.1837158203125hf, -0.36669921875hf)); +const f16mat4 W2 = f16mat4( + f16vec4(0.1390380859375hf, -0.267822265625hf, -0.06402587890625hf, 0.157470703125hf), + f16vec4(0.84814453125hf, -0.7890625hf, -0.78515625hf, -0.79541015625hf), + f16vec4(-0.3544921875hf, 0.1922607421875hf, 0.30078125hf, 0.38134765625hf), + f16vec4(-0.65869140625hf, -0.349853515625hf, 0.79638671875hf, 0.8798828125hf)); +const f16mat4 W3 = f16mat4( + f16vec4(0.1558837890625hf, 0.139404296875hf, -0.265869140625hf, 0.27099609375hf), + f16vec4(0.040679931640625hf, 0.054840087890625hf, -0.1944580078125hf, -0.06549072265625hf), + f16vec4(-0.051727294921875hf, 0.019561767578125hf, 0.274169921875hf, 0.065185546875hf), + f16vec4(-0.2216796875hf, 0.370361328125hf, 0.322998046875hf, 0.0223846435546875hf)); +const f16mat4 W4 = f16mat4( + f16vec4(-0.06903076171875hf, 0.1810302734375hf, 0.10711669921875hf, -0.1932373046875hf), + f16vec4(-0.0261077880859375hf, 0.411376953125hf, -0.0017595291137695312hf, -0.338623046875hf), + f16vec4(-0.039215087890625hf, -0.160400390625hf, 0.1748046875hf, -0.1187744140625hf), + f16vec4(-0.1041259765625hf, 1.3095703125hf, -0.07098388671875hf, -0.607421875hf)); +const f16mat4 W5 = f16mat4( + f16vec4(-0.169677734375hf, 0.3359375hf, 0.2255859375hf, 0.14501953125hf), + f16vec4(0.286376953125hf, -0.08050537109375hf, -0.2384033203125hf, -0.434326171875hf), + f16vec4(-0.16943359375hf, -0.0201263427734375hf, 0.315673828125hf, -0.0968017578125hf), + f16vec4(-0.11102294921875hf, 0.18115234375hf, 0.1219482421875hf, -0.227294921875hf)); +const f16mat4 W6 = f16mat4( + f16vec4(0.17578125hf, -0.344482421875hf, -0.041717529296875hf, -0.15771484375hf), + f16vec4(0.7236328125hf, -0.411376953125hf, -0.85693359375hf, -0.66357421875hf), + f16vec4(-0.429443359375hf, 0.0887451171875hf, 0.397216796875hf, 0.55029296875hf), + f16vec4(-0.70947265625hf, -0.4716796875hf, 0.6201171875hf, 0.1959228515625hf)); +const f16mat4 W7 = f16mat4( + f16vec4(-0.2132568359375hf, 0.07830810546875hf, 0.32861328125hf, 0.158447265625hf), + f16vec4(0.417236328125hf, -0.264404296875hf, -0.340087890625hf, -0.626953125hf), + f16vec4(-0.320068359375hf, 0.301025390625hf, 0.357421875hf, 0.4091796875hf), + f16vec4(0.06005859375hf, 0.32470703125hf, 0.1304931640625hf, -0.57763671875hf)); +const f16mat4 W8 = f16mat4( + f16vec4(-0.56884765625hf, 0.010711669921875hf, 0.6044921875hf, 0.56689453125hf), + f16vec4(0.60400390625hf, -0.77099609375hf, -0.44580078125hf, -0.62646484375hf), + f16vec4(-0.1766357421875hf, 0.07293701171875hf, 0.0294036865234375hf, -0.038604736328125hf), + f16vec4(0.099365234375hf, -0.8525390625hf, -0.231689453125hf, -0.43017578125hf)); +const f16vec4 AFF_A = f16vec4(-1.072265625hf, -0.287841796875hf, 1.39453125hf, -0.425537109375hf); +const f16vec4 AFF_B = f16vec4(0.70751953125hf, 0.55615234375hf, 0.67236328125hf, 0.6357421875hf); +const f16vec4 AFF_C = f16vec4(0.1878662109375hf, 0.255859375hf, 0.8662109375hf, -0.3037109375hf); + +f16vec4 edgeTap(ivec2 p) { + ivec2 sz = textureSize(featureTex, 0); + if (all(greaterThanEqual(p, ivec2(0))) && all(lessThan(p, sz))) { + return f16vec4(texelFetch(featureTex, p, 0)); + } + return f16vec4(0.0hf); +} + +void main() { + ivec2 gid = ivec2(gl_GlobalInvocationID.xy); + ivec2 outSize = imageSize(outTex); + if (gid.x >= outSize.x || gid.y >= outSize.y) { + return; + } + + f16vec4 acc = W0 * edgeTap(gid + ivec2(-1, -1)); + acc += W1 * edgeTap(gid + ivec2(-1, 0)); + acc += W2 * edgeTap(gid + ivec2(-1, 1)); + acc += W3 * edgeTap(gid + ivec2(0, -1)); + // center tap is not bounds-checked (dispatch guarantees outSize <= inSize) + acc += W4 * f16vec4(texelFetch(featureTex, gid, 0)); + acc += W5 * edgeTap(gid + ivec2(0, 1)); + acc += W6 * edgeTap(gid + ivec2(1, -1)); + acc += W7 * edgeTap(gid + ivec2(1, 0)); + acc += W8 * edgeTap(gid + ivec2(1, 1)); + + f16vec4 res = (acc - AFF_A) * AFF_B + AFF_C; + imageStore(outTex, gid, vec4(res)); +} diff --git a/cleanroom/glsl/shader_29.comp b/cleanroom/glsl/shader_29.comp new file mode 100644 index 0000000..ed9233a --- /dev/null +++ b/cleanroom/glsl/shader_29.comp @@ -0,0 +1,89 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D src; +layout(set = 0, binding = 33) uniform sampler2D residual; +layout(set = 0, binding = 48, rgba16f) uniform writeonly image2D outMerged; + +// matrices are column-major: column j = input channel j, row i = output channel i +const f16mat4 W_mm = f16mat4( + f16vec4( 0.2978515625hf, 0.27880859375hf, -0.744140625hf, -0.70068359375hf), + f16vec4( 0.1429443359375hf, 0.12115478515625hf, 0.11199951171875hf, 0.135009765625hf), + f16vec4( 0.20263671875hf, 0.2030029296875hf, 0.38818359375hf, 0.3916015625hf), + f16vec4(-0.6982421875hf, -0.69775390625hf, 0.326416015625hf, 0.32373046875hf)); + +const f16mat4 W_mz = f16mat4( + f16vec4( 0.6103515625hf, 0.59814453125hf, -0.07452392578125hf, -0.0933837890625hf), + f16vec4( 0.47900390625hf, 0.47021484375hf, 0.3330078125hf, 0.36669921875hf), + f16vec4( 0.399658203125hf, 0.395263671875hf, 0.439453125hf, 0.43896484375hf), + f16vec4(-0.66015625hf, -0.6337890625hf, 0.1593017578125hf, 0.1490478515625hf)); + +const f16mat4 W_mp = f16mat4( + f16vec4( 0.317626953125hf, 0.295166015625hf, -0.8017578125hf, -0.76171875hf), + f16vec4( 0.099365234375hf, 0.07647705078125hf, 0.212890625hf, 0.2216796875hf), + f16vec4( 0.275146484375hf, 0.26708984375hf, 0.279052734375hf, 0.306396484375hf), + f16vec4(-0.69970703125hf, -0.6669921875hf, 0.314453125hf, 0.320068359375hf)); + +const f16mat4 W_zm = f16mat4( + f16vec4( 0.56640625hf, 0.576171875hf, 0.0634765625hf, 0.0697021484375hf), + f16vec4( 0.47265625hf, 0.468017578125hf, 0.405029296875hf, 0.41650390625hf), + f16vec4( 0.37353515625hf, 0.36474609375hf, 0.541015625hf, 0.556640625hf), + f16vec4(-0.625hf, -0.6630859375hf, 0.2158203125hf, 0.20947265625hf)); + +const f16mat4 W_zz = f16mat4( + f16vec4( 0.85791015625hf, 0.8330078125hf, 0.6259765625hf, 0.591796875hf), + f16vec4( 0.826171875hf, 0.7802734375hf, 0.6591796875hf, 0.66015625hf), + f16vec4( 0.5673828125hf, 0.5419921875hf, 0.61669921875hf, 0.6171875hf), + f16vec4(-0.55224609375hf, -0.5537109375hf, 0.0438232421875hf, 0.0533447265625hf)); + +const f16mat4 W_zp = f16mat4( + f16vec4( 0.59033203125hf, 0.5673828125hf, -0.1058349609375hf, -0.12890625hf), + f16vec4( 0.439208984375hf, 0.419677734375hf, 0.5283203125hf, 0.53759765625hf), + f16vec4( 0.46337890625hf, 0.44873046875hf, 0.47509765625hf, 0.48193359375hf), + f16vec4(-0.67529296875hf, -0.6640625hf, 0.2344970703125hf, 0.2325439453125hf)); + +const f16mat4 W_pm = f16mat4( + f16vec4( 0.32373046875hf, 0.308349609375hf, -0.59814453125hf, -0.54345703125hf), + f16vec4( 0.1268310546875hf, 0.11712646484375hf, 0.1986083984375hf, 0.2012939453125hf), + f16vec4( 0.25390625hf, 0.2548828125hf, 0.40625hf, 0.403076171875hf), + f16vec4(-0.66845703125hf, -0.6845703125hf, 0.290771484375hf, 0.289794921875hf)); + +const f16mat4 W_pz = f16mat4( + f16vec4( 0.5859375hf, 0.595703125hf, -0.0224151611328125hf, -0.0367431640625hf), + f16vec4( 0.438232421875hf, 0.453369140625hf, 0.45068359375hf, 0.455810546875hf), + f16vec4( 0.444091796875hf, 0.447021484375hf, 0.475341796875hf, 0.47216796875hf), + f16vec4(-0.64892578125hf, -0.6533203125hf, 0.1353759765625hf, 0.1385498046875hf)); + +const f16mat4 W_pp = f16mat4( + f16vec4( 0.316650390625hf, 0.325927734375hf, -0.81396484375hf, -0.798828125hf), + f16vec4( 0.06280517578125hf, 0.07110595703125hf, 0.341552734375hf, 0.3369140625hf), + f16vec4( 0.30712890625hf, 0.3095703125hf, 0.338134765625hf, 0.3212890625hf), + f16vec4(-0.71337890625hf, -0.6943359375hf, 0.291259765625hf, 0.30078125hf)); + +const f16vec4 bias = f16vec4(0.7431640625hf, 0.830078125hf, 0.434814453125hf, 0.371337890625hf); + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + if (any(greaterThanEqual(p, imageSize(outMerged)))) { + return; + } + + vec2 S = vec2(textureSize(src, 0)); + vec2 uv = (vec2(gl_GlobalInvocationID.xy) + vec2(0.5, 0.5)) / S; + + f16vec4 acc = W_mm * f16vec4(textureLodOffset(src, uv, 0.0, ivec2(-1, -1))); + acc += W_mz * f16vec4(textureLodOffset(src, uv, 0.0, ivec2(-1, 0))); + acc += W_mp * f16vec4(textureLodOffset(src, uv, 0.0, ivec2(-1, 1))); + acc += W_zm * f16vec4(textureLodOffset(src, uv, 0.0, ivec2( 0, -1))); + acc += W_zz * f16vec4(textureLod(src, uv, 0.0)); + acc += W_zp * f16vec4(textureLodOffset(src, uv, 0.0, ivec2( 0, 1))); + acc += W_pm * f16vec4(textureLodOffset(src, uv, 0.0, ivec2( 1, -1))); + acc += W_pz * f16vec4(textureLodOffset(src, uv, 0.0, ivec2( 1, 0))); + acc += W_pp * f16vec4(textureLodOffset(src, uv, 0.0, ivec2( 1, 1))); + acc += bias; + acc += f16vec4(textureLod(residual, uv, 0.0)); + + imageStore(outMerged, p, vec4(acc)); +} diff --git a/cleanroom/glsl/shader_30.comp b/cleanroom/glsl/shader_30.comp new file mode 100644 index 0000000..7a87077 --- /dev/null +++ b/cleanroom/glsl/shader_30.comp @@ -0,0 +1,88 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcTex; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstA; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; + +const float16_t IN_MEAN = 0.322265625hf; +const float16_t IN_SCALE = 0.7373046875hf; +const float16_t IN_BIAS = 0.52490234375hf; + +const f16vec4 WA1 = f16vec4(-0.065368652344hf, 0.36206054688hf, 0.066772460938hf, 0.050598144531hf); +const f16vec4 WA2 = f16vec4(-0.019653320312hf, 0.31518554688hf, 0.010818481445hf, -0.071228027344hf); +const f16vec4 WA3 = f16vec4(-0.061187744141hf, 0.12493896484hf, 0.068176269531hf, -0.13073730469hf); +const f16vec4 WA4 = f16vec4(0.0045356750488hf, 0.13244628906hf, -0.0047492980957hf, 0.018783569336hf); +const f16vec4 WA5 = f16vec4(0.10791015625hf, 0.24694824219hf, -0.18420410156hf, -0.098266601562hf); +const f16vec4 WA6 = f16vec4(0.019195556641hf, -0.091735839844hf, -0.057739257812hf, -0.216796875hf); +const f16vec4 WA7 = f16vec4(0.079284667969hf, -0.16540527344hf, -0.15991210938hf, 0.10046386719hf); +const f16vec4 WA8 = f16vec4(0.2138671875hf, -0.064392089844hf, -0.31640625hf, 0.03125hf); +const f16vec4 WA9 = f16vec4(0.084716796875hf, -0.36279296875hf, -0.11651611328hf, -0.089111328125hf); + +const f16vec4 B1A = f16vec4(0.19067382812hf, 0.2578125hf, -0.36328125hf, -0.21069335938hf); +const f16vec4 GA = f16vec4(3.42578125hf, 1.4599609375hf, 5.015625hf, 5.2734375hf); +const f16vec4 B2A = f16vec4(0.098510742188hf, 0.30712890625hf, -0.28100585938hf, -0.23095703125hf); + +const f16vec4 WB1 = f16vec4(0.047882080078hf, -0.022064208984hf, -0.26904296875hf, -0.066223144531hf); +const f16vec4 WB2 = f16vec4(-0.013168334961hf, 0.11944580078hf, -0.220703125hf, 0.0083160400391hf); +const f16vec4 WB3 = f16vec4(-0.0947265625hf, 0.17797851562hf, -0.10607910156hf, 0.0048522949219hf); +const f16vec4 WB4 = f16vec4(0.15002441406hf, -0.097717285156hf, -0.0018367767334hf, -0.12976074219hf); +const f16vec4 WB5 = f16vec4(0.020935058594hf, 0.023071289062hf, 0.33105468750hf, -0.0361328125hf); +const f16vec4 WB6 = f16vec4(-0.085021972656hf, 0.1318359375hf, 0.4169921875hf, 0.029052734375hf); +const f16vec4 WB7 = f16vec4(0.11926269531hf, -0.10968017578hf, -0.11987304688hf, -0.097412109375hf); +const f16vec4 WB8 = f16vec4(0.018600463867hf, -0.077941894531hf, 0.051208496094hf, -0.0042533874512hf); +const f16vec4 WB9 = f16vec4(-0.029266357422hf, 0.016357421875hf, 0.28491210938hf, 0.045989990234hf); + +const f16vec4 B1B = f16vec4(0.069824218750hf, 0.083435058594hf, 0.19372558594hf, -0.12707519531hf); +const f16vec4 GB = f16vec4(3.697265625hf, 3.19921875hf, 1.1376953125hf, 8.796875hf); +const f16vec4 B2B = f16vec4(0.28417968750hf, 0.18713378906hf, 0.16345214844hf, -0.42236328125hf); + +#define TAP(ox, oy) \ + ((float16_t(textureLodOffset(srcTex, uv, 0.0, ivec2(ox, oy)).r) - IN_MEAN) * IN_SCALE + IN_BIAS) + +void main() { + ivec2 gid = ivec2(gl_GlobalInvocationID.xy); + if (any(greaterThanEqual(gid, imageSize(dstA)))) + return; + + vec2 srcSize = vec2(textureSize(srcTex, 0)); + vec2 uv = (vec2(gid * 2) + 0.5) / srcSize; + + float16_t t1 = TAP(-1, -1); + float16_t t2 = TAP(-1, 0); + float16_t t3 = TAP(-1, 1); + float16_t t4 = TAP(0, -1); + float16_t t5 = TAP(0, 0); + float16_t t6 = TAP(0, 1); + float16_t t7 = TAP(1, -1); + float16_t t8 = TAP(1, 0); + float16_t t9 = TAP(1, 1); + + f16vec4 accA = WA1 * t1; + accA += WA2 * t2; + accA += WA3 * t3; + accA += WA4 * t4; + accA += WA5 * t5; + accA += WA6 * t6; + accA += WA7 * t7; + accA += WA8 * t8; + accA += WA9 * t9; + + f16vec4 resA = (accA - B1A) * GA + B2A; + imageStore(dstA, gid, vec4(resA)); + + f16vec4 accB = WB1 * t1; + accB += WB2 * t2; + accB += WB3 * t3; + accB += WB4 * t4; + accB += WB5 * t5; + accB += WB6 * t6; + accB += WB7 * t7; + accB += WB8 * t8; + accB += WB9 * t9; + + f16vec4 resB = (accB - B1B) * GB + B2B; + imageStore(dstB, gid, vec4(resB)); +} diff --git a/cleanroom/glsl/shader_31.comp b/cleanroom/glsl/shader_31.comp new file mode 100644 index 0000000..d877ac8 --- /dev/null +++ b/cleanroom/glsl/shader_31.comp @@ -0,0 +1,309 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// Linear 3x3 refinement filter: 72 inputs (two 4-channel textures, 3x3 +// neighborhood) -> two 4-channel outputs via learned weight matrices. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcA; +layout(set = 0, binding = 33) uniform sampler2D srcB; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstF; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; + +const f16mat4 wfA_mm = f16mat4( + f16vec4(0.0199432373046875, 0.08966064453125, 0.017547607421875, 0.1976318359375), + f16vec4(-0.0447998046875, -0.0675048828125, -0.01873779296875, 0.11846923828125), + f16vec4(0.0196685791015625, -0.01708984375, -0.0295257568359375, -0.1881103515625), + f16vec4(-0.039337158203125, 0.049163818359375, 0.022125244140625, -0.12890625)); + +const f16mat4 wfA_mz = f16mat4( + f16vec4(-0.07073974609375, -0.092041015625, -0.0207672119140625, 0.201416015625), + f16vec4(-0.27392578125, -0.0968017578125, -0.0797119140625, 0.345458984375), + f16vec4(0.04315185546875, 0.0660400390625, 0.0947265625, -0.1376953125), + f16vec4(-0.10601806640625, 0.00759124755859375, 0.11334228515625, -0.153564453125)); + +const f16mat4 wfA_mp = f16mat4( + f16vec4(0.12469482421875, -0.2021484375, 0.0013027191162109375, 0.11737060546875), + f16vec4(-0.10858154296875, 0.0621337890625, -0.025726318359375, 0.240966796875), + f16vec4(-0.12432861328125, 0.074462890625, 0.1854248046875, -0.042694091796875), + f16vec4(-0.2161865234375, -0.0216522216796875, 0.054229736328125, -0.073486328125)); + +const f16mat4 wfA_zm = f16mat4( + f16vec4(0.037872314453125, 0.2027587890625, 0.0673828125, -0.049407958984375), + f16vec4(-0.11480712890625, 0.09210205078125, 0.00310516357421875, 0.09429931640625), + f16vec4(0.10809326171875, -0.1717529296875, -0.047637939453125, -0.0272674560546875), + f16vec4(0.150390625, 0.00959014892578125, -0.0007958412170410156, -0.0188446044921875)); + +const f16mat4 wfA_zz = f16mat4( + f16vec4(-0.05755615234375, 0.002307891845703125, -0.00510406494140625, -0.095703125), + f16vec4(-0.3076171875, -0.0005688667297363281, -0.01012420654296875, 0.1502685546875), + f16vec4(0.075439453125, -0.0291900634765625, 0.0489501953125, 0.0281982421875), + f16vec4(-0.057373046875, 0.0212249755859375, 0.0985107421875, -0.01342010498046875)); + +const f16mat4 wfA_zp = f16mat4( + f16vec4(0.202880859375, -0.255615234375, -0.00716400146484375, -0.1798095703125), + f16vec4(0.1182861328125, -0.03656005859375, 0.0063323974609375, 0.07403564453125), + f16vec4(-0.0909423828125, 0.1881103515625, 0.21337890625, 0.0877685546875), + f16vec4(-0.216796875, 0.06884765625, 0.11407470703125, 0.0175018310546875)); + +const f16mat4 wfA_pm = f16mat4( + f16vec4(0.0806884765625, 0.2381591796875, 0.00794219970703125, -0.197509765625), + f16vec4(-0.1392822265625, 0.216552734375, 0.0428466796875, -0.0352783203125), + f16vec4(0.007030487060546875, -0.18701171875, -0.10076904296875, 0.10113525390625), + f16vec4(0.0302886962890625, -0.0806884765625, -0.07476806640625, 0.058746337890625)); + +const f16mat4 wfA_pz = f16mat4( + f16vec4(-0.11016845703125, 0.15185546875, -0.0005979537963867188, -0.283203125), + f16vec4(-0.293701171875, 0.1365966796875, -0.0091705322265625, -0.0215911865234375), + f16vec4(0.06903076171875, -0.11163330078125, -0.0250244140625, 0.2271728515625), + f16vec4(-0.1568603515625, 0.0231781005859375, 0.0262451171875, 0.0948486328125)); + +const f16mat4 wfA_pp = f16mat4( + f16vec4(-0.048492431640625, -0.10064697265625, -0.00811767578125, -0.2137451171875), + f16vec4(0.0249786376953125, 0.00836944580078125, -0.04608154296875, -0.10308837890625), + f16vec4(0.07427978515625, 0.12548828125, 0.0738525390625, 0.2081298828125), + f16vec4(-0.250732421875, 0.122802734375, 0.08087158203125, 0.07244873046875)); + +const f16mat4 wfB_mm = f16mat4( + f16vec4(0.037109375, -0.07415771484375, -0.0013933181762695312, 0.0029163360595703125), + f16vec4(-0.0516357421875, -0.11761474609375, -0.032379150390625, 0.2080078125), + f16vec4(-0.14453125, -0.01983642578125, -0.0039825439453125, 0.2122802734375), + f16vec4(-0.09771728515625, 0.0516357421875, -0.08984375, -0.007785797119140625)); + +const f16mat4 wfB_mz = f16mat4( + f16vec4(-0.226318359375, -0.09869384765625, -0.00608062744140625, 0.12298583984375), + f16vec4(0.0662841796875, -0.151123046875, 0.00917816162109375, 0.34423828125), + f16vec4(-0.039886474609375, -0.085205078125, -0.03375244140625, 0.2105712890625), + f16vec4(0.120849609375, -0.0173797607421875, 0.0247802734375, -0.0699462890625)); + +const f16mat4 wfB_mp = f16mat4( + f16vec4(-0.25244140625, -0.0192718505859375, -0.0335693359375, 0.15234375), + f16vec4(0.07733154296875, 0.035064697265625, 0.059356689453125, 0.10113525390625), + f16vec4(0.14013671875, -0.07073974609375, -0.004497528076171875, 0.1239013671875), + f16vec4(-0.00928497314453125, -0.016143798828125, 0.10400390625, -0.1358642578125)); + +const f16mat4 wfB_zm = f16mat4( + f16vec4(0.06695556640625, 0.11212158203125, 0.03662109375, -0.06219482421875), + f16vec4(-0.1119384765625, -0.02459716796875, 0.0123748779296875, 0.0177764892578125), + f16vec4(-0.00812530517578125, 0.07427978515625, 0.007720947265625, -0.005306243896484375), + f16vec4(0.01079559326171875, -0.00146484375, -0.1339111328125, -0.0242919921875)); + +const f16mat4 wfB_zz = f16mat4( + f16vec4(-0.1658935546875, 0.056854248046875, 0.04473876953125, 0.00032901763916015625), + f16vec4(0.08831787109375, -0.1868896484375, 0.03472900390625, 0.0704345703125), + f16vec4(0.1419677734375, -0.1182861328125, -0.0255279541015625, -0.04644775390625), + f16vec4(0.1944580078125, -0.060943603515625, 0.012725830078125, 0.02056884765625)); + +const f16mat4 wfB_zp = f16mat4( + f16vec4(-0.03363037109375, 0.0070953369140625, -0.0091705322265625, -0.0250701904296875), + f16vec4(0.17041015625, -0.1058349609375, 0.020843505859375, -0.0208282470703125), + f16vec4(0.291748046875, -0.197509765625, -0.0198516845703125, -0.10150146484375), + f16vec4(0.020263671875, 0.016326904296875, 0.06951904296875, -0.0109100341796875)); + +const f16mat4 wfB_pm = f16mat4( + f16vec4(-0.0045013427734375, 0.09185791015625, -0.01445770263671875, -0.103759765625), + f16vec4(-0.0711669921875, 0.1785888671875, 0.0396728515625, -0.14697265625), + f16vec4(0.01473236083984375, 0.2105712890625, 0.030120849609375, -0.1463623046875), + f16vec4(-0.051666259765625, 0.018798828125, -0.1546630859375, -0.0006651878356933594)); + +const f16mat4 wfB_pz = f16mat4( + f16vec4(-0.1468505859375, 0.2083740234375, -0.006103515625, -0.12005615234375), + f16vec4(0.02734375, -0.11700439453125, 0.036773681640625, -0.11962890625), + f16vec4(0.058929443359375, 0.06292724609375, -0.0265960693359375, -0.2230224609375), + f16vec4(0.14111328125, -0.11688232421875, -0.04937744140625, 0.113037109375)); + +const f16mat4 wfB_pp = f16mat4( + f16vec4(-0.11956787109375, 0.18603515625, -0.03460693359375, -0.171630859375), + f16vec4(0.0210113525390625, -0.1663818359375, -0.01593017578125, -0.158935546875), + f16vec4(0.0506591796875, -0.0836181640625, -0.056427001953125, -0.171875), + f16vec4(-0.14697265625, -5.4001808166503906e-05, 0.01300048828125, 0.11138916015625)); + +const f16mat4 wbA_mm = f16mat4( + f16vec4(-0.03271484375, -0.2052001953125, 0.320068359375, -0.1123046875), + f16vec4(0.210693359375, -0.005035400390625, 0.1253662109375, 0.09271240234375), + f16vec4(0.0885009765625, 0.1627197265625, -0.288818359375, -0.128173828125), + f16vec4(-0.13134765625, -0.03204345703125, 0.032867431640625, -0.2113037109375)); + +const f16mat4 wbA_mz = f16mat4( + f16vec4(0.0364990234375, 0.127685546875, -0.004650115966796875, -0.0809326171875), + f16vec4(0.289306640625, 0.1964111328125, 0.0726318359375, 0.051910400390625), + f16vec4(0.064208984375, -0.01116180419921875, -0.0304412841796875, -0.10015869140625), + f16vec4(-0.10107421875, -0.0657958984375, 0.02996826171875, -0.2059326171875)); + +const f16mat4 wbA_mp = f16mat4( + f16vec4(0.1090087890625, 0.23779296875, -0.26708984375, 0.047332763671875), + f16vec4(0.2509765625, 0.206298828125, -0.045379638671875, -0.12213134765625), + f16vec4(-0.022125244140625, -0.1405029296875, 0.12841796875, -0.00213623046875), + f16vec4(0.014068603515625, 0.05096435546875, 0.09027099609375, 0.045562744140625)); + +const f16mat4 wbA_zm = f16mat4( + f16vec4(-0.18408203125, -0.313720703125, 0.286376953125, -0.0841064453125), + f16vec4(-0.0169219970703125, -0.139404296875, 0.440673828125, 0.0170135498046875), + f16vec4(0.197998046875, 0.1766357421875, -0.07037353515625, 0.010162353515625), + f16vec4(0.004680633544921875, 0.031280517578125, -0.0226593017578125, -0.145751953125)); + +const f16mat4 wbA_zz = f16mat4( + f16vec4(-0.2218017578125, -0.129638671875, -0.1439208984375, 0.051727294921875), + f16vec4(0.037811279296875, 0.048553466796875, 0.148681640625, -0.05426025390625), + f16vec4(0.226318359375, 0.0311126708984375, 0.069091796875, 0.08343505859375), + f16vec4(-0.039306640625, -0.060516357421875, 0.0657958984375, -0.05303955078125)); + +const f16mat4 wbA_zp = f16mat4( + f16vec4(-0.11181640625, 0.161865234375, -0.36572265625, 0.489013671875), + f16vec4(0.07818603515625, 0.238037109375, -0.1185302734375, -0.0579833984375), + f16vec4(0.11553955078125, -0.12005615234375, 0.156982421875, -0.140380859375), + f16vec4(-0.06640625, -0.045654296875, 0.11083984375, 0.0197906494140625)); + +const f16mat4 wbA_pm = f16mat4( + f16vec4(-0.09490966796875, -0.160888671875, 0.0535888671875, -0.3330078125), + f16vec4(-0.02496337890625, -0.0374755859375, 0.3896484375, -0.1376953125), + f16vec4(0.19873046875, 0.1533203125, 0.00789642333984375, 0.1209716796875), + f16vec4(0.0386962890625, 0.019134521484375, 0.06365966796875, -0.07135009765625)); + +const f16mat4 wbA_pz = f16mat4( + f16vec4(-0.06988525390625, -0.2415771484375, -0.234619140625, -0.09881591796875), + f16vec4(-0.08673095703125, -0.0638427734375, 0.061767578125, -0.287353515625), + f16vec4(0.200927734375, 0.135009765625, 0.1337890625, 0.1058349609375), + f16vec4(0.0096282958984375, 0.050567626953125, -0.0113983154296875, -0.01038360595703125)); + +const f16mat4 wbA_pp = f16mat4( + f16vec4(-0.069580078125, -0.09600830078125, -0.287109375, 0.44580078125), + f16vec4(-0.00904083251953125, 0.1907958984375, -0.1832275390625, -0.0408935546875), + f16vec4(0.10516357421875, 0.004695892333984375, 0.093017578125, -0.10272216796875), + f16vec4(-0.1029052734375, -0.02655029296875, -0.10662841796875, -0.05657958984375)); + +const f16mat4 wbB_mm = f16mat4( + f16vec4(0.0169677734375, -0.1627197265625, 0.10546875, 0.041259765625), + f16vec4(0.1953125, 0.096923828125, -0.0389404296875, 0.0645751953125), + f16vec4(0.1588134765625, 0.0106201171875, 0.192138671875, 0.0112457275390625), + f16vec4(-0.08184814453125, -0.024200439453125, -0.150390625, -0.15185546875)); + +const f16mat4 wbB_mz = f16mat4( + f16vec4(0.1837158203125, -0.033447265625, 0.11041259765625, -0.0200958251953125), + f16vec4(0.1416015625, 0.12103271484375, -0.10906982421875, -0.058135986328125), + f16vec4(0.1524658203125, 0.11700439453125, -0.0193939208984375, -0.03106689453125), + f16vec4(-0.055023193359375, -0.203857421875, -0.018768310546875, -0.340576171875)); + +const f16mat4 wbB_mp = f16mat4( + f16vec4(0.3046875, 0.258544921875, 0.0296478271484375, -0.006378173828125), + f16vec4(-0.066162109375, 0.034088134765625, -0.10888671875, -0.140380859375), + f16vec4(0.09783935546875, 0.25537109375, -0.17236328125, 0.0254669189453125), + f16vec4(-0.0299530029296875, 0.0679931640625, 0.004871368408203125, -0.0281982421875)); + +const f16mat4 wbB_zm = f16mat4( + f16vec4(-0.10406494140625, -0.29052734375, 0.388916015625, -0.01250457763671875), + f16vec4(-0.043731689453125, 0.01457977294921875, 0.057769775390625, 0.036865234375), + f16vec4(-0.0941162109375, -0.1827392578125, 0.2406005859375, -0.0701904296875), + f16vec4(0.029937744140625, -0.0196685791015625, -0.1673583984375, 0.0176849365234375)); + +const f16mat4 wbB_zz = f16mat4( + f16vec4(-0.06494140625, -0.1820068359375, 0.2396240234375, -0.059600830078125), + f16vec4(0.0293121337890625, 0.1331787109375, -0.099365234375, 0.00513458251953125), + f16vec4(-0.11285400390625, -0.00634765625, -0.046234130859375, 0.00847625732421875), + f16vec4(0.08331298828125, -0.0958251953125, -0.07769775390625, -0.132080078125)); + +const f16mat4 wbB_zp = f16mat4( + f16vec4(-0.04486083984375, 0.1397705078125, 0.041351318359375, 0.0426025390625), + f16vec4(0.008697509765625, 0.28076171875, -0.1693115234375, 0.2259521484375), + f16vec4(-0.1044921875, 0.281494140625, -0.200439453125, 0.2705078125), + f16vec4(0.09991455078125, 0.09588623046875, 0.0305328369140625, 0.287353515625)); + +const f16mat4 wbB_pm = f16mat4( + f16vec4(0.029388427734375, 0.01433563232421875, 0.223388671875, -0.290771484375), + f16vec4(-0.0183258056640625, -0.1571044921875, 0.0304718017578125, -0.06549072265625), + f16vec4(-0.101806640625, -0.14501953125, 0.0278167724609375, -0.10089111328125), + f16vec4(0.0821533203125, -0.189697265625, -0.1212158203125, 0.042327880859375)); + +const f16mat4 wbB_pz = f16mat4( + f16vec4(-0.000762939453125, -0.09295654296875, 0.07720947265625, -0.32861328125), + f16vec4(0.007701873779296875, -0.090576171875, -0.127685546875, 0.04290771484375), + f16vec4(-0.06512451171875, -0.1427001953125, -0.151611328125, 0.07977294921875), + f16vec4(0.135986328125, -0.211181640625, 0.03753662109375, 0.0804443359375)); + +const f16mat4 wbB_pp = f16mat4( + f16vec4(-0.0234832763671875, 0.05914306640625, -0.1162109375, 0.04315185546875), + f16vec4(0.0263824462890625, 0.2327880859375, -0.0679931640625, 0.1822509765625), + f16vec4(-0.05914306640625, -0.0011539459228515625, -0.110107421875, 0.2939453125), + f16vec4(0.181884765625, 0.0723876953125, -0.006908416748046875, 0.32470703125)); + +const f16vec4 subF = f16vec4(-0.481689453125, 0.07958984375, 0.063720703125, 0.193359375); + +const f16vec4 mulF = f16vec4(1.6923828125, 1.6337890625, 3.208984375, 2.80859375); + +const f16vec4 addF = f16vec4(-0.210205078125, 0.0880126953125, -0.45263671875, 0.16064453125); + +const f16vec4 subB = f16vec4(0.4033203125, 0.2088623046875, 0.369140625, -0.2333984375); + +const f16vec4 mulB = f16vec4(1.5693359375, 1.6083984375, 1.19140625, 1.8642578125); + +const f16vec4 addB = f16vec4(-0.39990234375, 0.137939453125, 0.08624267578125, -0.152099609375); + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 ext = imageSize(dstF); + if (p.x >= ext.x || p.y >= ext.y) return; + + vec2 uv = (vec2(p) + 0.5) / vec2(textureSize(srcA, 0)); + + f16vec4 tA[9]; + f16vec4 tB[9]; + tA[0] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(-1, -1))); + tA[1] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(-1, 0))); + tA[2] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(-1, 1))); + tA[3] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(0, -1))); + tA[4] = f16vec4(textureLod(srcA, uv, 0.0)); + tA[5] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(0, 1))); + tA[6] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(1, -1))); + tA[7] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(1, 0))); + tA[8] = f16vec4(textureLodOffset(srcA, uv, 0.0, ivec2(1, 1))); + tB[0] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(-1, -1))); + tB[1] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(-1, 0))); + tB[2] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(-1, 1))); + tB[3] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(0, -1))); + tB[4] = f16vec4(textureLod(srcB, uv, 0.0)); + tB[5] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(0, 1))); + tB[6] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(1, -1))); + tB[7] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(1, 0))); + tB[8] = f16vec4(textureLodOffset(srcB, uv, 0.0, ivec2(1, 1))); + + f16vec4 sF = wfA_mm * tA[0]; + sF += wfA_mz * tA[1]; + sF += wfA_mp * tA[2]; + sF += wfA_zm * tA[3]; + sF += wfA_zz * tA[4]; + sF += wfA_zp * tA[5]; + sF += wfA_pm * tA[6]; + sF += wfA_pz * tA[7]; + sF += wfA_pp * tA[8]; + sF += wfB_mm * tB[0]; + sF += wfB_mz * tB[1]; + sF += wfB_mp * tB[2]; + sF += wfB_zm * tB[3]; + sF += wfB_zz * tB[4]; + sF += wfB_zp * tB[5]; + sF += wfB_pm * tB[6]; + sF += wfB_pz * tB[7]; + sF += wfB_pp * tB[8]; + imageStore(dstF, p, vec4((sF - subF) * mulF + addF)); + + f16vec4 sB = wbA_mm * tA[0]; + sB += wbA_mz * tA[1]; + sB += wbA_mp * tA[2]; + sB += wbA_zm * tA[3]; + sB += wbA_zz * tA[4]; + sB += wbA_zp * tA[5]; + sB += wbA_pm * tA[6]; + sB += wbA_pz * tA[7]; + sB += wbA_pp * tA[8]; + sB += wbB_mm * tB[0]; + sB += wbB_mz * tB[1]; + sB += wbB_mp * tB[2]; + sB += wbB_zm * tB[3]; + sB += wbB_zz * tB[4]; + sB += wbB_zp * tB[5]; + sB += wbB_pm * tB[6]; + sB += wbB_pz * tB[7]; + sB += wbB_pp * tB[8]; + imageStore(dstB, p, vec4((sB - subB) * mulB + addB)); +} diff --git a/cleanroom/glsl/shader_32.comp b/cleanroom/glsl/shader_32.comp new file mode 100644 index 0000000..1e3c0c9 --- /dev/null +++ b/cleanroom/glsl/shader_32.comp @@ -0,0 +1,500 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D featA; +layout(set = 0, binding = 33) uniform sampler2D featB; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D plane0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D plane1; +layout(set = 0, binding = 50, rgba8) uniform writeonly image2D plane2; +layout(set = 0, binding = 51, rgba8) uniform writeonly image2D plane3; + +// output binding 48 +const f16vec4 sub48 = f16vec4(-0.1558837890625, 0.1956787109375, 0.1297607421875, -0.18310546875); +const f16vec4 mul48 = f16vec4(1.3388671875, 0.65966796875, 0.96435546875, 0.85107421875); +const f16vec4 add48 = f16vec4(-0.09576416015625, 0.1458740234375, 0.019012451171875, -0.01226043701171875); +const f16mat4 w48_00 = f16mat4( + f16vec4(-0.04132080078125, -0.056610107421875, -0.04681396484375, -0.0035953521728515625), + f16vec4(-0.0999755859375, -0.1683349609375, -0.06500244140625, 0.0283660888671875), + f16vec4(-0.1192626953125, -0.1214599609375, -0.0321044921875, 0.0029811859130859375), + f16vec4(0.0360107421875, -0.0863037109375, 0.0251007080078125, 0.036712646484375)); +const f16mat4 w48_01 = f16mat4( + f16vec4(0.05328369140625, 0.003368377685546875, -0.076416015625, -0.052276611328125), + f16vec4(-0.06634521484375, -0.11566162109375, 0.0079193115234375, 0.040374755859375), + f16vec4(-0.03125, -0.07330322265625, -0.00945281982421875, 0.05426025390625), + f16vec4(-0.045501708984375, -0.123046875, 0.0134429931640625, 0.01483154296875)); +const f16mat4 w48_02 = f16mat4( + f16vec4(0.051910400390625, -0.1278076171875, -0.05511474609375, 0.048431396484375), + f16vec4(0.11041259765625, 0.0012531280517578125, 0.1748046875, -0.416015625), + f16vec4(0.151123046875, 0.0367431640625, 0.071044921875, -0.165771484375), + f16vec4(-0.018829345703125, 0.2216796875, -0.08551025390625, -0.167724609375)); +const f16mat4 w48_03 = f16mat4( + f16vec4(-0.0168914794921875, -0.0271759033203125, 0.018798828125, -0.138671875), + f16vec4(-0.355224609375, 0.054962158203125, 0.086181640625, 0.06622314453125), + f16vec4(-0.146728515625, -0.06854248046875, 0.0091400146484375, 0.021087646484375), + f16vec4(0.1705322265625, -0.06903076171875, -0.072265625, 0.0784912109375)); +const f16mat4 w48_04 = f16mat4( + f16vec4(-0.0000669956207275390625, -0.021942138671875, -0.006694793701171875, 0.01421356201171875), + f16vec4(-0.3271484375, 0.137451171875, -0.08331298828125, -0.0171966552734375), + f16vec4(-0.11163330078125, 0.024627685546875, -0.0574951171875, 0.1600341796875), + f16vec4(0.05859375, 0.20166015625, 0.0031948089599609375, -0.1351318359375)); +const f16mat4 w48_05 = f16mat4( + f16vec4(0.0965576171875, -0.1414794921875, -0.041900634765625, 0.088134765625), + f16vec4(-0.02667236328125, 0.050750732421875, -0.01001739501953125, -0.392822265625), + f16vec4(0.0209503173828125, 0.09283447265625, 0.00024700164794921875, -0.2255859375), + f16vec4(-0.01082611083984375, 0.2529296875, -0.00803375244140625, -0.163818359375)); +const f16mat4 w48_06 = f16mat4( + f16vec4(-0.1180419921875, 0.006671905517578125, 0.01145172119140625, 0.0247650146484375), + f16vec4(-0.204345703125, 0.1455078125, 0.1239013671875, 0.033660888671875), + f16vec4(-0.06744384765625, 0.001850128173828125, 0.0014362335205078125, 0.0235595703125), + f16vec4(0.1400146484375, 0.1971435546875, -0.05389404296875, 0.039337158203125)); +const f16mat4 w48_07 = f16mat4( + f16vec4(-0.08050537109375, 0.0020198822021484375, -0.040679931640625, 0.059814453125), + f16vec4(-0.3935546875, 0.1536865234375, 0.08636474609375, 0.07342529296875), + f16vec4(-0.0921630859375, 0.13623046875, 0.0032138824462890625, 0.1800537109375), + f16vec4(0.1558837890625, 0.2459716796875, -0.034271240234375, -0.1500244140625)); +const f16mat4 w48_08 = f16mat4( + f16vec4(0.0003030300140380859375, 0.1339111328125, -0.0226593017578125, 0.0275421142578125), + f16vec4(-0.2041015625, -0.1661376953125, -0.1990966796875, -0.15576171875), + f16vec4(-0.04803466796875, 0.058837890625, -0.0869140625, -0.124267578125), + f16vec4(0.1253662109375, -0.043701171875, 0.047576904296875, 0.057647705078125)); +const f16mat4 w48_09 = f16mat4( + f16vec4(-0.004913330078125, -0.076171875, 0.022857666015625, -0.039520263671875), + f16vec4(-0.1531982421875, -0.1552734375, 0.1282958984375, -0.016571044921875), + f16vec4(-0.11981201171875, -0.1583251953125, -0.053955078125, -0.0137939453125), + f16vec4(-0.10247802734375, 0.09326171875, 0.0220947265625, -0.0335693359375)); +const f16mat4 w48_10 = f16mat4( + f16vec4(-0.054901123046875, -0.07330322265625, 0.04168701171875, -0.0179443359375), + f16vec4(-0.07373046875, 0.0819091796875, 0.1680908203125, -0.1728515625), + f16vec4(0.00811004638671875, -0.10186767578125, 0.031951904296875, 0.048583984375), + f16vec4(-0.0294189453125, 0.0887451171875, 0.04827880859375, 0.073486328125)); +const f16mat4 w48_11 = f16mat4( + f16vec4(-0.06170654296875, -0.02801513671875, -0.044647216796875, 0.01702880859375), + f16vec4(-0.08026123046875, -0.081787109375, -0.1199951171875, 0.2474365234375), + f16vec4(0.09503173828125, 0.0670166015625, 0.1533203125, -0.1744384765625), + f16vec4(-0.04376220703125, -0.1888427734375, 0.01348876953125, 0.0880126953125)); +const f16mat4 w48_12 = f16mat4( + f16vec4(0.045654296875, -0.007534027099609375, 0.01806640625, -0.041290283203125), + f16vec4(-0.04864501953125, -0.07086181640625, 0.1292724609375, -0.048858642578125), + f16vec4(-0.042938232421875, -0.10345458984375, -0.0345458984375, -0.026702880859375), + f16vec4(-0.06768798828125, 0.06988525390625, -0.048797607421875, -0.02801513671875)); +const f16mat4 w48_13 = f16mat4( + f16vec4(0.07220458984375, -0.01097869873046875, 0.0904541015625, -0.0168609619140625), + f16vec4(-0.01424407958984375, 0.0102996826171875, 0.188720703125, -0.18115234375), + f16vec4(0.0791015625, 0.282470703125, -0.028961181640625, 0.134521484375), + f16vec4(-0.049774169921875, -0.108154296875, -0.049072265625, 0.10882568359375)); +const f16mat4 w48_14 = f16mat4( + f16vec4(0.057525634765625, 0.0933837890625, 0.14111328125, -0.036407470703125), + f16vec4(-0.01251983642578125, -0.11407470703125, 0.13232421875, 0.303955078125), + f16vec4(0.0899658203125, 0.268798828125, -0.03277587890625, -0.2529296875), + f16vec4(0.0181884765625, -0.11871337890625, -0.01486968994140625, 0.076416015625)); +const f16mat4 w48_15 = f16mat4( + f16vec4(-0.04669189453125, 0.1259765625, 0.006542205810546875, 0.06903076171875), + f16vec4(0.049835205078125, -0.0457763671875, -0.09686279296875, 0.044036865234375), + f16vec4(-0.1380615234375, 0.09539794921875, 0.0098419189453125, -0.027099609375), + f16vec4(-0.19091796875, -0.07501220703125, -0.0650634765625, -0.01107025146484375)); +const f16mat4 w48_16 = f16mat4( + f16vec4(0.0992431640625, 0.1522216796875, 0.1060791015625, -0.010284423828125), + f16vec4(0.1068115234375, 0.0020122528076171875, 0.1654052734375, -0.150390625), + f16vec4(-0.09490966796875, 0.415283203125, -0.0386962890625, 0.066650390625), + f16vec4(-0.1942138671875, -0.0335693359375, -0.09332275390625, 0.0450439453125)); +const f16mat4 w48_17 = f16mat4( + f16vec4(0.062744140625, 0.118408203125, 0.1024169921875, 0.035614013671875), + f16vec4(0.1885986328125, -0.17626953125, 0.2587890625, 0.177734375), + f16vec4(0.0587158203125, 0.0263214111328125, -0.043487548828125, -0.048583984375), + f16vec4(-0.08001708984375, 0.0231475830078125, 0.00059413909912109375, -0.06085205078125)); + +// output binding 49 +const f16vec4 sub49 = f16vec4(0.086669921875, -0.036468505859375, -0.2196044921875, -0.4111328125); +const f16vec4 mul49 = f16vec4(1.5361328125, 1.2685546875, 1.12109375, 0.70751953125); +const f16vec4 add49 = f16vec4(-0.48388671875, -0.047698974609375, -0.06402587890625, 0.1292724609375); +const f16mat4 w49_00 = f16mat4( + f16vec4(-0.1484375, 0.01145172119140625, -0.032501220703125, 0.0228271484375), + f16vec4(0.01751708984375, -0.15380859375, -0.0821533203125, -0.029327392578125), + f16vec4(0.188720703125, -0.06793212890625, 0.0357666015625, -0.094482421875), + f16vec4(0.05267333984375, 0.087646484375, 0.052734375, -0.184814453125)); +const f16mat4 w49_01 = f16mat4( + f16vec4(-0.058319091796875, -0.00423431396484375, -0.040313720703125, -0.041412353515625), + f16vec4(-0.00862884521484375, -0.275146484375, -0.106201171875, 0.1072998046875), + f16vec4(0.354248046875, -0.130126953125, -0.08856201171875, -0.02587890625), + f16vec4(0.0305328369140625, 0.07440185546875, 0.038116455078125, -0.29736328125)); +const f16mat4 w49_02 = f16mat4( + f16vec4(-0.045562744140625, -0.047393798828125, -0.086669921875, -0.06549072265625), + f16vec4(0.0067138671875, -0.052825927734375, 0.177734375, 0.1363525390625), + f16vec4(0.1629638671875, -0.03363037109375, 0.0814208984375, 0.01126861572265625), + f16vec4(0.0084381103515625, -0.09912109375, -0.11212158203125, -0.221923828125)); +const f16mat4 w49_03 = f16mat4( + f16vec4(-0.09002685546875, -0.09478759765625, -0.0330810546875, -0.1524658203125), + f16vec4(0.00643157958984375, -0.088134765625, -0.1895751953125, -0.030181884765625), + f16vec4(0.238525390625, 0.043914794921875, 0.0728759765625, -0.0279388427734375), + f16vec4(-0.016754150390625, 0.063232421875, 0.0149688720703125, -0.251953125)); +const f16mat4 w49_04 = f16mat4( + f16vec4(0.006282806396484375, -0.118896484375, 0.047760009765625, -0.1988525390625), + f16vec4(0.031768798828125, -0.2171630859375, -0.33740234375, 0.01499176025390625), + f16vec4(0.35986328125, -0.044830322265625, -0.25390625, -0.0299224853515625), + f16vec4(0.0250244140625, 0.2147216796875, -0.042266845703125, -0.380859375)); +const f16mat4 w49_05 = f16mat4( + f16vec4(-0.06329345703125, -0.086669921875, -0.080322265625, -0.0943603515625), + f16vec4(0.033355712890625, -0.26220703125, 0.2120361328125, 0.01392364501953125), + f16vec4(0.27294921875, -0.0513916015625, 0.10662841796875, -0.0260009765625), + f16vec4(0.036590576171875, 0.12152099609375, -0.06744384765625, -0.2393798828125)); +const f16mat4 w49_06 = f16mat4( + f16vec4(-0.10711669921875, 0.038665771484375, 0.017425537109375, -0.027923583984375), + f16vec4(-0.0256805419921875, 0.093505859375, -0.061920166015625, 0.164306640625), + f16vec4(0.07891845703125, 0.06005859375, 0.08935546875, -0.0226287841796875), + f16vec4(-0.06634521484375, -0.0716552734375, -0.08758544921875, -0.2059326171875)); +const f16mat4 w49_07 = f16mat4( + f16vec4(-0.0272064208984375, -0.0341796875, 0.1607666015625, 0.04620361328125), + f16vec4(-0.0161590576171875, 0.0166778564453125, -0.28564453125, 0.207763671875), + f16vec4(0.2529296875, 0.04998779296875, -0.295166015625, 0.00530242919921875), + f16vec4(0.00824737548828125, 0.0400390625, -0.0323486328125, -0.285400390625)); +const f16mat4 w49_08 = f16mat4( + f16vec4(-0.05511474609375, 0.0048065185546875, -0.00103664398193359375, 0.07318115234375), + f16vec4(0.045166015625, -0.038055419921875, 0.11151123046875, 0.1971435546875), + f16vec4(0.1517333984375, 0.01113128662109375, -0.01776123046875, 0.0017414093017578125), + f16vec4(-0.057586669921875, 0.1015625, -0.03387451171875, -0.17724609375)); +const f16mat4 w49_09 = f16mat4( + f16vec4(0.07122802734375, -0.0191650390625, 0.043060302734375, -0.0218048095703125), + f16vec4(-0.12200927734375, 0.06097412109375, -0.0419921875, 0.10400390625), + f16vec4(0.06011962890625, 0.00919342041015625, 0.0020885467529296875, -0.10986328125), + f16vec4(0.0850830078125, -0.041259765625, -0.054229736328125, -0.01055908203125)); +const f16mat4 w49_10 = f16mat4( + f16vec4(0.032073974609375, -0.01287078857421875, 0.07672119140625, -0.052642822265625), + f16vec4(-0.0260162353515625, 0.05780029296875, 0.1524658203125, 0.050048828125), + f16vec4(-0.07049560546875, 0.0286865234375, -0.06646728515625, 0.0233917236328125), + f16vec4(0.03607177734375, -0.06903076171875, 0.0027313232421875, -0.00762176513671875)); +const f16mat4 w49_11 = f16mat4( + f16vec4(0.1080322265625, -0.0091552734375, 0.0105438232421875, -0.0635986328125), + f16vec4(0.00652313232421875, -0.04132080078125, -0.156982421875, -0.08319091796875), + f16vec4(-0.0438232421875, 0.060272216796875, -0.049041748046875, 0.036285400390625), + f16vec4(0.0189208984375, -0.052093505859375, -0.129150390625, -0.0195159912109375)); +const f16mat4 w49_12 = f16mat4( + f16vec4(0.09332275390625, -0.06396484375, -0.0233612060546875, 0.00495147705078125), + f16vec4(-0.02886962890625, 0.088134765625, -0.11053466796875, 0.07379150390625), + f16vec4(0.049041748046875, 0.003894805908203125, 0.09442138671875, -0.046783447265625), + f16vec4(0.0302276611328125, -0.130126953125, 0.0316162109375, 0.0310211181640625)); +const f16mat4 w49_13 = f16mat4( + f16vec4(0.08245849609375, 0.037689208984375, 0.03460693359375, -0.060150146484375), + f16vec4(0.03729248046875, 0.08416748046875, 0.2109375, 0.0203857421875), + f16vec4(-0.0584716796875, -0.0689697265625, -0.3056640625, -0.08441162109375), + f16vec4(-0.000762939453125, -0.20947265625, 0.07965087890625, 0.11590576171875)); +const f16mat4 w49_14 = f16mat4( + f16vec4(0.11553955078125, 0.08538818359375, -0.00933837890625, -0.06878662109375), + f16vec4(-0.00334930419921875, 0.163818359375, -0.04962158203125, 0.01303863525390625), + f16vec4(0.0034465789794921875, 0.001850128173828125, -0.11871337890625, -0.12548828125), + f16vec4(0.01904296875, -0.144287109375, -0.08447265625, 0.07171630859375)); +const f16mat4 w49_15 = f16mat4( + f16vec4(0.04083251953125, -0.04229736328125, -0.0177459716796875, -0.0136871337890625), + f16vec4(-0.0309295654296875, -0.11578369140625, -0.06756591796875, 0.033905029296875), + f16vec4(0.02593994140625, 0.1116943359375, 0.061737060546875, -0.045867919921875), + f16vec4(-0.00531768798828125, 0.072509765625, 0.058746337890625, 0.06451416015625)); +const f16mat4 w49_16 = f16mat4( + f16vec4(0.0138092041015625, -0.010986328125, 0.030517578125, -0.074462890625), + f16vec4(0.04742431640625, -0.077392578125, 0.25390625, -0.0178375244140625), + f16vec4(-0.034423828125, -0.03814697265625, -0.2230224609375, -0.04962158203125), + f16vec4(-0.017791748046875, -0.04461669921875, 0.10858154296875, 0.1988525390625)); +const f16mat4 w49_17 = f16mat4( + f16vec4(0.0175018310546875, 0.0694580078125, -0.00133228302001953125, -0.07757568359375), + f16vec4(-0.0306854248046875, 0.006481170654296875, -0.07781982421875, 0.0216522216796875), + f16vec4(0.01898193359375, -0.0650634765625, -0.038726806640625, -0.010650634765625), + f16vec4(0.0223541259765625, -0.051422119140625, -0.08050537109375, 0.04345703125)); + +// output binding 50 +const f16vec4 sub50 = f16vec4(-0.0635986328125, 0.177734375, -0.0994873046875, -0.138671875); +const f16vec4 mul50 = f16vec4(1.181640625, 0.83154296875, 0.99853515625, 1.515625); +const f16vec4 add50 = f16vec4(-0.01222991943359375, 0.14599609375, -0.0034809112548828125, -0.05859375); +const f16mat4 w50_00 = f16mat4( + f16vec4(0.000258922576904296875, 0.06719970703125, 0.030120849609375, -0.06201171875), + f16vec4(0.12249755859375, 0.1256103515625, 0.20556640625, -0.0283966064453125), + f16vec4(0.0445556640625, -0.0416259765625, 0.0311126708984375, 0.00024890899658203125), + f16vec4(0.0189208984375, -0.1302490234375, -0.1669921875, 0.06964111328125)); +const f16mat4 w50_01 = f16mat4( + f16vec4(-0.034820556640625, -0.059783935546875, 0.028045654296875, -0.08056640625), + f16vec4(0.262939453125, 0.0963134765625, 0.07379150390625, 0.0289764404296875), + f16vec4(0.057708740234375, 0.053375244140625, 0.0240478515625, -0.04254150390625), + f16vec4(-0.201904296875, 0.17431640625, -0.09613037109375, -0.0965576171875)); +const f16mat4 w50_02 = f16mat4( + f16vec4(0.0212860107421875, -0.058990478515625, 0.0404052734375, -0.01788330078125), + f16vec4(0.10443115234375, -0.04193115234375, -0.127685546875, -0.057647705078125), + f16vec4(-0.0028533935546875, 0.0149688720703125, -0.03564453125, -0.00655364990234375), + f16vec4(-0.1124267578125, 0.1644287109375, 0.1529541015625, 0.026275634765625)); +const f16mat4 w50_03 = f16mat4( + f16vec4(0.056732177734375, 0.0175628662109375, -0.1402587890625, 0.030487060546875), + f16vec4(-0.2149658203125, 0.1876220703125, 0.2371826171875, -0.122802734375), + f16vec4(-0.10845947265625, 0.1229248046875, 0.01396942138671875, -0.12017822265625), + f16vec4(0.1187744140625, 0.151123046875, -0.01189422607421875, -0.018890380859375)); +const f16mat4 w50_04 = f16mat4( + f16vec4(-0.008819580078125, 0.0684814453125, -0.2100830078125, -0.047760009765625), + f16vec4(0.002140045166015625, -0.021820068359375, 0.33251953125, 0.1488037109375), + f16vec4(0.044158935546875, 0.09857177734375, 0.068603515625, 0.054229736328125), + f16vec4(0.10589599609375, 0.187744140625, -0.295166015625, -0.053863525390625)); +const f16mat4 w50_05 = f16mat4( + f16vec4(-0.039093017578125, 0.0297088623046875, -0.137451171875, -0.03192138671875), + f16vec4(0.0821533203125, -0.160400390625, 0.1748046875, -0.04974365234375), + f16vec4(0.054962158203125, -0.01113128662109375, 0.0142364501953125, 0.01763916015625), + f16vec4(-0.1007080078125, -0.0863037109375, -0.1240234375, -0.00945281982421875)); +const f16mat4 w50_06 = f16mat4( + f16vec4(-0.052490234375, -0.0176239013671875, 0.143798828125, 0.10186767578125), + f16vec4(-0.01389312744140625, -0.00862884521484375, -0.3486328125, -0.208740234375), + f16vec4(-0.08477783203125, 0.061920166015625, -0.058319091796875, -0.146728515625), + f16vec4(-0.0372314453125, 0.199462890625, 0.2119140625, -0.10430908203125)); +const f16mat4 w50_07 = f16mat4( + f16vec4(-0.007694244384765625, 0.044647216796875, 0.08197021484375, 0.061004638671875), + f16vec4(-0.21728515625, -0.2322998046875, -0.1595458984375, 0.13427734375), + f16vec4(-0.0518798828125, -0.0484619140625, 0.052154541015625, 0.035247802734375), + f16vec4(0.036102294921875, -0.0151824951171875, 0.018707275390625, 0.0311279296875)); +const f16mat4 w50_08 = f16mat4( + f16vec4(-0.053680419921875, -0.0256805419921875, 0.04522705078125, 0.07220458984375), + f16vec4(-0.08343505859375, -0.13134765625, -0.0136566162109375, 0.0273284912109375), + f16vec4(0.0306243896484375, -0.0799560546875, 0.0033359527587890625, 0.03729248046875), + f16vec4(-0.03106689453125, -0.0859375, -0.08416748046875, 0.033721923828125)); +const f16mat4 w50_09 = f16mat4( + f16vec4(-0.07342529296875, -0.0301666259765625, -0.0309906005859375, 0.039398193359375), + f16vec4(-0.031219482421875, 0.15478515625, -0.1522216796875, -0.005748748779296875), + f16vec4(0.051910400390625, -0.079345703125, -0.03021240234375, -0.050628662109375), + f16vec4(0.0298614501953125, 0.06060791015625, 0.0249176025390625, -0.00562286376953125)); +const f16mat4 w50_10 = f16mat4( + f16vec4(-0.131591796875, 0.036529541015625, -0.04583740234375, -0.0158843994140625), + f16vec4(-0.23193359375, -0.0186614990234375, -0.00702667236328125, -0.1314697265625), + f16vec4(0.162841796875, 0.08197021484375, -0.07916259765625, -0.0579833984375), + f16vec4(-0.0260162353515625, -0.0697021484375, -0.0885009765625, -0.08563232421875)); +const f16mat4 w50_11 = f16mat4( + f16vec4(-0.09564208984375, 0.0080108642578125, 0.041656494140625, -0.016632080078125), + f16vec4(-0.061614990234375, -0.05731201171875, 0.1468505859375, 0.0007228851318359375), + f16vec4(-0.0047149658203125, 0.1810302734375, -0.06292724609375, 0.0286712646484375), + f16vec4(-0.03546142578125, -0.01169586181640625, 0.039154052734375, -0.052001953125)); +const f16mat4 w50_12 = f16mat4( + f16vec4(0.09197998046875, 0.01058197021484375, -0.093505859375, -0.009063720703125), + f16vec4(0.1759033203125, 0.04754638671875, -0.03369140625, 0.1717529296875), + f16vec4(-0.13330078125, 0.2230224609375, 0.00614166259765625, -0.197265625), + f16vec4(-0.00568389892578125, -0.1063232421875, 0.012939453125, 0.06060791015625)); +const f16mat4 w50_13 = f16mat4( + f16vec4(0.08050537109375, 0.0693359375, -0.2015380859375, -0.019378662109375), + f16vec4(0.1416015625, -0.1572265625, -0.297607421875, -0.05291748046875), + f16vec4(0.07269287109375, 0.2020263671875, 0.0280303955078125, -0.06103515625), + f16vec4(-0.03973388671875, -0.10888671875, -0.08441162109375, -0.0341796875)); +const f16mat4 w50_14 = f16mat4( + f16vec4(0.029388427734375, -0.087890625, -0.06793212890625, -0.0114593505859375), + f16vec4(-0.1859130859375, -0.1124267578125, -0.08892822265625, -0.04022216796875), + f16vec4(0.08099365234375, 0.1334228515625, 0.003116607666015625, 0.032745361328125), + f16vec4(-0.041534423828125, 0.04248046875, -0.09075927734375, -0.0204925537109375)); +const f16mat4 w50_15 = f16mat4( + f16vec4(-0.0078887939453125, 0.022857666015625, 0.0760498046875, -0.09698486328125), + f16vec4(0.01447296142578125, 0.049224853515625, 0.256103515625, 0.206787109375), + f16vec4(-0.098876953125, 0.24951171875, -0.0628662109375, -0.258544921875), + f16vec4(-0.05816650390625, -0.05059814453125, 0.00905609130859375, 0.08990478515625)); +const f16mat4 w50_16 = f16mat4( + f16vec4(0.045867919921875, -0.0364990234375, 0.1246337890625, 0.02105712890625), + f16vec4(0.151611328125, -0.1519775390625, 0.1142578125, 0.001194000244140625), + f16vec4(-0.08551025390625, 0.0084991455078125, 0.0223388671875, -0.04547119140625), + f16vec4(0.00159454345703125, -0.0201873779296875, -0.01343536376953125, -0.06396484375)); +const f16mat4 w50_17 = f16mat4( + f16vec4(0.052947998046875, -0.1466064453125, 0.027252197265625, 0.0472412109375), + f16vec4(-0.01401519775390625, 0.033477783203125, -0.10809326171875, -0.1112060546875), + f16vec4(-0.0626220703125, -0.10272216796875, 0.030242919921875, 0.033111572265625), + f16vec4(-0.052886962890625, -0.006145477294921875, 0.0015277862548828125, -0.06695556640625)); + +// output binding 51 +const f16vec4 sub51 = f16vec4(-0.145751953125, 0.2335205078125, -0.1492919921875, -0.3857421875); +const f16vec4 mul51 = f16vec4(0.85595703125, 0.7802734375, 0.98193359375, 0.99853515625); +const f16vec4 add51 = f16vec4(0.0016803741455078125, -0.0814208984375, -0.0187225341796875, 0.1307373046875); +const f16mat4 w51_00 = f16mat4( + f16vec4(0.011444091796875, 0.09722900390625, -0.045318603515625, -0.052001953125), + f16vec4(0.068603515625, 0.114501953125, 0.08184814453125, -0.11572265625), + f16vec4(0.017242431640625, 0.01788330078125, 0.12237548828125, -0.0033245086669921875), + f16vec4(-0.0623779296875, 0.05596923828125, -0.0267486572265625, -0.11285400390625)); +const f16mat4 w51_01 = f16mat4( + f16vec4(0.070068359375, 0.10760498046875, 0.0158233642578125, -0.05889892578125), + f16vec4(-0.07037353515625, 0.2705078125, -0.37109375, -0.2066650390625), + f16vec4(-0.0654296875, 0.0626220703125, -0.0965576171875, -0.06890869140625), + f16vec4(0.1719970703125, -0.10009765625, -0.1951904296875, 0.00524139404296875)); +const f16mat4 w51_02 = f16mat4( + f16vec4(0.002838134765625, 0.1163330078125, 0.05523681640625, -0.0267333984375), + f16vec4(-0.0419921875, 0.05859375, 0.1104736328125, -0.149658203125), + f16vec4(0.014007568359375, -0.0301971435546875, -0.01290130615234375, -0.0401611328125), + f16vec4(0.051422119140625, -0.059173583984375, 0.08270263671875, 0.1085205078125)); +const f16mat4 w51_03 = f16mat4( + f16vec4(-0.07012939453125, 0.04132080078125, -0.0228424072265625, -0.1409912109375), + f16vec4(0.2861328125, 0.10675048828125, 0.06103515625, -0.052886962890625), + f16vec4(0.060211181640625, 0.0121612548828125, 0.10595703125, -0.060699462890625), + f16vec4(-0.281494140625, 0.042083740234375, -0.1773681640625, -0.01617431640625)); +const f16mat4 w51_04 = f16mat4( + f16vec4(0.041748046875, 0.053466796875, 0.046661376953125, -0.164794921875), + f16vec4(0.123046875, 0.2242431640625, -0.264892578125, -0.26025390625), + f16vec4(0.012359619140625, 0.09942626953125, -0.09381103515625, -0.10528564453125), + f16vec4(-0.10992431640625, -0.047515869140625, -0.11492919921875, -0.033294677734375)); +const f16mat4 w51_05 = f16mat4( + f16vec4(0.0229949951171875, 0.041778564453125, -0.0550537109375, -0.10382080078125), + f16vec4(-0.133056640625, 0.1326904296875, -0.0312347412109375, -0.227294921875), + f16vec4(-0.035247802734375, 0.09869384765625, -0.046539306640625, -0.0960693359375), + f16vec4(0.1331787109375, -0.07073974609375, 0.1326904296875, -0.0333251953125)); +const f16mat4 w51_06 = f16mat4( + f16vec4(-0.047271728515625, 0.1058349609375, 0.0181427001953125, -0.00004100799560546875), + f16vec4(0.0460205078125, 0.07525634765625, -0.001186370849609375, -0.07073974609375), + f16vec4(-0.04632568359375, -0.0026760101318359375, 0.05242919921875, -0.10809326171875), + f16vec4(-0.048370361328125, -0.06488037109375, -0.0859375, 0.0885009765625)); +const f16mat4 w51_07 = f16mat4( + f16vec4(-0.0660400390625, 0.09686279296875, -0.015655517578125, -0.0236053466796875), + f16vec4(0.345458984375, 0.10040283203125, -0.10595703125, -0.150146484375), + f16vec4(0.049346923828125, 0.0916748046875, -0.062164306640625, -0.1077880859375), + f16vec4(-0.246826171875, -0.0638427734375, -0.00330352783203125, -0.0013446807861328125)); +const f16mat4 w51_08 = f16mat4( + f16vec4(-0.046844482421875, 0.0278778076171875, -0.01561737060546875, -0.035980224609375), + f16vec4(0.19921875, 0.2393798828125, 0.000897884368896484375, -0.1656494140625), + f16vec4(0.014434814453125, 0.142822265625, 0.0421142578125, -0.14208984375), + f16vec4(-0.1318359375, -0.0277557373046875, 0.083740234375, -0.0560302734375)); +const f16mat4 w51_09 = f16mat4( + f16vec4(-0.016998291015625, 0.000588893890380859375, -0.03729248046875, -0.0231170654296875), + f16vec4(0.05889892578125, -0.0860595703125, -0.1263427734375, 0.028961181640625), + f16vec4(-0.1025390625, 0.133544921875, 0.1566162109375, -0.1807861328125), + f16vec4(-0.0694580078125, 0.0290985107421875, 0.047027587890625, 0.00126361846923828125)); +const f16mat4 w51_10 = f16mat4( + f16vec4(0.031646728515625, -0.0022792816162109375, 0.0094451904296875, 0.041015625), + f16vec4(0.10992431640625, -0.05511474609375, 0.18505859375, -0.0163421630859375), + f16vec4(-0.1483154296875, 0.081787109375, -0.194091796875, -0.185302734375), + f16vec4(0.042327880859375, 0.01317596435546875, 0.0894775390625, -0.0262298583984375)); +const f16mat4 w51_11 = f16mat4( + f16vec4(0.00170040130615234375, 0.0303497314453125, -0.0440673828125, 0.0234527587890625), + f16vec4(0.047088623046875, 0.1243896484375, 0.046173095703125, -0.0033626556396484375), + f16vec4(-0.019378662109375, 0.025543212890625, -0.05987548828125, -0.06768798828125), + f16vec4(0.010162353515625, 0.04058837890625, -0.036956787109375, 0.0078125)); +const f16mat4 w51_12 = f16mat4( + f16vec4(-0.086181640625, 0.06134033203125, -0.00853729248046875, 0.033447265625), + f16vec4(-0.278564453125, -0.00937652587890625, -0.164794921875, 0.09869384765625), + f16vec4(0.07366943359375, 0.055908203125, 0.105224609375, -0.1988525390625), + f16vec4(-0.07275390625, 0.00164794921875, 0.02880859375, -0.05303955078125)); +const f16mat4 w51_13 = f16mat4( + f16vec4(-0.00525665283203125, -0.0034847259521484375, 0.0234222412109375, 0.018096923828125), + f16vec4(0.02349853515625, -0.039031982421875, 0.2449951171875, 0.08636474609375), + f16vec4(-0.071533203125, 0.1514892578125, -0.25146484375, -0.25146484375), + f16vec4(-0.1275634765625, -0.05230712890625, 0.042999267578125, -0.07177734375)); +const f16mat4 w51_14 = f16mat4( + f16vec4(0.01092529296875, 0.0262603759765625, -0.0279693603515625, 0.065185546875), + f16vec4(0.172119140625, 0.053131103515625, 0.069580078125, -0.00067901611328125), + f16vec4(-0.084228515625, 0.064697265625, -0.0933837890625, -0.11944580078125), + f16vec4(-0.035736083984375, -0.0555419921875, -0.045074462890625, -0.0014209747314453125)); +const f16mat4 w51_15 = f16mat4( + f16vec4(-0.0711669921875, 0.021087646484375, 0.0196685791015625, 0.0723876953125), + f16vec4(-0.04644775390625, 0.03521728515625, -0.071533203125, 0.186279296875), + f16vec4(-0.0005588531494140625, 0.0142822265625, -0.003551483154296875, -0.09771728515625), + f16vec4(0.0298004150390625, 0.045623779296875, -0.0119476318359375, -0.00162792205810546875)); +const f16mat4 w51_16 = f16mat4( + f16vec4(-0.09912109375, -0.035186767578125, 0.060211181640625, 0.060028076171875), + f16vec4(-0.328369140625, -0.0206451416015625, 0.0772705078125, 0.07305908203125), + f16vec4(0.038177490234375, 0.0275726318359375, -0.10235595703125, -0.09368896484375), + f16vec4(-0.0183258056640625, -0.00469970703125, -0.07440185546875, -0.003894805908203125)); +const f16mat4 w51_17 = f16mat4( + f16vec4(-0.020172119140625, -0.01137542724609375, 0.038177490234375, 0.04595947265625), + f16vec4(-0.142333984375, -0.10394287109375, 0.05950927734375, -0.0157623291015625), + f16vec4(-0.0213775634765625, 0.046661376953125, -0.055145263671875, -0.1260986328125), + f16vec4(-0.0306396484375, -0.019683837890625, -0.0023651123046875, 0.005435943603515625)); + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 lim = imageSize(plane0); + if (p.x >= lim.x || p.y >= lim.y) { + return; + } + vec2 uv = (vec2(p * 2) + 0.5) / vec2(textureSize(featA, 0)); + + f16vec4 t0 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(-1, -1))); + f16vec4 t1 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(-1, 0))); + f16vec4 t2 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(-1, 1))); + f16vec4 t3 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(0, -1))); + f16vec4 t4 = f16vec4(textureLod(featA, uv, 0.0)); + f16vec4 t5 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(0, 1))); + f16vec4 t6 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(1, -1))); + f16vec4 t7 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(1, 0))); + f16vec4 t8 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(1, 1))); + f16vec4 t9 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(-1, -1))); + f16vec4 t10 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(-1, 0))); + f16vec4 t11 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(-1, 1))); + f16vec4 t12 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(0, -1))); + f16vec4 t13 = f16vec4(textureLod(featB, uv, 0.0)); + f16vec4 t14 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(0, 1))); + f16vec4 t15 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(1, -1))); + f16vec4 t16 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(1, 0))); + f16vec4 t17 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(1, 1))); + + f16vec4 s0 = w48_00 * t0; + s0 += w48_01 * t1; + s0 += w48_02 * t2; + s0 += w48_03 * t3; + s0 += w48_04 * t4; + s0 += w48_05 * t5; + s0 += w48_06 * t6; + s0 += w48_07 * t7; + s0 += w48_08 * t8; + s0 += w48_09 * t9; + s0 += w48_10 * t10; + s0 += w48_11 * t11; + s0 += w48_12 * t12; + s0 += w48_13 * t13; + s0 += w48_14 * t14; + s0 += w48_15 * t15; + s0 += w48_16 * t16; + s0 += w48_17 * t17; + imageStore(plane0, p, vec4((s0 - sub48) * mul48 + add48)); + + f16vec4 s1 = w49_00 * t0; + s1 += w49_01 * t1; + s1 += w49_02 * t2; + s1 += w49_03 * t3; + s1 += w49_04 * t4; + s1 += w49_05 * t5; + s1 += w49_06 * t6; + s1 += w49_07 * t7; + s1 += w49_08 * t8; + s1 += w49_09 * t9; + s1 += w49_10 * t10; + s1 += w49_11 * t11; + s1 += w49_12 * t12; + s1 += w49_13 * t13; + s1 += w49_14 * t14; + s1 += w49_15 * t15; + s1 += w49_16 * t16; + s1 += w49_17 * t17; + imageStore(plane1, p, vec4((s1 - sub49) * mul49 + add49)); + + f16vec4 s2 = w50_00 * t0; + s2 += w50_01 * t1; + s2 += w50_02 * t2; + s2 += w50_03 * t3; + s2 += w50_04 * t4; + s2 += w50_05 * t5; + s2 += w50_06 * t6; + s2 += w50_07 * t7; + s2 += w50_08 * t8; + s2 += w50_09 * t9; + s2 += w50_10 * t10; + s2 += w50_11 * t11; + s2 += w50_12 * t12; + s2 += w50_13 * t13; + s2 += w50_14 * t14; + s2 += w50_15 * t15; + s2 += w50_16 * t16; + s2 += w50_17 * t17; + imageStore(plane2, p, vec4((s2 - sub50) * mul50 + add50)); + + f16vec4 s3 = w51_00 * t0; + s3 += w51_01 * t1; + s3 += w51_02 * t2; + s3 += w51_03 * t3; + s3 += w51_04 * t4; + s3 += w51_05 * t5; + s3 += w51_06 * t6; + s3 += w51_07 * t7; + s3 += w51_08 * t8; + s3 += w51_09 * t9; + s3 += w51_10 * t10; + s3 += w51_11 * t11; + s3 += w51_12 * t12; + s3 += w51_13 * t13; + s3 += w51_14 * t14; + s3 += w51_15 * t15; + s3 += w51_16 * t16; + s3 += w51_17 * t17; + imageStore(plane3, p, vec4((s3 - sub51) * mul51 + add51)); + +} diff --git a/cleanroom/glsl/shader_33.comp b/cleanroom/glsl/shader_33.comp new file mode 100644 index 0000000..c07baac --- /dev/null +++ b/cleanroom/glsl/shader_33.comp @@ -0,0 +1,952 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D featA; +layout(set = 0, binding = 33) uniform sampler2D featB; +layout(set = 0, binding = 34) uniform sampler2D featC; +layout(set = 0, binding = 35) uniform sampler2D featD; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D plane0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D plane1; +layout(set = 0, binding = 50, rgba8) uniform writeonly image2D plane2; +layout(set = 0, binding = 51, rgba8) uniform writeonly image2D plane3; + +// output binding 48 +const f16vec4 sub48 = f16vec4(0.036285400390625, 0.12744140625, 0.2032470703125, -0.1337890625); +const f16vec4 mul48 = f16vec4(3.28125, 4.8046875, 3.8125, 4.171875); +const f16vec4 add48 = f16vec4(0.470947265625, 0.60595703125, 0.2939453125, 0.58203125); +const f16mat4 w48_00 = f16mat4( + f16vec4(-0.0157318115234375, 0.14453125, -0.007476806640625, 0.0804443359375), + f16vec4(0.056060791015625, -0.035736083984375, -0.0012111663818359375, -0.05572509765625), + f16vec4(0.041534423828125, 0.1021728515625, 0.1201171875, -0.0665283203125), + f16vec4(0.03515625, 0.027557373046875, -0.03656005859375, 0.16064453125)); +const f16mat4 w48_01 = f16mat4( + f16vec4(0.03564453125, 0.30712890625, -0.0145111083984375, -0.0467529296875), + f16vec4(0.0280914306640625, -0.0292510986328125, 0.1763916015625, 0.0443115234375), + f16vec4(-0.0205078125, 0.10675048828125, 0.056304931640625, 0.008941650390625), + f16vec4(-0.0794677734375, 0.060791015625, 0.197021484375, 0.327392578125)); +const f16mat4 w48_02 = f16mat4( + f16vec4(-0.027862548828125, 0.049713134765625, -0.0665283203125, -0.047943115234375), + f16vec4(-0.0181427001953125, -0.040618896484375, 0.1539306640625, -0.0303802490234375), + f16vec4(-0.0469970703125, -0.083251953125, -0.03997802734375, -0.0062713623046875), + f16vec4(-0.049102783203125, -0.04852294921875, 0.1475830078125, 0.07403564453125)); +const f16mat4 w48_03 = f16mat4( + f16vec4(-0.051116943359375, 0.06103515625, -0.004199981689453125, 0.056854248046875), + f16vec4(0.08026123046875, -0.0882568359375, -0.0255279541015625, -0.0244903564453125), + f16vec4(-0.10406494140625, -0.01296234130859375, 0.1734619140625, -0.0202789306640625), + f16vec4(0.049957275390625, -0.00875091552734375, 0.27587890625, -0.341796875)); +const f16mat4 w48_04 = f16mat4( + f16vec4(0.061737060546875, 0.270751953125, -0.021728515625, 0.10284423828125), + f16vec4(0.03033447265625, -0.0888671875, 0.11273193359375, -0.009796142578125), + f16vec4(0.0880126953125, 0.07391357421875, 0.06402587890625, 0.0616455078125), + f16vec4(0.1297607421875, -0.0341796875, 0.288818359375, 0.027984619140625)); +const f16mat4 w48_05 = f16mat4( + f16vec4(0.01367950439453125, 0.06768798828125, 0.052459716796875, -0.1055908203125), + f16vec4(-0.07794189453125, -0.06561279296875, 0.09576416015625, -0.07232666015625), + f16vec4(0.0555419921875, -0.0120697021484375, -0.12005615234375, 0.12939453125), + f16vec4(-0.1768798828125, -0.04827880859375, -0.018890380859375, 0.20068359375)); +const f16mat4 w48_06 = f16mat4( + f16vec4(0.037506103515625, -0.0244903564453125, 0.07623291015625, -0.043304443359375), + f16vec4(-0.00170135498046875, 0.015869140625, -0.1470947265625, -0.04376220703125), + f16vec4(-0.142333984375, -0.1976318359375, -0.09295654296875, 0.0225677490234375), + f16vec4(-0.1883544921875, -0.0310516357421875, 0.07257080078125, -0.2379150390625)); +const f16mat4 w48_07 = f16mat4( + f16vec4(-0.080322265625, 0.058624267578125, 0.09857177734375, 0.089599609375), + f16vec4(0.0307464599609375, 0.06689453125, -0.1376953125, -0.048980712890625), + f16vec4(-0.02685546875, -0.1561279296875, -0.162841796875, 0.056884765625), + f16vec4(0.11944580078125, 0.037078857421875, -0.1190185546875, -0.1727294921875)); +const f16mat4 w48_08 = f16mat4( + f16vec4(0.064453125, -0.02642822265625, 0.06243896484375, 0.005596160888671875), + f16vec4(-0.028778076171875, 0.0226593017578125, 0.0423583984375, -0.062469482421875), + f16vec4(0.1998291015625, -0.0618896484375, -0.12030029296875, 0.142578125), + f16vec4(0.2425537109375, 0.07757568359375, -0.0721435546875, 0.154296875)); +const f16mat4 w48_09 = f16mat4( + f16vec4(-0.0966796875, 0.01239776611328125, 0.0099029541015625, 0.031280517578125), + f16vec4(0.004192352294921875, 0.1337890625, 0.0504150390625, 0.06048583984375), + f16vec4(-0.0352783203125, -0.028472900390625, 0.01983642578125, -0.1566162109375), + f16vec4(0.13037109375, -0.0221405029296875, 0.044342041015625, -0.09521484375)); +const f16mat4 w48_10 = f16mat4( + f16vec4(-0.050628662109375, -0.016326904296875, 0.0257110595703125, 0.128662109375), + f16vec4(0.06378173828125, 0.1756591796875, -0.035491943359375, -0.10345458984375), + f16vec4(0.038604736328125, -0.000833988189697265625, 0.1763916015625, 0.08563232421875), + f16vec4(-0.021148681640625, -0.2164306640625, -0.10101318359375, 0.06036376953125)); +const f16mat4 w48_11 = f16mat4( + f16vec4(-0.06219482421875, -0.000099003314971923828125, -0.0232391357421875, -0.07891845703125), + f16vec4(-0.1375732421875, -0.09820556640625, -0.05487060546875, -0.03289794921875), + f16vec4(-0.1646728515625, -0.013916015625, 0.122802734375, 0.1280517578125), + f16vec4(-0.017547607421875, 0.01678466796875, -0.09295654296875, -0.01042938232421875)); +const f16mat4 w48_12 = f16mat4( + f16vec4(-0.1494140625, 0.013275146484375, -0.046661376953125, 0.050445556640625), + f16vec4(-0.07720947265625, 0.3017578125, -0.0262451171875, 0.05615234375), + f16vec4(-0.10870361328125, -0.01357269287109375, 0.12890625, -0.258056640625), + f16vec4(0.114990234375, 0.019134521484375, 0.1190185546875, -0.0178680419921875)); +const f16mat4 w48_13 = f16mat4( + f16vec4(-0.102783203125, -0.07879638671875, -0.02783203125, 0.2451171875), + f16vec4(0.137451171875, 0.44580078125, -0.091796875, 0.0189056396484375), + f16vec4(0.08038330078125, 0.0213775634765625, 0.1334228515625, -0.29736328125), + f16vec4(-0.0240936279296875, -0.0243682861328125, 0.047821044921875, 0.047637939453125)); +const f16mat4 w48_14 = f16mat4( + f16vec4(-0.02557373046875, 0.00181293487548828125, -0.017974853515625, 0.0665283203125), + f16vec4(0.0158233642578125, 0.0609130859375, -0.0289459228515625, -0.09271240234375), + f16vec4(0.1492919921875, 0.0489501953125, -0.070556640625, 0.0916748046875), + f16vec4(-0.0408935546875, 0.006313323974609375, 0.054931640625, -0.061431884765625)); +const f16mat4 w48_15 = f16mat4( + f16vec4(-0.138671875, 0.054931640625, -0.01537322998046875, 0.11273193359375), + f16vec4(-0.1070556640625, 0.052032470703125, 0.067626953125, 0.046966552734375), + f16vec4(-0.031707763671875, 0.01442718505859375, -0.059600830078125, -0.0175933837890625), + f16vec4(0.20068359375, -0.032318115234375, 0.0770263671875, 0.037353515625)); +const f16mat4 w48_16 = f16mat4( + f16vec4(-0.1246337890625, -0.06488037109375, -0.052642822265625, 0.1162109375), + f16vec4(0.0189971923828125, 0.10626220703125, 0.035858154296875, 0.126953125), + f16vec4(-0.172607421875, 0.0657958984375, -0.2266845703125, -0.1749267578125), + f16vec4(-0.052459716796875, -0.0030345916748046875, 0.068603515625, -0.032073974609375)); +const f16mat4 w48_17 = f16mat4( + f16vec4(-0.08148193359375, 0.0299530029296875, -0.01824951171875, -0.01209259033203125), + f16vec4(0.0784912109375, -0.042633056640625, 0.11859130859375, -0.026214599609375), + f16vec4(0.2568359375, 0.06072998046875, -0.040130615234375, -0.01065826416015625), + f16vec4(-0.1973876953125, 0.05560302734375, 0.09552001953125, -0.055908203125)); +const f16mat4 w48_18 = f16mat4( + f16vec4(-0.09600830078125, 0.038482666015625, 0.062744140625, -0.07659912109375), + f16vec4(0.05987548828125, -0.07562255859375, -0.050537109375, 0.0123748779296875), + f16vec4(0.052825927734375, 0.05792236328125, 0.10137939453125, -0.05181884765625), + f16vec4(-0.168701171875, 0.0239105224609375, 0.00846099853515625, -0.1639404296875)); +const f16mat4 w48_19 = f16mat4( + f16vec4(0.0584716796875, 0.136962890625, 0.036163330078125, 0.058258056640625), + f16vec4(-0.04937744140625, -0.02984619140625, 0.1224365234375, 0.0550537109375), + f16vec4(-0.114501953125, 0.10760498046875, 0.056121826171875, -0.001148223876953125), + f16vec4(0.0052490234375, -0.047027587890625, 0.1358642578125, -0.10302734375)); +const f16mat4 w48_20 = f16mat4( + f16vec4(-0.139892578125, -0.057830810546875, -0.061614990234375, -0.116943359375), + f16vec4(-0.003520965576171875, -0.043365478515625, 0.2205810546875, 0.0243072509765625), + f16vec4(-0.0279388427734375, -0.034423828125, -0.08013916015625, -0.059051513671875), + f16vec4(0.0286102294921875, -0.059783935546875, 0.1954345703125, 0.2371826171875)); +const f16mat4 w48_21 = f16mat4( + f16vec4(0.03302001953125, 0.04144287109375, 0.043212890625, -0.10711669921875), + f16vec4(0.031463623046875, -0.036346435546875, -0.00727081298828125, 0.0036983489990234375), + f16vec4(0.2012939453125, 0.039093017578125, 0.06463623046875, -0.0712890625), + f16vec4(-0.1031494140625, -0.029296875, 0.041900634765625, -0.153564453125)); +const f16mat4 w48_22 = f16mat4( + f16vec4(-0.0865478515625, 0.208984375, -0.0280914306640625, 0.0687255859375), + f16vec4(0.0173492431640625, -0.054962158203125, 0.239013671875, -0.0765380859375), + f16vec4(-0.07598876953125, 0.1546630859375, -0.08428955078125, 0.05712890625), + f16vec4(-0.05908203125, -0.024871826171875, 0.09881591796875, -0.4013671875)); +const f16mat4 w48_23 = f16mat4( + f16vec4(0.07196044921875, -0.01971435546875, -0.1492919921875, 0.07135009765625), + f16vec4(-0.00426483154296875, -0.0248565673828125, 0.175537109375, -0.0163726806640625), + f16vec4(-0.0029468536376953125, 0.00847625732421875, -0.2020263671875, 0.10052490234375), + f16vec4(0.153564453125, 0.042388916015625, 0.007335662841796875, 0.005565643310546875)); +const f16mat4 w48_24 = f16mat4( + f16vec4(0.0965576171875, -0.06170654296875, -0.010284423828125, 0.002300262451171875), + f16vec4(-0.01096343994140625, 0.02130126953125, -0.061187744140625, 0.016998291015625), + f16vec4(0.0027675628662109375, -0.0908203125, 0.08685302734375, 0.06689453125), + f16vec4(-0.033447265625, 0.00824737548828125, -0.0755615234375, 0.047393798828125)); +const f16mat4 w48_25 = f16mat4( + f16vec4(-0.0855712890625, -0.0596923828125, -0.07867431640625, 0.07159423828125), + f16vec4(-0.089111328125, 0.00455474853515625, -0.1724853515625, -0.1009521484375), + f16vec4(0.047393798828125, -0.006366729736328125, -0.0040435791015625, 0.1058349609375), + f16vec4(-0.08209228515625, 0.0736083984375, -0.16259765625, -0.0797119140625)); +const f16mat4 w48_26 = f16mat4( + f16vec4(-0.01171112060546875, -0.013153076171875, -0.06732177734375, 0.1334228515625), + f16vec4(0.083251953125, 0.04266357421875, -0.0758056640625, 0.00141143798828125), + f16vec4(-0.12939453125, 0.0115509033203125, -0.0252838134765625, 0.09588623046875), + f16vec4(0.0689697265625, 0.054962158203125, -0.09832763671875, -0.09912109375)); +const f16mat4 w48_27 = f16mat4( + f16vec4(0.1689453125, 0.071533203125, 0.116943359375, -0.0916748046875), + f16vec4(0.06884765625, -0.011993408203125, 0.0282440185546875, 0.00073909759521484375), + f16vec4(0.15625, -0.00867462158203125, -0.0787353515625, 0.0298309326171875), + f16vec4(-0.004695892333984375, -0.083251953125, -0.0926513671875, 0.060302734375)); +const f16mat4 w48_28 = f16mat4( + f16vec4(-0.11590576171875, 0.10498046875, 0.03057861328125, -0.1173095703125), + f16vec4(-0.09246826171875, -0.06390380859375, 0.04925537109375, 0.06842041015625), + f16vec4(-0.01410675048828125, 0.06304931640625, -0.032379150390625, 0.27734375), + f16vec4(0.138916015625, 0.00974273681640625, -0.1875, -0.086181640625)); +const f16mat4 w48_29 = f16mat4( + f16vec4(-0.09869384765625, -0.05352783203125, -0.10198974609375, -0.038116455078125), + f16vec4(-0.02825927734375, -0.039093017578125, -0.0142822265625, -0.0037822723388671875), + f16vec4(-0.02288818359375, 0.0091552734375, 0.1446533203125, 0.1724853515625), + f16vec4(-0.046478271484375, 0.0780029296875, -0.0584716796875, -0.09161376953125)); +const f16mat4 w48_30 = f16mat4( + f16vec4(0.11090087890625, 0.033233642578125, 0.138916015625, 0.04888916015625), + f16vec4(0.05535888671875, -0.0494384765625, 0.056182861328125, -0.08953857421875), + f16vec4(-0.0736083984375, 0.0261383056640625, 0.02142333984375, -0.2215576171875), + f16vec4(-0.1787109375, 0.0667724609375, -0.038604736328125, 0.035888671875)); +const f16mat4 w48_31 = f16mat4( + f16vec4(0.0848388671875, 0.1549072265625, -0.058807373046875, -0.067138671875), + f16vec4(-0.07373046875, -0.10235595703125, 0.00041103363037109375, -0.03656005859375), + f16vec4(0.12322998046875, -0.00965118408203125, 0.3046875, -0.058319091796875), + f16vec4(0.147216796875, 0.051422119140625, -0.123291015625, 0.07275390625)); +const f16mat4 w48_32 = f16mat4( + f16vec4(-0.0672607421875, 0.01052093505859375, -0.1378173828125, 0.019195556640625), + f16vec4(-0.0704345703125, 0.0124969482421875, -0.06463623046875, 0.07879638671875), + f16vec4(-0.065185546875, -0.0594482421875, 0.1475830078125, 0.205322265625), + f16vec4(0.0275115966796875, -0.087646484375, -0.1810302734375, -0.224609375)); +const f16mat4 w48_33 = f16mat4( + f16vec4(-0.10699462890625, -0.043182373046875, 0.050445556640625, 0.054107666015625), + f16vec4(-0.046173095703125, 0.061309814453125, -0.1107177734375, -0.038055419921875), + f16vec4(-0.091552734375, -0.003696441650390625, 0.040374755859375, -0.085205078125), + f16vec4(-0.08001708984375, 0.061737060546875, 0.1436767578125, -0.0009021759033203125)); +const f16mat4 w48_34 = f16mat4( + f16vec4(0.10089111328125, 0.0036449432373046875, -0.0650634765625, 0.08154296875), + f16vec4(0.16455078125, 0.0190277099609375, -0.161865234375, -0.1029052734375), + f16vec4(0.0916748046875, -0.030548095703125, 0.0556640625, -0.275390625), + f16vec4(-0.1365966796875, 0.019683837890625, 0.15185546875, 0.07330322265625)); +const f16mat4 w48_35 = f16mat4( + f16vec4(-0.04766845703125, 0.036041259765625, -0.0256500244140625, 0.037017822265625), + f16vec4(-0.070556640625, 0.10357666015625, -0.1397705078125, 0.038726806640625), + f16vec4(0.172119140625, 0.0289764404296875, -0.0169830322265625, -0.0012340545654296875), + f16vec4(0.26416015625, -0.048126220703125, 0.11334228515625, -0.048309326171875)); + +// output binding 49 +const f16vec4 sub49 = f16vec4(-0.0589599609375, -0.10675048828125, 0.09002685546875, -0.12127685546875); +const f16vec4 mul49 = f16vec4(3.552734375, 3.640625, 3.396484375, 3.16015625); +const f16vec4 add49 = f16vec4(0.377685546875, 0.501953125, 0.55859375, 0.77197265625); +const f16mat4 w49_00 = f16mat4( + f16vec4(0.024505615234375, -0.03564453125, 0.033477783203125, 0.01194000244140625), + f16vec4(-0.167724609375, 0.01534271240234375, 0.0292510986328125, -0.06353759765625), + f16vec4(0.037078857421875, 0.0055084228515625, -0.04132080078125, 0.0277099609375), + f16vec4(-0.08953857421875, 0.1248779296875, -0.043060302734375, -0.07745361328125)); +const f16mat4 w49_01 = f16mat4( + f16vec4(-0.03662109375, -0.0469970703125, 0.006397247314453125, 0.049835205078125), + f16vec4(-0.022613525390625, 0.0259246826171875, 0.038543701171875, -0.05712890625), + f16vec4(0.0064239501953125, 0.0190277099609375, 0.050628662109375, 0.04705810546875), + f16vec4(0.08258056640625, 0.13134765625, -0.11077880859375, -0.064453125)); +const f16mat4 w49_02 = f16mat4( + f16vec4(-0.07568359375, 0.09039306640625, 0.0257568359375, 0.10662841796875), + f16vec4(0.32421875, -0.1207275390625, -0.04925537109375, -0.0233612060546875), + f16vec4(0.0347900390625, -0.0079498291015625, 0.00933837890625, 0.140869140625), + f16vec4(-0.078125, -0.0418701171875, -0.138916015625, 0.040740966796875)); +const f16mat4 w49_03 = f16mat4( + f16vec4(0.0028858184814453125, -0.07470703125, -0.038238525390625, 0.006771087646484375), + f16vec4(-0.2135009765625, 0.07080078125, 0.007724761962890625, -0.0885009765625), + f16vec4(-0.0406494140625, 0.12841796875, -0.06292724609375, -0.032440185546875), + f16vec4(0.087158203125, 0.246826171875, -0.0224456787109375, -0.07000732421875)); +const f16mat4 w49_04 = f16mat4( + f16vec4(0.006137847900390625, -0.0264129638671875, 0.00403594970703125, -0.138916015625), + f16vec4(0.2010498046875, -0.07025146484375, -0.00511932373046875, 0.047637939453125), + f16vec4(0.043701171875, -0.01450347900390625, 0.059295654296875, -0.2734375), + f16vec4(0.029632568359375, -0.1976318359375, -0.0272369384765625, -0.039276123046875)); +const f16mat4 w49_05 = f16mat4( + f16vec4(-0.007663726806640625, 0.115234375, -0.049835205078125, -0.02960205078125), + f16vec4(-0.139892578125, -0.1680908203125, -0.11505126953125, 0.0928955078125), + f16vec4(-0.05255126953125, -0.1207275390625, 0.050384521484375, -0.01300811767578125), + f16vec4(0.057647705078125, -0.293212890625, -0.124267578125, 0.00185871124267578125)); +const f16mat4 w49_06 = f16mat4( + f16vec4(-0.022857666015625, -0.0390625, -0.010406494140625, 0.01715087890625), + f16vec4(0.18505859375, 0.01056671142578125, 0.02886962890625, 0.02032470703125), + f16vec4(0.08831787109375, 0.08624267578125, -0.06524658203125, 0.036895751953125), + f16vec4(0.002529144287109375, 0.12115478515625, 0.034881591796875, 0.1590576171875)); +const f16mat4 w49_07 = f16mat4( + f16vec4(0.061553955078125, -0.04425048828125, 0.0023136138916015625, -0.09149169921875), + f16vec4(-0.1251220703125, -0.039093017578125, 0.040283203125, 0.149658203125), + f16vec4(-0.02838134765625, -0.058441162109375, -0.010223388671875, -0.282470703125), + f16vec4(0.01119232177734375, -0.298828125, 0.0433349609375, 0.060699462890625)); +const f16mat4 w49_08 = f16mat4( + f16vec4(0.05609130859375, 0.0543212890625, -0.10504150390625, -0.0204620361328125), + f16vec4(-0.250244140625, 0.03875732421875, -0.006900787353515625, 0.1827392578125), + f16vec4(-0.01349639892578125, -0.0936279296875, 0.11590576171875, -0.08123779296875), + f16vec4(-0.04412841796875, -0.1971435546875, 0.036102294921875, -0.0129547119140625)); +const f16mat4 w49_09 = f16mat4( + f16vec4(0.09222412109375, 0.0216827392578125, -0.08087158203125, -0.01348876953125), + f16vec4(0.00975799560546875, -0.06890869140625, 0.08953857421875, 0.09356689453125), + f16vec4(-0.053863525390625, 0.12176513671875, -0.005451202392578125, -0.0748291015625), + f16vec4(-0.05462646484375, -0.1309814453125, -0.1441650390625, 0.0733642578125)); +const f16mat4 w49_10 = f16mat4( + f16vec4(0.05712890625, 0.049346923828125, 0.040985107421875, 0.057769775390625), + f16vec4(-0.09722900390625, -0.07049560546875, 0.10797119140625, 0.04486083984375), + f16vec4(0.01369476318359375, 0.1416015625, 0.059051513671875, -0.0523681640625), + f16vec4(0.10546875, -0.07244873046875, 0.0085906982421875, 0.05938720703125)); +const f16mat4 w49_11 = f16mat4( + f16vec4(-0.0867919921875, -0.011993408203125, 0.06622314453125, -0.044708251953125), + f16vec4(0.050933837890625, 0.03277587890625, -0.059295654296875, 0.10369873046875), + f16vec4(-0.0526123046875, -0.0921630859375, -0.1561279296875, -0.04974365234375), + f16vec4(-0.1632080078125, 0.0306396484375, 0.19140625, 0.00405120849609375)); +const f16mat4 w49_12 = f16mat4( + f16vec4(0.1920166015625, -0.0965576171875, -0.07855224609375, -0.0204010009765625), + f16vec4(-0.01287078857421875, -0.10308837890625, 0.017547607421875, 0.004665374755859375), + f16vec4(0.049591064453125, 0.2216796875, 0.005283355712890625, -0.01161956787109375), + f16vec4(0.06329345703125, -0.13134765625, -0.098876953125, 0.020782470703125)); +const f16mat4 w49_13 = f16mat4( + f16vec4(0.13037109375, -0.0701904296875, -0.0579833984375, 0.085205078125), + f16vec4(0.01371002197265625, 0.00917816162109375, 0.06597900390625, -0.1650390625), + f16vec4(0.036651611328125, -0.10247802734375, 0.067626953125, -0.09808349609375), + f16vec4(-0.06939697265625, -0.0024929046630859375, 0.041961669921875, 0.061370849609375)); +const f16mat4 w49_14 = f16mat4( + f16vec4(0.017822265625, -0.0457763671875, -0.010009765625, 0.044891357421875), + f16vec4(-0.0286407470703125, 0.1278076171875, -0.0142669677734375, 0.041351318359375), + f16vec4(-0.0153961181640625, -0.31591796875, 0.049591064453125, 0.011932373046875), + f16vec4(0.0733642578125, 0.1038818359375, 0.11041259765625, -0.0338134765625)); +const f16mat4 w49_15 = f16mat4( + f16vec4(0.2418212890625, -0.07537841796875, -0.048919677734375, -0.00572967529296875), + f16vec4(-0.0137786865234375, -0.050933837890625, -0.057647705078125, 0.045928955078125), + f16vec4(-0.0263824462890625, 0.1343994140625, -0.044952392578125, 0.09051513671875), + f16vec4(-0.12310791015625, -0.038421630859375, -0.0142822265625, -0.12359619140625)); +const f16mat4 w49_16 = f16mat4( + f16vec4(0.1380615234375, -0.15673828125, -0.045867919921875, -0.022247314453125), + f16vec4(0.07098388671875, 0.044769287109375, -0.07745361328125, -0.274658203125), + f16vec4(-0.00679779052734375, -0.11944580078125, 0.0304107666015625, 0.03790283203125), + f16vec4(-0.0430908203125, 0.0114593505859375, -0.03594970703125, -0.1234130859375)); +const f16mat4 w49_17 = f16mat4( + f16vec4(0.12091064453125, -0.046630859375, -0.0794677734375, 0.06573486328125), + f16vec4(0.03973388671875, 0.0343017578125, -0.072265625, -0.09796142578125), + f16vec4(-0.0309295654296875, -0.10589599609375, 0.038116455078125, 0.049468994140625), + f16vec4(0.1820068359375, 0.075439453125, 0.07293701171875, -0.02899169921875)); +const f16mat4 w49_18 = f16mat4( + f16vec4(0.06256103515625, -0.031585693359375, -0.07928466796875, 0.1466064453125), + f16vec4(0.06732177734375, -0.06304931640625, 0.003082275390625, -0.056396484375), + f16vec4(0.040863037109375, 0.00030994415283203125, -0.1346435546875, 0.17822265625), + f16vec4(-0.115478515625, 0.161376953125, 0.0567626953125, -0.040252685546875)); +const f16mat4 w49_19 = f16mat4( + f16vec4(-0.006694793701171875, 0.05615234375, 0.29833984375, 0.08978271484375), + f16vec4(-0.280029296875, 0.11865234375, -0.03692626953125, -0.0361328125), + f16vec4(-0.02252197265625, 0.026824951171875, 0.2064208984375, 0.1856689453125), + f16vec4(-0.013763427734375, 0.10894775390625, -0.00457763671875, -0.13037109375)); +const f16mat4 w49_20 = f16mat4( + f16vec4(-0.0057373046875, 0.01549530029296875, 0.08648681640625, 0.07464599609375), + f16vec4(0.2276611328125, -0.028228759765625, -0.094970703125, -0.00897216796875), + f16vec4(-0.0634765625, -0.011444091796875, 0.367431640625, 0.09625244140625), + f16vec4(0.0246429443359375, -0.0509033203125, -0.039459228515625, -0.11431884765625)); +const f16mat4 w49_21 = f16mat4( + f16vec4(-0.00135517120361328125, 0.13232421875, -0.048309326171875, 0.10272216796875), + f16vec4(-0.21875, 0.037322998046875, -0.03314208984375, -0.032623291015625), + f16vec4(0.03167724609375, 0.08184814453125, -0.1324462890625, 0.12298583984375), + f16vec4(0.04620361328125, 0.19140625, 0.0171356201171875, -0.040740966796875)); +const f16mat4 w49_22 = f16mat4( + f16vec4(-0.01262664794921875, 0.061920166015625, 0.21484375, -0.2138671875), + f16vec4(0.188720703125, 0.072021484375, 0.0218353271484375, 0.03607177734375), + f16vec4(0.0233001708984375, 0.051666259765625, 0.08123779296875, -0.258544921875), + f16vec4(0.02587890625, 0.0068359375, 0.045135498046875, -0.0791015625)); +const f16mat4 w49_23 = f16mat4( + f16vec4(-0.021240234375, -0.0162353515625, 0.2237548828125, -0.1744384765625), + f16vec4(0.2178955078125, -0.228759765625, -0.0221405029296875, 0.05352783203125), + f16vec4(-0.13671875, -0.050689697265625, 0.37060546875, -0.2308349609375), + f16vec4(-0.1318359375, -0.310791015625, 0.05352783203125, 0.0081939697265625)); +const f16mat4 w49_24 = f16mat4( + f16vec4(0.01557159423828125, 0.1436767578125, -0.123779296875, 0.036590576171875), + f16vec4(-0.165771484375, 0.061492919921875, 0.0022869110107421875, 0.055511474609375), + f16vec4(0.08856201171875, 0.06402587890625, -0.1512451171875, 0.0196685791015625), + f16vec4(0.07086181640625, 0.10601806640625, -0.042022705078125, 0.090576171875)); +const f16mat4 w49_25 = f16mat4( + f16vec4(0.11810302734375, 0.082275390625, -0.048736572265625, -0.390625), + f16vec4(0.1832275390625, -0.01435089111328125, 0.000134944915771484375, 0.0902099609375), + f16vec4(0.0865478515625, 0.003997802734375, -0.134765625, -0.3564453125), + f16vec4(-0.095947265625, 0.01261138916015625, -0.0293121337890625, 0.14697265625)); +const f16mat4 w49_26 = f16mat4( + f16vec4(-0.0306854248046875, -0.12481689453125, -0.0166778564453125, -0.279541015625), + f16vec4(-0.311279296875, -0.11749267578125, 0.04168701171875, 0.057037353515625), + f16vec4(-0.00782012939453125, -0.0687255859375, -0.032958984375, -0.263427734375), + f16vec4(0.0135040283203125, -0.09405517578125, 0.0277557373046875, 0.11273193359375)); +const f16mat4 w49_27 = f16mat4( + f16vec4(0.004093170166015625, -0.0523681640625, -0.025665283203125, 0.1273193359375), + f16vec4(-0.05633544921875, 0.0673828125, -0.017913818359375, 0.055267333984375), + f16vec4(-0.0931396484375, -0.004055023193359375, -0.04833984375, -0.025054931640625), + f16vec4(-0.08685302734375, 0.0183868408203125, 0.1231689453125, 0.00165653228759765625)); +const f16mat4 w49_28 = f16mat4( + f16vec4(-0.0246429443359375, 0.005916595458984375, 0.125244140625, 0.186767578125), + f16vec4(-0.11083984375, 0.21435546875, 0.2626953125, 0.10791015625), + f16vec4(-0.01910400390625, 0.1405029296875, -0.103271484375, -0.0926513671875), + f16vec4(0.052581787109375, -0.1763916015625, -0.12371826171875, -0.1063232421875)); +const f16mat4 w49_29 = f16mat4( + f16vec4(-0.0222625732421875, -0.026153564453125, 0.297607421875, 0.09619140625), + f16vec4(0.062347412109375, -0.0079803466796875, 0.18798828125, 0.0261993408203125), + f16vec4(0.000029981136322021484375, 0.049072265625, -0.09674072265625, -0.0229034423828125), + f16vec4(-0.1314697265625, -0.00067806243896484375, -0.1112060546875, -0.0692138671875)); +const f16mat4 w49_30 = f16mat4( + f16vec4(0.039154052734375, 0.02313232421875, -0.057342529296875, 0.07781982421875), + f16vec4(-0.07244873046875, 0.171875, -0.0712890625, -0.04595947265625), + f16vec4(0.0010547637939453125, 0.100341796875, -0.012664794921875, -0.0148468017578125), + f16vec4(-0.01197052001953125, -0.1876220703125, 0.1483154296875, 0.005588531494140625)); +const f16mat4 w49_31 = f16mat4( + f16vec4(-0.0244598388671875, -0.0224456787109375, -0.07177734375, -0.337646484375), + f16vec4(0.0185699462890625, 0.0362548828125, 0.04449462890625, -0.2049560546875), + f16vec4(0.05609130859375, 0.118896484375, -0.03338623046875, -0.039031982421875), + f16vec4(0.046051025390625, 0.041290283203125, -0.047760009765625, 0.130615234375)); +const f16mat4 w49_32 = f16mat4( + f16vec4(-0.03631591796875, -0.05169677734375, 0.313720703125, -0.2095947265625), + f16vec4(-0.00738525390625, -0.1968994140625, 0.12432861328125, 0.004486083984375), + f16vec4(-0.0252685546875, -0.2457275390625, -0.11505126953125, -0.0615234375), + f16vec4(-0.01554107666015625, 0.1951904296875, -0.1773681640625, -0.018157958984375)); +const f16mat4 w49_33 = f16mat4( + f16vec4(0.060699462890625, 0.03448486328125, -0.1571044921875, 0.02813720703125), + f16vec4(0.07159423828125, 0.1112060546875, -0.0372314453125, -0.0119781494140625), + f16vec4(0.014801025390625, 0.1036376953125, 0.033203125, 0.05596923828125), + f16vec4(-0.10028076171875, -0.09344482421875, 0.1416015625, 0.00105953216552734375)); +const f16mat4 w49_34 = f16mat4( + f16vec4(0.01174163818359375, 0.06256103515625, -0.1904296875, -0.27392578125), + f16vec4(0.04669189453125, -0.025543212890625, -0.097412109375, -0.08465576171875), + f16vec4(-0.0266876220703125, -0.03680419921875, 0.059112548828125, 0.125244140625), + f16vec4(-0.012939453125, 0.093017578125, 0.13134765625, 0.1158447265625)); +const f16mat4 w49_35 = f16mat4( + f16vec4(-0.00669097900390625, -0.05535888671875, 0.03118896484375, -0.11798095703125), + f16vec4(-0.0733642578125, -0.254150390625, -0.058837890625, 0.07904052734375), + f16vec4(0.07965087890625, -0.2841796875, 0.0386962890625, 0.0228118896484375), + f16vec4(0.051422119140625, 0.213623046875, 0.0787353515625, 0.0033702850341796875)); + +// output binding 50 +const f16vec4 sub50 = f16vec4(-0.04107666015625, -0.260986328125, 0.0013561248779296875, 0.0287322998046875); +const f16vec4 mul50 = f16vec4(5.8515625, 2.794921875, 4.28125, 3.93359375); +const f16vec4 add50 = f16vec4(0.2900390625, 0.7578125, 0.341064453125, 0.496826171875); +const f16mat4 w50_00 = f16mat4( + f16vec4(-0.050506591796875, -0.08624267578125, -0.032379150390625, -0.035003662109375), + f16vec4(-0.00788116455078125, 0.00109577178955078125, -0.185302734375, -0.01349639892578125), + f16vec4(-0.031707763671875, 0.013946533203125, 0.074951171875, 0.08477783203125), + f16vec4(-0.256591796875, 0.1138916015625, 0.012054443359375, 0.04986572265625)); +const f16mat4 w50_01 = f16mat4( + f16vec4(-0.0176544189453125, -0.2861328125, -0.10772705078125, -0.00769805908203125), + f16vec4(-0.02520751953125, 0.0111846923828125, -0.323974609375, 0.01560211181640625), + f16vec4(-0.12017822265625, 0.10302734375, -0.0748291015625, -0.0443115234375), + f16vec4(-0.2349853515625, 0.061737060546875, 0.0670166015625, 0.04351806640625)); +const f16mat4 w50_02 = f16mat4( + f16vec4(-0.015533447265625, -0.014739990234375, 0.005542755126953125, -0.099365234375), + f16vec4(-0.003398895263671875, -0.00722503662109375, -0.148681640625, -0.010498046875), + f16vec4(0.052764892578125, 0.1744384765625, -0.03564453125, -0.0250091552734375), + f16vec4(0.055908203125, -0.005035400390625, 0.11328125, 0.0703125)); +const f16mat4 w50_03 = f16mat4( + f16vec4(0.0675048828125, -0.056854248046875, -0.092041015625, -0.041717529296875), + f16vec4(0.033111572265625, 0.04632568359375, -0.0284881591796875, 0.006443023681640625), + f16vec4(-0.2169189453125, -0.0199432373046875, 0.0237579345703125, -0.00754547119140625), + f16vec4(-0.0640869140625, -0.11578369140625, 0.01259613037109375, -0.030609130859375)); +const f16mat4 w50_04 = f16mat4( + f16vec4(-0.01029205322265625, -0.292236328125, -0.02142333984375, 0.0780029296875), + f16vec4(0.01132965087890625, -0.0880126953125, 0.2235107421875, 0.019500732421875), + f16vec4(-0.050384521484375, -0.1463623046875, 0.018768310546875, -0.0231781005859375), + f16vec4(0.1444091796875, -0.1451416015625, -0.024383544921875, -0.0251617431640625)); +const f16mat4 w50_05 = f16mat4( + f16vec4(-0.046966552734375, -0.09747314453125, 0.058319091796875, 0.125244140625), + f16vec4(-0.06396484375, 0.018798828125, 0.1473388671875, 0.0531005859375), + f16vec4(0.082763671875, -0.0115814208984375, 0.03045654296875, -0.0709228515625), + f16vec4(0.1083984375, -0.08465576171875, -0.003265380859375, -0.0109710693359375)); +const f16mat4 w50_06 = f16mat4( + f16vec4(0.03497314453125, 0.06591796875, -0.038177490234375, 0.08685302734375), + f16vec4(0.0015201568603515625, 0.107666015625, 0.2763671875, -0.06402587890625), + f16vec4(-0.071533203125, 0.264892578125, 0.0296478271484375, -0.051361083984375), + f16vec4(0.2215576171875, -0.07794189453125, -0.08154296875, 0.00186920166015625)); +const f16mat4 w50_07 = f16mat4( + f16vec4(-0.01045989990234375, -0.1014404296875, 0.0275115966796875, -0.06695556640625), + f16vec4(-0.0203704833984375, 0.032684326171875, 0.2171630859375, -0.0020275115966796875), + f16vec4(0.09161376953125, 0.0858154296875, 0.02838134765625, -0.06854248046875), + f16vec4(0.1710205078125, -0.146240234375, -0.06524658203125, -0.0016632080078125)); +const f16mat4 w50_08 = f16mat4( + f16vec4(-0.032928466796875, 0.033660888671875, -0.026123046875, -0.052734375), + f16vec4(-0.12213134765625, 0.0428466796875, -0.05914306640625, 0.042022705078125), + f16vec4(-0.01290130615234375, -0.0168609619140625, 0.064697265625, -0.1097412109375), + f16vec4(-0.12225341796875, -0.008453369140625, -0.0689697265625, -0.077880859375)); +const f16mat4 w50_09 = f16mat4( + f16vec4(-0.04595947265625, -0.0007171630859375, 0.00023400783538818359375, -0.0197601318359375), + f16vec4(-0.0692138671875, -0.1025390625, 0.006984710693359375, 0.03900146484375), + f16vec4(-0.176025390625, 0.0198516845703125, 0.044342041015625, 0.038421630859375), + f16vec4(0.0145721435546875, -0.1324462890625, 0.136474609375, -0.195068359375)); +const f16mat4 w50_10 = f16mat4( + f16vec4(-0.0035762786865234375, -0.0071258544921875, -0.0222625732421875, 0.001506805419921875), + f16vec4(-0.07659912109375, -0.084228515625, -0.061279296875, -0.0401611328125), + f16vec4(-0.1226806640625, 0.03717041015625, 0.052978515625, -0.022491455078125), + f16vec4(0.041046142578125, -0.126708984375, 0.267822265625, -0.08856201171875)); +const f16mat4 w50_11 = f16mat4( + f16vec4(-0.007190704345703125, -0.0219879150390625, -0.0635986328125, 0.02581787109375), + f16vec4(-0.0229949951171875, 0.19384765625, -0.032867431640625, -0.06634521484375), + f16vec4(0.09271240234375, -0.0010776519775390625, 0.06451416015625, 0.0228424072265625), + f16vec4(0.07843017578125, -0.14453125, 0.2314453125, -0.0552978515625)); +const f16mat4 w50_12 = f16mat4( + f16vec4(-0.035858154296875, -0.05810546875, -0.091552734375, -0.0340576171875), + f16vec4(0.0254669189453125, -0.2364501953125, -0.12939453125, -0.00843048095703125), + f16vec4(-0.03546142578125, -0.03399658203125, -0.026763916015625, 0.0333251953125), + f16vec4(0.0435791015625, -0.0032863616943359375, 0.11761474609375, 0.05389404296875)); +const f16mat4 w50_13 = f16mat4( + f16vec4(0.01702880859375, -0.0181427001953125, -0.052337646484375, -0.00189685821533203125), + f16vec4(-0.074462890625, -0.385986328125, -0.030120849609375, 0.08941650390625), + f16vec4(0.2099609375, -0.1612548828125, -0.0196075439453125, -0.0384521484375), + f16vec4(-0.0135345458984375, 0.1923828125, -0.0305633544921875, 0.10638427734375)); +const f16mat4 w50_14 = f16mat4( + f16vec4(-0.0182037353515625, 0.020355224609375, -0.0284881591796875, -0.0340576171875), + f16vec4(0.00910186767578125, -0.00182056427001953125, 0.145263671875, 0.05462646484375), + f16vec4(0.1654052734375, -0.1104736328125, -0.016571044921875, -0.08636474609375), + f16vec4(-0.138671875, 0.01385498046875, -0.254150390625, -0.027618408203125)); +const f16mat4 w50_15 = f16mat4( + f16vec4(-0.004947662353515625, 0.1307373046875, -0.076904296875, -0.180419921875), + f16vec4(-0.01302337646484375, -0.0443115234375, -0.030914306640625, 0.09332275390625), + f16vec4(0.1905517578125, 0.0029506683349609375, -0.05712890625, -0.05767822265625), + f16vec4(0.09228515625, 0.0176239013671875, -0.36376953125, 0.043182373046875)); +const f16mat4 w50_16 = f16mat4( + f16vec4(0.013824462890625, -0.06060791015625, -0.0091094970703125, -0.1025390625), + f16vec4(0.0197906494140625, -0.432861328125, 0.14794921875, -0.0491943359375), + f16vec4(0.2120361328125, -0.049468994140625, -0.0150604248046875, 0.08294677734375), + f16vec4(-0.10394287109375, 0.27490234375, -0.13818359375, 0.1768798828125)); +const f16mat4 w50_17 = f16mat4( + f16vec4(-0.0635986328125, -0.0195159912109375, 0.08935546875, -0.004547119140625), + f16vec4(0.00884246826171875, -0.0838623046875, 0.05279541015625, 0.0802001953125), + f16vec4(-0.173095703125, -0.0293426513671875, -0.03216552734375, 0.013458251953125), + f16vec4(-0.1824951171875, 0.0677490234375, 0.03564453125, 0.1583251953125)); +const f16mat4 w50_18 = f16mat4( + f16vec4(0.01068115234375, 0.0501708984375, 0.06390380859375, -0.07421875), + f16vec4(0.02203369140625, 0.059844970703125, 0.0178985595703125, -0.01332855224609375), + f16vec4(-0.0155181884765625, -0.0090484619140625, 0.014373779296875, -0.2288818359375), + f16vec4(-0.15234375, 0.006622314453125, 0.07696533203125, 0.12054443359375)); +const f16mat4 w50_19 = f16mat4( + f16vec4(-0.06494140625, 0.12384033203125, -0.011260986328125, -0.06048583984375), + f16vec4(-0.04595947265625, -0.0089111328125, -0.2333984375, 0.00424957275390625), + f16vec4(-0.088134765625, -0.033660888671875, -0.040130615234375, -0.271240234375), + f16vec4(-0.15673828125, 0.0278472900390625, 0.0247039794921875, -0.054107666015625)); +const f16mat4 w50_20 = f16mat4( + f16vec4(0.0042724609375, 0.1998291015625, -0.021728515625, -0.0328369140625), + f16vec4(-0.03350830078125, -0.0262298583984375, -0.278076171875, 0.051116943359375), + f16vec4(0.0048065185546875, 0.130126953125, 0.0301666259765625, -0.072509765625), + f16vec4(0.1004638671875, 0.05914306640625, 0.08953857421875, -0.057830810546875)); +const f16mat4 w50_21 = f16mat4( + f16vec4(-0.1356201171875, -0.1065673828125, -0.0843505859375, -0.039459228515625), + f16vec4(-0.01537322998046875, 0.12286376953125, -0.1844482421875, -0.0056304931640625), + f16vec4(-0.07232666015625, -0.05267333984375, 0.025848388671875, 0.1285400390625), + f16vec4(-0.09173583984375, -0.010833740234375, 0.04638671875, 0.042999267578125)); +const f16mat4 w50_22 = f16mat4( + f16vec4(-0.06939697265625, -0.20654296875, -0.0626220703125, -0.171142578125), + f16vec4(-0.044952392578125, -0.059417724609375, -0.0251922607421875, 0.02435302734375), + f16vec4(0.026885986328125, -0.2000732421875, 0.0274810791015625, -0.00846099853515625), + f16vec4(0.1304931640625, -0.123291015625, -0.0261993408203125, 0.0257568359375)); +const f16mat4 w50_23 = f16mat4( + f16vec4(0.12225341796875, 0.045654296875, 0.0262908935546875, -0.0611572265625), + f16vec4(0.0423583984375, -0.11224365234375, 0.04180908203125, 0.0080108642578125), + f16vec4(0.12060546875, -0.07269287109375, 0.02056884765625, -0.1839599609375), + f16vec4(0.252685546875, -0.154052734375, -0.034942626953125, -0.09881591796875)); +const f16mat4 w50_24 = f16mat4( + f16vec4(-0.055389404296875, 0.04071044921875, 0.00128459930419921875, 0.20458984375), + f16vec4(-0.043609619140625, 0.1201171875, 0.1976318359375, -0.077392578125), + f16vec4(-0.00904083251953125, 0.055572509765625, -0.0241546630859375, 0.239501953125), + f16vec4(0.0748291015625, 0.0992431640625, -0.1011962890625, -0.1187744140625)); +const f16mat4 w50_25 = f16mat4( + f16vec4(0.133056640625, -0.2412109375, 0.06719970703125, 0.1815185546875), + f16vec4(0.0389404296875, -0.023284912109375, 0.275390625, -0.0479736328125), + f16vec4(0.126220703125, -0.0325927734375, -0.1199951171875, 0.3486328125), + f16vec4(0.1883544921875, -0.0134735107421875, -0.08709716796875, -0.005733489990234375)); +const f16mat4 w50_26 = f16mat4( + f16vec4(0.1240234375, -0.10595703125, 0.0823974609375, -0.00849151611328125), + f16vec4(-0.028594970703125, -0.08673095703125, 0.1324462890625, -0.0185546875), + f16vec4(0.051849365234375, -0.042694091796875, -0.10443115234375, 0.13134765625), + f16vec4(-0.09521484375, 0.0131378173828125, -0.054595947265625, 0.0684814453125)); +const f16mat4 w50_27 = f16mat4( + f16vec4(-0.04388427734375, -0.0273895263671875, 0.0911865234375, -0.0753173828125), + f16vec4(-0.060455322265625, -0.053314208984375, 0.07220458984375, -0.0889892578125), + f16vec4(0.027496337890625, 0.0797119140625, 0.033477783203125, 0.027618408203125), + f16vec4(0.09423828125, 0.06634521484375, 0.07135009765625, 0.18505859375)); +const f16mat4 w50_28 = f16mat4( + f16vec4(-0.0830078125, 0.1002197265625, -0.01047515869140625, -0.282470703125), + f16vec4(-0.10870361328125, 0.07989501953125, -0.01800537109375, -0.1353759765625), + f16vec4(-0.248779296875, 0.060333251953125, 0.021392822265625, 0.0261993408203125), + f16vec4(0.14013671875, -0.01515960693359375, 0.03369140625, 0.1439208984375)); +const f16mat4 w50_29 = f16mat4( + f16vec4(0.040802001953125, 0.2452392578125, -0.0357666015625, -0.212890625), + f16vec4(0.023834228515625, 0.10675048828125, -0.006488800048828125, -0.000358104705810546875), + f16vec4(-0.09576416015625, 0.035247802734375, 0.1080322265625, 0.038909912109375), + f16vec4(0.0311126708984375, -0.04736328125, 0.1116943359375, 0.14404296875)); +const f16mat4 w50_30 = f16mat4( + f16vec4(-0.124755859375, -0.176513671875, 0.0543212890625, 0.2491455078125), + f16vec4(-0.08154296875, -0.155517578125, -0.052215576171875, 0.2205810546875), + f16vec4(-0.16162109375, -0.0111236572265625, 0.03668212890625, 0.005733489990234375), + f16vec4(0.07830810546875, -0.007778167724609375, -0.048095703125, -0.1104736328125)); +const f16mat4 w50_31 = f16mat4( + f16vec4(-0.0281524658203125, -0.254638671875, -0.051422119140625, 0.26171875), + f16vec4(0.06640625, -0.1171875, -0.036895751953125, -0.030792236328125), + f16vec4(-0.050750732421875, -0.0927734375, 0.07391357421875, -0.00940704345703125), + f16vec4(-0.06585693359375, 0.12103271484375, 0.0626220703125, 0.026580810546875)); +const f16mat4 w50_32 = f16mat4( + f16vec4(0.11956787109375, 0.05230712890625, -0.01024627685546875, -0.0210723876953125), + f16vec4(0.15185546875, 0.09521484375, 0.07855224609375, -0.162109375), + f16vec4(0.2138671875, -0.03790283203125, -0.03131103515625, -0.01258087158203125), + f16vec4(-0.0511474609375, -0.047637939453125, 0.037322998046875, 0.0243682861328125)); +const f16mat4 w50_33 = f16mat4( + f16vec4(-0.021759033203125, 0.050048828125, -0.06829833984375, -0.0291595458984375), + f16vec4(0.061981201171875, -0.07659912109375, 0.015960693359375, 0.163818359375), + f16vec4(0.0721435546875, 0.00112628936767578125, -0.06829833984375, 0.0174102783203125), + f16vec4(-0.04180908203125, -0.23779296875, -0.08013916015625, -0.10693359375)); +const f16mat4 w50_34 = f16mat4( + f16vec4(0.11151123046875, -0.0877685546875, 0.0029315948486328125, 0.37109375), + f16vec4(0.241455078125, -0.1260986328125, 0.0015392303466796875, 0.2396240234375), + f16vec4(0.2161865234375, -0.169921875, -0.1767578125, -0.0496826171875), + f16vec4(-0.1884765625, -0.0855712890625, -0.004413604736328125, -0.2054443359375)); +const f16mat4 w50_35 = f16mat4( + f16vec4(0.0221710205078125, -0.062164306640625, 0.0782470703125, 0.27294921875), + f16vec4(0.050506591796875, -0.04864501953125, 0.038055419921875, -0.002628326416015625), + f16vec4(0.0025081634521484375, -0.0728759765625, -0.1004638671875, -0.06024169921875), + f16vec4(0.0174713134765625, 0.09814453125, -0.095947265625, -0.230224609375)); + +// output binding 51 +const f16vec4 sub51 = f16vec4(0.10992431640625, 0.08477783203125, 0.1007080078125, -0.241455078125); +const f16vec4 mul51 = f16vec4(2.19140625, 3.0234375, 4.56640625, 4.8125); +const f16vec4 add51 = f16vec4(0.85595703125, 0.5927734375, 0.37353515625, -0.18701171875); +const f16mat4 w51_00 = f16mat4( + f16vec4(-0.0024051666259765625, 0.007259368896484375, -0.08880615234375, -0.041595458984375), + f16vec4(0.2208251953125, -0.1533203125, -0.0018463134765625, 0.0372314453125), + f16vec4(0.0794677734375, 0.01084136962890625, -0.06671142578125, -0.054962158203125), + f16vec4(-0.0828857421875, 0.08538818359375, -0.1075439453125, 0.063720703125)); +const f16mat4 w51_01 = f16mat4( + f16vec4(-0.07257080078125, 0.0254669189453125, 0.0182342529296875, 0.0133819580078125), + f16vec4(0.0027599334716796875, 0.03814697265625, -0.06024169921875, 0.004177093505859375), + f16vec4(0.01385498046875, -0.06268310546875, -0.19775390625, -0.05224609375), + f16vec4(-0.08563232421875, 0.0256500244140625, -0.1737060546875, 0.06353759765625)); +const f16mat4 w51_02 = f16mat4( + f16vec4(0.0457763671875, 0.0217437744140625, 0.11871337890625, -0.159423828125), + f16vec4(0.031280517578125, 0.2103271484375, -0.01035308837890625, -0.0181884765625), + f16vec4(0.0672607421875, -0.037353515625, -0.132568359375, -0.06256103515625), + f16vec4(0.1072998046875, -0.123046875, -0.054351806640625, -0.00943756103515625)); +const f16mat4 w51_03 = f16mat4( + f16vec4(0.057830810546875, 0.04400634765625, -0.06866455078125, 0.06103515625), + f16vec4(0.1341552734375, -0.2412109375, 0.0823974609375, 0.00830841064453125), + f16vec4(0.015380859375, -0.0782470703125, 0.01338958740234375, -0.006389617919921875), + f16vec4(-0.0628662109375, 0.00635528564453125, 0.09820556640625, -0.04693603515625)); +const f16mat4 w51_04 = f16mat4( + f16vec4(0.0205841064453125, 0.035491943359375, -0.0960693359375, 0.025726318359375), + f16vec4(-0.19873046875, 0.1898193359375, -0.0280914306640625, -0.0416259765625), + f16vec4(-0.02435302734375, -0.035400390625, 0.115966796875, -0.037933349609375), + f16vec4(0.1661376953125, -0.020538330078125, -0.10400390625, 0.060089111328125)); +const f16mat4 w51_05 = f16mat4( + f16vec4(0.0305633544921875, -0.01055908203125, 0.1265869140625, -0.052093505859375), + f16vec4(-0.1397705078125, 0.321044921875, -0.05474853515625, -0.0218963623046875), + f16vec4(0.01471710205078125, -0.0159912109375, 0.12200927734375, -0.1005859375), + f16vec4(0.262939453125, -0.08062744140625, -0.070068359375, 0.04364013671875)); +const f16mat4 w51_06 = f16mat4( + f16vec4(0.052215576171875, 0.03594970703125, 0.055633544921875, -0.1270751953125), + f16vec4(-0.0253753662109375, -0.2357177734375, 0.0220489501953125, -0.009246826171875), + f16vec4(-0.04901123046875, -0.0701904296875, 0.0214385986328125, -0.000852108001708984375), + f16vec4(0.039215087890625, -0.026947021484375, 0.038665771484375, 0.07000732421875)); +const f16mat4 w51_07 = f16mat4( + f16vec4(-0.0265655517578125, 0.01554107666015625, -0.09698486328125, 0.0711669921875), + f16vec4(-0.203369140625, 0.291748046875, 0.053466796875, -0.040191650390625), + f16vec4(-0.11468505859375, 0.037994384765625, 0.2457275390625, 0.0543212890625), + f16vec4(0.1986083984375, -0.0328369140625, 0.1695556640625, 0.02215576171875)); +const f16mat4 w51_08 = f16mat4( + f16vec4(-0.0098114013671875, -0.033966064453125, -0.100830078125, -0.033111572265625), + f16vec4(-0.06768798828125, 0.2449951171875, 0.0292510986328125, 0.024383544921875), + f16vec4(-0.049530029296875, 0.1138916015625, 0.392822265625, -0.1785888671875), + f16vec4(0.122314453125, 0.06671142578125, 0.09442138671875, 0.0125274658203125)); +const f16mat4 w51_09 = f16mat4( + f16vec4(-0.00565338134765625, 0.0303192138671875, -0.01898193359375, -0.055877685546875), + f16vec4(0.028411865234375, 0.00757598876953125, -0.0765380859375, -0.0582275390625), + f16vec4(0.0565185546875, -0.0242462158203125, 0.0736083984375, -0.03662109375), + f16vec4(-0.049774169921875, 0.1524658203125, 0.057098388671875, 0.00998687744140625)); +const f16mat4 w51_10 = f16mat4( + f16vec4(0.06121826171875, -0.08709716796875, -0.0211334228515625, -0.004390716552734375), + f16vec4(-0.027191162109375, -0.04962158203125, 0.016357421875, -0.07293701171875), + f16vec4(-0.1214599609375, -0.0034923553466796875, -0.2113037109375, 0.07904052734375), + f16vec4(0.0250091552734375, 0.051788330078125, 0.09515380859375, -0.0657958984375)); +const f16mat4 w51_11 = f16mat4( + f16vec4(-0.0093841552734375, -0.0162506103515625, 0.001811981201171875, 0.002117156982421875), + f16vec4(-0.0518798828125, 0.05035400390625, 0.036895751953125, -0.167236328125), + f16vec4(-0.000587940216064453125, -0.00653076171875, -0.10205078125, 0.06988525390625), + f16vec4(-0.07452392578125, -0.1632080078125, 0.02325439453125, -0.0038242340087890625)); +const f16mat4 w51_12 = f16mat4( + f16vec4(0.031585693359375, -0.044891357421875, -0.04052734375, -0.047332763671875), + f16vec4(0.05389404296875, 0.032928466796875, -0.0992431640625, -0.00444793701171875), + f16vec4(0.057586669921875, 0.023193359375, 0.06268310546875, 0.06787109375), + f16vec4(-0.1136474609375, 0.1387939453125, -0.0814208984375, -0.08563232421875)); +const f16mat4 w51_13 = f16mat4( + f16vec4(0.120361328125, -0.11993408203125, 0.026885986328125, -0.036590576171875), + f16vec4(-0.034027099609375, -0.012176513671875, 0.0841064453125, -0.07843017578125), + f16vec4(-0.00620269775390625, -0.05255126953125, 0.1505126953125, -0.08941650390625), + f16vec4(0.03076171875, 0.0758056640625, -0.029571533203125, 0.0250396728515625)); +const f16mat4 w51_14 = f16mat4( + f16vec4(0.0521240234375, 0.049468994140625, 0.036651611328125, -0.022308349609375), + f16vec4(-0.061004638671875, 0.0418701171875, 0.19873046875, -0.08197021484375), + f16vec4(0.161376953125, -0.00890350341796875, -0.019622802734375, -0.006687164306640625), + f16vec4(0.1309814453125, -0.168212890625, -0.01319122314453125, 0.00069713592529296875)); +const f16mat4 w51_15 = f16mat4( + f16vec4(0.069091796875, -0.12384033203125, 0.0246124267578125, -0.01371002197265625), + f16vec4(0.05523681640625, 0.050689697265625, -0.0985107421875, 0.00628662109375), + f16vec4(0.0941162109375, -0.05206298828125, -0.09136962890625, -0.033355712890625), + f16vec4(-0.09112548828125, 0.2149658203125, -0.0007457733154296875, -0.056732177734375)); +const f16mat4 w51_16 = f16mat4( + f16vec4(0.06329345703125, -0.1719970703125, -0.043548583984375, -0.06707763671875), + f16vec4(-0.0141143798828125, -0.00952911376953125, -0.0179443359375, 0.1810302734375), + f16vec4(0.1151123046875, -0.0157012939453125, 0.1011962890625, 0.06890869140625), + f16vec4(0.094970703125, 0.016845703125, -0.1314697265625, -0.1890869140625)); +const f16mat4 w51_17 = f16mat4( + f16vec4(0.08154296875, 0.0765380859375, -0.003780364990234375, -0.0517578125), + f16vec4(-0.047088623046875, -0.0264434814453125, 0.07916259765625, -0.19091796875), + f16vec4(0.04681396484375, 0.06402587890625, 0.142333984375, 0.0166778564453125), + f16vec4(0.2548828125, -0.2169189453125, -0.068603515625, 0.01261138916015625)); +const f16mat4 w51_18 = f16mat4( + f16vec4(0.023773193359375, 0.029998779296875, -0.0298614501953125, -0.350830078125), + f16vec4(0.235595703125, 0.00922393798828125, 0.06561279296875, 0.00100612640380859375), + f16vec4(0.02947998046875, 0.06903076171875, -0.02020263671875, -0.12060546875), + f16vec4(-0.02630615234375, -0.07562255859375, 0.11468505859375, 0.05169677734375)); +const f16mat4 w51_19 = f16mat4( + f16vec4(0.018951416015625, -0.036834716796875, -0.042449951171875, -0.0888671875), + f16vec4(0.1483154296875, -0.128662109375, -0.04461669921875, -0.00853729248046875), + f16vec4(-0.05377197265625, -0.0245513916015625, -0.02215576171875, -0.3291015625), + f16vec4(-0.0255279541015625, -0.0248870849609375, -0.0751953125, -0.0201263427734375)); +const f16mat4 w51_20 = f16mat4( + f16vec4(-0.02569580078125, -0.057037353515625, 0.0312042236328125, -0.0243377685546875), + f16vec4(-0.06085205078125, 0.09454345703125, -0.06488037109375, 0.031097412109375), + f16vec4(0.0274200439453125, -0.067138671875, 0.026702880859375, -0.081298828125), + f16vec4(-0.0364990234375, 0.0943603515625, -0.22509765625, 0.08917236328125)); +const f16mat4 w51_21 = f16mat4( + f16vec4(0.03680419921875, -0.09771728515625, 0.0418701171875, 0.191650390625), + f16vec4(0.2919921875, -0.0924072265625, 0.07275390625, -0.0196533203125), + f16vec4(-0.052215576171875, -0.0113525390625, -0.061767578125, 0.13916015625), + f16vec4(-0.02362060546875, 0.0028438568115234375, 0.00923919677734375, 0.04833984375)); +const f16mat4 w51_22 = f16mat4( + f16vec4(-0.06219482421875, -0.1298828125, 0.1241455078125, 0.077880859375), + f16vec4(-0.007080078125, -0.11077880859375, 0.01983642578125, 0.00169467926025390625), + f16vec4(-0.1044921875, -0.07421875, 0.1314697265625, 0.2081298828125), + f16vec4(-0.00885772705078125, 0.005321502685546875, 0.1756591796875, -0.00396728515625)); +const f16mat4 w51_23 = f16mat4( + f16vec4(0.016448974609375, -0.035888671875, 0.1773681640625, -0.2183837890625), + f16vec4(-0.162109375, 0.206787109375, -0.046783447265625, -0.002010345458984375), + f16vec4(-0.0791015625, -0.0235137939453125, 0.1883544921875, -0.1156005859375), + f16vec4(0.0740966796875, -0.0179443359375, 0.045867919921875, -0.064208984375)); +const f16mat4 w51_24 = f16mat4( + f16vec4(-0.028350830078125, -0.0865478515625, -0.10626220703125, -0.1256103515625), + f16vec4(0.12127685546875, -0.1605224609375, -0.01309967041015625, -0.036834716796875), + f16vec4(-0.0560302734375, -0.00426483154296875, -0.080810546875, -0.20458984375), + f16vec4(0.036529541015625, 0.09228515625, -0.053009033203125, 0.00234222412109375)); +const f16mat4 w51_25 = f16mat4( + f16vec4(-0.0704345703125, -0.0189361572265625, 0.2275390625, 0.2303466796875), + f16vec4(-0.123779296875, -0.005615234375, 0.0193634033203125, 0.0032215118408203125), + f16vec4(-0.060028076171875, 0.0214385986328125, 0.041473388671875, 0.0157470703125), + f16vec4(0.04998779296875, 0.0217742919921875, -0.01617431640625, -0.0293121337890625)); +const f16mat4 w51_26 = f16mat4( + f16vec4(-0.056915283203125, 0.0845947265625, 0.2435302734375, 0.05206298828125), + f16vec4(-0.231689453125, 0.2137451171875, 0.0266571044921875, 0.038360595703125), + f16vec4(-0.053253173828125, 0.03985595703125, 0.1817626953125, 0.157958984375), + f16vec4(0.130859375, -0.0189666748046875, 0.1448974609375, 0.045501708984375)); +const f16mat4 w51_27 = f16mat4( + f16vec4(0.07623291015625, 0.09002685546875, -0.06304931640625, 0.0057373046875), + f16vec4(0.1380615234375, 0.0167083740234375, -0.0101776123046875, 0.027099609375), + f16vec4(-0.03302001953125, 0.078125, -0.05670166015625, 0.0914306640625), + f16vec4(-0.1705322265625, 0.1297607421875, -0.0146636962890625, 0.0280609130859375)); +const f16mat4 w51_28 = f16mat4( + f16vec4(-0.0287933349609375, -0.0892333984375, -0.07183837890625, -0.1434326171875), + f16vec4(0.04541015625, -0.049407958984375, -0.1971435546875, -0.0758056640625), + f16vec4(-0.14111328125, 0.1351318359375, -0.1458740234375, 0.06072998046875), + f16vec4(-0.125244140625, 0.1290283203125, 0.1434326171875, 0.043304443359375)); +const f16mat4 w51_29 = f16mat4( + f16vec4(-0.08514404296875, -0.033233642578125, -0.07989501953125, -0.2044677734375), + f16vec4(0.042694091796875, 0.053955078125, -0.0460205078125, -0.00406646728515625), + f16vec4(0.0236358642578125, -0.06256103515625, -0.080322265625, 0.0135345458984375), + f16vec4(0.032958984375, -0.154296875, 0.089111328125, -0.1007080078125)); +const f16mat4 w51_30 = f16mat4( + f16vec4(0.0222930908203125, 0.0238037109375, -0.06903076171875, 0.00720977783203125), + f16vec4(0.1541748046875, -0.1187744140625, 0.05047607421875, 0.0946044921875), + f16vec4(-0.08935546875, 0.046783447265625, 0.07891845703125, -0.034576416015625), + f16vec4(-0.1580810546875, 0.28125, -0.099609375, -0.0183563232421875)); +const f16mat4 w51_31 = f16mat4( + f16vec4(-0.0457763671875, -0.1317138671875, 0.11090087890625, 0.1497802734375), + f16vec4(-0.006793975830078125, -0.07867431640625, 0.045501708984375, 0.0244598388671875), + f16vec4(-0.00626373291015625, 0.042327880859375, -0.014251708984375, -0.004283905029296875), + f16vec4(0.12493896484375, 0.02935791015625, 0.017578125, -0.0264739990234375)); +const f16mat4 w51_32 = f16mat4( + f16vec4(-0.08233642578125, -0.0174407958984375, 0.15087890625, -0.08453369140625), + f16vec4(0.0133056640625, 0.09014892578125, -0.162109375, -0.007335662841796875), + f16vec4(0.226318359375, -0.10076904296875, -0.1614990234375, 0.0411376953125), + f16vec4(0.1890869140625, -0.281005859375, 0.15087890625, 0.0149993896484375)); +const f16mat4 w51_33 = f16mat4( + f16vec4(-0.06622314453125, 0.0584716796875, -0.09136962890625, -0.08135986328125), + f16vec4(0.097900390625, -0.11279296875, -0.045074462890625, -0.1331787109375), + f16vec4(0.0157623291015625, 0.0253753662109375, -0.03692626953125, -0.006572723388671875), + f16vec4(-0.09423828125, 0.2252197265625, 0.0863037109375, -0.034332275390625)); +const f16mat4 w51_34 = f16mat4( + f16vec4(-0.07415771484375, 0.09466552734375, 0.08819580078125, -0.2459716796875), + f16vec4(-0.0662841796875, 0.09881591796875, 0.22607421875, -0.0511474609375), + f16vec4(0.10174560546875, -0.0584716796875, 0.1151123046875, 0.01117706298828125), + f16vec4(0.1646728515625, -0.239013671875, -0.244384765625, -0.017822265625)); +const f16mat4 w51_35 = f16mat4( + f16vec4(-0.07373046875, -0.01117706298828125, 0.262451171875, -0.12445068359375), + f16vec4(-0.032684326171875, 0.09161376953125, 0.036041259765625, 0.0189208984375), + f16vec4(0.1837158203125, -0.0050048828125, 0.044403076171875, 0.019805908203125), + f16vec4(0.08343505859375, -0.20068359375, -0.0948486328125, -0.0245819091796875)); + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 lim = imageSize(plane0); + if (p.x >= lim.x || p.y >= lim.y) { + return; + } + vec2 uv = (vec2(p) + 0.5) / vec2(textureSize(featA, 0)); + + f16vec4 t0 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(-1, -1))); + f16vec4 t1 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(-1, 0))); + f16vec4 t2 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(-1, 1))); + f16vec4 t3 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(0, -1))); + f16vec4 t4 = f16vec4(textureLod(featA, uv, 0.0)); + f16vec4 t5 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(0, 1))); + f16vec4 t6 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(1, -1))); + f16vec4 t7 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(1, 0))); + f16vec4 t8 = f16vec4(textureLodOffset(featA, uv, 0.0, ivec2(1, 1))); + f16vec4 t9 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(-1, -1))); + f16vec4 t10 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(-1, 0))); + f16vec4 t11 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(-1, 1))); + f16vec4 t12 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(0, -1))); + f16vec4 t13 = f16vec4(textureLod(featB, uv, 0.0)); + f16vec4 t14 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(0, 1))); + f16vec4 t15 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(1, -1))); + f16vec4 t16 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(1, 0))); + f16vec4 t17 = f16vec4(textureLodOffset(featB, uv, 0.0, ivec2(1, 1))); + f16vec4 t18 = f16vec4(textureLodOffset(featC, uv, 0.0, ivec2(-1, -1))); + f16vec4 t19 = f16vec4(textureLodOffset(featC, uv, 0.0, ivec2(-1, 0))); + f16vec4 t20 = f16vec4(textureLodOffset(featC, uv, 0.0, ivec2(-1, 1))); + f16vec4 t21 = f16vec4(textureLodOffset(featC, uv, 0.0, ivec2(0, -1))); + f16vec4 t22 = f16vec4(textureLod(featC, uv, 0.0)); + f16vec4 t23 = f16vec4(textureLodOffset(featC, uv, 0.0, ivec2(0, 1))); + f16vec4 t24 = f16vec4(textureLodOffset(featC, uv, 0.0, ivec2(1, -1))); + f16vec4 t25 = f16vec4(textureLodOffset(featC, uv, 0.0, ivec2(1, 0))); + f16vec4 t26 = f16vec4(textureLodOffset(featC, uv, 0.0, ivec2(1, 1))); + f16vec4 t27 = f16vec4(textureLodOffset(featD, uv, 0.0, ivec2(-1, -1))); + f16vec4 t28 = f16vec4(textureLodOffset(featD, uv, 0.0, ivec2(-1, 0))); + f16vec4 t29 = f16vec4(textureLodOffset(featD, uv, 0.0, ivec2(-1, 1))); + f16vec4 t30 = f16vec4(textureLodOffset(featD, uv, 0.0, ivec2(0, -1))); + f16vec4 t31 = f16vec4(textureLod(featD, uv, 0.0)); + f16vec4 t32 = f16vec4(textureLodOffset(featD, uv, 0.0, ivec2(0, 1))); + f16vec4 t33 = f16vec4(textureLodOffset(featD, uv, 0.0, ivec2(1, -1))); + f16vec4 t34 = f16vec4(textureLodOffset(featD, uv, 0.0, ivec2(1, 0))); + f16vec4 t35 = f16vec4(textureLodOffset(featD, uv, 0.0, ivec2(1, 1))); + + f16vec4 s0 = w48_00 * t0; + s0 += w48_01 * t1; + s0 += w48_02 * t2; + s0 += w48_03 * t3; + s0 += w48_04 * t4; + s0 += w48_05 * t5; + s0 += w48_06 * t6; + s0 += w48_07 * t7; + s0 += w48_08 * t8; + s0 += w48_09 * t9; + s0 += w48_10 * t10; + s0 += w48_11 * t11; + s0 += w48_12 * t12; + s0 += w48_13 * t13; + s0 += w48_14 * t14; + s0 += w48_15 * t15; + s0 += w48_16 * t16; + s0 += w48_17 * t17; + s0 += w48_18 * t18; + s0 += w48_19 * t19; + s0 += w48_20 * t20; + s0 += w48_21 * t21; + s0 += w48_22 * t22; + s0 += w48_23 * t23; + s0 += w48_24 * t24; + s0 += w48_25 * t25; + s0 += w48_26 * t26; + s0 += w48_27 * t27; + s0 += w48_28 * t28; + s0 += w48_29 * t29; + s0 += w48_30 * t30; + s0 += w48_31 * t31; + s0 += w48_32 * t32; + s0 += w48_33 * t33; + s0 += w48_34 * t34; + s0 += w48_35 * t35; + imageStore(plane0, p, vec4((s0 - sub48) * mul48 + add48)); + + f16vec4 s1 = w49_00 * t0; + s1 += w49_01 * t1; + s1 += w49_02 * t2; + s1 += w49_03 * t3; + s1 += w49_04 * t4; + s1 += w49_05 * t5; + s1 += w49_06 * t6; + s1 += w49_07 * t7; + s1 += w49_08 * t8; + s1 += w49_09 * t9; + s1 += w49_10 * t10; + s1 += w49_11 * t11; + s1 += w49_12 * t12; + s1 += w49_13 * t13; + s1 += w49_14 * t14; + s1 += w49_15 * t15; + s1 += w49_16 * t16; + s1 += w49_17 * t17; + s1 += w49_18 * t18; + s1 += w49_19 * t19; + s1 += w49_20 * t20; + s1 += w49_21 * t21; + s1 += w49_22 * t22; + s1 += w49_23 * t23; + s1 += w49_24 * t24; + s1 += w49_25 * t25; + s1 += w49_26 * t26; + s1 += w49_27 * t27; + s1 += w49_28 * t28; + s1 += w49_29 * t29; + s1 += w49_30 * t30; + s1 += w49_31 * t31; + s1 += w49_32 * t32; + s1 += w49_33 * t33; + s1 += w49_34 * t34; + s1 += w49_35 * t35; + imageStore(plane1, p, vec4((s1 - sub49) * mul49 + add49)); + + f16vec4 s2 = w50_00 * t0; + s2 += w50_01 * t1; + s2 += w50_02 * t2; + s2 += w50_03 * t3; + s2 += w50_04 * t4; + s2 += w50_05 * t5; + s2 += w50_06 * t6; + s2 += w50_07 * t7; + s2 += w50_08 * t8; + s2 += w50_09 * t9; + s2 += w50_10 * t10; + s2 += w50_11 * t11; + s2 += w50_12 * t12; + s2 += w50_13 * t13; + s2 += w50_14 * t14; + s2 += w50_15 * t15; + s2 += w50_16 * t16; + s2 += w50_17 * t17; + s2 += w50_18 * t18; + s2 += w50_19 * t19; + s2 += w50_20 * t20; + s2 += w50_21 * t21; + s2 += w50_22 * t22; + s2 += w50_23 * t23; + s2 += w50_24 * t24; + s2 += w50_25 * t25; + s2 += w50_26 * t26; + s2 += w50_27 * t27; + s2 += w50_28 * t28; + s2 += w50_29 * t29; + s2 += w50_30 * t30; + s2 += w50_31 * t31; + s2 += w50_32 * t32; + s2 += w50_33 * t33; + s2 += w50_34 * t34; + s2 += w50_35 * t35; + imageStore(plane2, p, vec4((s2 - sub50) * mul50 + add50)); + + f16vec4 s3 = w51_00 * t0; + s3 += w51_01 * t1; + s3 += w51_02 * t2; + s3 += w51_03 * t3; + s3 += w51_04 * t4; + s3 += w51_05 * t5; + s3 += w51_06 * t6; + s3 += w51_07 * t7; + s3 += w51_08 * t8; + s3 += w51_09 * t9; + s3 += w51_10 * t10; + s3 += w51_11 * t11; + s3 += w51_12 * t12; + s3 += w51_13 * t13; + s3 += w51_14 * t14; + s3 += w51_15 * t15; + s3 += w51_16 * t16; + s3 += w51_17 * t17; + s3 += w51_18 * t18; + s3 += w51_19 * t19; + s3 += w51_20 * t20; + s3 += w51_21 * t21; + s3 += w51_22 * t22; + s3 += w51_23 * t23; + s3 += w51_24 * t24; + s3 += w51_25 * t25; + s3 += w51_26 * t26; + s3 += w51_27 * t27; + s3 += w51_28 * t28; + s3 += w51_29 * t29; + s3 += w51_30 * t30; + s3 += w51_31 * t31; + s3 += w51_32 * t32; + s3 += w51_33 * t33; + s3 += w51_34 * t34; + s3 += w51_35 * t35; + imageStore(plane3, p, vec4((s3 - sub51) * mul51 + add51)); + +} diff --git a/cleanroom/glsl/shader_34.comp b/cleanroom/glsl/shader_34.comp new file mode 100644 index 0000000..b2b5562 --- /dev/null +++ b/cleanroom/glsl/shader_34.comp @@ -0,0 +1,143 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_34: 3x3 local correlation of two 16ch center features against a 16ch +// neighborhood, quant-style normalize, two 18->4 linear heads -> two RGBA8 images. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcRefA0; +layout(set = 0, binding = 33) uniform sampler2D srcRefA1; +layout(set = 0, binding = 34) uniform sampler2D srcRefA2; +layout(set = 0, binding = 35) uniform sampler2D srcRefA3; +layout(set = 0, binding = 36) uniform sampler2D srcRefB0; +layout(set = 0, binding = 37) uniform sampler2D srcRefB1; +layout(set = 0, binding = 38) uniform sampler2D srcRefB2; +layout(set = 0, binding = 39) uniform sampler2D srcRefB3; +layout(set = 0, binding = 40) uniform sampler2D srcNbr0; +layout(set = 0, binding = 41) uniform sampler2D srcNbr1; +layout(set = 0, binding = 42) uniform sampler2D srcNbr2; +layout(set = 0, binding = 43) uniform sampler2D srcNbr3; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstHead0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstHead1; + +const f16vec4 kZero1 = f16vec4(4.31640625hf, 4.34375hf, 4.30859375hf, 4.35546875hf); +const f16vec4 kScale1 = f16vec4(0.1795654296875hf, 0.348388671875hf, 0.626953125hf, 0.36328125hf); +const f16vec4 kOfs1 = f16vec4(0.2196044921875hf, 0.027496337890625hf, -0.63037109375hf, -0.004611968994140625hf); +const f16vec4 kZero2 = f16vec4(4.421875hf, 4.33984375hf, 4.328125hf, 4.34375hf); +const f16vec4 kScale2 = f16vec4(0.2403564453125hf, 0.564453125hf, 0.521484375hf, 0.33349609375hf); +const f16vec4 kOfs2 = f16vec4(0.1405029296875hf, -0.216552734375hf, -0.415283203125hf, 0.04852294921875hf); +const float16_t kZero3 = 4.3046875hf; +const float16_t kScale3 = 0.380126953125hf; +const float16_t kOfs3 = 0.0450439453125hf; + +const f16mat4 kP1 = f16mat4( + f16vec4(0.2120361328125hf, 0.10186767578125hf, -0.00580596923828125hf, -0.1025390625hf), + f16vec4(0.1046142578125hf, 0.2313232421875hf, -0.2171630859375hf, -0.2486572265625hf), + f16vec4(0.031768798828125hf, 0.0247802734375hf, 0.1446533203125hf, -0.057586669921875hf), + f16vec4(0.17578125hf, 0.10382080078125hf, 0.33642578125hf, -0.339111328125hf)); +const f16mat4 kP2 = f16mat4( + f16vec4(0.275634765625hf, 0.326171875hf, -0.10076904296875hf, -0.63623046875hf), + f16vec4(0.154541015625hf, 0.0806884765625hf, -0.1961669921875hf, -0.0672607421875hf), + f16vec4(0.091552734375hf, 0.269287109375hf, 0.11114501953125hf, -0.1405029296875hf), + f16vec4(0.248046875hf, -0.223388671875hf, 0.1978759765625hf, -0.294921875hf)); +const f16vec4 kQ1 = f16vec4(0.013763427734375hf, -0.5341796875hf, 0.0024166107177734375hf, -0.2110595703125hf); +const f16mat4 kP3 = f16mat4( + f16vec4(0.076416015625hf, -0.21044921875hf, -0.2861328125hf, 0.2242431640625hf), + f16vec4(-0.2344970703125hf, 0.51611328125hf, -0.31103515625hf, 0.302734375hf), + f16vec4(-0.50341796875hf, 0.276611328125hf, 0.26708984375hf, 0.2529296875hf), + f16vec4(-0.174560546875hf, 0.10589599609375hf, 0.66748046875hf, 0.4013671875hf)); +const f16mat4 kP4 = f16mat4( + f16vec4(-1.0595703125hf, 0.40087890625hf, -0.2958984375hf, -0.1337890625hf), + f16vec4(-0.07440185546875hf, 0.26611328125hf, -0.1875hf, 0.201416015625hf), + f16vec4(-0.291015625hf, 0.289794921875hf, 0.0615234375hf, 0.06060791015625hf), + f16vec4(-0.08892822265625hf, -0.716796875hf, 0.6728515625hf, 0.37451171875hf)); +const f16vec4 kQ2 = f16vec4(-0.0297698974609375hf, -0.609375hf, -0.267822265625hf, 0.210205078125hf); +const f16vec4 kDeq0A = f16vec4(-0.0872802734375hf, -0.0192108154296875hf, -0.018218994140625hf, -0.07098388671875hf); +const f16vec4 kDeq1A = f16vec4(4.140625hf, 2.90625hf, 1.388671875hf, 6.20703125hf); +const f16vec4 kDeq2A = f16vec4(0.24609375hf, -0.2822265625hf, 0.427734375hf, 0.354248046875hf); + +const f16mat4 kR1 = f16mat4( + f16vec4(-0.11334228515625hf, -0.5966796875hf, -0.220703125hf, -0.1552734375hf), + f16vec4(0.027679443359375hf, -0.15869140625hf, -0.1466064453125hf, -0.219970703125hf), + f16vec4(-0.1318359375hf, 0.170166015625hf, -0.1160888671875hf, 0.08544921875hf), + f16vec4(-0.08880615234375hf, -0.17041015625hf, -0.0277099609375hf, -0.365478515625hf)); +const f16mat4 kR2 = f16mat4( + f16vec4(0.56396484375hf, 0.204833984375hf, 0.6162109375hf, -0.414794921875hf), + f16vec4(-0.0650634765625hf, 0.4287109375hf, -0.0005249977111816406hf, -0.089599609375hf), + f16vec4(-0.02532958984375hf, -0.0310516357421875hf, -0.303466796875hf, 0.2349853515625hf), + f16vec4(0.1968994140625hf, 0.2177734375hf, -0.12322998046875hf, -0.192626953125hf)); +const f16vec4 kQ3 = f16vec4(0.1524658203125hf, 0.1317138671875hf, -0.2255859375hf, -0.155029296875hf); +const f16mat4 kR3 = f16mat4( + f16vec4(-0.1258544921875hf, -0.53271484375hf, 0.0654296875hf, -0.0849609375hf), + f16vec4(-0.12255859375hf, -0.1435546875hf, -0.281005859375hf, -0.13232421875hf), + f16vec4(-0.035888671875hf, -0.07440185546875hf, -0.07196044921875hf, 0.0215606689453125hf), + f16vec4(-0.08941650390625hf, -0.497802734375hf, -0.059234619140625hf, -0.2252197265625hf)); +const f16mat4 kR4 = f16mat4( + f16vec4(1.1591796875hf, -0.328857421875hf, 1.236328125hf, -0.40087890625hf), + f16vec4(-0.1263427734375hf, 0.494873046875hf, -0.171630859375hf, -0.0341796875hf), + f16vec4(-0.1104736328125hf, -0.0399169921875hf, -0.152099609375hf, 0.15087890625hf), + f16vec4(0.1806640625hf, 0.1837158203125hf, 0.025299072265625hf, -0.0479736328125hf)); +const f16vec4 kQ4 = f16vec4(0.140380859375hf, 0.032562255859375hf, -0.11468505859375hf, 0.041717529296875hf); +const f16vec4 kDeq0B = f16vec4(0.29736328125hf, -0.2337646484375hf, 0.121826171875hf, -0.376953125hf); +const f16vec4 kDeq1B = f16vec4(1.20703125hf, 1.8583984375hf, 1.6904296875hf, 2.734375hf); +const f16vec4 kDeq2B = f16vec4(-0.44287109375hf, 0.0650634765625hf, 0.2000732421875hf, -0.0643310546875hf); + +#define CORR_TAP(ox, oy, sa, sb) { \ + f16vec4 c0 = f16vec4(textureLodOffset(srcNbr0, uv, 0.0, ivec2(ox, oy))); \ + f16vec4 c1 = f16vec4(textureLodOffset(srcNbr1, uv, 0.0, ivec2(ox, oy))); \ + f16vec4 c2 = f16vec4(textureLodOffset(srcNbr2, uv, 0.0, ivec2(ox, oy))); \ + f16vec4 c3 = f16vec4(textureLodOffset(srcNbr3, uv, 0.0, ivec2(ox, oy))); \ + sa = dot(a0, c0) + dot(a1, c1) + dot(a2, c2) + dot(a3, c3); \ + sb = dot(b0, c0) + dot(b1, c1) + dot(b2, c2) + dot(b3, c3); \ + } + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 lim = imageSize(dstHead0); + if (p.x >= lim.x || p.y >= lim.y) { + return; + } + vec2 uv = (vec2(p) + 0.5) / vec2(textureSize(srcRefA0, 0)); + + f16vec4 a0 = f16vec4(textureLod(srcRefA0, uv, 0.0)); + f16vec4 a1 = f16vec4(textureLod(srcRefA1, uv, 0.0)); + f16vec4 a2 = f16vec4(textureLod(srcRefA2, uv, 0.0)); + f16vec4 a3 = f16vec4(textureLod(srcRefA3, uv, 0.0)); + f16vec4 b0 = f16vec4(textureLod(srcRefB0, uv, 0.0)); + f16vec4 b1 = f16vec4(textureLod(srcRefB1, uv, 0.0)); + f16vec4 b2 = f16vec4(textureLod(srcRefB2, uv, 0.0)); + f16vec4 b3 = f16vec4(textureLod(srcRefB3, uv, 0.0)); + + float16_t sa0, sa1, sa2, sa3, sa4, sa5, sa6, sa7, sa8; + float16_t sb0, sb1, sb2, sb3, sb4, sb5, sb6, sb7, sb8; + CORR_TAP(-1, -1, sa0, sb0) + CORR_TAP( 0, -1, sa1, sb1) + CORR_TAP( 1, -1, sa2, sb2) + CORR_TAP(-1, 0, sa3, sb3) + { + f16vec4 c0 = f16vec4(textureLod(srcNbr0, uv, 0.0)); + f16vec4 c1 = f16vec4(textureLod(srcNbr1, uv, 0.0)); + f16vec4 c2 = f16vec4(textureLod(srcNbr2, uv, 0.0)); + f16vec4 c3 = f16vec4(textureLod(srcNbr3, uv, 0.0)); + sa4 = dot(a0, c0) + dot(a1, c1) + dot(a2, c2) + dot(a3, c3); + sb4 = dot(b0, c0) + dot(b1, c1) + dot(b2, c2) + dot(b3, c3); + } + CORR_TAP( 1, 0, sa5, sb5) + CORR_TAP(-1, 1, sa6, sb6) + CORR_TAP( 0, 1, sa7, sb7) + CORR_TAP( 1, 1, sa8, sb8) + + f16vec4 nA1 = clamp((f16vec4(sa0, sa1, sa2, sa3) - kZero1) * kScale1 + kOfs1, 0.0hf, 1.0hf); + f16vec4 nA2 = clamp((f16vec4(sa4, sa5, sa6, sa7) - kZero2) * kScale2 + kOfs2, 0.0hf, 1.0hf); + float16_t nA3 = clamp((sa8 - kZero3) * kScale3 + kOfs3, 0.0hf, 1.0hf); + f16vec4 nB1 = clamp((f16vec4(sb0, sb1, sb2, sb3) - kZero1) * kScale1 + kOfs1, 0.0hf, 1.0hf); + f16vec4 nB2 = clamp((f16vec4(sb4, sb5, sb6, sb7) - kZero2) * kScale2 + kOfs2, 0.0hf, 1.0hf); + float16_t nB3 = clamp((sb8 - kZero3) * kScale3 + kOfs3, 0.0hf, 1.0hf); + + f16vec4 h1 = ((((kP1 * nA1 + kP2 * nA2) + kQ1 * nA3) + kP3 * nB1) + kP4 * nB2) + kQ2 * nB3; + imageStore(dstHead0, p, vec4((h1 - kDeq0A) * kDeq1A + kDeq2A)); + + f16vec4 h2 = ((((kR1 * nA1 + kR2 * nA2) + kQ3 * nA3) + kR3 * nB1) + kR4 * nB2) + kQ4 * nB3; + imageStore(dstHead1, p, vec4((h2 - kDeq0B) * kDeq1B + kDeq2B)); +} diff --git a/cleanroom/glsl/shader_35.comp b/cleanroom/glsl/shader_35.comp new file mode 100644 index 0000000..d183529 --- /dev/null +++ b/cleanroom/glsl/shader_35.comp @@ -0,0 +1,211 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_35: 3x3 fp16 conv over two RGBA inputs, two affine-remapped RGBA8 outputs. +// Weights baked per member; columns of the 18 4x4 matrices, head A then head B. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcFeat0; +layout(set = 0, binding = 33) uniform sampler2D srcFeat1; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstFlow0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstFlow1; + +const f16vec4 kColsA[72] = f16vec4[72]( + f16vec4(-0.0308074951171875hf, 0.3134765625hf, 1.046875hf, -0.0265655517578125hf), + f16vec4(-0.1644287109375hf, -0.10498046875hf, -0.439697265625hf, 0.1456298828125hf), + f16vec4(0.1673583984375hf, 0.8955078125hf, 0.236083984375hf, -0.67529296875hf), + f16vec4(0.2431640625hf, 0.121337890625hf, 0.85498046875hf, 0.1988525390625hf), + f16vec4(-0.306640625hf, 0.426513671875hf, -0.25830078125hf, 0.1859130859375hf), + f16vec4(-0.396484375hf, -0.16796875hf, -0.03424072265625hf, 0.31201171875hf), + f16vec4(0.0310821533203125hf, -0.326416015625hf, 0.01284027099609375hf, -0.395263671875hf), + f16vec4(0.28759765625hf, 0.0215301513671875hf, -0.09466552734375hf, 0.31982421875hf), + f16vec4(-0.002254486083984375hf, 0.66015625hf, -0.404296875hf, 0.028778076171875hf), + f16vec4(-0.264892578125hf, -0.046295166015625hf, 0.09771728515625hf, 0.5126953125hf), + f16vec4(-0.2568359375hf, 0.28515625hf, -0.447021484375hf, -0.5078125hf), + f16vec4(0.1807861328125hf, 0.06195068359375hf, -0.373291015625hf, 0.0709228515625hf), + f16vec4(-0.2005615234375hf, 0.5078125hf, -0.1282958984375hf, 0.1544189453125hf), + f16vec4(-0.320068359375hf, 0.09527587890625hf, 0.05792236328125hf, 0.17822265625hf), + f16vec4(-0.01026153564453125hf, 0.853515625hf, -0.462890625hf, 0.34130859375hf), + f16vec4(0.3076171875hf, 0.391845703125hf, -0.04473876953125hf, 0.2259521484375hf), + f16vec4(-0.44384765625hf, -0.44970703125hf, 0.00237274169921875hf, -0.057830810546875hf), + f16vec4(-0.4677734375hf, -0.051605224609375hf, 0.01041412353515625hf, 0.303466796875hf), + f16vec4(0.03558349609375hf, -0.053863525390625hf, -0.22998046875hf, 0.300048828125hf), + f16vec4(0.328125hf, -0.306884765625hf, -0.0023784637451171875hf, 0.0670166015625hf), + f16vec4(-0.2939453125hf, 0.271728515625hf, 0.324951171875hf, 0.0207672119140625hf), + f16vec4(-0.2734375hf, 0.12237548828125hf, -0.037445068359375hf, 0.5966796875hf), + f16vec4(-0.07318115234375hf, 0.5322265625hf, 0.05401611328125hf, 0.01317596435546875hf), + f16vec4(0.194580078125hf, 0.254150390625hf, 0.2398681640625hf, 0.079833984375hf), + f16vec4(-0.23193359375hf, 0.2108154296875hf, 0.17529296875hf, 0.0211944580078125hf), + f16vec4(-0.293212890625hf, 0.24365234375hf, 0.2183837890625hf, 0.2010498046875hf), + f16vec4(0.104736328125hf, 0.7021484375hf, 0.470947265625hf, -0.18505859375hf), + f16vec4(0.6083984375hf, 0.1788330078125hf, -0.305908203125hf, 0.1328125hf), + f16vec4(-0.1904296875hf, 0.322998046875hf, 0.1981201171875hf, 0.27978515625hf), + f16vec4(-0.486328125hf, 0.18798828125hf, 0.0190277099609375hf, 0.359619140625hf), + f16vec4(0.1055908203125hf, 0.6435546875hf, 0.094482421875hf, 0.1663818359375hf), + f16vec4(0.283447265625hf, 0.37841796875hf, 0.1884765625hf, 0.103515625hf), + f16vec4(-0.2022705078125hf, 0.4716796875hf, 0.1829833984375hf, 0.333251953125hf), + f16vec4(-0.1331787109375hf, 0.310546875hf, -0.1357421875hf, 0.5087890625hf), + f16vec4(0.04864501953125hf, 0.73193359375hf, -0.380859375hf, -0.1663818359375hf), + f16vec4(0.345458984375hf, 0.41552734375hf, 0.31591796875hf, 0.1812744140625hf), + f16vec4(-0.371337890625hf, -0.11053466796875hf, -0.49951171875hf, -0.210693359375hf), + f16vec4(-0.135498046875hf, -0.134765625hf, 0.330322265625hf, -0.56005859375hf), + f16vec4(0.12054443359375hf, 0.1416015625hf, -1.3232421875hf, -0.456787109375hf), + f16vec4(0.0323486328125hf, -0.54296875hf, -0.355712890625hf, -0.392578125hf), + f16vec4(-0.3291015625hf, -0.05462646484375hf, 0.19677734375hf, -0.1070556640625hf), + f16vec4(-0.1937255859375hf, -0.1524658203125hf, -0.1036376953125hf, -0.212646484375hf), + f16vec4(-0.07611083984375hf, 0.0947265625hf, 0.2052001953125hf, -0.662109375hf), + f16vec4(-0.016265869140625hf, -0.1600341796875hf, -0.6298828125hf, -0.40478515625hf), + f16vec4(-0.2342529296875hf, -0.423583984375hf, -0.12469482421875hf, 0.0140838623046875hf), + f16vec4(-0.11834716796875hf, 0.074462890625hf, -0.2362060546875hf, -0.051239013671875hf), + f16vec4(-0.103271484375hf, -0.28955078125hf, 0.2418212890625hf, -0.327392578125hf), + f16vec4(0.0175933837890625hf, -0.11627197265625hf, -0.43994140625hf, -0.4755859375hf), + f16vec4(-0.414306640625hf, 0.0223541259765625hf, -0.01139068603515625hf, -0.1993408203125hf), + f16vec4(-0.386962890625hf, -0.27099609375hf, 0.0997314453125hf, -0.548828125hf), + f16vec4(-0.11639404296875hf, -0.041351318359375hf, 0.1885986328125hf, -0.57568359375hf), + f16vec4(0.1287841796875hf, -0.41552734375hf, -0.203857421875hf, -0.324462890625hf), + f16vec4(-0.35693359375hf, 0.09820556640625hf, -0.16748046875hf, 0.10125732421875hf), + f16vec4(-0.28173828125hf, -0.73291015625hf, -0.005207061767578125hf, -0.46875hf), + f16vec4(-0.156005859375hf, 0.450439453125hf, -0.038665771484375hf, -0.455322265625hf), + f16vec4(0.01824951171875hf, -0.09674072265625hf, -0.064453125hf, -0.261474609375hf), + f16vec4(-0.236572265625hf, -0.312255859375hf, -0.63623046875hf, -0.0506591796875hf), + f16vec4(-0.302490234375hf, -0.7373046875hf, -0.355712890625hf, -0.28564453125hf), + f16vec4(-0.10638427734375hf, -0.32763671875hf, -0.556640625hf, -0.455322265625hf), + f16vec4(-0.022735595703125hf, -0.0256805419921875hf, -0.336181640625hf, -0.2386474609375hf), + f16vec4(-0.272705078125hf, 0.20654296875hf, 0.2218017578125hf, -0.150390625hf), + f16vec4(-0.50048828125hf, 0.0443115234375hf, 0.040252685546875hf, -0.158447265625hf), + f16vec4(-0.1993408203125hf, 0.197998046875hf, 0.5927734375hf, -0.34326171875hf), + f16vec4(0.364501953125hf, -0.320556640625hf, -0.257568359375hf, -0.340576171875hf), + f16vec4(-0.1253662109375hf, 0.2548828125hf, -0.0928955078125hf, 0.008544921875hf), + f16vec4(-0.334228515625hf, -0.2010498046875hf, -0.19775390625hf, -0.1937255859375hf), + f16vec4(-0.10791015625hf, -0.10833740234375hf, -0.43017578125hf, -0.599609375hf), + f16vec4(0.1424560546875hf, 0.0002961158752441406hf, -0.12042236328125hf, -0.2366943359375hf), + f16vec4(0.031707763671875hf, -0.07183837890625hf, -0.70263671875hf, -0.351318359375hf), + f16vec4(-0.421630859375hf, -0.159912109375hf, 0.0460205078125hf, -0.2366943359375hf), + f16vec4(0.0123138427734375hf, -0.4140625hf, -0.609375hf, -0.70458984375hf), + f16vec4(0.25634765625hf, -0.08355712890625hf, 0.07635498046875hf, -0.2005615234375hf) +); +const f16vec4 kMuA = f16vec4(-0.4873046875hf, 2.787109375hf, -0.5966796875hf, -1.41796875hf); +const f16vec4 kSigmaA = f16vec4(0.53515625hf, 0.61474609375hf, 0.7158203125hf, 0.70166015625hf); +const f16vec4 kBetaA = f16vec4(0.006866455078125hf, 0.01308441162109375hf, -0.00901031494140625hf, 0.14208984375hf); + +const f16vec4 kColsB[72] = f16vec4[72]( + f16vec4(-0.220703125hf, 0.57177734375hf, -0.3681640625hf, 0.0709228515625hf), + f16vec4(-0.81005859375hf, -0.1534423828125hf, 0.499755859375hf, 0.36181640625hf), + f16vec4(-0.26171875hf, -0.094482421875hf, -0.416015625hf, 0.42236328125hf), + f16vec4(-0.056427001953125hf, 0.66015625hf, 0.179931640625hf, 0.003551483154296875hf), + f16vec4(-0.08636474609375hf, 0.1453857421875hf, 0.204345703125hf, 0.2626953125hf), + f16vec4(-0.55615234375hf, 0.005832672119140625hf, 0.235595703125hf, -0.2379150390625hf), + f16vec4(0.020599365234375hf, 0.1787109375hf, -0.5732421875hf, 0.440185546875hf), + f16vec4(0.1441650390625hf, 0.28466796875hf, 0.52294921875hf, 0.2159423828125hf), + f16vec4(-0.006656646728515625hf, 0.43505859375hf, 0.313720703125hf, 0.23291015625hf), + f16vec4(0.006305694580078125hf, 0.1949462890625hf, 0.0980224609375hf, -0.61767578125hf), + f16vec4(-0.492431640625hf, -0.1473388671875hf, -0.440673828125hf, 0.381103515625hf), + f16vec4(0.044647216796875hf, 0.376953125hf, 0.603515625hf, 0.2054443359375hf), + f16vec4(-0.047088623046875hf, 0.1754150390625hf, 0.1353759765625hf, 0.22705078125hf), + f16vec4(-0.5224609375hf, 0.14501953125hf, 0.11407470703125hf, -0.09442138671875hf), + f16vec4(0.039947509765625hf, 0.07135009765625hf, -0.427978515625hf, 0.19677734375hf), + f16vec4(-0.01274871826171875hf, 0.236083984375hf, -0.482666015625hf, 0.368408203125hf), + f16vec4(0.1209716796875hf, -0.155029296875hf, 0.74365234375hf, 0.2144775390625hf), + f16vec4(-0.296142578125hf, 0.043365478515625hf, 0.1336669921875hf, -0.430419921875hf), + f16vec4(0.339599609375hf, 0.03692626953125hf, -0.7978515625hf, 0.140869140625hf), + f16vec4(0.2283935546875hf, -0.47998046875hf, -0.54248046875hf, 0.2578125hf), + f16vec4(0.10205078125hf, 0.048980712890625hf, 0.066650390625hf, 0.188720703125hf), + f16vec4(0.254150390625hf, 0.1087646484375hf, 0.20947265625hf, -0.419677734375hf), + f16vec4(-0.1319580078125hf, 0.00722503662109375hf, -0.444580078125hf, 0.06549072265625hf), + f16vec4(0.139892578125hf, -0.258056640625hf, 0.419189453125hf, 0.16650390625hf), + f16vec4(-0.172607421875hf, 0.5234375hf, 0.2276611328125hf, 0.048858642578125hf), + f16vec4(-0.70654296875hf, 0.0897216796875hf, 0.055084228515625hf, -0.2919921875hf), + f16vec4(0.1053466796875hf, 0.04266357421875hf, -0.0628662109375hf, 0.2861328125hf), + f16vec4(-0.09130859375hf, 0.38525390625hf, 0.1300048828125hf, 0.5068359375hf), + f16vec4(-0.044189453125hf, 0.05706787109375hf, -0.0172271728515625hf, 0.10589599609375hf), + f16vec4(-0.330322265625hf, 0.122802734375hf, -0.060699462890625hf, -0.53271484375hf), + f16vec4(0.2294921875hf, -0.03961181640625hf, -0.0080718994140625hf, 0.456787109375hf), + f16vec4(0.1163330078125hf, -0.0295562744140625hf, 0.318359375hf, 0.4140625hf), + f16vec4(-0.0194854736328125hf, 0.2000732421875hf, 0.06854248046875hf, 0.681640625hf), + f16vec4(0.1683349609375hf, 0.53955078125hf, 0.168212890625hf, -0.290771484375hf), + f16vec4(-0.2783203125hf, -0.060302734375hf, -0.2274169921875hf, 0.08673095703125hf), + f16vec4(0.0005078315734863281hf, 0.0682373046875hf, 0.154052734375hf, -0.5595703125hf), + f16vec4(-0.6181640625hf, -0.2177734375hf, -0.1622314453125hf, 0.52099609375hf), + f16vec4(-0.07366943359375hf, -0.006687164306640625hf, 0.2529296875hf, 0.367431640625hf), + f16vec4(-0.255126953125hf, -0.369873046875hf, 0.345947265625hf, 0.401611328125hf), + f16vec4(-0.031341552734375hf, 0.296630859375hf, -0.1527099609375hf, -0.1981201171875hf), + f16vec4(-0.439208984375hf, -0.10040283203125hf, -0.187744140625hf, 0.2467041015625hf), + f16vec4(0.038848876953125hf, 0.1751708984375hf, 0.4228515625hf, 0.2763671875hf), + f16vec4(-0.4287109375hf, -0.0200042724609375hf, -0.410888671875hf, -0.0172576904296875hf), + f16vec4(-0.29345703125hf, -0.2340087890625hf, -0.03662109375hf, 0.037353515625hf), + f16vec4(-0.564453125hf, 0.13525390625hf, 0.039398193359375hf, -0.06146240234375hf), + f16vec4(-0.6181640625hf, -0.288818359375hf, 0.50634765625hf, 0.2095947265625hf), + f16vec4(-0.2587890625hf, -0.037017822265625hf, -0.38671875hf, -0.155029296875hf), + f16vec4(-0.18408203125hf, 0.41162109375hf, 0.188232421875hf, -0.02313232421875hf), + f16vec4(-0.6162109375hf, 0.1739501953125hf, -0.285400390625hf, 0.452392578125hf), + f16vec4(-0.1129150390625hf, -0.0904541015625hf, -0.0135498046875hf, 0.251220703125hf), + f16vec4(-0.42431640625hf, -0.1514892578125hf, 0.267822265625hf, -0.0237884521484375hf), + f16vec4(-0.2049560546875hf, -0.1324462890625hf, -0.1844482421875hf, 0.2362060546875hf), + f16vec4(-0.55517578125hf, 0.10235595703125hf, -0.146728515625hf, 0.1051025390625hf), + f16vec4(0.07855224609375hf, 0.1737060546875hf, 0.03424072265625hf, 0.299072265625hf), + f16vec4(-0.68505859375hf, 0.299560546875hf, -0.42822265625hf, -0.233642578125hf), + f16vec4(-0.423828125hf, -1.0546875hf, 0.00934600830078125hf, 0.2384033203125hf), + f16vec4(-0.82080078125hf, 0.599609375hf, 0.0482177734375hf, -0.114501953125hf), + f16vec4(-0.50732421875hf, 0.0517578125hf, 0.07415771484375hf, 0.2249755859375hf), + f16vec4(-0.455810546875hf, 0.37255859375hf, -0.425048828125hf, -0.130859375hf), + f16vec4(-0.289794921875hf, -0.59619140625hf, 0.37109375hf, 0.10516357421875hf), + f16vec4(-0.4091796875hf, 0.697265625hf, -0.4931640625hf, 0.404541015625hf), + f16vec4(-0.416015625hf, -0.492431640625hf, 0.0660400390625hf, 0.279541015625hf), + f16vec4(-0.21044921875hf, -0.1427001953125hf, -0.2117919921875hf, 0.058746337890625hf), + f16vec4(-0.210205078125hf, 0.33447265625hf, -0.11773681640625hf, 0.083740234375hf), + f16vec4(-0.455078125hf, 0.492431640625hf, -0.268310546875hf, 0.208740234375hf), + f16vec4(-0.181640625hf, 0.169921875hf, -0.0380859375hf, 0.271728515625hf), + f16vec4(-0.434326171875hf, 0.278564453125hf, -0.340087890625hf, 0.0003509521484375hf), + f16vec4(-0.41259765625hf, -0.7939453125hf, 0.12396240234375hf, 0.1641845703125hf), + f16vec4(-0.9658203125hf, 1.0869140625hf, 0.055572509765625hf, 0.134033203125hf), + f16vec4(-0.73974609375hf, 0.0595703125hf, 0.125hf, 0.26416015625hf), + f16vec4(-0.35400390625hf, 0.62841796875hf, -0.144287109375hf, 0.1451416015625hf), + f16vec4(-0.302001953125hf, -0.7021484375hf, 0.2198486328125hf, -0.1793212890625hf) +); +const f16vec4 kMuB = f16vec4(-2.615234375hf, 1.2119140625hf, -0.13720703125hf, 2.935546875hf); +const f16vec4 kSigmaB = f16vec4(0.68212890625hf, 0.5263671875hf, 0.5625hf, 0.755859375hf); +const f16vec4 kBetaB = f16vec4(0.1959228515625hf, -0.496826171875hf, 0.28515625hf, 0.1214599609375hf); + +f16vec4 borderTap(sampler2D s, ivec2 q) { + if (all(greaterThanEqual(q, ivec2(0))) && all(lessThan(q, textureSize(s, 0)))) { + return f16vec4(texelFetch(s, q, 0)); + } + return f16vec4(0.0hf); +} + +f16vec4 runHead(const f16vec4 cols[72], f16vec4 mu, f16vec4 sigma, f16vec4 beta, + const f16vec4 taps[18]) { + f16vec4 acc = cols[0] * taps[0].x + cols[1] * taps[0].y + + cols[2] * taps[0].z + cols[3] * taps[0].w; + for (int k = 1; k < 18; ++k) { + int b = 4 * k; + acc += cols[b] * taps[k].x + cols[b + 1] * taps[k].y + + cols[b + 2] * taps[k].z + cols[b + 3] * taps[k].w; + } + return (acc - mu) * sigma + beta; +} + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 outSize = imageSize(dstFlow0); + if (p.x >= outSize.x || p.y >= outSize.y) { + return; + } + + f16vec4 taps[18]; + for (int t = 0; t < 9; ++t) { + if (t == 4) { + // center tap is deliberately unguarded (inputs assumed >= output size) + taps[4] = f16vec4(texelFetch(srcFeat0, p, 0)); + taps[13] = f16vec4(texelFetch(srcFeat1, p, 0)); + } else { + ivec2 q = p + ivec2(t / 3 - 1, t % 3 - 1); + taps[t] = borderTap(srcFeat0, q); + taps[t + 9] = borderTap(srcFeat1, q); + } + } + + imageStore(dstFlow0, p, vec4(runHead(kColsA, kMuA, kSigmaA, kBetaA, taps))); + imageStore(dstFlow1, p, vec4(runHead(kColsB, kMuB, kSigmaB, kBetaB, taps))); +} diff --git a/cleanroom/glsl/shader_36.comp b/cleanroom/glsl/shader_36.comp new file mode 100644 index 0000000..acd1bf4 --- /dev/null +++ b/cleanroom/glsl/shader_36.comp @@ -0,0 +1,211 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_36: 3x3 fp16 conv over two RGBA inputs, two affine-remapped RGBA8 outputs. +// Weights baked per member; columns of the 18 4x4 matrices, head A then head B. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcFeat0; +layout(set = 0, binding = 33) uniform sampler2D srcFeat1; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstFlow0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstFlow1; + +const f16vec4 kColsA[72] = f16vec4[72]( + f16vec4(-0.36181640625hf, 0.227783203125hf, 0.096435546875hf, -0.2381591796875hf), + f16vec4(-0.4423828125hf, -0.26806640625hf, -0.073974609375hf, -0.102294921875hf), + f16vec4(0.314697265625hf, 0.3857421875hf, 0.15185546875hf, -0.04046630859375hf), + f16vec4(-0.253662109375hf, 0.29150390625hf, -0.1888427734375hf, -0.0096893310546875hf), + f16vec4(-0.053680419921875hf, 0.2054443359375hf, 0.01476287841796875hf, -0.4443359375hf), + f16vec4(-0.2587890625hf, -0.32666015625hf, -0.0631103515625hf, -0.00974273681640625hf), + f16vec4(-0.302490234375hf, -0.30859375hf, 0.10931396484375hf, -0.0980224609375hf), + f16vec4(-0.3720703125hf, -0.12451171875hf, -0.1748046875hf, 0.14111328125hf), + f16vec4(0.525390625hf, 0.289794921875hf, 4.202127456665039e-05hf, -0.04736328125hf), + f16vec4(0.2393798828125hf, -0.452880859375hf, -0.005626678466796875hf, 0.1015625hf), + f16vec4(-0.355712890625hf, -0.892578125hf, 0.071044921875hf, 0.1744384765625hf), + f16vec4(-0.2646484375hf, -0.56005859375hf, -0.0197296142578125hf, 0.169921875hf), + f16vec4(-0.495361328125hf, 0.138916015625hf, 0.10260009765625hf, -0.4775390625hf), + f16vec4(-0.260498046875hf, -0.445556640625hf, -0.1431884765625hf, 0.077392578125hf), + f16vec4(0.39990234375hf, -0.0811767578125hf, 0.147216796875hf, -0.09442138671875hf), + f16vec4(-0.1649169921875hf, -0.0697021484375hf, -0.36328125hf, 0.07720947265625hf), + f16vec4(-0.2001953125hf, 0.166748046875hf, 0.062225341796875hf, -0.548828125hf), + f16vec4(-0.1444091796875hf, -0.420654296875hf, -0.13330078125hf, 0.265869140625hf), + f16vec4(-0.2392578125hf, -0.49169921875hf, 0.09051513671875hf, 0.218505859375hf), + f16vec4(-0.095458984375hf, -0.29345703125hf, -0.233154296875hf, 0.42822265625hf), + f16vec4(0.350830078125hf, 0.208984375hf, 0.05389404296875hf, -0.199951171875hf), + f16vec4(0.422119140625hf, -0.298583984375hf, 0.021820068359375hf, 0.26708984375hf), + f16vec4(-0.2091064453125hf, -0.5810546875hf, 0.019775390625hf, 0.39013671875hf), + f16vec4(-0.1461181640625hf, -0.340576171875hf, 0.0012655258178710938hf, 0.401123046875hf), + f16vec4(-0.3232421875hf, 0.2568359375hf, 0.1295166015625hf, -0.167236328125hf), + f16vec4(-0.035858154296875hf, -0.60400390625hf, -0.03924560546875hf, 0.0718994140625hf), + f16vec4(0.0080108642578125hf, -0.77099609375hf, 0.1728515625hf, -0.0289764404296875hf), + f16vec4(-0.286865234375hf, -0.283203125hf, -0.268310546875hf, 0.0509033203125hf), + f16vec4(-0.2315673828125hf, 0.179931640625hf, 0.09320068359375hf, -0.253662109375hf), + f16vec4(-0.01306915283203125hf, -0.57861328125hf, 0.06329345703125hf, 0.131103515625hf), + f16vec4(-0.1962890625hf, -0.67041015625hf, 0.11993408203125hf, 0.07281494140625hf), + f16vec4(-0.10357666015625hf, -0.49560546875hf, -0.062408447265625hf, 0.34765625hf), + f16vec4(0.225830078125hf, 0.247314453125hf, 0.0863037109375hf, -0.1395263671875hf), + f16vec4(0.26806640625hf, -0.432861328125hf, 0.145263671875hf, 0.15478515625hf), + f16vec4(0.1688232421875hf, -0.172119140625hf, 0.09942626953125hf, 0.0498046875hf), + f16vec4(-0.1368408203125hf, -0.33837890625hf, 0.168212890625hf, 0.343017578125hf), + f16vec4(0.1539306640625hf, 0.13037109375hf, 0.05926513671875hf, -0.2354736328125hf), + f16vec4(0.5830078125hf, 0.80224609375hf, -0.0411376953125hf, 0.74853515625hf), + f16vec4(-0.361083984375hf, -0.308837890625hf, 0.1441650390625hf, -0.378662109375hf), + f16vec4(-0.26025390625hf, 0.10931396484375hf, 0.1431884765625hf, -0.217529296875hf), + f16vec4(0.405029296875hf, 0.0872802734375hf, -0.1220703125hf, -0.29931640625hf), + f16vec4(0.438232421875hf, 0.364501953125hf, -0.01526641845703125hf, 0.2374267578125hf), + f16vec4(0.035552978515625hf, -0.316162109375hf, -0.044708251953125hf, -0.37744140625hf), + f16vec4(-0.1494140625hf, 0.251708984375hf, 0.213623046875hf, -0.60205078125hf), + f16vec4(0.64306640625hf, 0.1890869140625hf, -0.153076171875hf, -0.1856689453125hf), + f16vec4(0.28662109375hf, 0.3984375hf, -0.2044677734375hf, 0.094482421875hf), + f16vec4(0.798828125hf, -0.448486328125hf, 0.06494140625hf, -0.1343994140625hf), + f16vec4(0.10577392578125hf, 0.07696533203125hf, 0.220947265625hf, 0.08843994140625hf), + f16vec4(-0.326904296875hf, 0.078369140625hf, -0.01039886474609375hf, -0.427978515625hf), + f16vec4(0.21484375hf, 0.53564453125hf, 0.0005259513854980469hf, 0.379150390625hf), + f16vec4(-0.2457275390625hf, -0.31689453125hf, 0.03497314453125hf, -0.2359619140625hf), + f16vec4(-0.0004429817199707031hf, 0.34765625hf, 0.1566162109375hf, -0.544921875hf), + f16vec4(-0.211669921875hf, 0.0189971923828125hf, -0.08978271484375hf, -0.4755859375hf), + f16vec4(0.2244873046875hf, 0.232421875hf, -0.033966064453125hf, 0.04473876953125hf), + f16vec4(-0.0247039794921875hf, -0.219970703125hf, 0.005390167236328125hf, -0.0863037109375hf), + f16vec4(0.0301361083984375hf, 0.45751953125hf, 0.271484375hf, -1.0078125hf), + f16vec4(0.0290985107421875hf, 0.07470703125hf, -0.1424560546875hf, -0.380859375hf), + f16vec4(0.478515625hf, 0.26123046875hf, -0.240966796875hf, -0.059112548828125hf), + f16vec4(0.34765625hf, -0.386474609375hf, 0.1248779296875hf, 0.1202392578125hf), + f16vec4(0.01065826416015625hf, 0.1575927734375hf, 0.294677734375hf, -0.03173828125hf), + f16vec4(-0.4306640625hf, 0.12744140625hf, 0.0258636474609375hf, -0.260009765625hf), + f16vec4(0.339599609375hf, 0.67041015625hf, -0.00478363037109375hf, 0.1326904296875hf), + f16vec4(-0.218994140625hf, -0.320556640625hf, 0.00719451904296875hf, -0.14697265625hf), + f16vec4(0.11749267578125hf, 0.32275390625hf, 0.141357421875hf, -0.167236328125hf), + f16vec4(-0.486083984375hf, 0.028839111328125hf, -0.01183319091796875hf, -0.374755859375hf), + f16vec4(0.303466796875hf, 0.580078125hf, -0.039398193359375hf, 0.00957489013671875hf), + f16vec4(-0.00411224365234375hf, -0.25341796875hf, 0.00568389892578125hf, 0.0372314453125hf), + f16vec4(0.0987548828125hf, 0.2578125hf, 0.26171875hf, -0.461669921875hf), + f16vec4(-0.35302734375hf, 0.0771484375hf, -0.087158203125hf, -0.250244140625hf), + f16vec4(0.6806640625hf, 0.391845703125hf, -0.27734375hf, -0.227783203125hf), + f16vec4(0.213134765625hf, -0.337158203125hf, 0.0888671875hf, 0.1632080078125hf), + f16vec4(0.0178375244140625hf, -0.056640625hf, 0.297119140625hf, 0.268310546875hf) +); +const f16vec4 kMuA = f16vec4(-0.7626953125hf, -1.9921875hf, 0.66162109375hf, -2.158203125hf); +const f16vec4 kSigmaA = f16vec4(0.46875hf, 0.3095703125hf, 0.1951904296875hf, 0.340087890625hf); +const f16vec4 kBetaA = f16vec4(-0.40234375hf, -0.32275390625hf, -0.595703125hf, -0.1331787109375hf); + +const f16vec4 kColsB[72] = f16vec4[72]( + f16vec4(0.400146484375hf, -0.029510498046875hf, -0.16064453125hf, 0.32958984375hf), + f16vec4(-0.16015625hf, -0.09033203125hf, 0.60205078125hf, -0.5625hf), + f16vec4(0.053955078125hf, 0.08917236328125hf, 0.51953125hf, -0.02374267578125hf), + f16vec4(0.09661865234375hf, 0.3212890625hf, 0.56787109375hf, -0.15966796875hf), + f16vec4(0.281982421875hf, 0.005039215087890625hf, -0.1024169921875hf, 0.1473388671875hf), + f16vec4(-0.09661865234375hf, -0.1605224609375hf, 0.1500244140625hf, -0.400634765625hf), + f16vec4(-0.15478515625hf, -0.019378662109375hf, 0.318603515625hf, -0.0665283203125hf), + f16vec4(-0.0267333984375hf, -0.1373291015625hf, 0.53173828125hf, -0.1656494140625hf), + f16vec4(0.41845703125hf, 0.05706787109375hf, -0.264892578125hf, 0.1363525390625hf), + f16vec4(0.08880615234375hf, -0.1298828125hf, -0.023590087890625hf, -0.1904296875hf), + f16vec4(0.001953125hf, -0.379150390625hf, -0.2386474609375hf, -0.04730224609375hf), + f16vec4(0.12890625hf, -0.494140625hf, 0.1087646484375hf, -0.2138671875hf), + f16vec4(0.37451171875hf, 0.0360107421875hf, -0.1739501953125hf, 0.1947021484375hf), + f16vec4(-0.117431640625hf, -0.16796875hf, 0.3671875hf, -0.445556640625hf), + f16vec4(-0.1278076171875hf, -0.0096435546875hf, 0.29345703125hf, -0.07415771484375hf), + f16vec4(0.1094970703125hf, 0.1409912109375hf, 0.333740234375hf, -0.183837890625hf), + f16vec4(0.2044677734375hf, 0.1318359375hf, -0.2462158203125hf, 0.0313720703125hf), + f16vec4(-0.07415771484375hf, -0.09307861328125hf, 0.10784912109375hf, -0.1925048828125hf), + f16vec4(-0.3212890625hf, -0.197998046875hf, -0.08416748046875hf, -0.2066650390625hf), + f16vec4(-0.0736083984375hf, -0.04010009765625hf, 0.347412109375hf, -0.060546875hf), + f16vec4(0.34033203125hf, 0.10247802734375hf, -0.537109375hf, 0.016082763671875hf), + f16vec4(0.10321044921875hf, -0.06829833984375hf, 0.03692626953125hf, -0.140625hf), + f16vec4(-0.123046875hf, -0.12890625hf, -0.050567626953125hf, -0.1846923828125hf), + f16vec4(0.06915283203125hf, -0.2349853515625hf, -0.01806640625hf, -0.17919921875hf), + f16vec4(0.5537109375hf, 0.1575927734375hf, -0.1715087890625hf, 0.30029296875hf), + f16vec4(0.170654296875hf, -0.25390625hf, 0.006580352783203125hf, -0.423828125hf), + f16vec4(-0.01422882080078125hf, -0.53759765625hf, 0.049560546875hf, -0.45068359375hf), + f16vec4(0.123291015625hf, -0.043853759765625hf, -0.02679443359375hf, -0.153564453125hf), + f16vec4(0.3984375hf, 0.11041259765625hf, -0.453125hf, 0.0771484375hf), + f16vec4(0.176025390625hf, -0.1829833984375hf, -0.150390625hf, -0.2412109375hf), + f16vec4(-0.2156982421875hf, -0.36376953125hf, -0.175537109375hf, -0.1802978515625hf), + f16vec4(0.04315185546875hf, -0.298095703125hf, 0.03131103515625hf, -0.1348876953125hf), + f16vec4(0.43798828125hf, 0.1243896484375hf, -0.85693359375hf, 0.0831298828125hf), + f16vec4(0.321044921875hf, -0.08966064453125hf, -0.3662109375hf, -0.34765625hf), + f16vec4(-0.051849365234375hf, -0.01056671142578125hf, -0.267822265625hf, -0.21435546875hf), + f16vec4(0.1468505859375hf, -0.373779296875hf, -0.2486572265625hf, -0.2578125hf), + f16vec4(0.5703125hf, 0.39794921875hf, 0.1878662109375hf, 0.490966796875hf), + f16vec4(0.425048828125hf, 0.8544921875hf, -0.384521484375hf, 0.869140625hf), + f16vec4(0.1324462890625hf, -0.267822265625hf, 0.433837890625hf, -0.046112060546875hf), + f16vec4(0.11700439453125hf, -0.5849609375hf, -0.2025146484375hf, 0.0382080078125hf), + f16vec4(0.64794921875hf, 0.1832275390625hf, 0.1552734375hf, 0.401123046875hf), + f16vec4(0.12322998046875hf, 0.427490234375hf, 0.195068359375hf, 0.4150390625hf), + f16vec4(0.10882568359375hf, -0.415283203125hf, 0.181396484375hf, -0.077880859375hf), + f16vec4(-0.09625244140625hf, -0.2349853515625hf, 0.03167724609375hf, -0.349609375hf), + f16vec4(0.6279296875hf, 0.401611328125hf, -0.07696533203125hf, 0.348876953125hf), + f16vec4(-0.1898193359375hf, 0.4990234375hf, 0.11572265625hf, 0.0748291015625hf), + f16vec4(0.454345703125hf, -0.368896484375hf, -0.36572265625hf, -0.00978851318359375hf), + f16vec4(0.07647705078125hf, -0.1019287109375hf, -0.04754638671875hf, -0.2266845703125hf), + f16vec4(0.63720703125hf, 0.3671875hf, 0.0260009765625hf, 0.376708984375hf), + f16vec4(0.283203125hf, 0.68798828125hf, 0.004474639892578125hf, 0.54541015625hf), + f16vec4(-0.048614501953125hf, -0.087890625hf, 0.347900390625hf, -0.274658203125hf), + f16vec4(0.06719970703125hf, -0.295654296875hf, -0.169677734375hf, -0.283203125hf), + f16vec4(0.6396484375hf, 0.2022705078125hf, 0.01284027099609375hf, 0.33349609375hf), + f16vec4(0.11199951171875hf, 0.33642578125hf, 0.4765625hf, 0.09967041015625hf), + f16vec4(-0.088134765625hf, -0.0141143798828125hf, 0.2139892578125hf, -0.353271484375hf), + f16vec4(-0.1302490234375hf, 0.060302734375hf, 0.05889892578125hf, -0.56201171875hf), + f16vec4(0.56298828125hf, 0.3974609375hf, -0.369140625hf, 0.258056640625hf), + f16vec4(0.0269012451171875hf, 0.460205078125hf, 0.69140625hf, -0.0582275390625hf), + f16vec4(0.2430419921875hf, -0.1517333984375hf, -0.33740234375hf, -0.26513671875hf), + f16vec4(-0.0225830078125hf, 0.06402587890625hf, -0.06268310546875hf, -0.40673828125hf), + f16vec4(0.57470703125hf, 0.56103515625hf, -0.07098388671875hf, 0.46240234375hf), + f16vec4(0.1512451171875hf, 0.54833984375hf, 0.332275390625hf, 0.313720703125hf), + f16vec4(-0.009552001953125hf, -0.052093505859375hf, 0.08929443359375hf, -0.053009033203125hf), + f16vec4(0.25732421875hf, -0.0347900390625hf, -0.213134765625hf, -0.08404541015625hf), + f16vec4(0.52880859375hf, 0.35498046875hf, -0.2337646484375hf, 0.320556640625hf), + f16vec4(0.03717041015625hf, 0.436279296875hf, 1.16015625hf, -0.041259765625hf), + f16vec4(-0.06365966796875hf, -0.13671875hf, -0.0908203125hf, -0.3828125hf), + f16vec4(0.04913330078125hf, 0.00927734375hf, -0.20068359375hf, -0.4697265625hf), + f16vec4(0.38525390625hf, 0.59521484375hf, -0.7490234375hf, 0.257568359375hf), + f16vec4(0.056243896484375hf, 0.73681640625hf, 1.390625hf, -0.095703125hf), + f16vec4(0.265380859375hf, -0.27001953125hf, -0.57177734375hf, -0.27099609375hf), + f16vec4(0.1634521484375hf, -0.017242431640625hf, -0.3837890625hf, -0.343994140625hf) +); +const f16vec4 kMuB = f16vec4(3.62109375hf, -0.384033203125hf, -0.74072265625hf, -1.4716796875hf); +const f16vec4 kSigmaB = f16vec4(0.390625hf, 0.347900390625hf, 0.59716796875hf, 0.640625hf); +const f16vec4 kBetaB = f16vec4(-0.016998291015625hf, -0.5546875hf, -0.058746337890625hf, 0.2216796875hf); + +f16vec4 borderTap(sampler2D s, ivec2 q) { + if (all(greaterThanEqual(q, ivec2(0))) && all(lessThan(q, textureSize(s, 0)))) { + return f16vec4(texelFetch(s, q, 0)); + } + return f16vec4(0.0hf); +} + +f16vec4 runHead(const f16vec4 cols[72], f16vec4 mu, f16vec4 sigma, f16vec4 beta, + const f16vec4 taps[18]) { + f16vec4 acc = cols[0] * taps[0].x + cols[1] * taps[0].y + + cols[2] * taps[0].z + cols[3] * taps[0].w; + for (int k = 1; k < 18; ++k) { + int b = 4 * k; + acc += cols[b] * taps[k].x + cols[b + 1] * taps[k].y + + cols[b + 2] * taps[k].z + cols[b + 3] * taps[k].w; + } + return (acc - mu) * sigma + beta; +} + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 outSize = imageSize(dstFlow0); + if (p.x >= outSize.x || p.y >= outSize.y) { + return; + } + + f16vec4 taps[18]; + for (int t = 0; t < 9; ++t) { + if (t == 4) { + // center tap is deliberately unguarded (inputs assumed >= output size) + taps[4] = f16vec4(texelFetch(srcFeat0, p, 0)); + taps[13] = f16vec4(texelFetch(srcFeat1, p, 0)); + } else { + ivec2 q = p + ivec2(t / 3 - 1, t % 3 - 1); + taps[t] = borderTap(srcFeat0, q); + taps[t + 9] = borderTap(srcFeat1, q); + } + } + + imageStore(dstFlow0, p, vec4(runHead(kColsA, kMuA, kSigmaA, kBetaA, taps))); + imageStore(dstFlow1, p, vec4(runHead(kColsB, kMuB, kSigmaB, kBetaB, taps))); +} diff --git a/cleanroom/glsl/shader_37.comp b/cleanroom/glsl/shader_37.comp new file mode 100644 index 0000000..0dec6f9 --- /dev/null +++ b/cleanroom/glsl/shader_37.comp @@ -0,0 +1,211 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_37: 3x3 fp16 conv over two RGBA inputs, two affine-remapped RGBA8 outputs. +// Weights baked per member; columns of the 18 4x4 matrices, head A then head B. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcFeat0; +layout(set = 0, binding = 33) uniform sampler2D srcFeat1; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstFlow0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstFlow1; + +const f16vec4 kColsA[72] = f16vec4[72]( + f16vec4(0.031768798828125hf, 0.29931640625hf, 0.370361328125hf, 0.34521484375hf), + f16vec4(0.218994140625hf, 0.2227783203125hf, 0.1922607421875hf, 0.225830078125hf), + f16vec4(-0.04351806640625hf, -0.0765380859375hf, -0.10198974609375hf, -0.039337158203125hf), + f16vec4(0.3349609375hf, 0.378173828125hf, 0.09588623046875hf, 0.227294921875hf), + f16vec4(-0.09423828125hf, 0.132568359375hf, 0.362548828125hf, 0.314697265625hf), + f16vec4(0.120361328125hf, 0.343505859375hf, 0.338134765625hf, 0.0340576171875hf), + f16vec4(0.034912109375hf, 0.0152587890625hf, 0.00994873046875hf, 0.053009033203125hf), + f16vec4(0.26953125hf, 0.322265625hf, 0.263671875hf, 0.205322265625hf), + f16vec4(0.361572265625hf, 0.52001953125hf, 0.71435546875hf, 0.7900390625hf), + f16vec4(-0.01293182373046875hf, 0.034027099609375hf, -0.184814453125hf, -0.21044921875hf), + f16vec4(0.025726318359375hf, -0.01100921630859375hf, 0.00807952880859375hf, 0.0645751953125hf), + f16vec4(-0.009674072265625hf, -0.053863525390625hf, -0.0758056640625hf, 0.08001708984375hf), + f16vec4(-0.1490478515625hf, 0.2294921875hf, 0.432373046875hf, 0.21435546875hf), + f16vec4(0.332275390625hf, 0.34619140625hf, 0.352294921875hf, 0.361572265625hf), + f16vec4(-0.025909423828125hf, -0.0240325927734375hf, -0.0296478271484375hf, 0.0428466796875hf), + f16vec4(0.259765625hf, 0.4267578125hf, 0.343017578125hf, 0.06201171875hf), + f16vec4(-0.38427734375hf, -0.1480712890625hf, 0.1036376953125hf, 0.07696533203125hf), + f16vec4(0.2274169921875hf, 0.366455078125hf, 0.417236328125hf, 0.12457275390625hf), + f16vec4(-0.0102081298828125hf, -0.0116729736328125hf, -0.01715087890625hf, 0.10040283203125hf), + f16vec4(0.2442626953125hf, 0.266845703125hf, 0.232177734375hf, 0.099609375hf), + f16vec4(0.073974609375hf, 0.1383056640625hf, 0.35400390625hf, 0.47705078125hf), + f16vec4(0.186767578125hf, 0.125hf, -0.0299224853515625hf, -0.00571441650390625hf), + f16vec4(-0.0249786376953125hf, -0.0611572265625hf, -0.052001953125hf, 0.0494384765625hf), + f16vec4(0.045257568359375hf, -0.01461029052734375hf, -0.036285400390625hf, 0.1112060546875hf), + f16vec4(-0.1953125hf, 0.04547119140625hf, 0.352294921875hf, 0.250244140625hf), + f16vec4(0.32177734375hf, 0.09027099609375hf, 0.039794921875hf, 0.41845703125hf), + f16vec4(-0.04852294921875hf, -0.03399658203125hf, -0.046661376953125hf, 0.0277252197265625hf), + f16vec4(-0.05328369140625hf, -0.042877197265625hf, 0.077880859375hf, -0.087646484375hf), + f16vec4(-0.338134765625hf, -0.30517578125hf, -0.0009732246398925781hf, 0.1922607421875hf), + f16vec4(0.162109375hf, 0.169921875hf, 0.1842041015625hf, 0.2349853515625hf), + f16vec4(-0.045135498046875hf, -0.05096435546875hf, -0.048828125hf, 0.093994140625hf), + f16vec4(0.0916748046875hf, 0.0248565673828125hf, 0.102783203125hf, 0.185546875hf), + f16vec4(0.1734619140625hf, 0.0013303756713867188hf, 0.1810302734375hf, 0.71435546875hf), + f16vec4(0.162841796875hf, 0.051361083984375hf, -0.11297607421875hf, 0.1190185546875hf), + f16vec4(-0.07763671875hf, -0.1112060546875hf, -0.08380126953125hf, -0.01201629638671875hf), + f16vec4(-0.02850341796875hf, -0.060882568359375hf, 0.0758056640625hf, 0.289306640625hf), + f16vec4(-0.11419677734375hf, -0.224609375hf, -0.294921875hf, -0.01526641845703125hf), + f16vec4(0.8046875hf, 0.83154296875hf, 0.84716796875hf, 0.2861328125hf), + f16vec4(0.0144805908203125hf, 0.1024169921875hf, 0.1510009765625hf, -0.10986328125hf), + f16vec4(0.430908203125hf, 0.30517578125hf, 0.1243896484375hf, 0.1986083984375hf), + f16vec4(-0.0099334716796875hf, -0.0230560302734375hf, -0.0565185546875hf, -0.039398193359375hf), + f16vec4(0.67822265625hf, 0.9794921875hf, 1.0869140625hf, 0.1787109375hf), + f16vec4(0.12078857421875hf, 0.28076171875hf, 0.1845703125hf, -0.217529296875hf), + f16vec4(0.19580078125hf, 0.052947998046875hf, -0.12030029296875hf, -0.0180511474609375hf), + f16vec4(-0.07183837890625hf, 0.036346435546875hf, 0.0256805419921875hf, -0.0303497314453125hf), + f16vec4(0.74267578125hf, 0.9326171875hf, 0.8779296875hf, 0.1610107421875hf), + f16vec4(-0.268310546875hf, 0.003948211669921875hf, -0.195556640625hf, -0.556640625hf), + f16vec4(0.24560546875hf, 0.2763671875hf, -0.114013671875hf, -0.139404296875hf), + f16vec4(-0.06207275390625hf, -0.09320068359375hf, -0.178955078125hf, -0.08746337890625hf), + f16vec4(0.92578125hf, 1.0302734375hf, 1.125hf, 0.30126953125hf), + f16vec4(0.0247955322265625hf, -0.0198516845703125hf, 0.0677490234375hf, 0.05218505859375hf), + f16vec4(0.2440185546875hf, 0.235595703125hf, 0.216552734375hf, 0.0084686279296875hf), + f16vec4(0.042327880859375hf, 0.08392333984375hf, 0.04931640625hf, -0.1767578125hf), + f16vec4(0.6201171875hf, 0.8115234375hf, 0.9267578125hf, 0.1475830078125hf), + f16vec4(0.219482421875hf, 0.329833984375hf, 0.30078125hf, 0.17236328125hf), + f16vec4(-0.004039764404296875hf, -0.06817626953125hf, -0.0762939453125hf, -0.1517333984375hf), + f16vec4(-0.067138671875hf, 0.085205078125hf, 0.0948486328125hf, -0.203369140625hf), + f16vec4(0.6171875hf, 0.7236328125hf, 0.71044921875hf, 0.1373291015625hf), + f16vec4(-0.07269287109375hf, 0.25732421875hf, 0.13623046875hf, 0.0232086181640625hf), + f16vec4(-0.0189361572265625hf, 0.1820068359375hf, 0.016693115234375hf, -0.13134765625hf), + f16vec4(-0.05133056640625hf, -0.08135986328125hf, -0.115234375hf, -0.09033203125hf), + f16vec4(0.95068359375hf, 1.041015625hf, 1.083984375hf, 0.42626953125hf), + f16vec4(-0.171630859375hf, -0.398681640625hf, -0.186279296875hf, 0.10479736328125hf), + f16vec4(0.32568359375hf, 0.0275726318359375hf, 0.09033203125hf, 0.09423828125hf), + f16vec4(-0.037261962890625hf, 0.05035400390625hf, 0.07122802734375hf, -0.22900390625hf), + f16vec4(0.61328125hf, 0.85546875hf, 0.9580078125hf, 0.250732421875hf), + f16vec4(0.0198211669921875hf, 0.09063720703125hf, 0.2193603515625hf, 0.384521484375hf), + f16vec4(0.1507568359375hf, -0.09539794921875hf, -0.091064453125hf, -0.021392822265625hf), + f16vec4(-0.1368408203125hf, -0.002864837646484375hf, 0.111328125hf, -0.2437744140625hf), + f16vec4(0.771484375hf, 0.91455078125hf, 0.876953125hf, 0.26611328125hf), + f16vec4(-0.75hf, -0.365966796875hf, -0.16650390625hf, -0.0270233154296875hf), + f16vec4(-0.302001953125hf, -0.0012912750244140625hf, -0.0136260986328125hf, -0.0863037109375hf) +); +const f16vec4 kMuA = f16vec4(0.95849609375hf, 1.4169921875hf, 1.1357421875hf, 0.2216796875hf); +const f16vec4 kSigmaA = f16vec4(0.88916015625hf, 0.677734375hf, 0.5751953125hf, 0.6015625hf); +const f16vec4 kBetaA = f16vec4(-0.279541015625hf, -0.52197265625hf, -0.76904296875hf, -0.970703125hf); + +const f16vec4 kColsB[72] = f16vec4[72]( + f16vec4(0.04193115234375hf, 0.1402587890625hf, 0.0174713134765625hf, -0.41162109375hf), + f16vec4(0.34130859375hf, 0.360107421875hf, 0.1395263671875hf, -0.0091094970703125hf), + f16vec4(-0.055450439453125hf, -0.07586669921875hf, 0.060760498046875hf, 0.06451416015625hf), + f16vec4(-0.0087738037109375hf, 0.1669921875hf, -0.40625hf, -1.0654296875hf), + f16vec4(-0.029998779296875hf, 0.09259033203125hf, -0.1392822265625hf, -0.363525390625hf), + f16vec4(0.332275390625hf, 0.40625hf, -0.0958251953125hf, -0.214599609375hf), + f16vec4(-0.00501251220703125hf, 0.007373809814453125hf, 0.042938232421875hf, 0.09661865234375hf), + f16vec4(0.036651611328125hf, 0.2247314453125hf, -1.0556640625hf, -0.92431640625hf), + f16vec4(0.310546875hf, 0.509765625hf, -0.39599609375hf, -0.397705078125hf), + f16vec4(-0.04107666015625hf, -0.0202178955078125hf, -0.036773681640625hf, -0.314697265625hf), + f16vec4(0.00872039794921875hf, -0.005756378173828125hf, 0.077392578125hf, 0.1029052734375hf), + f16vec4(-0.2432861328125hf, -0.165283203125hf, -1.02734375hf, -0.0006108283996582031hf), + f16vec4(0.007160186767578125hf, 0.1524658203125hf, 0.044647216796875hf, -0.480224609375hf), + f16vec4(0.4306640625hf, 0.443115234375hf, 0.109375hf, -0.032867431640625hf), + f16vec4(-0.029571533203125hf, -0.025543212890625hf, 0.05938720703125hf, 0.03216552734375hf), + f16vec4(0.1727294921875hf, 0.29833984375hf, -1.1396484375hf, -0.4072265625hf), + f16vec4(-0.281982421875hf, -0.1590576171875hf, -0.034393310546875hf, -0.331787109375hf), + f16vec4(0.38916015625hf, 0.440673828125hf, 0.0726318359375hf, -0.1407470703125hf), + f16vec4(-0.034332275390625hf, -0.0297393798828125hf, 0.1162109375hf, 0.1085205078125hf), + f16vec4(0.09576416015625hf, 0.1790771484375hf, -1.1708984375hf, 0.17919921875hf), + f16vec4(-0.03509521484375hf, 0.1397705078125hf, -0.1458740234375hf, -0.15234375hf), + f16vec4(0.1414794921875hf, 0.1229248046875hf, 0.20751953125hf, -0.2021484375hf), + f16vec4(-0.03973388671875hf, -0.06195068359375hf, 0.1824951171875hf, 0.1580810546875hf), + f16vec4(-0.0791015625hf, -0.07928466796875hf, -0.215576171875hf, 0.5322265625hf), + f16vec4(-0.087890625hf, 0.057769775390625hf, 0.0731201171875hf, -0.60595703125hf), + f16vec4(0.36767578125hf, 0.281494140625hf, 0.031951904296875hf, -0.1611328125hf), + f16vec4(-0.04156494140625hf, -0.052734375hf, 0.045440673828125hf, 0.0020751953125hf), + f16vec4(-0.088623046875hf, -0.024627685546875hf, -1.291015625hf, 0.0281524658203125hf), + f16vec4(-0.36669921875hf, -0.288330078125hf, 0.09674072265625hf, -0.474853515625hf), + f16vec4(0.28515625hf, 0.322021484375hf, 0.1260986328125hf, -0.19482421875hf), + f16vec4(-0.054962158203125hf, -0.05633544921875hf, 0.1546630859375hf, 0.0743408203125hf), + f16vec4(0.0295257568359375hf, 0.0748291015625hf, -0.23046875hf, 0.375244140625hf), + f16vec4(-0.11676025390625hf, 0.03973388671875hf, 0.06597900390625hf, -0.282470703125hf), + f16vec4(0.1624755859375hf, 0.11187744140625hf, 0.2218017578125hf, -0.15380859375hf), + f16vec4(-0.093505859375hf, -0.10302734375hf, 0.2481689453125hf, 0.11212158203125hf), + f16vec4(0.0239410400390625hf, 0.024169921875hf, 0.55908203125hf, 0.44873046875hf), + f16vec4(-0.12164306640625hf, -0.209716796875hf, 0.2459716796875hf, 0.414306640625hf), + f16vec4(0.76708984375hf, 0.88720703125hf, -0.278564453125hf, -0.365966796875hf), + f16vec4(-0.060089111328125hf, 0.0157928466796875hf, 0.00835418701171875hf, 0.2734375hf), + f16vec4(0.357421875hf, 0.3896484375hf, -0.258056640625hf, 0.1126708984375hf), + f16vec4(-0.01229095458984375hf, -0.0010957717895507812hf, 0.1802978515625hf, 0.29052734375hf), + f16vec4(0.828125hf, 1.037109375hf, -0.18408203125hf, -0.1788330078125hf), + f16vec4(0.05938720703125hf, 0.1290283203125hf, 0.1507568359375hf, 0.30126953125hf), + f16vec4(0.1693115234375hf, 0.1776123046875hf, -0.14599609375hf, 0.267822265625hf), + f16vec4(0.025238037109375hf, 0.042938232421875hf, 0.21337890625hf, 0.384521484375hf), + f16vec4(0.78076171875hf, 0.99267578125hf, -0.477783203125hf, -0.2398681640625hf), + f16vec4(-0.271484375hf, -0.288330078125hf, 0.12255859375hf, -0.9306640625hf), + f16vec4(0.314208984375hf, 0.2464599609375hf, -0.10479736328125hf, 0.175048828125hf), + f16vec4(-0.1275634765625hf, -0.1414794921875hf, 0.361572265625hf, 0.55029296875hf), + f16vec4(0.90234375hf, 1.1357421875hf, -0.1595458984375hf, -0.1907958984375hf), + f16vec4(0.011962890625hf, 0.01294708251953125hf, 0.304931640625hf, 0.32568359375hf), + f16vec4(0.35791015625hf, 0.318359375hf, -0.195556640625hf, 0.11248779296875hf), + f16vec4(-0.02239990234375hf, 0.04046630859375hf, 0.318115234375hf, 0.411376953125hf), + f16vec4(0.8193359375hf, 0.94921875hf, 0.05450439453125hf, 0.048431396484375hf), + f16vec4(0.256103515625hf, 0.323486328125hf, 0.2724609375hf, 0.50439453125hf), + f16vec4(0.13232421875hf, 0.01277923583984375hf, 0.07354736328125hf, 0.2337646484375hf), + f16vec4(-0.0355224609375hf, 0.05548095703125hf, 0.392578125hf, 0.61328125hf), + f16vec4(0.67138671875hf, 0.81787109375hf, -0.195068359375hf, -0.0033779144287109375hf), + f16vec4(0.151123046875hf, 0.13720703125hf, -0.311279296875hf, -0.67236328125hf), + f16vec4(0.2626953125hf, 0.1773681640625hf, 0.1226806640625hf, 0.18701171875hf), + f16vec4(-0.1544189453125hf, -0.1220703125hf, 0.2474365234375hf, 0.43994140625hf), + f16vec4(0.86865234375hf, 1.126953125hf, -0.364013671875hf, -0.38720703125hf), + f16vec4(-0.173828125hf, -0.1708984375hf, 0.301513671875hf, -0.63037109375hf), + f16vec4(0.401123046875hf, 0.37744140625hf, -0.09027099609375hf, 0.08966064453125hf), + f16vec4(-0.10211181640625hf, -0.03289794921875hf, 0.307861328125hf, 0.348876953125hf), + f16vec4(0.72265625hf, 0.89404296875hf, -0.0777587890625hf, -0.10015869140625hf), + f16vec4(0.1861572265625hf, 0.28466796875hf, -0.356689453125hf, -0.279541015625hf), + f16vec4(0.352294921875hf, 0.296630859375hf, 0.161865234375hf, 0.156982421875hf), + f16vec4(-0.149169921875hf, -0.07647705078125hf, 0.47998046875hf, 0.6611328125hf), + f16vec4(0.751953125hf, 0.95556640625hf, -0.2078857421875hf, -0.0828857421875hf), + f16vec4(-0.1436767578125hf, -0.204345703125hf, -1.205078125hf, -0.93603515625hf), + f16vec4(0.263916015625hf, 0.243896484375hf, 0.2388916015625hf, 0.222412109375hf) +); +const f16vec4 kMuB = f16vec4(1.5166015625hf, 1.8359375hf, -0.67041015625hf, 0.5947265625hf); +const f16vec4 kSigmaB = f16vec4(0.7255859375hf, 0.59521484375hf, 0.4306640625hf, 0.677734375hf); +const f16vec4 kBetaB = f16vec4(-0.2607421875hf, -0.416259765625hf, 0.4873046875hf, 0.1953125hf); + +f16vec4 borderTap(sampler2D s, ivec2 q) { + if (all(greaterThanEqual(q, ivec2(0))) && all(lessThan(q, textureSize(s, 0)))) { + return f16vec4(texelFetch(s, q, 0)); + } + return f16vec4(0.0hf); +} + +f16vec4 runHead(const f16vec4 cols[72], f16vec4 mu, f16vec4 sigma, f16vec4 beta, + const f16vec4 taps[18]) { + f16vec4 acc = cols[0] * taps[0].x + cols[1] * taps[0].y + + cols[2] * taps[0].z + cols[3] * taps[0].w; + for (int k = 1; k < 18; ++k) { + int b = 4 * k; + acc += cols[b] * taps[k].x + cols[b + 1] * taps[k].y + + cols[b + 2] * taps[k].z + cols[b + 3] * taps[k].w; + } + return (acc - mu) * sigma + beta; +} + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 outSize = imageSize(dstFlow0); + if (p.x >= outSize.x || p.y >= outSize.y) { + return; + } + + f16vec4 taps[18]; + for (int t = 0; t < 9; ++t) { + if (t == 4) { + // center tap is deliberately unguarded (inputs assumed >= output size) + taps[4] = f16vec4(texelFetch(srcFeat0, p, 0)); + taps[13] = f16vec4(texelFetch(srcFeat1, p, 0)); + } else { + ivec2 q = p + ivec2(t / 3 - 1, t % 3 - 1); + taps[t] = borderTap(srcFeat0, q); + taps[t + 9] = borderTap(srcFeat1, q); + } + } + + imageStore(dstFlow0, p, vec4(runHead(kColsA, kMuA, kSigmaA, kBetaA, taps))); + imageStore(dstFlow1, p, vec4(runHead(kColsB, kMuB, kSigmaB, kBetaB, taps))); +} diff --git a/cleanroom/glsl/shader_38.comp b/cleanroom/glsl/shader_38.comp new file mode 100644 index 0000000..b121214 --- /dev/null +++ b/cleanroom/glsl/shader_38.comp @@ -0,0 +1,102 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_38: 3x3 fp16 conv (2x RGBA in -> 1ch) + sigmoid + threshold gate, then a +// 6-level box pyramid of the mask built in shared memory within one dispatch. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 0) uniform ParamBlock { + float reserved0; + float reserved1; + float maskThreshold; +} ub; + +layout(set = 0, binding = 32) uniform sampler2D srcFlow; +layout(set = 0, binding = 33) uniform sampler2D srcFeat; + +layout(set = 0, binding = 48, r8) uniform writeonly image2D dstMask0; +layout(set = 0, binding = 49, r8) uniform writeonly image2D dstMask1; +layout(set = 0, binding = 50, r8) uniform writeonly image2D dstMask2; +layout(set = 0, binding = 51, r8) uniform writeonly image2D dstMask3; +layout(set = 0, binding = 52, r8) uniform writeonly image2D dstMask4; +layout(set = 0, binding = 53, r8) uniform writeonly image2D dstMask5; + +shared float16_t sTile[32][32]; + +const ivec2 kTaps[9] = ivec2[9]( + ivec2(-1, -1), ivec2(-1, 0), ivec2(-1, 1), + ivec2( 0, -1), ivec2( 0, 0), ivec2( 0, 1), + ivec2( 1, -1), ivec2( 1, 0), ivec2( 1, 1)); + +const f16vec4 kWFlow[9] = f16vec4[9]( + f16vec4(0.12200927734375hf, 0.580078125hf, 0.90673828125hf, 0.51318359375hf), + f16vec4(0.4296875hf, 0.35693359375hf, 0.55615234375hf, 0.5283203125hf), + f16vec4(0.459716796875hf, 0.490478515625hf, 0.666015625hf, 0.75244140625hf), + f16vec4(0.129150390625hf, 0.498046875hf, 0.57568359375hf, 0.1358642578125hf), + f16vec4(0.4189453125hf, 0.19287109375hf, 0.1644287109375hf, 0.2252197265625hf), + f16vec4(0.4697265625hf, 0.4453125hf, 0.46484375hf, 0.5224609375hf), + f16vec4(0.251220703125hf, 0.55810546875hf, 0.7001953125hf, 0.35107421875hf), + f16vec4(0.58740234375hf, 0.457275390625hf, 0.483154296875hf, 0.65673828125hf), + f16vec4(0.4658203125hf, 0.498779296875hf, 0.5634765625hf, 0.6953125hf)); + +const f16vec4 kWFeat[9] = f16vec4[9]( + f16vec4(0.54931640625hf, 0.66162109375hf, -0.892578125hf, -1.1923828125hf), + f16vec4(0.472900390625hf, 0.457275390625hf, -0.89013671875hf, -1.123046875hf), + f16vec4(0.47314453125hf, 0.54150390625hf, -1.1689453125hf, -1.22265625hf), + f16vec4(0.43505859375hf, 0.435302734375hf, -0.84375hf, -1.0126953125hf), + f16vec4(0.251953125hf, 0.1683349609375hf, -0.8759765625hf, -0.94677734375hf), + f16vec4(0.377685546875hf, 0.406494140625hf, -1.095703125hf, -1.126953125hf), + f16vec4(0.365234375hf, 0.447265625hf, -1.2197265625hf, -1.1259765625hf), + f16vec4(0.343994140625hf, 0.4189453125hf, -1.1650390625hf, -1.134765625hf), + f16vec4(0.356201171875hf, 0.456787109375hf, -1.3017578125hf, -1.3056640625hf)); + +const float16_t kBias = -1.3642578125hf; + +#define REDUCE_LEVEL(dst, n) \ + barrier(); \ + if (lid.x < n && lid.y < n) { \ + float16_t r = 0.25hf * (((sTile[2u * lid.x][2u * lid.y] \ + + sTile[2u * lid.x + 1u][2u * lid.y]) \ + + sTile[2u * lid.x][2u * lid.y + 1u]) \ + + sTile[2u * lid.x + 1u][2u * lid.y + 1u]); \ + ivec2 c = ivec2(wg * n + lid); \ + if (c.x < imageSize(dst).x && c.y < imageSize(dst).y) { \ + imageStore(dst, c, vec4(float(r))); \ + } \ + sTile[lid.x][lid.y] = r; \ + } + +void main() { + uvec2 wg = gl_WorkGroupID.xy; + uvec2 lid = gl_LocalInvocationID.xy; + ivec2 hi = ivec2(vec2(textureSize(srcFlow, 0))) - ivec2(1); + ivec2 lim0 = imageSize(dstMask0); + float16_t thr = float16_t(ub.maskThreshold); + + for (uint dy = 0u; dy < 2u; ++dy) { + for (uint dx = 0u; dx < 2u; ++dx) { + ivec2 p = ivec2(wg * 32u + lid * 2u + uvec2(dx, dy)); + float16_t s = 0.0hf; + for (int t = 0; t < 9; ++t) { + s += dot(f16vec4(texelFetch(srcFlow, clamp(p + kTaps[t], ivec2(0), hi), 0)), kWFlow[t]); + } + for (int t = 0; t < 9; ++t) { + s += dot(f16vec4(texelFetch(srcFeat, clamp(p + kTaps[t], ivec2(0), hi), 0)), kWFeat[t]); + } + s += kBias; + float16_t m = 1.0hf / (1.0hf + exp(-s)); + float16_t v = step(thr, m) * m; + if (p.x < lim0.x && p.y < lim0.y) { + imageStore(dstMask0, p, vec4(float(v))); + } + sTile[lid.x * 2u + dx][lid.y * 2u + dy] = v; + } + } + + REDUCE_LEVEL(dstMask1, 16u) + REDUCE_LEVEL(dstMask2, 8u) + REDUCE_LEVEL(dstMask3, 4u) + REDUCE_LEVEL(dstMask4, 2u) + REDUCE_LEVEL(dstMask5, 1u) +} diff --git a/cleanroom/glsl/shader_39.comp b/cleanroom/glsl/shader_39.comp new file mode 100644 index 0000000..90ddac1 --- /dev/null +++ b/cleanroom/glsl/shader_39.comp @@ -0,0 +1,67 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 0) uniform Params { + float reserved0; + float phase; + float reserved1; +} ub; + +layout(set = 0, binding = 32) uniform sampler2D featA0; +layout(set = 0, binding = 33) uniform sampler2D featA1; +layout(set = 0, binding = 34) uniform sampler2D featA2; +layout(set = 0, binding = 35) uniform sampler2D featA3; +layout(set = 0, binding = 36) uniform sampler2D featB0; +layout(set = 0, binding = 37) uniform sampler2D featB1; +layout(set = 0, binding = 38) uniform sampler2D featB2; +layout(set = 0, binding = 39) uniform sampler2D featB3; +layout(set = 0, binding = 40) uniform sampler2D flowPair; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D costOut0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D costOut1; +layout(set = 0, binding = 50, rgba8) uniform writeonly image2D costOut2; + +// 16-channel correlation at one 3x3 offset of the warped B position. +#define CORR(o) \ + (((dot(fa0, f16vec4(textureLodOffset(featB0, uvB, 0.0, o))) + \ + dot(fa1, f16vec4(textureLodOffset(featB1, uvB, 0.0, o)))) + \ + dot(fa2, f16vec4(textureLodOffset(featB2, uvB, 0.0, o)))) + \ + dot(fa3, f16vec4(textureLodOffset(featB3, uvB, 0.0, o)))) + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + if (any(greaterThanEqual(p, imageSize(costOut0)))) return; + + vec2 sz = vec2(textureSize(featA0, 0)); + vec2 pc = vec2(p) + 0.5; + vec2 uv = pc / sz; + + f16vec4 flow = f16vec4(textureLod(flowPair, uv, 0.0)); + f16vec2 dispA = flow.xy * float16_t(ub.phase); + f16vec2 dispB = flow.zw * float16_t(1.0 - ub.phase); + + vec2 uvA = (pc + vec2(dispA)) / sz; + vec2 uvB = (pc + vec2(dispB)) / sz; + + f16vec4 fa0 = f16vec4(textureLod(featA0, uvA, 0.0)); + f16vec4 fa1 = f16vec4(textureLod(featA1, uvA, 0.0)); + f16vec4 fa2 = f16vec4(textureLod(featA2, uvA, 0.0)); + f16vec4 fa3 = f16vec4(textureLod(featA3, uvA, 0.0)); + + float16_t cCenter = ((dot(fa0, f16vec4(textureLod(featB0, uvB, 0.0))) + + dot(fa1, f16vec4(textureLod(featB1, uvB, 0.0)))) + + dot(fa2, f16vec4(textureLod(featB2, uvB, 0.0)))) + + dot(fa3, f16vec4(textureLod(featB3, uvB, 0.0))); + + f16vec4 grp1 = f16vec4(CORR(ivec2(-1, -1)), CORR(ivec2(0, -1)), + CORR(ivec2(1, -1)), CORR(ivec2(-1, 0))); + f16vec4 grp2 = f16vec4(cCenter, CORR(ivec2(1, 0)), + CORR(ivec2(-1, 1)), CORR(ivec2(0, 1))); + float16_t cLast = CORR(ivec2(1, 1)); + + imageStore(costOut0, p, vec4((grp1 - f16vec4(4.71875hf, 4.84375hf, 4.70703125hf, 4.9453125hf)) * f16vec4(0.31884765625hf, 0.345458984375hf, 0.351806640625hf, 0.349853515625hf) + f16vec4(0.1812744140625hf, 0.29150390625hf, 0.253173828125hf, 0.322509765625hf))); + imageStore(costOut1, p, vec4((grp2 - f16vec4(5.38671875hf, 4.9609375hf, 4.6953125hf, 4.83203125hf)) * f16vec4(0.2998046875hf, 0.333251953125hf, 0.334228515625hf, 0.352783203125hf) + f16vec4(0.355712890625hf, 0.298095703125hf, 0.18994140625hf, 0.32080078125hf))); + imageStore(costOut2, p, + vec4(float((cLast - 4.72265625hf) * 0.327392578125hf + 0.226318359375hf), 0.0, 0.0, 0.0)); +} diff --git a/cleanroom/glsl/shader_40.comp b/cleanroom/glsl/shader_40.comp new file mode 100644 index 0000000..23055d0 --- /dev/null +++ b/cleanroom/glsl/shader_40.comp @@ -0,0 +1,594 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_40: 3x3 stride-1 conv, 9->16 channels, zero-padded texelFetch + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcA; +layout(set = 0, binding = 33) uniform sampler2D srcB; +layout(set = 0, binding = 34) uniform sampler2D srcC; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstA; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; +layout(set = 0, binding = 50, rgba8) uniform writeonly image2D dstC; +layout(set = 0, binding = 51, rgba8) uniform writeonly image2D dstD; + +// zero-padded fetch for non-center taps +f16vec4 padTap(sampler2D img, ivec2 c) +{ + bool inb = c.x >= 0 && c.y >= 0; + if (inb) { + ivec2 sz = textureSize(img, 0); + inb = c.x < sz.x && c.y < sz.y; + } + return inb ? f16vec4(texelFetch(img, c, 0)) : f16vec4(0.0hf); +} + +const f16mat4 w0_0 = f16mat4( + f16vec4(0.002140045166015625hf, -0.1162109375hf, 0.10107421875hf, -0.07171630859375hf), + f16vec4(0.0845947265625hf, -0.1253662109375hf, -0.08673095703125hf, -0.03924560546875hf), + f16vec4(0.0202484130859375hf, 0.057586669921875hf, -0.1048583984375hf, 0.2578125hf), + f16vec4(0.007434844970703125hf, 0.019256591796875hf, -0.12078857421875hf, -0.034454345703125hf)); +const f16mat4 w0_1 = f16mat4( + f16vec4(0.0268402099609375hf, 0.031585693359375hf, 0.0867919921875hf, -0.07623291015625hf), + f16vec4(0.22119140625hf, -0.034149169921875hf, -0.17529296875hf, 0.08538818359375hf), + f16vec4(0.0875244140625hf, -0.09588623046875hf, -0.10443115234375hf, 0.408447265625hf), + f16vec4(-0.11712646484375hf, 0.0245513916015625hf, -0.1861572265625hf, 0.08489990234375hf)); +const f16mat4 w0_2 = f16mat4( + f16vec4(0.0870361328125hf, -0.054046630859375hf, 0.158203125hf, -0.272216796875hf), + f16vec4(0.1866455078125hf, -0.1748046875hf, -0.18115234375hf, 0.1348876953125hf), + f16vec4(-0.02276611328125hf, -0.279052734375hf, -0.06585693359375hf, 0.2213134765625hf), + f16vec4(0.007640838623046875hf, -0.08294677734375hf, -0.055450439453125hf, -0.0848388671875hf)); +const f16mat4 w0_3 = f16mat4( + f16vec4(0.0430908203125hf, -0.1466064453125hf, 0.194091796875hf, -0.08892822265625hf), + f16vec4(-0.0290374755859375hf, -0.02630615234375hf, -0.1036376953125hf, 0.06842041015625hf), + f16vec4(0.0019855499267578125hf, 0.0728759765625hf, -0.0345458984375hf, 0.09429931640625hf), + f16vec4(-0.0090179443359375hf, 0.11614990234375hf, -0.138916015625hf, 0.08123779296875hf)); +const f16mat4 w0_4 = f16mat4( + f16vec4(0.1778564453125hf, 0.1904296875hf, 0.25830078125hf, -0.1358642578125hf), + f16vec4(0.262451171875hf, 0.036407470703125hf, -0.129638671875hf, -0.0219268798828125hf), + f16vec4(0.1607666015625hf, 0.09869384765625hf, -0.136474609375hf, 0.2122802734375hf), + f16vec4(-0.10552978515625hf, 0.240234375hf, -0.1865234375hf, 0.03643798828125hf)); +const f16mat4 w0_5 = f16mat4( + f16vec4(0.003910064697265625hf, 0.310546875hf, 0.322998046875hf, -0.24072265625hf), + f16vec4(0.1583251953125hf, 0.1807861328125hf, -0.12030029296875hf, -0.29296875hf), + f16vec4(0.0902099609375hf, 0.0184173583984375hf, -0.227783203125hf, 0.26171875hf), + f16vec4(-0.09271240234375hf, 0.1783447265625hf, -0.14453125hf, 0.0819091796875hf)); +const f16mat4 w0_6 = f16mat4( + f16vec4(-0.02972412109375hf, 0.1075439453125hf, 0.1671142578125hf, -0.18212890625hf), + f16vec4(0.01262664794921875hf, 0.1138916015625hf, -0.00026798248291015625hf, -0.09820556640625hf), + f16vec4(-0.06646728515625hf, 0.08056640625hf, 0.0280303955078125hf, -0.12164306640625hf), + f16vec4(-0.11334228515625hf, 0.2198486328125hf, -0.202392578125hf, 0.1744384765625hf)); +const f16mat4 w0_7 = f16mat4( + f16vec4(0.190185546875hf, -0.2430419921875hf, 0.2279052734375hf, -0.282958984375hf), + f16vec4(0.3154296875hf, -0.384033203125hf, -0.1036376953125hf, -0.09259033203125hf), + f16vec4(0.099853515625hf, -0.01079559326171875hf, -0.042144775390625hf, -0.09783935546875hf), + f16vec4(-0.1600341796875hf, -0.09649658203125hf, -0.2265625hf, -0.23388671875hf)); +const f16mat4 w0_8 = f16mat4( + f16vec4(0.032379150390625hf, 0.2425537109375hf, 0.289306640625hf, -0.39892578125hf), + f16vec4(0.2548828125hf, -0.03564453125hf, -0.2161865234375hf, 0.1446533203125hf), + f16vec4(0.019775390625hf, 0.188232421875hf, -0.060455322265625hf, 0.22998046875hf), + f16vec4(-0.20458984375hf, 0.260986328125hf, -0.286865234375hf, 0.2059326171875hf)); +const f16mat4 w0_9 = f16mat4( + f16vec4(-0.10882568359375hf, -0.034271240234375hf, -0.07598876953125hf, -0.06658935546875hf), + f16vec4(-0.10931396484375hf, -0.1512451171875hf, 0.147216796875hf, 0.0487060546875hf), + f16vec4(0.0130767822265625hf, -0.337158203125hf, -0.03668212890625hf, 0.2205810546875hf), + f16vec4(0.183837890625hf, 0.218994140625hf, 0.043609619140625hf, 0.11981201171875hf)); +const f16mat4 w0_10 = f16mat4( + f16vec4(-0.38427734375hf, 0.04473876953125hf, -0.07391357421875hf, 0.0263824462890625hf), + f16vec4(-0.361328125hf, -0.0367431640625hf, 0.28564453125hf, -0.26171875hf), + f16vec4(0.037322998046875hf, -0.1038818359375hf, -0.0168609619140625hf, -0.0017843246459960938hf), + f16vec4(0.247314453125hf, 0.1337890625hf, 0.056304931640625hf, 0.0965576171875hf)); +const f16mat4 w0_11 = f16mat4( + f16vec4(-0.26953125hf, -0.248779296875hf, -0.05126953125hf, 0.0277862548828125hf), + f16vec4(-0.294677734375hf, -0.226318359375hf, 0.197265625hf, -0.020721435546875hf), + f16vec4(-0.067626953125hf, -0.10174560546875hf, 0.02276611328125hf, -0.1298828125hf), + f16vec4(0.1104736328125hf, -0.083984375hf, 0.10736083984375hf, -0.1380615234375hf)); +const f16mat4 w0_12 = f16mat4( + f16vec4(-0.23046875hf, -0.1746826171875hf, -0.06512451171875hf, -0.05078125hf), + f16vec4(-0.11102294921875hf, -0.2218017578125hf, 0.142578125hf, -0.057098388671875hf), + f16vec4(0.03570556640625hf, -0.377197265625hf, 0.0662841796875hf, 0.3603515625hf), + f16vec4(0.191650390625hf, 0.1695556640625hf, 0.197998046875hf, -0.171875hf)); +const f16mat4 w0_13 = f16mat4( + f16vec4(-0.413330078125hf, 0.178466796875hf, -0.0665283203125hf, -0.501953125hf), + f16vec4(-0.192138671875hf, -0.08465576171875hf, 0.055450439453125hf, -0.148193359375hf), + f16vec4(0.09954833984375hf, -0.2022705078125hf, -0.02301025390625hf, 0.1610107421875hf), + f16vec4(0.209228515625hf, 0.337646484375hf, -0.00417327880859375hf, -0.137451171875hf)); +const f16mat4 w0_14 = f16mat4( + f16vec4(-0.45556640625hf, 0.2244873046875hf, -0.1365966796875hf, -0.1260986328125hf), + f16vec4(-0.2353515625hf, 0.09857177734375hf, 0.094970703125hf, 0.0092620849609375hf), + f16vec4(-0.033966064453125hf, -0.06390380859375hf, -0.0007929801940917969hf, -0.06658935546875hf), + f16vec4(0.031707763671875hf, 0.193603515625hf, 0.051910400390625hf, 0.062286376953125hf)); +const f16mat4 w0_15 = f16mat4( + f16vec4(-0.2293701171875hf, -0.09844970703125hf, -0.07586669921875hf, -0.060791015625hf), + f16vec4(-0.147705078125hf, 0.2174072265625hf, 0.1134033203125hf, -0.05029296875hf), + f16vec4(-0.02374267578125hf, -0.457763671875hf, 0.033050537109375hf, 0.20947265625hf), + f16vec4(0.2020263671875hf, 0.1549072265625hf, 0.163818359375hf, 0.1224365234375hf)); +const f16mat4 w0_16 = f16mat4( + f16vec4(-0.3203125hf, -0.46337890625hf, -0.1661376953125hf, -0.137451171875hf), + f16vec4(-0.1766357421875hf, -0.2408447265625hf, 0.055145263671875hf, 0.0509033203125hf), + f16vec4(0.00933074951171875hf, -0.61279296875hf, -0.095703125hf, 0.1793212890625hf), + f16vec4(0.255859375hf, -0.1690673828125hf, 0.0782470703125hf, 0.04949951171875hf)); +const f16mat4 w0_17 = f16mat4( + f16vec4(-0.353515625hf, -0.020751953125hf, -0.152587890625hf, 0.0290985107421875hf), + f16vec4(-0.1905517578125hf, 0.029449462890625hf, 0.15478515625hf, 0.09405517578125hf), + f16vec4(-0.056854248046875hf, -0.438232421875hf, -0.054656982421875hf, 0.273681640625hf), + f16vec4(0.0621337890625hf, 0.11810302734375hf, 0.15478515625hf, 0.076171875hf)); +const f16vec4 q0_0 = f16vec4(0.26220703125hf, 0.221923828125hf, 0.092529296875hf, -0.332763671875hf); +const f16vec4 q0_1 = f16vec4(0.1734619140625hf, 0.28515625hf, 0.003143310546875hf, -0.1827392578125hf); +const f16vec4 q0_2 = f16vec4(0.1475830078125hf, -0.1534423828125hf, 0.0240020751953125hf, -0.101318359375hf); +const f16vec4 q0_3 = f16vec4(0.263427734375hf, 0.0252532958984375hf, 0.018768310546875hf, -0.14990234375hf); +const f16vec4 q0_4 = f16vec4(0.1976318359375hf, 0.194091796875hf, -0.101806640625hf, -0.1722412109375hf); +const f16vec4 q0_5 = f16vec4(0.04766845703125hf, 0.1776123046875hf, 0.023162841796875hf, 0.01526641845703125hf); +const f16vec4 q0_6 = f16vec4(0.10791015625hf, 0.16259765625hf, 0.052093505859375hf, -0.112060546875hf); +const f16vec4 q0_7 = f16vec4(0.1427001953125hf, -0.383544921875hf, 0.0175628662109375hf, -0.0911865234375hf); +const f16vec4 q0_8 = f16vec4(-0.0916748046875hf, -0.003826141357421875hf, -0.03216552734375hf, -0.0777587890625hf); +const f16vec4 sub0 = f16vec4(-0.3671875hf, -0.2115478515625hf, -0.31689453125hf, -0.33349609375hf); +const f16vec4 mul0 = f16vec4(1.88671875hf, 3.259765625hf, 2.43359375hf, 3.0390625hf); +const f16vec4 add0 = f16vec4(-0.345458984375hf, -0.07415771484375hf, -0.0609130859375hf, -0.400390625hf); + +const f16mat4 w1_0 = f16mat4( + f16vec4(-0.05181884765625hf, -0.07354736328125hf, 0.04486083984375hf, -0.031982421875hf), + f16vec4(-0.063720703125hf, 0.09429931640625hf, 0.27294921875hf, 0.11541748046875hf), + f16vec4(0.1085205078125hf, -0.0214080810546875hf, -0.1689453125hf, 0.033233642578125hf), + f16vec4(0.036468505859375hf, -0.125hf, 0.01421356201171875hf, 0.054656982421875hf)); +const f16mat4 w1_1 = f16mat4( + f16vec4(-0.05084228515625hf, 0.00860595703125hf, -0.214111328125hf, -0.322265625hf), + f16vec4(-0.240234375hf, 0.218505859375hf, -0.2081298828125hf, -0.240966796875hf), + f16vec4(0.09088134765625hf, 0.0253143310546875hf, -0.2880859375hf, -0.193359375hf), + f16vec4(0.00263214111328125hf, -0.238037109375hf, -0.389892578125hf, -0.028594970703125hf)); +const f16mat4 w1_2 = f16mat4( + f16vec4(0.0186004638671875hf, 0.11651611328125hf, 0.037322998046875hf, -0.1689453125hf), + f16vec4(-0.271240234375hf, 0.2252197265625hf, 0.01245880126953125hf, -0.30712890625hf), + f16vec4(0.08258056640625hf, 0.1802978515625hf, -0.1588134765625hf, -0.22119140625hf), + f16vec4(0.007793426513671875hf, -0.0672607421875hf, 0.258056640625hf, 0.259033203125hf)); +const f16mat4 w1_3 = f16mat4( + f16vec4(0.0882568359375hf, -0.035186767578125hf, 0.27978515625hf, -0.129150390625hf), + f16vec4(-0.09332275390625hf, -0.0268707275390625hf, 0.256103515625hf, 0.06402587890625hf), + f16vec4(0.08026123046875hf, -0.061798095703125hf, -0.01334381103515625hf, 0.0249481201171875hf), + f16vec4(0.2373046875hf, -0.1844482421875hf, 0.175048828125hf, 0.074462890625hf)); +const f16mat4 w1_4 = f16mat4( + f16vec4(0.12646484375hf, 0.068603515625hf, 0.0198822021484375hf, -0.360595703125hf), + f16vec4(-0.1925048828125hf, 0.0875244140625hf, 0.230224609375hf, -0.2491455078125hf), + f16vec4(0.1842041015625hf, -0.044097900390625hf, -0.022216796875hf, -0.218505859375hf), + f16vec4(0.257080078125hf, -0.181884765625hf, -0.453125hf, -0.13134765625hf)); +const f16mat4 w1_5 = f16mat4( + f16vec4(0.11151123046875hf, 0.2213134765625hf, -0.37646484375hf, -0.275146484375hf), + f16vec4(-0.274169921875hf, 0.337890625hf, 0.028717041015625hf, -0.314208984375hf), + f16vec4(0.1630859375hf, 0.0762939453125hf, -0.28466796875hf, -0.07720947265625hf), + f16vec4(0.2042236328125hf, -0.16162109375hf, -0.0689697265625hf, 0.307861328125hf)); +const f16mat4 w1_6 = f16mat4( + f16vec4(0.0904541015625hf, 0.0202789306640625hf, -0.0760498046875hf, -0.05120849609375hf), + f16vec4(-0.0814208984375hf, 0.1551513671875hf, -0.0870361328125hf, 0.1307373046875hf), + f16vec4(-0.032684326171875hf, -0.0256195068359375hf, -0.1817626953125hf, 0.0230865478515625hf), + f16vec4(0.1710205078125hf, -0.28662109375hf, 0.1728515625hf, 0.1466064453125hf)); +const f16mat4 w1_7 = f16mat4( + f16vec4(0.10369873046875hf, 0.02410888671875hf, 0.325927734375hf, -0.33447265625hf), + f16vec4(-0.1944580078125hf, 0.1177978515625hf, 0.296630859375hf, -0.1944580078125hf), + f16vec4(-0.050933837890625hf, -0.01541900634765625hf, -0.0304718017578125hf, -0.2357177734375hf), + f16vec4(0.2393798828125hf, -0.2498779296875hf, 0.1578369140625hf, -0.2457275390625hf)); +const f16mat4 w1_8 = f16mat4( + f16vec4(0.173828125hf, 0.291748046875hf, -0.05859375hf, -0.35498046875hf), + f16vec4(-0.2071533203125hf, 0.31640625hf, 0.11700439453125hf, -0.2213134765625hf), + f16vec4(0.08251953125hf, 0.0771484375hf, -0.4619140625hf, -0.0298004150390625hf), + f16vec4(0.220458984375hf, -0.3076171875hf, -0.01180267333984375hf, 0.251953125hf)); +const f16mat4 w1_9 = f16mat4( + f16vec4(-0.320068359375hf, -0.0731201171875hf, -0.00968170166015625hf, -0.03350830078125hf), + f16vec4(0.287841796875hf, 0.025177001953125hf, 0.43212890625hf, -0.0001360177993774414hf), + f16vec4(0.030029296875hf, 0.039947509765625hf, 0.037841796875hf, 0.03985595703125hf), + f16vec4(-0.2203369140625hf, -0.2108154296875hf, -0.313720703125hf, 0.183837890625hf)); +const f16mat4 w1_10 = f16mat4( + f16vec4(-0.55029296875hf, -0.1048583984375hf, -0.68798828125hf, -0.2396240234375hf), + f16vec4(0.261474609375hf, 0.201904296875hf, -0.2490234375hf, -0.36376953125hf), + f16vec4(-0.06005859375hf, 0.0772705078125hf, 0.09783935546875hf, 0.0880126953125hf), + f16vec4(-0.196533203125hf, -0.1551513671875hf, -0.10504150390625hf, 0.287109375hf)); +const f16mat4 w1_11 = f16mat4( + f16vec4(-0.283447265625hf, -0.1116943359375hf, 0.20458984375hf, 0.09490966796875hf), + f16vec4(0.2425537109375hf, 0.09136962890625hf, 0.28955078125hf, 0.1708984375hf), + f16vec4(-0.0809326171875hf, 0.1380615234375hf, 0.061920166015625hf, 0.2333984375hf), + f16vec4(-0.077880859375hf, -0.0259246826171875hf, 0.2021484375hf, 0.1031494140625hf)); +const f16mat4 w1_12 = f16mat4( + f16vec4(-0.283935546875hf, -0.21142578125hf, 0.383056640625hf, -0.0863037109375hf), + f16vec4(0.2841796875hf, -0.04376220703125hf, 0.39794921875hf, 0.0250091552734375hf), + f16vec4(0.1898193359375hf, 0.1285400390625hf, -0.09326171875hf, 0.045135498046875hf), + f16vec4(-0.25341796875hf, -0.1082763671875hf, 0.11395263671875hf, 0.11260986328125hf)); +const f16mat4 w1_13 = f16mat4( + f16vec4(-0.5009765625hf, -0.040252685546875hf, -0.006740570068359375hf, -0.477783203125hf), + f16vec4(0.356201171875hf, 0.09539794921875hf, 0.1165771484375hf, -0.297607421875hf), + f16vec4(0.11676025390625hf, 0.1302490234375hf, 0.213623046875hf, 0.03765869140625hf), + f16vec4(-0.1572265625hf, -0.16455078125hf, 0.06756591796875hf, 0.17724609375hf)); +const f16mat4 w1_14 = f16mat4( + f16vec4(-0.2578125hf, -0.0814208984375hf, 0.0150299072265625hf, 0.0207366943359375hf), + f16vec4(0.23828125hf, 0.2344970703125hf, 0.00522613525390625hf, 0.16162109375hf), + f16vec4(0.061981201171875hf, 0.22412109375hf, 0.0034694671630859375hf, 0.164306640625hf), + f16vec4(-0.115478515625hf, -0.1129150390625hf, -0.140625hf, 0.1453857421875hf)); +const f16mat4 w1_15 = f16mat4( + f16vec4(-0.2149658203125hf, -0.179443359375hf, -0.059814453125hf, 0.055999755859375hf), + f16vec4(-0.035400390625hf, 0.06390380859375hf, -0.13525390625hf, 0.0157623291015625hf), + f16vec4(0.10797119140625hf, 0.2027587890625hf, -0.0126495361328125hf, 0.115966796875hf), + f16vec4(-0.2427978515625hf, -0.1474609375hf, -0.1346435546875hf, 0.1998291015625hf)); +const f16mat4 w1_16 = f16mat4( + f16vec4(-0.382080078125hf, -0.100830078125hf, 0.17138671875hf, -0.263427734375hf), + f16vec4(-0.0190887451171875hf, -0.04058837890625hf, 0.0017824172973632812hf, -0.157958984375hf), + f16vec4(0.11285400390625hf, 0.089599609375hf, 0.32861328125hf, 0.11212158203125hf), + f16vec4(-0.1900634765625hf, -0.1029052734375hf, 0.1806640625hf, 0.1966552734375hf)); +const f16mat4 w1_17 = f16mat4( + f16vec4(-0.14794921875hf, -0.004756927490234375hf, 0.0164642333984375hf, 0.0433349609375hf), + f16vec4(0.0190277099609375hf, 0.1416015625hf, -0.165283203125hf, 0.24072265625hf), + f16vec4(0.13916015625hf, 0.150634765625hf, -0.09405517578125hf, 0.226318359375hf), + f16vec4(-0.0616455078125hf, -0.0372314453125hf, -0.20654296875hf, 0.1337890625hf)); +const f16vec4 q1_0 = f16vec4(0.11090087890625hf, -0.13427734375hf, 0.1387939453125hf, 0.2132568359375hf); +const f16vec4 q1_1 = f16vec4(0.038970947265625hf, -0.186767578125hf, 0.015960693359375hf, 0.27197265625hf); +const f16vec4 q1_2 = f16vec4(0.0623779296875hf, -0.12298583984375hf, 0.0802001953125hf, 0.302734375hf); +const f16vec4 q1_3 = f16vec4(0.2230224609375hf, -0.195556640625hf, 0.38330078125hf, 0.1322021484375hf); +const f16vec4 q1_4 = f16vec4(0.166748046875hf, -0.057952880859375hf, 0.272705078125hf, 0.134765625hf); +const f16vec4 q1_5 = f16vec4(0.08447265625hf, 0.034759521484375hf, -0.2105712890625hf, 0.1851806640625hf); +const f16vec4 q1_6 = f16vec4(0.006458282470703125hf, -0.164794921875hf, -0.197509765625hf, 0.1644287109375hf); +const f16vec4 q1_7 = f16vec4(-0.03253173828125hf, -0.13916015625hf, 0.197509765625hf, 0.1781005859375hf); +const f16vec4 q1_8 = f16vec4(-0.03045654296875hf, 0.09588623046875hf, -0.205810546875hf, 0.2076416015625hf); +const f16vec4 sub1 = f16vec4(-0.491943359375hf, -0.3564453125hf, 0.1444091796875hf, -0.049957275390625hf); +const f16vec4 mul1 = f16vec4(1.873046875hf, 2.880859375hf, 3.689453125hf, 0.96875hf); +const f16vec4 add1 = f16vec4(-0.35595703125hf, -0.1866455078125hf, 0.030670166015625hf, 0.1534423828125hf); + +const f16mat4 w2_0 = f16mat4( + f16vec4(0.1268310546875hf, -0.07647705078125hf, 0.07196044921875hf, 0.19970703125hf), + f16vec4(-0.0322265625hf, -0.15283203125hf, 0.046783447265625hf, 0.11737060546875hf), + f16vec4(0.1103515625hf, -0.11737060546875hf, 0.134033203125hf, 0.278076171875hf), + f16vec4(0.07989501953125hf, 0.0188140869140625hf, -0.06439208984375hf, 0.27197265625hf)); +const f16mat4 w2_1 = f16mat4( + f16vec4(-0.0196990966796875hf, 0.0139617919921875hf, 0.030303955078125hf, 0.0850830078125hf), + f16vec4(-0.131103515625hf, -0.150390625hf, 0.052947998046875hf, 0.12030029296875hf), + f16vec4(0.043060302734375hf, -0.01326751708984375hf, 0.0687255859375hf, 0.1458740234375hf), + f16vec4(-0.10845947265625hf, 0.028564453125hf, -0.2279052734375hf, 0.01690673828125hf)); +const f16mat4 w2_2 = f16mat4( + f16vec4(-0.0631103515625hf, 0.04254150390625hf, 0.067138671875hf, 0.0279083251953125hf), + f16vec4(-0.242431640625hf, -0.176513671875hf, 0.02093505859375hf, 0.1767578125hf), + f16vec4(0.06146240234375hf, -0.063720703125hf, 0.03515625hf, 0.10137939453125hf), + f16vec4(0.07769775390625hf, -0.017303466796875hf, -0.08544921875hf, 0.0103912353515625hf)); +const f16mat4 w2_3 = f16mat4( + f16vec4(0.04583740234375hf, 0.0653076171875hf, 0.13623046875hf, 0.164794921875hf), + f16vec4(-0.10064697265625hf, -0.1512451171875hf, 0.0711669921875hf, 0.1358642578125hf), + f16vec4(0.1287841796875hf, 0.003917694091796875hf, -0.07635498046875hf, 0.265380859375hf), + f16vec4(0.04095458984375hf, 0.12646484375hf, 0.1370849609375hf, 0.1751708984375hf)); +const f16mat4 w2_4 = f16mat4( + f16vec4(-0.06353759765625hf, 0.07452392578125hf, 0.238525390625hf, -0.03466796875hf), + f16vec4(-0.1553955078125hf, -0.1435546875hf, 0.104736328125hf, -0.000827789306640625hf), + f16vec4(0.0242919921875hf, 0.01337432861328125hf, -0.037139892578125hf, 0.06256103515625hf), + f16vec4(-0.07196044921875hf, 0.077392578125hf, 0.03546142578125hf, -0.10198974609375hf)); +const f16mat4 w2_5 = f16mat4( + f16vec4(-0.1123046875hf, 0.03668212890625hf, 0.1756591796875hf, -0.024658203125hf), + f16vec4(-0.1646728515625hf, -0.146484375hf, 0.054229736328125hf, 0.08514404296875hf), + f16vec4(0.043701171875hf, -0.00295257568359375hf, -0.168212890625hf, 0.1080322265625hf), + f16vec4(-0.055938720703125hf, 0.053070068359375hf, -0.01546478271484375hf, 0.128173828125hf)); +const f16mat4 w2_6 = f16mat4( + f16vec4(0.03704833984375hf, 0.17333984375hf, 0.1671142578125hf, 0.227294921875hf), + f16vec4(-0.06561279296875hf, 0.03863525390625hf, -0.09112548828125hf, 0.185791015625hf), + f16vec4(0.17724609375hf, 0.1895751953125hf, -0.2464599609375hf, 0.2484130859375hf), + f16vec4(0.0223236083984375hf, 0.27783203125hf, 0.2303466796875hf, 0.12139892578125hf)); +const f16mat4 w2_7 = f16mat4( + f16vec4(-0.036346435546875hf, 0.339599609375hf, 0.1949462890625hf, -0.033599853515625hf), + f16vec4(-0.198486328125hf, 0.01953125hf, -0.11981201171875hf, 0.1143798828125hf), + f16vec4(0.01418304443359375hf, 0.1556396484375hf, -0.165771484375hf, 0.1217041015625hf), + f16vec4(0.11407470703125hf, 0.352294921875hf, 0.2119140625hf, -0.1195068359375hf)); +const f16mat4 w2_8 = f16mat4( + f16vec4(-0.0758056640625hf, 0.362548828125hf, 0.3583984375hf, 0.01396942138671875hf), + f16vec4(-0.233642578125hf, -0.0283203125hf, -0.1201171875hf, 0.12646484375hf), + f16vec4(-0.048095703125hf, 0.0770263671875hf, -0.2252197265625hf, 0.10272216796875hf), + f16vec4(-0.11029052734375hf, 0.235107421875hf, 0.35791015625hf, 0.1632080078125hf)); +const f16mat4 w2_9 = f16mat4( + f16vec4(0.039031982421875hf, -0.130615234375hf, -0.1307373046875hf, -0.028289794921875hf), + f16vec4(-0.0916748046875hf, -0.2379150390625hf, -0.041473388671875hf, -0.07568359375hf), + f16vec4(0.11224365234375hf, -0.0379638671875hf, 0.05902099609375hf, -0.12060546875hf), + f16vec4(0.28759765625hf, -0.13427734375hf, 0.08721923828125hf, -0.169921875hf)); +const f16mat4 w2_10 = f16mat4( + f16vec4(-0.08465576171875hf, -0.0748291015625hf, -0.287353515625hf, -0.1900634765625hf), + f16vec4(-0.126708984375hf, -0.102783203125hf, -0.03173828125hf, -0.28857421875hf), + f16vec4(-0.004436492919921875hf, 0.036163330078125hf, 0.0208740234375hf, -0.2010498046875hf), + f16vec4(0.13720703125hf, -0.0504150390625hf, -0.0013437271118164062hf, -0.09033203125hf)); +const f16mat4 w2_11 = f16mat4( + f16vec4(-0.076904296875hf, -0.078125hf, -0.206298828125hf, -0.01812744140625hf), + f16vec4(-0.222900390625hf, -0.2247314453125hf, -0.06671142578125hf, 0.033355712890625hf), + f16vec4(-0.10308837890625hf, -0.09759521484375hf, 0.0665283203125hf, -0.067626953125hf), + f16vec4(0.1885986328125hf, -0.009613037109375hf, 0.11273193359375hf, 0.029388427734375hf)); +const f16mat4 w2_12 = f16mat4( + f16vec4(-0.039642333984375hf, -0.07513427734375hf, -0.11553955078125hf, -0.0638427734375hf), + f16vec4(-0.06951904296875hf, -0.1702880859375hf, -0.053131103515625hf, 0.05841064453125hf), + f16vec4(0.1356201171875hf, 0.0416259765625hf, 0.2076416015625hf, -0.2044677734375hf), + f16vec4(0.352783203125hf, 0.0298919677734375hf, 0.2587890625hf, -0.156005859375hf)); +const f16mat4 w2_13 = f16mat4( + f16vec4(-0.0269622802734375hf, -0.037506103515625hf, -0.094482421875hf, -0.314453125hf), + f16vec4(-0.166748046875hf, -0.11383056640625hf, -0.016448974609375hf, -0.25830078125hf), + f16vec4(-0.07183837890625hf, 0.08685302734375hf, 0.06988525390625hf, -0.2479248046875hf), + f16vec4(0.088134765625hf, -0.057220458984375hf, 0.255126953125hf, 0.009490966796875hf)); +const f16mat4 w2_14 = f16mat4( + f16vec4(-0.1744384765625hf, -0.1334228515625hf, -0.13720703125hf, 0.033355712890625hf), + f16vec4(-0.12841796875hf, -0.1319580078125hf, -0.11395263671875hf, -0.032073974609375hf), + f16vec4(-0.07257080078125hf, 0.055023193359375hf, 0.1375732421875hf, -0.11920166015625hf), + f16vec4(0.1156005859375hf, -0.09381103515625hf, 0.1158447265625hf, 0.1048583984375hf)); +const f16mat4 w2_15 = f16mat4( + f16vec4(-0.0418701171875hf, -0.03021240234375hf, -0.3154296875hf, 0.0043182373046875hf), + f16vec4(0.0245513916015625hf, 0.0015401840209960938hf, -0.187744140625hf, 0.128173828125hf), + f16vec4(0.291015625hf, 0.28662109375hf, 0.294189453125hf, -0.306640625hf), + f16vec4(0.343994140625hf, 0.021453857421875hf, -0.09759521484375hf, -0.19189453125hf)); +const f16mat4 w2_16 = f16mat4( + f16vec4(0.0011644363403320312hf, 0.0165863037109375hf, -0.404296875hf, -0.2529296875hf), + f16vec4(-0.180419921875hf, 0.00250244140625hf, -0.2548828125hf, -0.11358642578125hf), + f16vec4(0.00022304058074951172hf, 0.255859375hf, 0.2154541015625hf, -0.1842041015625hf), + f16vec4(0.2237548828125hf, 0.1588134765625hf, 0.0364990234375hf, -0.09124755859375hf)); +const f16mat4 w2_17 = f16mat4( + f16vec4(-0.0657958984375hf, 0.05218505859375hf, -0.1561279296875hf, -0.04443359375hf), + f16vec4(-0.08734130859375hf, 0.005916595458984375hf, -0.228515625hf, -0.05523681640625hf), + f16vec4(-0.04559326171875hf, 0.22509765625hf, 0.26611328125hf, -0.06787109375hf), + f16vec4(0.037445068359375hf, 0.1336669921875hf, 0.12176513671875hf, 0.0894775390625hf)); +const f16vec4 q2_0 = f16vec4(0.29833984375hf, -0.1358642578125hf, -0.019195556640625hf, -0.1607666015625hf); +const f16vec4 q2_1 = f16vec4(-0.0450439453125hf, -0.0882568359375hf, 0.0021190643310546875hf, -0.0074615478515625hf); +const f16vec4 q2_2 = f16vec4(0.00948333740234375hf, -0.144287109375hf, 0.055633544921875hf, 0.07611083984375hf); +const f16vec4 q2_3 = f16vec4(0.1971435546875hf, -0.1553955078125hf, -0.179443359375hf, -0.05987548828125hf); +const f16vec4 q2_4 = f16vec4(-0.0284576416015625hf, -0.023345947265625hf, -0.0899658203125hf, -0.03619384765625hf); +const f16vec4 q2_5 = f16vec4(-0.07916259765625hf, -0.05975341796875hf, -0.1954345703125hf, 0.01739501953125hf); +const f16vec4 q2_6 = f16vec4(0.072509765625hf, -0.04443359375hf, -0.34912109375hf, -0.08331298828125hf); +const f16vec4 q2_7 = f16vec4(0.030242919921875hf, 0.12408447265625hf, -0.333740234375hf, -0.1322021484375hf); +const f16vec4 q2_8 = f16vec4(-0.0672607421875hf, 0.0859375hf, -0.2218017578125hf, 0.0205230712890625hf); +const f16vec4 sub2 = f16vec4(-0.0841064453125hf, -0.025482177734375hf, -0.41455078125hf, -0.030914306640625hf); +const f16vec4 mul2 = f16vec4(2.9453125hf, 1.826171875hf, 1.48046875hf, 2.080078125hf); +const f16vec4 add2 = f16vec4(-0.04730224609375hf, 0.0968017578125hf, 0.054290771484375hf, 0.10955810546875hf); + +const f16mat4 w3_0 = f16mat4( + f16vec4(-0.117431640625hf, 0.0008921623229980469hf, 0.08441162109375hf, -0.237548828125hf), + f16vec4(0.1710205078125hf, 0.045379638671875hf, 0.0621337890625hf, -0.0006761550903320312hf), + f16vec4(-0.10479736328125hf, 0.13671875hf, 0.2330322265625hf, 0.24853515625hf), + f16vec4(-0.04547119140625hf, 0.0877685546875hf, 0.0014476776123046875hf, -0.1385498046875hf)); +const f16mat4 w3_1 = f16mat4( + f16vec4(-0.037628173828125hf, -0.024322509765625hf, 0.1328125hf, -0.301513671875hf), + f16vec4(0.185302734375hf, -0.0499267578125hf, 0.05450439453125hf, 0.0019626617431640625hf), + f16vec4(-0.050811767578125hf, -0.082763671875hf, 0.337890625hf, 0.172119140625hf), + f16vec4(0.041107177734375hf, -0.06939697265625hf, 0.08746337890625hf, -0.1455078125hf)); +const f16mat4 w3_2 = f16mat4( + f16vec4(0.10760498046875hf, -0.02471923828125hf, 0.1240234375hf, -0.3330078125hf), + f16vec4(0.278076171875hf, 0.06634521484375hf, -0.059326171875hf, -0.167724609375hf), + f16vec4(0.0273895263671875hf, 0.003719329833984375hf, 0.320556640625hf, 0.1798095703125hf), + f16vec4(0.080810546875hf, -0.045135498046875hf, 0.00909423828125hf, -0.1478271484375hf)); +const f16mat4 w3_3 = f16mat4( + f16vec4(-0.0096893310546875hf, -0.01947021484375hf, -0.084228515625hf, -0.10693359375hf), + f16vec4(0.1378173828125hf, -0.0751953125hf, -0.1376953125hf, -0.0113525390625hf), + f16vec4(-0.1832275390625hf, -0.050079345703125hf, 0.1328125hf, 0.07745361328125hf), + f16vec4(-0.0802001953125hf, 0.04022216796875hf, -0.15771484375hf, -0.08428955078125hf)); +const f16mat4 w3_4 = f16mat4( + f16vec4(-0.020294189453125hf, -0.058563232421875hf, 0.03192138671875hf, -0.048431396484375hf), + f16vec4(0.1956787109375hf, -0.015777587890625hf, -0.10064697265625hf, 0.08966064453125hf), + f16vec4(-0.0297393798828125hf, -0.0411376953125hf, 0.169921875hf, 0.0161285400390625hf), + f16vec4(0.004169464111328125hf, 0.09375hf, -0.0165557861328125hf, -0.029144287109375hf)); +const f16mat4 w3_5 = f16mat4( + f16vec4(0.11651611328125hf, 0.04608154296875hf, -0.03277587890625hf, -0.01267242431640625hf), + f16vec4(0.1988525390625hf, 0.2388916015625hf, -0.078857421875hf, 0.28662109375hf), + f16vec4(0.00363922119140625hf, -0.08941650390625hf, 0.1348876953125hf, 0.06903076171875hf), + f16vec4(0.107421875hf, 0.197265625hf, -0.149169921875hf, -0.0386962890625hf)); +const f16mat4 w3_6 = f16mat4( + f16vec4(0.05712890625hf, 0.045654296875hf, -0.1568603515625hf, 0.07183837890625hf), + f16vec4(0.07366943359375hf, -0.03631591796875hf, -0.09747314453125hf, 0.1732177734375hf), + f16vec4(-0.044769287109375hf, -0.0574951171875hf, -0.0986328125hf, 0.07781982421875hf), + f16vec4(0.04193115234375hf, 0.1895751953125hf, -0.233642578125hf, -0.11480712890625hf)); +const f16mat4 w3_7 = f16mat4( + f16vec4(0.12469482421875hf, 0.0305023193359375hf, -0.040435791015625hf, -0.06390380859375hf), + f16vec4(0.2445068359375hf, 0.08837890625hf, -0.131591796875hf, -0.0582275390625hf), + f16vec4(-0.1024169921875hf, -0.04901123046875hf, 0.052947998046875hf, 0.0199127197265625hf), + f16vec4(0.0657958984375hf, 0.338623046875hf, -0.023681640625hf, -0.10382080078125hf)); +const f16mat4 w3_8 = f16mat4( + f16vec4(0.1923828125hf, 0.085693359375hf, -0.113037109375hf, 0.0106964111328125hf), + f16vec4(0.2030029296875hf, -0.0102386474609375hf, -0.227783203125hf, 0.0047454833984375hf), + f16vec4(-0.0291900634765625hf, -0.184326171875hf, 0.0020160675048828125hf, 0.044036865234375hf), + f16vec4(0.10552978515625hf, 0.1912841796875hf, -0.197265625hf, -0.05743408203125hf)); +const f16mat4 w3_9 = f16mat4( + f16vec4(-0.1363525390625hf, 0.0709228515625hf, 0.0226593017578125hf, -0.0787353515625hf), + f16vec4(-0.2064208984375hf, -0.060089111328125hf, 0.258544921875hf, 0.29638671875hf), + f16vec4(-0.02276611328125hf, 0.08453369140625hf, 0.08343505859375hf, -0.23193359375hf), + f16vec4(-0.1575927734375hf, -0.162353515625hf, 0.031402587890625hf, -0.1572265625hf)); +const f16mat4 w3_10 = f16mat4( + f16vec4(-0.11676025390625hf, -0.0731201171875hf, 0.0279388427734375hf, -0.1881103515625hf), + f16vec4(-0.240966796875hf, -0.11956787109375hf, 0.340087890625hf, 0.31396484375hf), + f16vec4(-0.059539794921875hf, -0.029144287109375hf, 0.142822265625hf, -0.1422119140625hf), + f16vec4(-0.0811767578125hf, -0.17431640625hf, 0.04510498046875hf, -0.1802978515625hf)); +const f16mat4 w3_11 = f16mat4( + f16vec4(0.0458984375hf, -0.0005459785461425781hf, 0.0173187255859375hf, -0.32080078125hf), + f16vec4(-0.08221435546875hf, -0.130615234375hf, 0.25439453125hf, 0.126708984375hf), + f16vec4(0.1502685546875hf, 0.027801513671875hf, 0.156494140625hf, -0.2073974609375hf), + f16vec4(-0.01103973388671875hf, -0.051971435546875hf, 0.0941162109375hf, -0.13623046875hf)); +const f16mat4 w3_12 = f16mat4( + f16vec4(-0.1883544921875hf, -0.10980224609375hf, -0.1102294921875hf, -0.10662841796875hf), + f16vec4(-0.1319580078125hf, -0.05682373046875hf, 0.11578369140625hf, 0.04583740234375hf), + f16vec4(-0.1866455078125hf, -0.038909912109375hf, -0.079345703125hf, -0.10040283203125hf), + f16vec4(-0.2117919921875hf, -0.1953125hf, -0.06298828125hf, -0.0172882080078125hf)); +const f16mat4 w3_13 = f16mat4( + f16vec4(-0.2174072265625hf, -0.04241943359375hf, 0.0167694091796875hf, 0.00965118408203125hf), + f16vec4(-0.2054443359375hf, -0.1083984375hf, 0.17431640625hf, 0.034942626953125hf), + f16vec4(-0.11785888671875hf, 0.0165252685546875hf, -0.00989532470703125hf, -0.0160675048828125hf), + f16vec4(-0.208251953125hf, -0.1588134765625hf, -0.02972412109375hf, 0.08148193359375hf)); +const f16mat4 w3_14 = f16mat4( + f16vec4(-0.09429931640625hf, -0.01114654541015625hf, -0.059173583984375hf, 0.059539794921875hf), + f16vec4(-0.09490966796875hf, -0.11651611328125hf, 0.1385498046875hf, 0.2021484375hf), + f16vec4(-0.0019073486328125hf, 0.127685546875hf, -0.0175933837890625hf, 0.10272216796875hf), + f16vec4(-0.0987548828125hf, -0.11541748046875hf, -0.09381103515625hf, 0.0178070068359375hf)); +const f16mat4 w3_15 = f16mat4( + f16vec4(-0.038055419921875hf, 0.00940704345703125hf, -0.1842041015625hf, -0.060150146484375hf), + f16vec4(-0.0792236328125hf, 0.0035800933837890625hf, 0.033172607421875hf, 0.05108642578125hf), + f16vec4(-0.1650390625hf, 0.148193359375hf, -0.16748046875hf, 0.042449951171875hf), + f16vec4(-0.09942626953125hf, -0.23193359375hf, -0.191650390625hf, -0.05157470703125hf)); +const f16mat4 w3_16 = f16mat4( + f16vec4(-0.053497314453125hf, -0.06378173828125hf, -0.1241455078125hf, -0.1907958984375hf), + f16vec4(-0.049835205078125hf, -0.062408447265625hf, 0.077392578125hf, -0.1717529296875hf), + f16vec4(-0.1322021484375hf, 0.11572265625hf, -0.065673828125hf, 0.068359375hf), + f16vec4(-0.1680908203125hf, -0.228271484375hf, -0.11651611328125hf, 0.041412353515625hf)); +const f16mat4 w3_17 = f16mat4( + f16vec4(-0.06500244140625hf, -0.162841796875hf, -0.11053466796875hf, -0.0103302001953125hf), + f16vec4(0.057098388671875hf, -0.14208984375hf, 0.006744384765625hf, -0.09576416015625hf), + f16vec4(0.01554107666015625hf, -0.0264892578125hf, -0.12744140625hf, 0.08245849609375hf), + f16vec4(-0.03765869140625hf, -0.207763671875hf, -0.04412841796875hf, 0.036712646484375hf)); +const f16vec4 q3_0 = f16vec4(0.140625hf, 0.27197265625hf, 0.245849609375hf, 0.34130859375hf); +const f16vec4 q3_1 = f16vec4(0.1392822265625hf, 0.2281494140625hf, 0.228271484375hf, 0.26708984375hf); +const f16vec4 q3_2 = f16vec4(0.187744140625hf, 0.195556640625hf, 0.1632080078125hf, 0.08355712890625hf); +const f16vec4 q3_3 = f16vec4(0.216552734375hf, 0.1361083984375hf, -0.036285400390625hf, -0.0182647705078125hf); +const f16vec4 q3_4 = f16vec4(0.0377197265625hf, 0.1142578125hf, 0.061279296875hf, 0.1688232421875hf); +const f16vec4 q3_5 = f16vec4(0.12744140625hf, 0.06298828125hf, 0.0628662109375hf, 0.1820068359375hf); +const f16vec4 q3_6 = f16vec4(0.17919921875hf, 0.1077880859375hf, -0.06439208984375hf, 0.048980712890625hf); +const f16vec4 q3_7 = f16vec4(0.05816650390625hf, 0.057159423828125hf, -0.07586669921875hf, -0.03466796875hf); +const f16vec4 q3_8 = f16vec4(0.09698486328125hf, -0.06048583984375hf, -0.095703125hf, 0.0433349609375hf); +const f16vec4 sub3 = f16vec4(-0.25439453125hf, -0.2105712890625hf, 0.1103515625hf, -0.179931640625hf); +const f16vec4 mul3 = f16vec4(1.7236328125hf, 3.564453125hf, 1.5859375hf, 2.3359375hf); +const f16vec4 add3 = f16vec4(-0.035980224609375hf, -0.06927490234375hf, -0.01763916015625hf, 0.11865234375hf); + +void main() +{ + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 ext = imageSize(dstA); + if (p.x >= ext.x || p.y >= ext.y) + return; + + f16vec4 t0 = padTap(srcA, p + ivec2(-1, -1)); + f16vec4 t1 = padTap(srcA, p + ivec2(-1, 0)); + f16vec4 t2 = padTap(srcA, p + ivec2(-1, 1)); + f16vec4 t3 = padTap(srcA, p + ivec2(0, -1)); + f16vec4 t4 = f16vec4(texelFetch(srcA, p, 0)); + f16vec4 t5 = padTap(srcA, p + ivec2(0, 1)); + f16vec4 t6 = padTap(srcA, p + ivec2(1, -1)); + f16vec4 t7 = padTap(srcA, p + ivec2(1, 0)); + f16vec4 t8 = padTap(srcA, p + ivec2(1, 1)); + f16vec4 t9 = padTap(srcB, p + ivec2(-1, -1)); + f16vec4 t10 = padTap(srcB, p + ivec2(-1, 0)); + f16vec4 t11 = padTap(srcB, p + ivec2(-1, 1)); + f16vec4 t12 = padTap(srcB, p + ivec2(0, -1)); + f16vec4 t13 = f16vec4(texelFetch(srcB, p, 0)); + f16vec4 t14 = padTap(srcB, p + ivec2(0, 1)); + f16vec4 t15 = padTap(srcB, p + ivec2(1, -1)); + f16vec4 t16 = padTap(srcB, p + ivec2(1, 0)); + f16vec4 t17 = padTap(srcB, p + ivec2(1, 1)); + float16_t s0 = padTap(srcC, p + ivec2(-1, -1)).r; + float16_t s1 = padTap(srcC, p + ivec2(-1, 0)).r; + float16_t s2 = padTap(srcC, p + ivec2(-1, 1)).r; + float16_t s3 = padTap(srcC, p + ivec2(0, -1)).r; + float16_t s4 = float16_t(texelFetch(srcC, p, 0).r); + float16_t s5 = padTap(srcC, p + ivec2(0, 1)).r; + float16_t s6 = padTap(srcC, p + ivec2(1, -1)).r; + float16_t s7 = padTap(srcC, p + ivec2(1, 0)).r; + float16_t s8 = padTap(srcC, p + ivec2(1, 1)).r; + + f16vec4 r0 = w0_0 * t0; + r0 += w0_1 * t1; + r0 += w0_2 * t2; + r0 += w0_3 * t3; + r0 += w0_4 * t4; + r0 += w0_5 * t5; + r0 += w0_6 * t6; + r0 += w0_7 * t7; + r0 += w0_8 * t8; + r0 += w0_9 * t9; + r0 += w0_10 * t10; + r0 += w0_11 * t11; + r0 += w0_12 * t12; + r0 += w0_13 * t13; + r0 += w0_14 * t14; + r0 += w0_15 * t15; + r0 += w0_16 * t16; + r0 += w0_17 * t17; + r0 += q0_0 * s0; + r0 += q0_1 * s1; + r0 += q0_2 * s2; + r0 += q0_3 * s3; + r0 += q0_4 * s4; + r0 += q0_5 * s5; + r0 += q0_6 * s6; + r0 += q0_7 * s7; + r0 += q0_8 * s8; + r0 = (r0 - sub0) * mul0 + add0; + imageStore(dstA, p, vec4(r0)); + + f16vec4 r1 = w1_0 * t0; + r1 += w1_1 * t1; + r1 += w1_2 * t2; + r1 += w1_3 * t3; + r1 += w1_4 * t4; + r1 += w1_5 * t5; + r1 += w1_6 * t6; + r1 += w1_7 * t7; + r1 += w1_8 * t8; + r1 += w1_9 * t9; + r1 += w1_10 * t10; + r1 += w1_11 * t11; + r1 += w1_12 * t12; + r1 += w1_13 * t13; + r1 += w1_14 * t14; + r1 += w1_15 * t15; + r1 += w1_16 * t16; + r1 += w1_17 * t17; + r1 += q1_0 * s0; + r1 += q1_1 * s1; + r1 += q1_2 * s2; + r1 += q1_3 * s3; + r1 += q1_4 * s4; + r1 += q1_5 * s5; + r1 += q1_6 * s6; + r1 += q1_7 * s7; + r1 += q1_8 * s8; + r1 = (r1 - sub1) * mul1 + add1; + imageStore(dstB, p, vec4(r1)); + + f16vec4 r2 = w2_0 * t0; + r2 += w2_1 * t1; + r2 += w2_2 * t2; + r2 += w2_3 * t3; + r2 += w2_4 * t4; + r2 += w2_5 * t5; + r2 += w2_6 * t6; + r2 += w2_7 * t7; + r2 += w2_8 * t8; + r2 += w2_9 * t9; + r2 += w2_10 * t10; + r2 += w2_11 * t11; + r2 += w2_12 * t12; + r2 += w2_13 * t13; + r2 += w2_14 * t14; + r2 += w2_15 * t15; + r2 += w2_16 * t16; + r2 += w2_17 * t17; + r2 += q2_0 * s0; + r2 += q2_1 * s1; + r2 += q2_2 * s2; + r2 += q2_3 * s3; + r2 += q2_4 * s4; + r2 += q2_5 * s5; + r2 += q2_6 * s6; + r2 += q2_7 * s7; + r2 += q2_8 * s8; + r2 = (r2 - sub2) * mul2 + add2; + imageStore(dstC, p, vec4(r2)); + + f16vec4 r3 = w3_0 * t0; + r3 += w3_1 * t1; + r3 += w3_2 * t2; + r3 += w3_3 * t3; + r3 += w3_4 * t4; + r3 += w3_5 * t5; + r3 += w3_6 * t6; + r3 += w3_7 * t7; + r3 += w3_8 * t8; + r3 += w3_9 * t9; + r3 += w3_10 * t10; + r3 += w3_11 * t11; + r3 += w3_12 * t12; + r3 += w3_13 * t13; + r3 += w3_14 * t14; + r3 += w3_15 * t15; + r3 += w3_16 * t16; + r3 += w3_17 * t17; + r3 += q3_0 * s0; + r3 += q3_1 * s1; + r3 += q3_2 * s2; + r3 += q3_3 * s3; + r3 += q3_4 * s4; + r3 += q3_5 * s5; + r3 += q3_6 * s6; + r3 += q3_7 * s7; + r3 += q3_8 * s8; + r3 = (r3 - sub3) * mul3 + add3; + imageStore(dstD, p, vec4(r3)); + +} diff --git a/cleanroom/glsl/shader_41.comp b/cleanroom/glsl/shader_41.comp new file mode 100644 index 0000000..1b14491 --- /dev/null +++ b/cleanroom/glsl/shader_41.comp @@ -0,0 +1,964 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_41: 3x3 stride-1 conv, 16->16 channels, zero-padded texelFetch + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcA; +layout(set = 0, binding = 33) uniform sampler2D srcB; +layout(set = 0, binding = 34) uniform sampler2D srcC; +layout(set = 0, binding = 35) uniform sampler2D srcD; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstA; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; +layout(set = 0, binding = 50, rgba8) uniform writeonly image2D dstC; +layout(set = 0, binding = 51, rgba8) uniform writeonly image2D dstD; + +// zero-padded fetch for non-center taps +f16vec4 padTap(sampler2D img, ivec2 c) +{ + bool inb = c.x >= 0 && c.y >= 0; + if (inb) { + ivec2 sz = textureSize(img, 0); + inb = c.x < sz.x && c.y < sz.y; + } + return inb ? f16vec4(texelFetch(img, c, 0)) : f16vec4(0.0hf); +} + +const f16mat4 w0_0 = f16mat4( + f16vec4(0.1309814453125hf, 0.2142333984375hf, 0.333251953125hf, -0.039276123046875hf), + f16vec4(-0.253662109375hf, -0.0309906005859375hf, -0.040130615234375hf, -0.253662109375hf), + f16vec4(0.0019464492797851562hf, 0.053192138671875hf, -0.447509765625hf, 0.297119140625hf), + f16vec4(-0.271484375hf, 0.01470184326171875hf, -0.0175018310546875hf, 0.0055389404296875hf)); +const f16mat4 w0_1 = f16mat4( + f16vec4(0.1761474609375hf, 0.40966796875hf, 0.1451416015625hf, -0.09112548828125hf), + f16vec4(-0.321044921875hf, 0.1300048828125hf, -0.393798828125hf, 0.2288818359375hf), + f16vec4(0.09136962890625hf, -0.0670166015625hf, -0.317138671875hf, 0.0592041015625hf), + f16vec4(-0.380126953125hf, -0.10400390625hf, -0.095458984375hf, 0.1640625hf)); +const f16mat4 w0_2 = f16mat4( + f16vec4(0.117431640625hf, 0.1551513671875hf, 0.1964111328125hf, -0.05364990234375hf), + f16vec4(-0.468505859375hf, -0.1363525390625hf, -0.5732421875hf, -0.0026035308837890625hf), + f16vec4(-0.166259765625hf, 0.0902099609375hf, -0.320068359375hf, 0.1085205078125hf), + f16vec4(-0.478759765625hf, -0.24267578125hf, 0.149169921875hf, -0.2313232421875hf)); +const f16mat4 w0_3 = f16mat4( + f16vec4(0.0853271484375hf, 0.09417724609375hf, 0.150390625hf, -0.054351806640625hf), + f16vec4(-0.159423828125hf, -0.218994140625hf, -0.1622314453125hf, -0.5283203125hf), + f16vec4(0.0031261444091796875hf, 0.0287628173828125hf, -0.33154296875hf, 0.10107421875hf), + f16vec4(-0.11163330078125hf, 0.004245758056640625hf, -0.26806640625hf, -0.1685791015625hf)); +const f16mat4 w0_4 = f16mat4( + f16vec4(0.164794921875hf, 0.360595703125hf, -0.03656005859375hf, -0.1590576171875hf), + f16vec4(-0.220703125hf, -0.09173583984375hf, 0.1907958984375hf, -0.57763671875hf), + f16vec4(0.0628662109375hf, -0.11468505859375hf, -0.2027587890625hf, -0.0467529296875hf), + f16vec4(-0.2032470703125hf, 0.058197021484375hf, -0.487060546875hf, 0.1011962890625hf)); +const f16mat4 w0_5 = f16mat4( + f16vec4(0.1087646484375hf, 0.0997314453125hf, -0.028167724609375hf, -0.0640869140625hf), + f16vec4(-0.3515625hf, -0.20458984375hf, -0.1595458984375hf, -0.1417236328125hf), + f16vec4(-0.1824951171875hf, 0.004512786865234375hf, -0.203125hf, -0.017974853515625hf), + f16vec4(-0.340576171875hf, -0.026641845703125hf, -0.40673828125hf, -0.146484375hf)); +const f16mat4 w0_6 = f16mat4( + f16vec4(0.049713134765625hf, 0.08721923828125hf, 0.32861328125hf, 0.057769775390625hf), + f16vec4(-0.2418212890625hf, -0.0408935546875hf, -0.5810546875hf, 0.1025390625hf), + f16vec4(0.027099609375hf, 0.042083740234375hf, -0.408447265625hf, 0.0665283203125hf), + f16vec4(-0.373046875hf, -0.1920166015625hf, -0.0310516357421875hf, -0.1453857421875hf)); +const f16mat4 w0_7 = f16mat4( + f16vec4(0.1629638671875hf, 0.33544921875hf, 0.175048828125hf, -0.135009765625hf), + f16vec4(-0.274169921875hf, -0.19287109375hf, -0.343505859375hf, -0.1380615234375hf), + f16vec4(0.08349609375hf, 0.020782470703125hf, -0.290283203125hf, 0.0863037109375hf), + f16vec4(-0.424072265625hf, -0.209716796875hf, 0.1817626953125hf, -0.05767822265625hf)); +const f16mat4 w0_8 = f16mat4( + f16vec4(0.055694580078125hf, 0.0753173828125hf, 0.1500244140625hf, 0.00901031494140625hf), + f16vec4(-0.423583984375hf, -0.1484375hf, -0.0767822265625hf, -0.1217041015625hf), + f16vec4(-0.30908203125hf, -0.0162353515625hf, -0.319091796875hf, 0.07159423828125hf), + f16vec4(-0.52490234375hf, -0.06353759765625hf, -0.0701904296875hf, 0.07574462890625hf)); +const f16mat4 w0_9 = f16mat4( + f16vec4(0.3369140625hf, -0.14404296875hf, -0.2080078125hf, 0.06591796875hf), + f16vec4(0.120849609375hf, -0.11163330078125hf, 0.2476806640625hf, -0.08563232421875hf), + f16vec4(-0.50390625hf, -0.1278076171875hf, -0.10821533203125hf, -0.003635406494140625hf), + f16vec4(0.036773681640625hf, 0.283203125hf, -0.428955078125hf, 0.14306640625hf)); +const f16mat4 w0_10 = f16mat4( + f16vec4(-0.04791259765625hf, -0.14208984375hf, -0.1395263671875hf, 0.06402587890625hf), + f16vec4(0.08770751953125hf, 0.039886474609375hf, -0.0181427001953125hf, -0.02947998046875hf), + f16vec4(-0.38427734375hf, -0.2325439453125hf, 0.29833984375hf, -0.2374267578125hf), + f16vec4(-0.0236663818359375hf, 0.087158203125hf, -0.0394287109375hf, 0.2301025390625hf)); +const f16mat4 w0_11 = f16mat4( + f16vec4(0.1695556640625hf, -0.0253448486328125hf, -0.2313232421875hf, 0.06512451171875hf), + f16vec4(-0.00428009033203125hf, 0.07666015625hf, -0.1766357421875hf, 0.031280517578125hf), + f16vec4(-0.51611328125hf, -0.134765625hf, 0.046356201171875hf, -0.04132080078125hf), + f16vec4(-0.0219573974609375hf, 0.054168701171875hf, 0.387451171875hf, 0.158935546875hf)); +const f16mat4 w0_12 = f16mat4( + f16vec4(0.275390625hf, -0.1671142578125hf, -0.283935546875hf, -0.062347412109375hf), + f16vec4(0.134521484375hf, 0.0499267578125hf, -0.068603515625hf, 0.10992431640625hf), + f16vec4(-0.42431640625hf, -0.06231689453125hf, -0.1746826171875hf, -0.054351806640625hf), + f16vec4(0.10260009765625hf, 0.23388671875hf, -0.1171875hf, -0.12213134765625hf)); +const f16mat4 w0_13 = f16mat4( + f16vec4(-0.13720703125hf, -0.0950927734375hf, -0.147216796875hf, 0.01204681396484375hf), + f16vec4(0.1119384765625hf, 0.14794921875hf, 0.07745361328125hf, -0.050048828125hf), + f16vec4(-0.321533203125hf, -0.2301025390625hf, -0.35546875hf, 0.212646484375hf), + f16vec4(0.11614990234375hf, 0.10528564453125hf, -0.166015625hf, 0.1278076171875hf)); +const f16mat4 w0_14 = f16mat4( + f16vec4(0.1014404296875hf, -0.02850341796875hf, -0.299560546875hf, 0.007724761962890625hf), + f16vec4(0.052734375hf, 0.041839599609375hf, -0.1492919921875hf, 0.1260986328125hf), + f16vec4(-0.5732421875hf, -0.368408203125hf, 0.16748046875hf, -0.41259765625hf), + f16vec4(0.06500244140625hf, 0.09478759765625hf, 0.01212310791015625hf, 0.0511474609375hf)); +const f16mat4 w0_15 = f16mat4( + f16vec4(0.337890625hf, -0.1278076171875hf, -0.1461181640625hf, 0.08929443359375hf), + f16vec4(-0.02142333984375hf, -0.197998046875hf, 0.073486328125hf, 0.216552734375hf), + f16vec4(-0.5107421875hf, -0.07623291015625hf, 0.2008056640625hf, -0.349609375hf), + f16vec4(-0.01207733154296875hf, 0.2259521484375hf, -0.2310791015625hf, -0.1138916015625hf)); +const f16mat4 w0_16 = f16mat4( + f16vec4(0.00872039794921875hf, -0.08258056640625hf, -0.005584716796875hf, 0.12353515625hf), + f16vec4(0.07177734375hf, 0.11602783203125hf, -0.1270751953125hf, -0.06414794921875hf), + f16vec4(-0.45361328125hf, -0.03143310546875hf, -0.331298828125hf, 0.2347412109375hf), + f16vec4(-0.0283966064453125hf, 0.031768798828125hf, 0.201904296875hf, -0.04595947265625hf)); +const f16mat4 w0_17 = f16mat4( + f16vec4(0.2322998046875hf, 0.07086181640625hf, -0.0750732421875hf, 0.2105712890625hf), + f16vec4(0.0125579833984375hf, -0.0007271766662597656hf, 0.01235198974609375hf, -0.007354736328125hf), + f16vec4(-0.55322265625hf, -0.335693359375hf, -0.483154296875hf, -0.08172607421875hf), + f16vec4(-0.06121826171875hf, 0.10699462890625hf, 0.137451171875hf, 0.1368408203125hf)); +const f16mat4 w0_18 = f16mat4( + f16vec4(0.04608154296875hf, 0.263916015625hf, -0.03765869140625hf, 0.26025390625hf), + f16vec4(-0.135009765625hf, 0.0465087890625hf, 0.08502197265625hf, -0.046539306640625hf), + f16vec4(0.011871337890625hf, 0.087158203125hf, 0.2021484375hf, 0.133056640625hf), + f16vec4(0.1307373046875hf, -0.1328125hf, 0.185791015625hf, -0.191650390625hf)); +const f16mat4 w0_19 = f16mat4( + f16vec4(0.2481689453125hf, -0.114501953125hf, 0.2137451171875hf, -0.0791015625hf), + f16vec4(-0.11114501953125hf, 0.0521240234375hf, 0.04608154296875hf, -0.365478515625hf), + f16vec4(0.06146240234375hf, 0.11895751953125hf, 0.0307159423828125hf, 0.054290771484375hf), + f16vec4(0.08416748046875hf, 0.1285400390625hf, -0.08978271484375hf, -0.08673095703125hf)); +const f16mat4 w0_20 = f16mat4( + f16vec4(-0.004314422607421875hf, 0.39990234375hf, 0.1312255859375hf, 0.316162109375hf), + f16vec4(-0.2413330078125hf, 0.294677734375hf, 0.1873779296875hf, 0.03582763671875hf), + f16vec4(-0.07275390625hf, 0.047576904296875hf, 0.0833740234375hf, 0.07073974609375hf), + f16vec4(0.08843994140625hf, -0.01486968994140625hf, -0.2340087890625hf, -0.4072265625hf)); +const f16mat4 w0_21 = f16mat4( + f16vec4(0.1505126953125hf, 0.37060546875hf, -0.087890625hf, 0.26416015625hf), + f16vec4(-0.057525634765625hf, 0.02301025390625hf, 0.0036773681640625hf, 0.08477783203125hf), + f16vec4(0.09478759765625hf, 0.0958251953125hf, -0.044036865234375hf, 0.01526641845703125hf), + f16vec4(0.09625244140625hf, -0.1357421875hf, 0.27294921875hf, -0.1435546875hf)); +const f16mat4 w0_22 = f16mat4( + f16vec4(0.2958984375hf, -0.2001953125hf, -0.125244140625hf, -0.1265869140625hf), + f16vec4(-0.0628662109375hf, -0.035552978515625hf, -0.02685546875hf, -0.362060546875hf), + f16vec4(0.06396484375hf, 0.11810302734375hf, 0.071044921875hf, -0.07080078125hf), + f16vec4(0.094482421875hf, 0.1849365234375hf, -0.057220458984375hf, 0.149658203125hf)); +const f16mat4 w0_23 = f16mat4( + f16vec4(0.085693359375hf, 0.38427734375hf, 0.0125579833984375hf, 0.12158203125hf), + f16vec4(-0.2232666015625hf, 0.182373046875hf, 0.1082763671875hf, -0.131103515625hf), + f16vec4(-0.0867919921875hf, 0.096923828125hf, 0.23828125hf, -0.166015625hf), + f16vec4(0.11334228515625hf, 0.03179931640625hf, -0.216552734375hf, -0.07818603515625hf)); +const f16mat4 w0_24 = f16mat4( + f16vec4(0.11932373046875hf, 0.308349609375hf, 0.0275115966796875hf, 0.085205078125hf), + f16vec4(-0.136474609375hf, 0.0888671875hf, 0.12481689453125hf, 0.045928955078125hf), + f16vec4(0.0384521484375hf, 0.12457275390625hf, 0.0191192626953125hf, 0.07012939453125hf), + f16vec4(0.042510986328125hf, -0.1295166015625hf, 0.1392822265625hf, -0.032562255859375hf)); +const f16mat4 w0_25 = f16mat4( + f16vec4(0.189697265625hf, -0.00360870361328125hf, -0.144287109375hf, 0.08013916015625hf), + f16vec4(-0.1114501953125hf, -0.138916015625hf, 0.11541748046875hf, -0.1517333984375hf), + f16vec4(0.04034423828125hf, 0.182373046875hf, -0.042083740234375hf, 0.08612060546875hf), + f16vec4(-0.0178375244140625hf, 0.07757568359375hf, 0.1607666015625hf, -0.0703125hf)); +const f16mat4 w0_26 = f16mat4( + f16vec4(-0.08343505859375hf, 0.24853515625hf, 0.01218414306640625hf, 0.1923828125hf), + f16vec4(-0.22900390625hf, 0.0171051025390625hf, 0.1800537109375hf, 0.09722900390625hf), + f16vec4(-0.1146240234375hf, 0.1815185546875hf, 0.2110595703125hf, -0.032196044921875hf), + f16vec4(-0.06695556640625hf, -0.1917724609375hf, -0.08624267578125hf, -0.2037353515625hf)); +const f16mat4 w0_27 = f16mat4( + f16vec4(-0.1650390625hf, -0.443115234375hf, 0.0298614501953125hf, -0.4375hf), + f16vec4(0.1649169921875hf, -0.2337646484375hf, 0.121826171875hf, -0.043853759765625hf), + f16vec4(-0.15380859375hf, -0.0289306640625hf, -0.1602783203125hf, 0.09832763671875hf), + f16vec4(0.1669921875hf, -0.059600830078125hf, 0.1251220703125hf, -0.008636474609375hf)); +const f16mat4 w0_28 = f16mat4( + f16vec4(-0.135986328125hf, -0.1907958984375hf, 0.1346435546875hf, -0.2666015625hf), + f16vec4(0.1566162109375hf, -0.28125hf, 0.0267486572265625hf, -0.1298828125hf), + f16vec4(-0.249755859375hf, -0.151611328125hf, -0.250244140625hf, -0.0293426513671875hf), + f16vec4(0.1839599609375hf, 0.2001953125hf, 0.0400390625hf, 0.1693115234375hf)); +const f16mat4 w0_29 = f16mat4( + f16vec4(-0.13720703125hf, 0.149658203125hf, 0.2047119140625hf, -0.445556640625hf), + f16vec4(-0.007190704345703125hf, -0.2109375hf, -0.00463104248046875hf, -0.00617218017578125hf), + f16vec4(-0.352294921875hf, -0.0170745849609375hf, -0.10546875hf, 0.2015380859375hf), + f16vec4(0.033966064453125hf, 0.07879638671875hf, -0.2154541015625hf, 0.054840087890625hf)); +const f16mat4 w0_30 = f16mat4( + f16vec4(-0.058441162109375hf, -0.1544189453125hf, 0.0364990234375hf, -0.53857421875hf), + f16vec4(0.1864013671875hf, -0.052978515625hf, 0.12481689453125hf, -0.398681640625hf), + f16vec4(-0.1453857421875hf, -0.0299835205078125hf, -0.11370849609375hf, 0.00441741943359375hf), + f16vec4(0.1661376953125hf, 0.0306549072265625hf, -0.053619384765625hf, 0.025146484375hf)); +const f16mat4 w0_31 = f16mat4( + f16vec4(0.027801513671875hf, 0.1114501953125hf, -0.029571533203125hf, -0.06414794921875hf), + f16vec4(0.149658203125hf, -0.1444091796875hf, -0.046417236328125hf, -0.26318359375hf), + f16vec4(-0.2003173828125hf, -0.06463623046875hf, -0.0936279296875hf, -0.2138671875hf), + f16vec4(0.161865234375hf, 0.085693359375hf, 0.24609375hf, 0.00585174560546875hf)); +const f16mat4 w0_32 = f16mat4( + f16vec4(-0.0281829833984375hf, 0.239990234375hf, 0.102294921875hf, -0.11102294921875hf), + f16vec4(0.0166168212890625hf, -0.1793212890625hf, -0.1856689453125hf, -0.1170654296875hf), + f16vec4(-0.271728515625hf, 0.1572265625hf, -0.1363525390625hf, 0.17578125hf), + f16vec4(0.050262451171875hf, 0.06658935546875hf, -0.0212860107421875hf, 0.053436279296875hf)); +const f16mat4 w0_33 = f16mat4( + f16vec4(-0.30419921875hf, -0.344970703125hf, 0.07342529296875hf, -0.677734375hf), + f16vec4(0.247314453125hf, -0.27783203125hf, -0.01007843017578125hf, -0.34130859375hf), + f16vec4(-0.1727294921875hf, -0.0975341796875hf, -0.37841796875hf, 0.1287841796875hf), + f16vec4(0.07086181640625hf, -0.046478271484375hf, -0.233642578125hf, 0.249755859375hf)); +const f16mat4 w0_34 = f16mat4( + f16vec4(-0.1685791015625hf, -0.108642578125hf, 0.1522216796875hf, -0.282470703125hf), + f16vec4(0.2099609375hf, -0.252685546875hf, -0.033843994140625hf, -0.2144775390625hf), + f16vec4(-0.255859375hf, -0.062347412109375hf, -0.21435546875hf, -0.09075927734375hf), + f16vec4(0.1336669921875hf, -0.0069427490234375hf, -0.128173828125hf, 0.08837890625hf)); +const f16mat4 w0_35 = f16mat4( + f16vec4(-0.2119140625hf, -0.0228118896484375hf, 0.09033203125hf, -0.18408203125hf), + f16vec4(0.0288848876953125hf, -0.2257080078125hf, -0.0572509765625hf, 0.004974365234375hf), + f16vec4(-0.33544921875hf, 0.206787109375hf, -0.00870513916015625hf, 0.09600830078125hf), + f16vec4(-0.027801513671875hf, 0.01015472412109375hf, 0.010406494140625hf, 0.1385498046875hf)); +const f16vec4 sub0 = f16vec4(-2.3515625hf, 0.049102783203125hf, -1.5791015625hf, -1.2529296875hf); +const f16vec4 mul0 = f16vec4(0.484619140625hf, 0.48193359375hf, 0.348388671875hf, 0.288330078125hf); +const f16vec4 add0 = f16vec4(-1.0283203125hf, -0.59228515625hf, 0.0012111663818359375hf, 0.051300048828125hf); + +const f16mat4 w1_0 = f16mat4( + f16vec4(0.2122802734375hf, 0.2279052734375hf, 0.165771484375hf, 0.145263671875hf), + f16vec4(0.1729736328125hf, 0.2291259765625hf, -0.362060546875hf, -0.2218017578125hf), + f16vec4(0.1263427734375hf, -0.2103271484375hf, 0.11651611328125hf, 0.306640625hf), + f16vec4(-0.0145111083984375hf, -0.06121826171875hf, -0.1287841796875hf, -0.447509765625hf)); +const f16mat4 w1_1 = f16mat4( + f16vec4(0.057769775390625hf, -0.012786865234375hf, 0.06915283203125hf, 0.251708984375hf), + f16vec4(0.232666015625hf, -0.1478271484375hf, -0.0232086181640625hf, 0.03814697265625hf), + f16vec4(-0.0775146484375hf, -0.049041748046875hf, 0.034271240234375hf, 0.012176513671875hf), + f16vec4(-0.1256103515625hf, -0.2032470703125hf, -0.2310791015625hf, -0.387451171875hf)); +const f16mat4 w1_2 = f16mat4( + f16vec4(0.051025390625hf, -0.0316162109375hf, 0.2015380859375hf, 0.1351318359375hf), + f16vec4(-0.28857421875hf, 0.049957275390625hf, 0.10382080078125hf, 0.060272216796875hf), + f16vec4(0.125hf, -0.2396240234375hf, 0.09393310546875hf, 0.349609375hf), + f16vec4(-0.069580078125hf, 0.0138092041015625hf, -0.370849609375hf, -0.46142578125hf)); +const f16mat4 w1_3 = f16mat4( + f16vec4(-0.00936126708984375hf, 0.1883544921875hf, 0.1195068359375hf, 0.1864013671875hf), + f16vec4(-0.3271484375hf, -0.03436279296875hf, -0.018798828125hf, -0.1455078125hf), + f16vec4(0.156005859375hf, -0.11016845703125hf, -0.0201873779296875hf, 0.04150390625hf), + f16vec4(-0.11004638671875hf, 0.035614013671875hf, -0.142333984375hf, -0.437255859375hf)); +const f16mat4 w1_4 = f16mat4( + f16vec4(-0.148193359375hf, -0.032958984375hf, -0.0056610107421875hf, 0.3095703125hf), + f16vec4(0.251953125hf, -0.256591796875hf, -0.41064453125hf, -0.0237884521484375hf), + f16vec4(-0.13330078125hf, -0.0019931793212890625hf, -0.1226806640625hf, -0.263916015625hf), + f16vec4(0.1651611328125hf, -0.04150390625hf, -0.01042938232421875hf, -0.164306640625hf)); +const f16mat4 w1_5 = f16mat4( + f16vec4(-0.09161376953125hf, -0.097412109375hf, 0.1094970703125hf, 0.12890625hf), + f16vec4(0.050048828125hf, -0.349609375hf, -0.15673828125hf, -0.007602691650390625hf), + f16vec4(0.07904052734375hf, -0.193603515625hf, -0.00830841064453125hf, 0.041290283203125hf), + f16vec4(-0.0263824462890625hf, 0.1539306640625hf, -0.196044921875hf, -0.1719970703125hf)); +const f16mat4 w1_6 = f16mat4( + f16vec4(0.07281494140625hf, 0.120361328125hf, 0.11297607421875hf, 0.2220458984375hf), + f16vec4(0.049041748046875hf, -0.003093719482421875hf, 0.1282958984375hf, -0.19921875hf), + f16vec4(0.1173095703125hf, -0.11309814453125hf, 0.09814453125hf, 0.281005859375hf), + f16vec4(-0.34765625hf, -0.10382080078125hf, -0.388671875hf, -0.6025390625hf)); +const f16mat4 w1_7 = f16mat4( + f16vec4(-0.11346435546875hf, -0.060882568359375hf, -0.0496826171875hf, 0.26123046875hf), + f16vec4(-0.156005859375hf, 0.07879638671875hf, 0.0306854248046875hf, -0.06121826171875hf), + f16vec4(-0.11883544921875hf, -0.1634521484375hf, 0.061279296875hf, 0.019439697265625hf), + f16vec4(-0.166259765625hf, -0.1734619140625hf, -0.291259765625hf, -0.46875hf)); +const f16mat4 w1_8 = f16mat4( + f16vec4(-0.01690673828125hf, -0.164306640625hf, 0.05926513671875hf, 0.0477294921875hf), + f16vec4(0.147216796875hf, -0.10009765625hf, -0.255859375hf, -0.183349609375hf), + f16vec4(-0.01425933837890625hf, -0.313720703125hf, 0.0863037109375hf, 0.2080078125hf), + f16vec4(-0.0693359375hf, -0.1268310546875hf, -0.0738525390625hf, -0.28271484375hf)); +const f16mat4 w1_9 = f16mat4( + f16vec4(-0.009307861328125hf, 0.052978515625hf, -0.05621337890625hf, 0.0164794921875hf), + f16vec4(-0.4375hf, 0.40380859375hf, 0.07965087890625hf, -0.246337890625hf), + f16vec4(-0.126220703125hf, 0.041015625hf, -0.0096435546875hf, -0.1162109375hf), + f16vec4(0.0848388671875hf, -0.50244140625hf, 0.09442138671875hf, 0.2222900390625hf)); +const f16mat4 w1_10 = f16mat4( + f16vec4(-0.006801605224609375hf, -0.129150390625hf, -0.08929443359375hf, 0.0423583984375hf), + f16vec4(-0.259765625hf, 0.0016698837280273438hf, 0.02923583984375hf, -0.188720703125hf), + f16vec4(0.128662109375hf, 0.142578125hf, -0.264892578125hf, -0.04925537109375hf), + f16vec4(-0.0614013671875hf, -0.5263671875hf, 0.1343994140625hf, 0.0260009765625hf)); +const f16mat4 w1_11 = f16mat4( + f16vec4(0.04290771484375hf, -0.0013980865478515625hf, -0.059906005859375hf, 0.1427001953125hf), + f16vec4(-0.4892578125hf, 0.18603515625hf, 0.1331787109375hf, -0.12451171875hf), + f16vec4(0.13818359375hf, 0.00705718994140625hf, -0.11859130859375hf, -0.1961669921875hf), + f16vec4(0.16064453125hf, 0.00943756103515625hf, -0.0007529258728027344hf, 0.1630859375hf)); +const f16mat4 w1_12 = f16mat4( + f16vec4(-0.0362548828125hf, -0.037322998046875hf, -0.10089111328125hf, 0.0992431640625hf), + f16vec4(-0.344482421875hf, 0.2296142578125hf, 0.10284423828125hf, 0.024383544921875hf), + f16vec4(-0.2392578125hf, -0.1405029296875hf, -0.05462646484375hf, -0.057159423828125hf), + f16vec4(0.20556640625hf, -0.1153564453125hf, 0.0146484375hf, 0.1494140625hf)); +const f16mat4 w1_13 = f16mat4( + f16vec4(-0.03924560546875hf, -0.189208984375hf, -0.1436767578125hf, 0.16357421875hf), + f16vec4(-0.366943359375hf, -0.1441650390625hf, -0.0023345947265625hf, 0.076904296875hf), + f16vec4(-0.2042236328125hf, -0.2274169921875hf, 0.1375732421875hf, -0.029388427734375hf), + f16vec4(0.1280517578125hf, -0.203369140625hf, 0.0802001953125hf, 0.0263671875hf)); +const f16mat4 w1_14 = f16mat4( + f16vec4(0.022735595703125hf, -0.0192413330078125hf, -0.1529541015625hf, 0.23828125hf), + f16vec4(-0.309814453125hf, 0.110595703125hf, 0.06744384765625hf, 0.03167724609375hf), + f16vec4(-0.1846923828125hf, 0.1326904296875hf, -0.196044921875hf, -0.12890625hf), + f16vec4(0.08758544921875hf, 0.03973388671875hf, 0.037200927734375hf, 0.180908203125hf)); +const f16mat4 w1_15 = f16mat4( + f16vec4(0.09503173828125hf, 0.13427734375hf, -0.08721923828125hf, 0.1492919921875hf), + f16vec4(-0.59228515625hf, 0.261474609375hf, 0.11627197265625hf, -0.2301025390625hf), + f16vec4(-0.2451171875hf, 0.1314697265625hf, -0.2452392578125hf, -0.1636962890625hf), + f16vec4(0.32666015625hf, -0.10992431640625hf, 0.0330810546875hf, 0.34130859375hf)); +const f16mat4 w1_16 = f16mat4( + f16vec4(0.0261993408203125hf, -0.0501708984375hf, -0.1611328125hf, 0.1766357421875hf), + f16vec4(-0.7060546875hf, 0.03887939453125hf, 0.08642578125hf, -0.054412841796875hf), + f16vec4(0.1871337890625hf, -0.185791015625hf, 0.0455322265625hf, -0.114013671875hf), + f16vec4(0.455810546875hf, -0.292236328125hf, -0.05615234375hf, 0.157958984375hf)); +const f16mat4 w1_17 = f16mat4( + f16vec4(0.1578369140625hf, 0.05914306640625hf, -0.11700439453125hf, 0.263671875hf), + f16vec4(-0.76025390625hf, 0.424072265625hf, -0.026580810546875hf, -0.112548828125hf), + f16vec4(-0.32861328125hf, 0.17626953125hf, 0.23095703125hf, -0.03973388671875hf), + f16vec4(0.5185546875hf, -0.20703125hf, 0.10614013671875hf, 0.2030029296875hf)); +const f16mat4 w1_18 = f16mat4( + f16vec4(0.0614013671875hf, -0.552734375hf, -0.0236663818359375hf, 0.114501953125hf), + f16vec4(0.110107421875hf, 0.2064208984375hf, -0.24267578125hf, -0.37890625hf), + f16vec4(0.11090087890625hf, 0.047576904296875hf, -0.019775390625hf, -0.1903076171875hf), + f16vec4(0.00986480712890625hf, 0.2193603515625hf, 0.1290283203125hf, -0.341796875hf)); +const f16mat4 w1_19 = f16mat4( + f16vec4(0.061614990234375hf, -0.2288818359375hf, -0.03863525390625hf, -0.08306884765625hf), + f16vec4(0.0750732421875hf, -0.136474609375hf, -0.416259765625hf, -0.134033203125hf), + f16vec4(0.1964111328125hf, 0.01763916015625hf, 0.0133819580078125hf, -0.06915283203125hf), + f16vec4(0.09844970703125hf, -0.243408203125hf, 0.206298828125hf, -0.00933837890625hf)); +const f16mat4 w1_20 = f16mat4( + f16vec4(0.3916015625hf, -0.442626953125hf, 0.1517333984375hf, 0.1661376953125hf), + f16vec4(0.364990234375hf, -0.03411865234375hf, -0.26025390625hf, -0.1923828125hf), + f16vec4(0.1746826171875hf, 0.1124267578125hf, -0.1431884765625hf, -0.209228515625hf), + f16vec4(-0.35693359375hf, 0.62109375hf, -0.1329345703125hf, -0.12042236328125hf)); +const f16mat4 w1_21 = f16mat4( + f16vec4(0.239990234375hf, -0.274658203125hf, 0.04803466796875hf, 0.0196380615234375hf), + f16vec4(0.00698089599609375hf, 0.03131103515625hf, -0.12176513671875hf, -0.1380615234375hf), + f16vec4(0.11871337890625hf, -0.091064453125hf, -0.0645751953125hf, -0.0447998046875hf), + f16vec4(-0.1962890625hf, 0.1453857421875hf, -0.126220703125hf, -0.1685791015625hf)); +const f16mat4 w1_22 = f16mat4( + f16vec4(-0.14404296875hf, 0.08990478515625hf, -0.1134033203125hf, -0.1297607421875hf), + f16vec4(-0.12249755859375hf, -0.27490234375hf, -0.2447509765625hf, 0.11407470703125hf), + f16vec4(0.0789794921875hf, -0.005306243896484375hf, 0.03485107421875hf, 0.0897216796875hf), + f16vec4(0.255859375hf, -0.307373046875hf, 0.029052734375hf, 0.13037109375hf)); +const f16mat4 w1_23 = f16mat4( + f16vec4(0.2113037109375hf, 0.020721435546875hf, -0.01137542724609375hf, 0.08929443359375hf), + f16vec4(0.2093505859375hf, -0.1627197265625hf, -0.1044921875hf, 0.00638580322265625hf), + f16vec4(0.149169921875hf, 0.027984619140625hf, -0.165283203125hf, -0.072021484375hf), + f16vec4(-0.11395263671875hf, 0.31005859375hf, 0.0066986083984375hf, 0.013641357421875hf)); +const f16mat4 w1_24 = f16mat4( + f16vec4(0.43408203125hf, -0.5732421875hf, 0.007534027099609375hf, 0.1334228515625hf), + f16vec4(0.304931640625hf, 0.095703125hf, -0.24267578125hf, -0.180419921875hf), + f16vec4(0.2437744140625hf, -0.1837158203125hf, -0.0703125hf, -0.319091796875hf), + f16vec4(-0.250732421875hf, 0.318603515625hf, 0.11767578125hf, -0.148681640625hf)); +const f16mat4 w1_25 = f16mat4( + f16vec4(0.223388671875hf, -0.259765625hf, 0.035247802734375hf, -0.04339599609375hf), + f16vec4(-0.042327880859375hf, -0.25537109375hf, -0.3115234375hf, -0.03363037109375hf), + f16vec4(0.1700439453125hf, -0.01345062255859375hf, -0.0002570152282714844hf, -0.10699462890625hf), + f16vec4(0.098388671875hf, 0.0166015625hf, 0.0099639892578125hf, 0.031036376953125hf)); +const f16mat4 w1_26 = f16mat4( + f16vec4(0.340576171875hf, -0.180908203125hf, 0.0906982421875hf, 0.135986328125hf), + f16vec4(0.1656494140625hf, -0.054595947265625hf, -0.0859375hf, -0.216796875hf), + f16vec4(0.11065673828125hf, 0.08740234375hf, -0.160400390625hf, -0.228271484375hf), + f16vec4(-0.204833984375hf, 0.33251953125hf, 0.041717529296875hf, -0.1571044921875hf)); +const f16mat4 w1_27 = f16mat4( + f16vec4(0.0316162109375hf, -0.180908203125hf, 0.11248779296875hf, -0.27978515625hf), + f16vec4(-0.09490966796875hf, 0.2027587890625hf, -0.1964111328125hf, -0.0218048095703125hf), + f16vec4(0.173828125hf, 0.125244140625hf, 0.1842041015625hf, 0.087158203125hf), + f16vec4(0.01387786865234375hf, 0.031829833984375hf, 0.178955078125hf, 0.1875hf)); +const f16mat4 w1_28 = f16mat4( + f16vec4(-0.1640625hf, -0.0989990234375hf, 0.00409698486328125hf, 0.0075531005859375hf), + f16vec4(-0.006809234619140625hf, 0.12548828125hf, 0.055328369140625hf, 0.1669921875hf), + f16vec4(-0.20751953125hf, -0.17626953125hf, 0.00788116455078125hf, 0.057403564453125hf), + f16vec4(0.06103515625hf, -0.05963134765625hf, 0.25634765625hf, 0.22265625hf)); +const f16mat4 w1_29 = f16mat4( + f16vec4(-0.00495147705078125hf, 0.257568359375hf, -0.12042236328125hf, -0.041473388671875hf), + f16vec4(0.276611328125hf, -0.03466796875hf, -0.35791015625hf, -0.060272216796875hf), + f16vec4(-0.0565185546875hf, 0.07843017578125hf, 0.332763671875hf, 0.22900390625hf), + f16vec4(-0.3193359375hf, 0.132080078125hf, 0.56298828125hf, 0.1767578125hf)); +const f16mat4 w1_30 = f16mat4( + f16vec4(0.0195770263671875hf, -0.0325927734375hf, -0.045135498046875hf, 0.06988525390625hf), + f16vec4(0.0164794921875hf, 0.159912109375hf, -0.2119140625hf, 0.3544921875hf), + f16vec4(-0.0236358642578125hf, 0.09649658203125hf, 0.12078857421875hf, 0.09649658203125hf), + f16vec4(-0.337158203125hf, 0.10113525390625hf, -0.046630859375hf, 0.171142578125hf)); +const f16mat4 w1_31 = f16mat4( + f16vec4(-0.05242919921875hf, -0.0653076171875hf, 0.154541015625hf, 0.388916015625hf), + f16vec4(-0.03558349609375hf, 0.0224456787109375hf, -0.04595947265625hf, 0.4384765625hf), + f16vec4(-0.22900390625hf, -0.2218017578125hf, -0.2291259765625hf, -0.08941650390625hf), + f16vec4(-0.156982421875hf, 0.0304107666015625hf, -0.2298583984375hf, 0.0302886962890625hf)); +const f16mat4 w1_32 = f16mat4( + f16vec4(-0.12066650390625hf, 0.2325439453125hf, 0.1043701171875hf, 0.2261962890625hf), + f16vec4(-0.032928466796875hf, -0.022552490234375hf, -0.177978515625hf, 0.136474609375hf), + f16vec4(-0.0889892578125hf, -0.10211181640625hf, -0.053314208984375hf, -0.038330078125hf), + f16vec4(0.0284423828125hf, 0.1182861328125hf, 0.11309814453125hf, 0.03021240234375hf)); +const f16mat4 w1_33 = f16mat4( + f16vec4(-0.0687255859375hf, -0.044647216796875hf, -0.053741455078125hf, -0.053955078125hf), + f16vec4(-0.082763671875hf, 0.1805419921875hf, -0.0162506103515625hf, -0.0162506103515625hf), + f16vec4(-0.12420654296875hf, 0.1278076171875hf, 0.367431640625hf, 0.1641845703125hf), + f16vec4(-0.2308349609375hf, 0.0369873046875hf, 0.56640625hf, 0.1253662109375hf)); +const f16mat4 w1_34 = f16mat4( + f16vec4(-0.121337890625hf, -0.01824951171875hf, -0.08795166015625hf, 0.10089111328125hf), + f16vec4(0.0038280487060546875hf, 0.07257080078125hf, -0.1298828125hf, 0.05133056640625hf), + f16vec4(-0.294677734375hf, -0.09368896484375hf, 0.06536865234375hf, 0.119140625hf), + f16vec4(-0.2939453125hf, 0.08563232421875hf, 0.283203125hf, 0.158935546875hf)); +const f16mat4 w1_35 = f16mat4( + f16vec4(-0.1861572265625hf, 0.3193359375hf, -0.11309814453125hf, -0.11981201171875hf), + f16vec4(0.0136871337890625hf, 0.018402099609375hf, -0.362548828125hf, -0.307861328125hf), + f16vec4(0.046966552734375hf, 0.08685302734375hf, 0.10797119140625hf, 0.11553955078125hf), + f16vec4(-0.1519775390625hf, 0.2169189453125hf, 0.09039306640625hf, 0.2366943359375hf)); +const f16vec4 sub1 = f16vec4(-0.53955078125hf, -0.759765625hf, -0.642578125hf, -0.08746337890625hf); +const f16vec4 mul1 = f16vec4(0.25830078125hf, 0.321533203125hf, 0.42333984375hf, 0.482666015625hf); +const f16vec4 add1 = f16vec4(-0.09368896484375hf, -0.235107421875hf, -0.14111328125hf, -0.65771484375hf); + +const f16mat4 w2_0 = f16mat4( + f16vec4(-0.10064697265625hf, -0.0721435546875hf, 0.1649169921875hf, 0.2056884765625hf), + f16vec4(-0.2010498046875hf, -0.044891357421875hf, -0.00307464599609375hf, -0.030303955078125hf), + f16vec4(0.103515625hf, -0.2218017578125hf, -0.1461181640625hf, 0.1546630859375hf), + f16vec4(-0.12042236328125hf, 0.043243408203125hf, -0.288818359375hf, 0.106689453125hf)); +const f16mat4 w2_1 = f16mat4( + f16vec4(-0.09442138671875hf, -0.09149169921875hf, 0.046539306640625hf, 0.4521484375hf), + f16vec4(0.00569915771484375hf, -0.2283935546875hf, -0.07427978515625hf, 0.2138671875hf), + f16vec4(0.05194091796875hf, -0.0623779296875hf, 0.1094970703125hf, 0.037506103515625hf), + f16vec4(-0.157470703125hf, -0.1693115234375hf, -0.03662109375hf, 0.214111328125hf)); +const f16mat4 w2_2 = f16mat4( + f16vec4(-0.05657958984375hf, -0.026336669921875hf, 0.192138671875hf, 0.1397705078125hf), + f16vec4(-0.25732421875hf, -0.081298828125hf, -0.040496826171875hf, 0.021697998046875hf), + f16vec4(0.1253662109375hf, -0.057159423828125hf, -0.1590576171875hf, 0.04595947265625hf), + f16vec4(-0.0855712890625hf, -0.0802001953125hf, -0.66064453125hf, -0.036773681640625hf)); +const f16mat4 w2_3 = f16mat4( + f16vec4(-0.155029296875hf, -0.01233673095703125hf, 0.1600341796875hf, 0.1719970703125hf), + f16vec4(-0.378662109375hf, 0.143310546875hf, -0.075439453125hf, -0.4873046875hf), + f16vec4(-0.0780029296875hf, -0.3701171875hf, 0.25537109375hf, 0.146484375hf), + f16vec4(-0.0892333984375hf, 0.029388427734375hf, -0.36474609375hf, 0.179443359375hf)); +const f16mat4 w2_4 = f16mat4( + f16vec4(-0.115966796875hf, -0.03448486328125hf, 0.042236328125hf, 0.372802734375hf), + f16vec4(-0.30126953125hf, 0.283447265625hf, -0.21923828125hf, -0.11798095703125hf), + f16vec4(-0.07452392578125hf, -0.187744140625hf, 0.389404296875hf, 0.061920166015625hf), + f16vec4(-0.047637939453125hf, -0.127197265625hf, -0.06829833984375hf, 0.308349609375hf)); +const f16mat4 w2_5 = f16mat4( + f16vec4(-0.06951904296875hf, 0.044647216796875hf, 0.12078857421875hf, 0.10650634765625hf), + f16vec4(-0.1917724609375hf, 0.0010232925415039062hf, -0.1279296875hf, -0.267822265625hf), + f16vec4(-0.018829345703125hf, -0.232177734375hf, 0.01275634765625hf, -0.07763671875hf), + f16vec4(-0.240234375hf, -0.1617431640625hf, -0.367431640625hf, 0.2822265625hf)); +const f16mat4 w2_6 = f16mat4( + f16vec4(-0.0166168212890625hf, -0.111083984375hf, 0.24072265625hf, 0.20166015625hf), + f16vec4(-0.2442626953125hf, -0.35302734375hf, -0.058135986328125hf, -0.142822265625hf), + f16vec4(0.1336669921875hf, -0.404296875hf, 0.070556640625hf, 0.138916015625hf), + f16vec4(-0.2958984375hf, -0.1424560546875hf, -0.7109375hf, -0.041168212890625hf)); +const f16mat4 w2_7 = f16mat4( + f16vec4(-0.032745361328125hf, -0.112548828125hf, 0.08612060546875hf, 0.33642578125hf), + f16vec4(-0.26708984375hf, -0.20556640625hf, -0.12457275390625hf, 0.03424072265625hf), + f16vec4(0.09869384765625hf, -0.28564453125hf, 0.14501953125hf, 0.1474609375hf), + f16vec4(-0.09930419921875hf, 0.06707763671875hf, -0.708984375hf, 0.01934814453125hf)); +const f16mat4 w2_8 = f16mat4( + f16vec4(0.0214385986328125hf, -0.0592041015625hf, 0.1595458984375hf, -0.0120697021484375hf), + f16vec4(-0.36083984375hf, -0.15283203125hf, -0.006656646728515625hf, -0.059326171875hf), + f16vec4(0.142822265625hf, -0.3349609375hf, -0.33642578125hf, -0.1640625hf), + f16vec4(-0.121826171875hf, -0.0771484375hf, -0.60107421875hf, 0.08624267578125hf)); +const f16mat4 w2_9 = f16mat4( + f16vec4(0.187744140625hf, 0.1246337890625hf, 0.1114501953125hf, 0.1126708984375hf), + f16vec4(0.1400146484375hf, -0.09466552734375hf, 0.07525634765625hf, 0.310791015625hf), + f16vec4(-0.09649658203125hf, -0.11810302734375hf, -0.1221923828125hf, -0.206787109375hf), + f16vec4(-0.1783447265625hf, 0.129150390625hf, -0.1729736328125hf, -0.0262908935546875hf)); +const f16mat4 w2_10 = f16mat4( + f16vec4(0.198486328125hf, 0.1341552734375hf, 0.107177734375hf, 0.075439453125hf), + f16vec4(0.2568359375hf, 0.053802490234375hf, -0.1429443359375hf, 0.38330078125hf), + f16vec4(-0.23046875hf, -0.04901123046875hf, -0.11529541015625hf, -0.302734375hf), + f16vec4(-0.11944580078125hf, -0.0428466796875hf, 0.1898193359375hf, 0.1239013671875hf)); +const f16mat4 w2_11 = f16mat4( + f16vec4(0.209228515625hf, 0.1837158203125hf, 0.05682373046875hf, 0.052581787109375hf), + f16vec4(0.0980224609375hf, -0.18212890625hf, 0.0291595458984375hf, 0.159912109375hf), + f16vec4(-0.01214599609375hf, -0.11065673828125hf, 0.04638671875hf, 0.0279998779296875hf), + f16vec4(-0.277099609375hf, 0.0132598876953125hf, -0.496826171875hf, 0.01082611083984375hf)); +const f16mat4 w2_12 = f16mat4( + f16vec4(0.2161865234375hf, 0.230712890625hf, 0.10174560546875hf, -0.20751953125hf), + f16vec4(-0.0767822265625hf, -0.260986328125hf, -0.01328277587890625hf, 0.240234375hf), + f16vec4(-0.0306854248046875hf, -0.149169921875hf, -0.2044677734375hf, -0.0491943359375hf), + f16vec4(0.03350830078125hf, 0.322265625hf, 0.039306640625hf, 0.1470947265625hf)); +const f16mat4 w2_13 = f16mat4( + f16vec4(0.259765625hf, 0.286865234375hf, 0.0244140625hf, -0.2095947265625hf), + f16vec4(-0.00489044189453125hf, -0.00970458984375hf, -0.0858154296875hf, 0.399169921875hf), + f16vec4(-0.2939453125hf, -0.26025390625hf, -0.0584716796875hf, -0.276611328125hf), + f16vec4(0.087890625hf, -0.030242919921875hf, 0.394287109375hf, 0.17138671875hf)); +const f16mat4 w2_14 = f16mat4( + f16vec4(0.218505859375hf, 0.257568359375hf, 0.02569580078125hf, -0.11065673828125hf), + f16vec4(0.01544952392578125hf, -0.203125hf, -0.0153350830078125hf, 0.1373291015625hf), + f16vec4(-0.1153564453125hf, 0.04937744140625hf, -0.09454345703125hf, -0.1649169921875hf), + f16vec4(-0.27197265625hf, -0.07489013671875hf, -0.294189453125hf, 0.11334228515625hf)); +const f16mat4 w2_15 = f16mat4( + f16vec4(0.36181640625hf, 0.2103271484375hf, 0.2421875hf, 0.31005859375hf), + f16vec4(0.172119140625hf, -0.26904296875hf, 0.0653076171875hf, 0.08575439453125hf), + f16vec4(-0.140869140625hf, 0.0208740234375hf, 0.044952392578125hf, 0.1959228515625hf), + f16vec4(0.01221466064453125hf, 0.293212890625hf, -0.294921875hf, 0.105712890625hf)); +const f16mat4 w2_16 = f16mat4( + f16vec4(0.49951171875hf, 0.27490234375hf, 0.088623046875hf, 0.2626953125hf), + f16vec4(0.09246826171875hf, -0.049957275390625hf, 0.04827880859375hf, 0.39306640625hf), + f16vec4(-0.11712646484375hf, -0.38525390625hf, 0.0298309326171875hf, 0.15283203125hf), + f16vec4(0.1876220703125hf, 0.153564453125hf, -0.0203399658203125hf, 0.1693115234375hf)); +const f16mat4 w2_17 = f16mat4( + f16vec4(0.470703125hf, 0.341796875hf, 0.129150390625hf, 0.40234375hf), + f16vec4(-0.058135986328125hf, -0.135009765625hf, 0.06488037109375hf, 0.2646484375hf), + f16vec4(-0.1519775390625hf, -0.310791015625hf, -0.12030029296875hf, 0.1865234375hf), + f16vec4(-0.125hf, 0.062255859375hf, -0.30908203125hf, 0.012481689453125hf)); +const f16mat4 w2_18 = f16mat4( + f16vec4(-0.09228515625hf, -0.041412353515625hf, -0.12127685546875hf, 0.138427734375hf), + f16vec4(-0.262451171875hf, 0.30908203125hf, 0.169189453125hf, -0.170166015625hf), + f16vec4(-0.053924560546875hf, 0.368408203125hf, 0.0810546875hf, 0.0767822265625hf), + f16vec4(0.00907135009765625hf, 0.03997802734375hf, 0.25927734375hf, -0.037445068359375hf)); +const f16mat4 w2_19 = f16mat4( + f16vec4(0.07611083984375hf, 0.09356689453125hf, -0.03729248046875hf, 0.06121826171875hf), + f16vec4(-0.2135009765625hf, 0.176513671875hf, -0.11785888671875hf, 0.12347412109375hf), + f16vec4(0.1474609375hf, 0.1876220703125hf, 0.0726318359375hf, 0.191162109375hf), + f16vec4(0.0396728515625hf, 0.066650390625hf, 0.11956787109375hf, -0.009185791015625hf)); +const f16mat4 w2_20 = f16mat4( + f16vec4(-0.12408447265625hf, 0.006343841552734375hf, -0.1336669921875hf, 0.280029296875hf), + f16vec4(-0.24658203125hf, 0.1630859375hf, 0.2171630859375hf, -0.028289794921875hf), + f16vec4(-0.069091796875hf, 0.075927734375hf, 0.07147216796875hf, 0.20458984375hf), + f16vec4(-0.005191802978515625hf, 0.1893310546875hf, 0.396728515625hf, 0.368408203125hf)); +const f16mat4 w2_21 = f16mat4( + f16vec4(-0.08746337890625hf, 0.041473388671875hf, 0.091796875hf, 0.26416015625hf), + f16vec4(-0.0635986328125hf, -0.0161285400390625hf, -0.01290130615234375hf, -0.1002197265625hf), + f16vec4(-0.0733642578125hf, -0.051116943359375hf, 0.1768798828125hf, 0.09100341796875hf), + f16vec4(-0.047698974609375hf, 0.10137939453125hf, 0.1458740234375hf, -0.032318115234375hf)); +const f16mat4 w2_22 = f16mat4( + f16vec4(0.10150146484375hf, -0.04461669921875hf, 0.1160888671875hf, 0.246337890625hf), + f16vec4(0.09796142578125hf, -0.1572265625hf, -0.1365966796875hf, 0.034027099609375hf), + f16vec4(0.17626953125hf, -0.0955810546875hf, 0.201171875hf, 0.1878662109375hf), + f16vec4(0.07781982421875hf, 0.232666015625hf, -0.0655517578125hf, -0.07373046875hf)); +const f16mat4 w2_23 = f16mat4( + f16vec4(0.0019588470458984375hf, 0.05548095703125hf, -0.05645751953125hf, 0.400146484375hf), + f16vec4(0.171875hf, 0.1534423828125hf, 0.2188720703125hf, -0.14697265625hf), + f16vec4(-0.11431884765625hf, -0.119873046875hf, 0.1761474609375hf, 0.1309814453125hf), + f16vec4(-0.019439697265625hf, 0.12225341796875hf, 0.11883544921875hf, 0.327392578125hf)); +const f16mat4 w2_24 = f16mat4( + f16vec4(-0.09423828125hf, 0.120361328125hf, -0.1441650390625hf, 0.1962890625hf), + f16vec4(-0.28759765625hf, 0.301513671875hf, 0.2188720703125hf, 0.0477294921875hf), + f16vec4(-0.31201171875hf, 0.248046875hf, 0.08636474609375hf, 0.03387451171875hf), + f16vec4(0.0186309814453125hf, -0.02960205078125hf, 0.21630859375hf, -0.0697021484375hf)); +const f16mat4 w2_25 = f16mat4( + f16vec4(0.06182861328125hf, -0.039459228515625hf, -0.0675048828125hf, 0.2415771484375hf), + f16vec4(-0.240234375hf, 0.017852783203125hf, 0.006359100341796875hf, 0.1365966796875hf), + f16vec4(-0.0166168212890625hf, 0.047149658203125hf, 0.21875hf, 0.2476806640625hf), + f16vec4(0.18017578125hf, 0.338623046875hf, -0.140625hf, -0.1431884765625hf)); +const f16mat4 w2_26 = f16mat4( + f16vec4(-0.0860595703125hf, -0.019195556640625hf, -0.295166015625hf, 0.21728515625hf), + f16vec4(-0.09832763671875hf, 0.2093505859375hf, 0.305908203125hf, -0.007656097412109375hf), + f16vec4(-0.221435546875hf, 0.167236328125hf, 0.134033203125hf, 0.1439208984375hf), + f16vec4(0.164306640625hf, 0.1802978515625hf, 0.165771484375hf, 0.2227783203125hf)); +const f16mat4 w2_27 = f16mat4( + f16vec4(-0.43359375hf, 0.14599609375hf, 0.264892578125hf, -0.27783203125hf), + f16vec4(0.0097198486328125hf, 0.006610870361328125hf, 0.2685546875hf, 0.021484375hf), + f16vec4(0.313720703125hf, -0.2783203125hf, -0.257568359375hf, -0.1287841796875hf), + f16vec4(0.36328125hf, -0.345703125hf, -0.176513671875hf, 0.127685546875hf)); +const f16mat4 w2_28 = f16mat4( + f16vec4(-0.269287109375hf, 0.03985595703125hf, 0.077392578125hf, 0.2384033203125hf), + f16vec4(0.12890625hf, 0.0478515625hf, -0.02056884765625hf, -0.0687255859375hf), + f16vec4(0.1292724609375hf, 0.0005421638488769531hf, -0.07379150390625hf, 0.156005859375hf), + f16vec4(0.311279296875hf, -0.1639404296875hf, -0.060699462890625hf, 0.10858154296875hf)); +const f16mat4 w2_29 = f16mat4( + f16vec4(-0.33544921875hf, 0.1480712890625hf, 0.26025390625hf, 0.0927734375hf), + f16vec4(-0.052337646484375hf, 0.0408935546875hf, 0.099609375hf, 0.0003039836883544922hf), + f16vec4(0.408203125hf, 0.1829833984375hf, -0.25048828125hf, -0.10723876953125hf), + f16vec4(0.12042236328125hf, -0.328125hf, -0.2178955078125hf, -0.0040740966796875hf)); +const f16mat4 w2_30 = f16mat4( + f16vec4(-0.0721435546875hf, -0.0006890296936035156hf, -0.06011962890625hf, 0.12176513671875hf), + f16vec4(0.10150146484375hf, 0.218994140625hf, 0.0237274169921875hf, 0.1265869140625hf), + f16vec4(0.1253662109375hf, -0.003284454345703125hf, -0.12939453125hf, -0.0860595703125hf), + f16vec4(0.055755615234375hf, -0.03436279296875hf, -0.034759521484375hf, -0.007717132568359375hf)); +const f16mat4 w2_31 = f16mat4( + f16vec4(-0.024566650390625hf, -0.11572265625hf, -0.138671875hf, 0.49755859375hf), + f16vec4(0.2408447265625hf, 0.11798095703125hf, -0.0985107421875hf, 0.08465576171875hf), + f16vec4(-0.0249786376953125hf, 0.09393310546875hf, 0.10504150390625hf, 0.33984375hf), + f16vec4(0.006725311279296875hf, 0.361328125hf, 0.11676025390625hf, 0.09661865234375hf)); +const f16mat4 w2_32 = f16mat4( + f16vec4(-0.2269287109375hf, -0.1339111328125hf, 0.057037353515625hf, 0.265625hf), + f16vec4(-0.0042572021484375hf, 0.10101318359375hf, -0.00428009033203125hf, 0.0482177734375hf), + f16vec4(0.143798828125hf, 0.1959228515625hf, -0.19580078125hf, 0.06256103515625hf), + f16vec4(0.10736083984375hf, 0.04541015625hf, -0.05999755859375hf, 0.01113128662109375hf)); +const f16mat4 w2_33 = f16mat4( + f16vec4(0.0355224609375hf, 0.182861328125hf, 0.210693359375hf, -0.1292724609375hf), + f16vec4(-0.3017578125hf, 0.2083740234375hf, 0.1871337890625hf, -0.1063232421875hf), + f16vec4(0.1634521484375hf, -0.232666015625hf, -0.260986328125hf, -0.328369140625hf), + f16vec4(0.1915283203125hf, -0.405517578125hf, -0.09173583984375hf, 0.20068359375hf)); +const f16mat4 w2_34 = f16mat4( + f16vec4(0.07110595703125hf, 0.1405029296875hf, 0.057891845703125hf, 0.35595703125hf), + f16vec4(-0.1552734375hf, 0.08709716796875hf, 0.0638427734375hf, -0.08978271484375hf), + f16vec4(-0.0450439453125hf, -0.11395263671875hf, 0.0003199577331542969hf, 0.17138671875hf), + f16vec4(0.057281494140625hf, -0.1707763671875hf, 0.12164306640625hf, 0.2587890625hf)); +const f16mat4 w2_35 = f16mat4( + f16vec4(-0.11865234375hf, -0.013427734375hf, 0.16748046875hf, 0.09588623046875hf), + f16vec4(-0.35302734375hf, 0.08685302734375hf, -0.0699462890625hf, -0.16796875hf), + f16vec4(0.1256103515625hf, -0.1517333984375hf, -0.226318359375hf, -0.033050537109375hf), + f16vec4(0.160888671875hf, -0.24609375hf, -0.0149078369140625hf, 0.301025390625hf)); +const f16vec4 sub2 = f16vec4(-0.98583984375hf, -0.2060546875hf, -0.369873046875hf, 3.03125hf); +const f16vec4 mul2 = f16vec4(0.461181640625hf, 0.46435546875hf, 0.489013671875hf, 0.32666015625hf); +const f16vec4 add2 = f16vec4(-0.4267578125hf, -0.381103515625hf, -0.513671875hf, -0.396484375hf); + +const f16mat4 w3_0 = f16mat4( + f16vec4(-0.02325439453125hf, 0.0697021484375hf, 0.215576171875hf, 0.252685546875hf), + f16vec4(-0.2430419921875hf, -0.65771484375hf, -0.1781005859375hf, -0.25048828125hf), + f16vec4(-0.01312255859375hf, -0.1651611328125hf, -0.031463623046875hf, -0.04376220703125hf), + f16vec4(-0.02947998046875hf, -0.0767822265625hf, -0.308349609375hf, 0.1026611328125hf)); +const f16mat4 w3_1 = f16mat4( + f16vec4(-0.0033397674560546875hf, 0.0298004150390625hf, 0.107177734375hf, 0.1834716796875hf), + f16vec4(-0.034027099609375hf, -0.30322265625hf, -0.191650390625hf, -0.055419921875hf), + f16vec4(-0.1212158203125hf, -0.0292510986328125hf, 0.057037353515625hf, -0.1611328125hf), + f16vec4(0.003635406494140625hf, 0.07965087890625hf, -0.29931640625hf, 0.07257080078125hf)); +const f16mat4 w3_2 = f16mat4( + f16vec4(0.1866455078125hf, 0.04449462890625hf, 0.163818359375hf, 0.30419921875hf), + f16vec4(-0.162109375hf, -0.0223388671875hf, -0.278564453125hf, -0.20361328125hf), + f16vec4(0.1324462890625hf, -0.049102783203125hf, -0.04638671875hf, -0.29296875hf), + f16vec4(-0.28759765625hf, 0.0555419921875hf, -0.430419921875hf, -0.1195068359375hf)); +const f16mat4 w3_3 = f16mat4( + f16vec4(0.10467529296875hf, 0.1455078125hf, 0.11895751953125hf, 0.18359375hf), + f16vec4(-0.10931396484375hf, -0.37890625hf, -0.243408203125hf, -0.177001953125hf), + f16vec4(0.251708984375hf, -0.199462890625hf, 0.0423583984375hf, -0.041046142578125hf), + f16vec4(-0.0259552001953125hf, 0.052947998046875hf, -0.29296875hf, 0.21044921875hf)); +const f16mat4 w3_4 = f16mat4( + f16vec4(0.049468994140625hf, 0.0946044921875hf, -0.0251007080078125hf, 0.11859130859375hf), + f16vec4(0.1865234375hf, -0.43408203125hf, -0.25732421875hf, -0.2266845703125hf), + f16vec4(0.06610107421875hf, -0.06494140625hf, 0.1009521484375hf, -0.0865478515625hf), + f16vec4(0.1585693359375hf, 0.03326416015625hf, -0.32080078125hf, 0.199951171875hf)); +const f16mat4 w3_5 = f16mat4( + f16vec4(0.226806640625hf, 0.1361083984375hf, 0.01502227783203125hf, 0.2017822265625hf), + f16vec4(0.01313018798828125hf, -0.26123046875hf, -0.37841796875hf, -0.0465087890625hf), + f16vec4(0.278076171875hf, -0.1116943359375hf, -0.0038776397705078125hf, -0.302978515625hf), + f16vec4(0.0149688720703125hf, 0.2158203125hf, -0.2841796875hf, -0.029510498046875hf)); +const f16mat4 w3_6 = f16mat4( + f16vec4(0.040924072265625hf, 0.07025146484375hf, 0.2076416015625hf, 0.16845703125hf), + f16vec4(-0.2293701171875hf, -0.54052734375hf, -0.12115478515625hf, -0.2578125hf), + f16vec4(0.1561279296875hf, -0.07159423828125hf, -0.1396484375hf, -0.10791015625hf), + f16vec4(-0.262451171875hf, -0.06829833984375hf, -0.350341796875hf, -0.1031494140625hf)); +const f16mat4 w3_7 = f16mat4( + f16vec4(-0.020538330078125hf, -0.033294677734375hf, 0.0914306640625hf, 0.093994140625hf), + f16vec4(-0.1318359375hf, -0.5107421875hf, -0.203369140625hf, -0.214111328125hf), + f16vec4(0.042816162109375hf, -0.11871337890625hf, -0.091064453125hf, -0.0880126953125hf), + f16vec4(-0.06866455078125hf, -0.129150390625hf, -0.3544921875hf, 0.10791015625hf)); +const f16mat4 w3_8 = f16mat4( + f16vec4(0.0733642578125hf, 0.0325927734375hf, 0.125732421875hf, 0.1650390625hf), + f16vec4(-0.199462890625hf, -0.498046875hf, -0.291015625hf, -0.30908203125hf), + f16vec4(0.18359375hf, -0.20361328125hf, -0.2587890625hf, -0.30126953125hf), + f16vec4(0.026214599609375hf, -0.0162200927734375hf, -0.29736328125hf, -0.036651611328125hf)); +const f16mat4 w3_9 = f16mat4( + f16vec4(0.302001953125hf, 0.1298828125hf, 0.2259521484375hf, 0.182373046875hf), + f16vec4(-0.157958984375hf, 0.0280303955078125hf, 0.020538330078125hf, 0.1046142578125hf), + f16vec4(-0.099609375hf, -0.1932373046875hf, -0.391357421875hf, -0.12646484375hf), + f16vec4(0.149169921875hf, 0.305419921875hf, -0.1109619140625hf, -0.0970458984375hf)); +const f16mat4 w3_10 = f16mat4( + f16vec4(0.5859375hf, 0.09771728515625hf, 0.1014404296875hf, 0.07373046875hf), + f16vec4(-0.20947265625hf, 0.103271484375hf, 0.09027099609375hf, 0.0135650634765625hf), + f16vec4(-0.037109375hf, -0.2335205078125hf, -0.482177734375hf, -0.268798828125hf), + f16vec4(0.295166015625hf, 0.1676025390625hf, 0.0167999267578125hf, 0.04193115234375hf)); +const f16mat4 w3_11 = f16mat4( + f16vec4(0.509765625hf, 0.1768798828125hf, 0.242431640625hf, -0.01366424560546875hf), + f16vec4(-0.1453857421875hf, -0.2900390625hf, 0.09051513671875hf, 0.331787109375hf), + f16vec4(0.055816650390625hf, -0.2342529296875hf, -0.445556640625hf, -0.247802734375hf), + f16vec4(0.157470703125hf, 0.2327880859375hf, 0.00885772705078125hf, -0.23779296875hf)); +const f16mat4 w3_12 = f16mat4( + f16vec4(0.016815185546875hf, 0.208984375hf, 0.034454345703125hf, 0.0133056640625hf), + f16vec4(0.061370849609375hf, 0.041168212890625hf, 0.0248260498046875hf, 0.046905517578125hf), + f16vec4(-0.005504608154296875hf, -0.1585693359375hf, -0.3720703125hf, -0.048095703125hf), + f16vec4(0.1099853515625hf, 0.2119140625hf, -0.021209716796875hf, 0.08074951171875hf)); +const f16mat4 w3_13 = f16mat4( + f16vec4(0.426513671875hf, 0.08758544921875hf, -0.085205078125hf, -0.0238037109375hf), + f16vec4(0.1124267578125hf, 0.2763671875hf, 0.0181121826171875hf, -0.1549072265625hf), + f16vec4(-0.0357666015625hf, 0.0753173828125hf, -0.43505859375hf, -0.0985107421875hf), + f16vec4(0.2083740234375hf, 0.0277099609375hf, 0.057403564453125hf, 0.230712890625hf)); +const f16mat4 w3_14 = f16mat4( + f16vec4(0.395751953125hf, 0.1893310546875hf, 0.0865478515625hf, -0.043792724609375hf), + f16vec4(0.08013916015625hf, 0.1016845703125hf, 0.003520965576171875hf, 0.1934814453125hf), + f16vec4(0.1583251953125hf, -0.2357177734375hf, -0.37255859375hf, -0.2037353515625hf), + f16vec4(0.0265045166015625hf, 0.141845703125hf, 0.072265625hf, -0.2088623046875hf)); +const f16mat4 w3_15 = f16mat4( + f16vec4(0.00846099853515625hf, 0.1597900390625hf, 0.234375hf, 0.0465087890625hf), + f16vec4(-0.01959228515625hf, -0.11004638671875hf, 0.11468505859375hf, 0.2958984375hf), + f16vec4(-0.04437255859375hf, -0.271728515625hf, -0.437255859375hf, -0.1334228515625hf), + f16vec4(-0.063232421875hf, 0.21044921875hf, -0.032135009765625hf, -0.0362548828125hf)); +const f16mat4 w3_16 = f16mat4( + f16vec4(0.26611328125hf, 0.137451171875hf, 0.09844970703125hf, -0.0014314651489257812hf), + f16vec4(0.1409912109375hf, 0.1004638671875hf, 0.09832763671875hf, -0.0963134765625hf), + f16vec4(-0.0231475830078125hf, -0.08648681640625hf, -0.47802734375hf, -0.09136962890625hf), + f16vec4(0.1053466796875hf, 0.0223236083984375hf, 0.0399169921875hf, 0.1732177734375hf)); +const f16mat4 w3_17 = f16mat4( + f16vec4(0.294189453125hf, 0.2073974609375hf, 0.28271484375hf, -0.02032470703125hf), + f16vec4(0.148681640625hf, -0.0384521484375hf, 0.06787109375hf, 0.1396484375hf), + f16vec4(-0.15576171875hf, -0.0595703125hf, -0.438720703125hf, -0.137451171875hf), + f16vec4(-0.10137939453125hf, 0.12841796875hf, 0.0267486572265625hf, -0.1982421875hf)); +const f16mat4 w3_18 = f16mat4( + f16vec4(0.1708984375hf, 0.2152099609375hf, 0.10455322265625hf, 0.0203094482421875hf), + f16vec4(0.32763671875hf, 0.4169921875hf, -0.01056671142578125hf, 0.024993896484375hf), + f16vec4(0.1478271484375hf, 0.216064453125hf, 0.0289764404296875hf, -0.0004169940948486328hf), + f16vec4(-0.0287628173828125hf, -0.24365234375hf, 0.1490478515625hf, 0.25927734375hf)); +const f16mat4 w3_19 = f16mat4( + f16vec4(0.1097412109375hf, -0.103759765625hf, 0.1168212890625hf, 0.166259765625hf), + f16vec4(0.359619140625hf, -0.08740234375hf, -0.159912109375hf, -0.0537109375hf), + f16vec4(0.2734375hf, 0.11572265625hf, -0.0202789306640625hf, 0.09881591796875hf), + f16vec4(0.1439208984375hf, 0.139404296875hf, -0.0225067138671875hf, 0.07568359375hf)); +const f16mat4 w3_20 = f16mat4( + f16vec4(0.409912109375hf, 0.1572265625hf, 0.0258331298828125hf, -0.125hf), + f16vec4(0.45751953125hf, 0.1063232421875hf, -0.0247039794921875hf, -0.06524658203125hf), + f16vec4(0.193359375hf, 0.318115234375hf, 0.004302978515625hf, -0.1259765625hf), + f16vec4(0.28662109375hf, 0.0584716796875hf, 0.0335693359375hf, 0.2159423828125hf)); +const f16mat4 w3_21 = f16mat4( + f16vec4(0.10662841796875hf, 0.09442138671875hf, 0.0908203125hf, 0.12188720703125hf), + f16vec4(0.0845947265625hf, 0.0261993408203125hf, -0.1485595703125hf, 0.0249786376953125hf), + f16vec4(-0.09014892578125hf, 0.056365966796875hf, -0.0254669189453125hf, 0.05810546875hf), + f16vec4(0.012451171875hf, -0.1724853515625hf, 0.10968017578125hf, 0.1119384765625hf)); +const f16mat4 w3_22 = f16mat4( + f16vec4(-0.0816650390625hf, 0.022125244140625hf, 0.156982421875hf, 0.28955078125hf), + f16vec4(0.10223388671875hf, -0.2203369140625hf, -0.259765625hf, 0.039825439453125hf), + f16vec4(0.10723876953125hf, 0.01200103759765625hf, -0.060272216796875hf, 0.1549072265625hf), + f16vec4(0.2491455078125hf, 0.1717529296875hf, -0.03436279296875hf, -0.0289459228515625hf)); +const f16mat4 w3_23 = f16mat4( + f16vec4(0.16455078125hf, 0.020111083984375hf, 0.11895751953125hf, 0.04327392578125hf), + f16vec4(0.2685546875hf, -0.01551055908203125hf, -0.11663818359375hf, 0.0177764892578125hf), + f16vec4(0.0709228515625hf, 0.07708740234375hf, -0.036529541015625hf, -0.05377197265625hf), + f16vec4(0.318115234375hf, 0.0626220703125hf, 0.06005859375hf, 0.181884765625hf)); +const f16mat4 w3_24 = f16mat4( + f16vec4(-0.1104736328125hf, 0.06976318359375hf, 0.02044677734375hf, -0.119873046875hf), + f16vec4(-0.034393310546875hf, 0.33544921875hf, 0.01422882080078125hf, -0.3125hf), + f16vec4(-0.2266845703125hf, 0.12060546875hf, 0.1666259765625hf, -0.1741943359375hf), + f16vec4(-0.1910400390625hf, -0.21826171875hf, 0.20849609375hf, 0.28564453125hf)); +const f16mat4 w3_25 = f16mat4( + f16vec4(-0.2264404296875hf, -0.007213592529296875hf, 0.10955810546875hf, 0.05316162109375hf), + f16vec4(-0.01483154296875hf, -0.046844482421875hf, -0.172607421875hf, -0.1671142578125hf), + f16vec4(-0.12176513671875hf, 0.2568359375hf, 0.0989990234375hf, 0.041900634765625hf), + f16vec4(0.03631591796875hf, 0.029541015625hf, 0.030914306640625hf, 0.0286865234375hf)); +const f16mat4 w3_26 = f16mat4( + f16vec4(-0.10498046875hf, 0.125732421875hf, 0.12335205078125hf, -0.198486328125hf), + f16vec4(0.0294189453125hf, 0.35302734375hf, 0.0251312255859375hf, -0.1375732421875hf), + f16vec4(-0.1707763671875hf, 0.343505859375hf, 0.06634521484375hf, -0.1602783203125hf), + f16vec4(0.08880615234375hf, -0.25830078125hf, 0.140625hf, 0.3310546875hf)); +const f16mat4 w3_27 = f16mat4( + f16vec4(0.0704345703125hf, -0.061492919921875hf, -0.2174072265625hf, -0.051239013671875hf), + f16vec4(0.267822265625hf, 0.1529541015625hf, 0.047393798828125hf, -0.09375hf), + f16vec4(0.04736328125hf, -0.087646484375hf, -0.25830078125hf, 0.050506591796875hf), + f16vec4(-0.1767578125hf, -0.311767578125hf, 0.045562744140625hf, 0.1634521484375hf)); +const f16mat4 w3_28 = f16mat4( + f16vec4(0.310302734375hf, -0.11004638671875hf, -0.2003173828125hf, -0.07647705078125hf), + f16vec4(0.284912109375hf, 0.042755126953125hf, -0.08782958984375hf, 0.05792236328125hf), + f16vec4(0.144287109375hf, -0.2469482421875hf, -0.1651611328125hf, -0.0145111083984375hf), + f16vec4(-0.2406005859375hf, -0.016082763671875hf, 0.0911865234375hf, 0.3525390625hf)); +const f16mat4 w3_29 = f16mat4( + f16vec4(-0.06439208984375hf, -0.06903076171875hf, -0.0797119140625hf, -0.1309814453125hf), + f16vec4(0.2626953125hf, 0.09735107421875hf, -0.034759521484375hf, -0.20361328125hf), + f16vec4(0.2381591796875hf, -0.58154296875hf, -0.023773193359375hf, 0.1888427734375hf), + f16vec4(-0.2012939453125hf, -0.312744140625hf, -0.018280029296875hf, 0.129150390625hf)); +const f16mat4 w3_30 = f16mat4( + f16vec4(0.249267578125hf, -0.084716796875hf, -0.1947021484375hf, 0.037567138671875hf), + f16vec4(0.18798828125hf, 0.1436767578125hf, 0.1702880859375hf, 0.0261993408203125hf), + f16vec4(0.370849609375hf, 0.10870361328125hf, -0.1773681640625hf, 0.039947509765625hf), + f16vec4(0.1715087890625hf, -0.019012451171875hf, 0.141357421875hf, 0.0103759765625hf)); +const f16mat4 w3_31 = f16mat4( + f16vec4(0.46142578125hf, -0.24365234375hf, -0.265625hf, -0.0085296630859375hf), + f16vec4(0.1756591796875hf, 0.12744140625hf, 0.01303863525390625hf, 0.2374267578125hf), + f16vec4(0.442626953125hf, 0.2166748046875hf, -0.12200927734375hf, -0.0266265869140625hf), + f16vec4(0.1661376953125hf, 0.21923828125hf, 0.2008056640625hf, 0.0125274658203125hf)); +const f16mat4 w3_32 = f16mat4( + f16vec4(-0.040679931640625hf, -0.0869140625hf, -0.1278076171875hf, -0.0687255859375hf), + f16vec4(0.12890625hf, 0.214111328125hf, 0.055572509765625hf, -0.060394287109375hf), + f16vec4(0.48193359375hf, 0.04815673828125hf, -0.0118865966796875hf, 0.2249755859375hf), + f16vec4(0.159912109375hf, 0.10675048828125hf, 0.09539794921875hf, 0.0875244140625hf)); +const f16mat4 w3_33 = f16mat4( + f16vec4(-0.046875hf, -0.05322265625hf, 0.00458526611328125hf, 0.056610107421875hf), + f16vec4(-0.1571044921875hf, -0.08038330078125hf, 0.30615234375hf, -0.0235748291015625hf), + f16vec4(0.041107177734375hf, -0.341064453125hf, -0.267822265625hf, 0.06256103515625hf), + f16vec4(0.15576171875hf, -0.1268310546875hf, 0.0455322265625hf, 0.331298828125hf)); +const f16mat4 w3_34 = f16mat4( + f16vec4(0.2705078125hf, -0.281982421875hf, -0.08740234375hf, -0.0592041015625hf), + f16vec4(-0.09735107421875hf, -0.072998046875hf, 0.10882568359375hf, -0.01476287841796875hf), + f16vec4(0.184814453125hf, -0.19775390625hf, -0.23779296875hf, -0.0638427734375hf), + f16vec4(0.176513671875hf, 0.01392364501953125hf, 0.097900390625hf, 0.1392822265625hf)); +const f16mat4 w3_35 = f16mat4( + f16vec4(-0.266845703125hf, -0.1500244140625hf, 0.0079345703125hf, -0.05047607421875hf), + f16vec4(-0.2418212890625hf, 0.0016765594482421875hf, 0.1260986328125hf, -0.2347412109375hf), + f16vec4(0.2039794921875hf, -0.384521484375hf, -0.1497802734375hf, 0.149658203125hf), + f16vec4(0.1827392578125hf, -0.1285400390625hf, 0.0243682861328125hf, 0.0672607421875hf)); +const f16vec4 sub3 = f16vec4(2.587890625hf, -0.8134765625hf, -1.97265625hf, 0.06402587890625hf); +const f16vec4 mul3 = f16vec4(0.279296875hf, 0.42529296875hf, 0.4912109375hf, 0.5166015625hf); +const f16vec4 add3 = f16vec4(-0.10247802734375hf, -0.58544921875hf, -0.9365234375hf, -0.61865234375hf); + +void main() +{ + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 ext = imageSize(dstA); + if (p.x >= ext.x || p.y >= ext.y) + return; + + f16vec4 t0 = padTap(srcA, p + ivec2(-1, -1)); + f16vec4 t1 = padTap(srcA, p + ivec2(-1, 0)); + f16vec4 t2 = padTap(srcA, p + ivec2(-1, 1)); + f16vec4 t3 = padTap(srcA, p + ivec2(0, -1)); + f16vec4 t4 = f16vec4(texelFetch(srcA, p, 0)); + f16vec4 t5 = padTap(srcA, p + ivec2(0, 1)); + f16vec4 t6 = padTap(srcA, p + ivec2(1, -1)); + f16vec4 t7 = padTap(srcA, p + ivec2(1, 0)); + f16vec4 t8 = padTap(srcA, p + ivec2(1, 1)); + f16vec4 t9 = padTap(srcB, p + ivec2(-1, -1)); + f16vec4 t10 = padTap(srcB, p + ivec2(-1, 0)); + f16vec4 t11 = padTap(srcB, p + ivec2(-1, 1)); + f16vec4 t12 = padTap(srcB, p + ivec2(0, -1)); + f16vec4 t13 = f16vec4(texelFetch(srcB, p, 0)); + f16vec4 t14 = padTap(srcB, p + ivec2(0, 1)); + f16vec4 t15 = padTap(srcB, p + ivec2(1, -1)); + f16vec4 t16 = padTap(srcB, p + ivec2(1, 0)); + f16vec4 t17 = padTap(srcB, p + ivec2(1, 1)); + f16vec4 t18 = padTap(srcC, p + ivec2(-1, -1)); + f16vec4 t19 = padTap(srcC, p + ivec2(-1, 0)); + f16vec4 t20 = padTap(srcC, p + ivec2(-1, 1)); + f16vec4 t21 = padTap(srcC, p + ivec2(0, -1)); + f16vec4 t22 = f16vec4(texelFetch(srcC, p, 0)); + f16vec4 t23 = padTap(srcC, p + ivec2(0, 1)); + f16vec4 t24 = padTap(srcC, p + ivec2(1, -1)); + f16vec4 t25 = padTap(srcC, p + ivec2(1, 0)); + f16vec4 t26 = padTap(srcC, p + ivec2(1, 1)); + f16vec4 t27 = padTap(srcD, p + ivec2(-1, -1)); + f16vec4 t28 = padTap(srcD, p + ivec2(-1, 0)); + f16vec4 t29 = padTap(srcD, p + ivec2(-1, 1)); + f16vec4 t30 = padTap(srcD, p + ivec2(0, -1)); + f16vec4 t31 = f16vec4(texelFetch(srcD, p, 0)); + f16vec4 t32 = padTap(srcD, p + ivec2(0, 1)); + f16vec4 t33 = padTap(srcD, p + ivec2(1, -1)); + f16vec4 t34 = padTap(srcD, p + ivec2(1, 0)); + f16vec4 t35 = padTap(srcD, p + ivec2(1, 1)); + + f16vec4 r0 = w0_0 * t0; + r0 += w0_1 * t1; + r0 += w0_2 * t2; + r0 += w0_3 * t3; + r0 += w0_4 * t4; + r0 += w0_5 * t5; + r0 += w0_6 * t6; + r0 += w0_7 * t7; + r0 += w0_8 * t8; + r0 += w0_9 * t9; + r0 += w0_10 * t10; + r0 += w0_11 * t11; + r0 += w0_12 * t12; + r0 += w0_13 * t13; + r0 += w0_14 * t14; + r0 += w0_15 * t15; + r0 += w0_16 * t16; + r0 += w0_17 * t17; + r0 += w0_18 * t18; + r0 += w0_19 * t19; + r0 += w0_20 * t20; + r0 += w0_21 * t21; + r0 += w0_22 * t22; + r0 += w0_23 * t23; + r0 += w0_24 * t24; + r0 += w0_25 * t25; + r0 += w0_26 * t26; + r0 += w0_27 * t27; + r0 += w0_28 * t28; + r0 += w0_29 * t29; + r0 += w0_30 * t30; + r0 += w0_31 * t31; + r0 += w0_32 * t32; + r0 += w0_33 * t33; + r0 += w0_34 * t34; + r0 += w0_35 * t35; + r0 = (r0 - sub0) * mul0 + add0; + imageStore(dstA, p, vec4(r0)); + + f16vec4 r1 = w1_0 * t0; + r1 += w1_1 * t1; + r1 += w1_2 * t2; + r1 += w1_3 * t3; + r1 += w1_4 * t4; + r1 += w1_5 * t5; + r1 += w1_6 * t6; + r1 += w1_7 * t7; + r1 += w1_8 * t8; + r1 += w1_9 * t9; + r1 += w1_10 * t10; + r1 += w1_11 * t11; + r1 += w1_12 * t12; + r1 += w1_13 * t13; + r1 += w1_14 * t14; + r1 += w1_15 * t15; + r1 += w1_16 * t16; + r1 += w1_17 * t17; + r1 += w1_18 * t18; + r1 += w1_19 * t19; + r1 += w1_20 * t20; + r1 += w1_21 * t21; + r1 += w1_22 * t22; + r1 += w1_23 * t23; + r1 += w1_24 * t24; + r1 += w1_25 * t25; + r1 += w1_26 * t26; + r1 += w1_27 * t27; + r1 += w1_28 * t28; + r1 += w1_29 * t29; + r1 += w1_30 * t30; + r1 += w1_31 * t31; + r1 += w1_32 * t32; + r1 += w1_33 * t33; + r1 += w1_34 * t34; + r1 += w1_35 * t35; + r1 = (r1 - sub1) * mul1 + add1; + imageStore(dstB, p, vec4(r1)); + + f16vec4 r2 = w2_0 * t0; + r2 += w2_1 * t1; + r2 += w2_2 * t2; + r2 += w2_3 * t3; + r2 += w2_4 * t4; + r2 += w2_5 * t5; + r2 += w2_6 * t6; + r2 += w2_7 * t7; + r2 += w2_8 * t8; + r2 += w2_9 * t9; + r2 += w2_10 * t10; + r2 += w2_11 * t11; + r2 += w2_12 * t12; + r2 += w2_13 * t13; + r2 += w2_14 * t14; + r2 += w2_15 * t15; + r2 += w2_16 * t16; + r2 += w2_17 * t17; + r2 += w2_18 * t18; + r2 += w2_19 * t19; + r2 += w2_20 * t20; + r2 += w2_21 * t21; + r2 += w2_22 * t22; + r2 += w2_23 * t23; + r2 += w2_24 * t24; + r2 += w2_25 * t25; + r2 += w2_26 * t26; + r2 += w2_27 * t27; + r2 += w2_28 * t28; + r2 += w2_29 * t29; + r2 += w2_30 * t30; + r2 += w2_31 * t31; + r2 += w2_32 * t32; + r2 += w2_33 * t33; + r2 += w2_34 * t34; + r2 += w2_35 * t35; + r2 = (r2 - sub2) * mul2 + add2; + imageStore(dstC, p, vec4(r2)); + + f16vec4 r3 = w3_0 * t0; + r3 += w3_1 * t1; + r3 += w3_2 * t2; + r3 += w3_3 * t3; + r3 += w3_4 * t4; + r3 += w3_5 * t5; + r3 += w3_6 * t6; + r3 += w3_7 * t7; + r3 += w3_8 * t8; + r3 += w3_9 * t9; + r3 += w3_10 * t10; + r3 += w3_11 * t11; + r3 += w3_12 * t12; + r3 += w3_13 * t13; + r3 += w3_14 * t14; + r3 += w3_15 * t15; + r3 += w3_16 * t16; + r3 += w3_17 * t17; + r3 += w3_18 * t18; + r3 += w3_19 * t19; + r3 += w3_20 * t20; + r3 += w3_21 * t21; + r3 += w3_22 * t22; + r3 += w3_23 * t23; + r3 += w3_24 * t24; + r3 += w3_25 * t25; + r3 += w3_26 * t26; + r3 += w3_27 * t27; + r3 += w3_28 * t28; + r3 += w3_29 * t29; + r3 += w3_30 * t30; + r3 += w3_31 * t31; + r3 += w3_32 * t32; + r3 += w3_33 * t33; + r3 += w3_34 * t34; + r3 += w3_35 * t35; + r3 = (r3 - sub3) * mul3 + add3; + imageStore(dstD, p, vec4(r3)); + +} diff --git a/cleanroom/glsl/shader_42.comp b/cleanroom/glsl/shader_42.comp new file mode 100644 index 0000000..74d784c --- /dev/null +++ b/cleanroom/glsl/shader_42.comp @@ -0,0 +1,964 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_42: 3x3 stride-1 conv, 16->16 channels, zero-padded texelFetch + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcA; +layout(set = 0, binding = 33) uniform sampler2D srcB; +layout(set = 0, binding = 34) uniform sampler2D srcC; +layout(set = 0, binding = 35) uniform sampler2D srcD; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstA; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; +layout(set = 0, binding = 50, rgba8) uniform writeonly image2D dstC; +layout(set = 0, binding = 51, rgba8) uniform writeonly image2D dstD; + +// zero-padded fetch for non-center taps +f16vec4 padTap(sampler2D img, ivec2 c) +{ + bool inb = c.x >= 0 && c.y >= 0; + if (inb) { + ivec2 sz = textureSize(img, 0); + inb = c.x < sz.x && c.y < sz.y; + } + return inb ? f16vec4(texelFetch(img, c, 0)) : f16vec4(0.0hf); +} + +const f16mat4 w0_0 = f16mat4( + f16vec4(0.342529296875hf, 0.41552734375hf, 0.384521484375hf, 0.485595703125hf), + f16vec4(0.1748046875hf, -0.21923828125hf, -0.29296875hf, 0.2352294921875hf), + f16vec4(0.1292724609375hf, 0.288330078125hf, 0.0298004150390625hf, 0.09063720703125hf), + f16vec4(0.1748046875hf, -0.1195068359375hf, 0.050567626953125hf, 0.053802490234375hf)); +const f16mat4 w0_1 = f16mat4( + f16vec4(0.356689453125hf, 0.388671875hf, 0.32666015625hf, 0.478271484375hf), + f16vec4(-0.151611328125hf, 0.02734375hf, -0.1427001953125hf, -0.14697265625hf), + f16vec4(0.21044921875hf, -0.16259765625hf, 0.093505859375hf, -0.047088623046875hf), + f16vec4(-0.00852203369140625hf, -0.12548828125hf, 0.021026611328125hf, 0.0008158683776855469hf)); +const f16mat4 w0_2 = f16mat4( + f16vec4(0.2890625hf, 0.441162109375hf, 0.393798828125hf, 0.3935546875hf), + f16vec4(-0.01361083984375hf, -0.263916015625hf, -0.28466796875hf, 0.2353515625hf), + f16vec4(-0.374755859375hf, -0.235107421875hf, 0.018280029296875hf, -0.1678466796875hf), + f16vec4(0.10113525390625hf, -0.356689453125hf, 0.270751953125hf, 0.2349853515625hf)); +const f16mat4 w0_3 = f16mat4( + f16vec4(0.372314453125hf, 0.3056640625hf, 0.32421875hf, 0.5615234375hf), + f16vec4(0.14697265625hf, -0.08734130859375hf, -0.2137451171875hf, 0.1607666015625hf), + f16vec4(-0.420654296875hf, 0.262451171875hf, -0.12127685546875hf, -0.07177734375hf), + f16vec4(0.26220703125hf, 0.051116943359375hf, 0.154541015625hf, -0.0234527587890625hf)); +const f16mat4 w0_4 = f16mat4( + f16vec4(0.3681640625hf, 0.29296875hf, 0.2420654296875hf, 0.5400390625hf), + f16vec4(0.017120361328125hf, 0.1551513671875hf, -0.02789306640625hf, -0.10992431640625hf), + f16vec4(-0.16357421875hf, -0.033050537109375hf, -0.11285400390625hf, 0.1568603515625hf), + f16vec4(-0.0111541748046875hf, 0.036895751953125hf, 0.042694091796875hf, -0.21044921875hf)); +const f16mat4 w0_5 = f16mat4( + f16vec4(0.326416015625hf, 0.3603515625hf, 0.3212890625hf, 0.452880859375hf), + f16vec4(0.11529541015625hf, -0.10565185546875hf, -0.116455078125hf, 0.06982421875hf), + f16vec4(-0.0921630859375hf, 0.133056640625hf, -0.07769775390625hf, -0.013671875hf), + f16vec4(0.03717041015625hf, -0.11285400390625hf, 0.2003173828125hf, 0.033782958984375hf)); +const f16mat4 w0_6 = f16mat4( + f16vec4(0.3740234375hf, 0.3408203125hf, 0.4423828125hf, 0.595703125hf), + f16vec4(-0.01512908935546875hf, -0.30615234375hf, -0.34326171875hf, 0.212646484375hf), + f16vec4(-0.00601959228515625hf, 0.33740234375hf, 0.0499267578125hf, 0.0003058910369873047hf), + f16vec4(0.05682373046875hf, -0.1707763671875hf, 0.04278564453125hf, -0.0209503173828125hf)); +const f16mat4 w0_7 = f16mat4( + f16vec4(0.3935546875hf, 0.341064453125hf, 0.3759765625hf, 0.6015625hf), + f16vec4(-0.08514404296875hf, 0.01076507568359375hf, -0.2022705078125hf, 0.0523681640625hf), + f16vec4(-0.3974609375hf, -0.1673583984375hf, -0.069091796875hf, -0.104248046875hf), + f16vec4(0.1383056640625hf, -0.07720947265625hf, -0.054168701171875hf, 0.0130157470703125hf)); +const f16mat4 w0_8 = f16mat4( + f16vec4(0.3447265625hf, 0.398681640625hf, 0.43310546875hf, 0.5244140625hf), + f16vec4(0.1590576171875hf, -0.26318359375hf, -0.18359375hf, 0.2430419921875hf), + f16vec4(-0.392333984375hf, -0.03582763671875hf, 0.01273345947265625hf, -0.0635986328125hf), + f16vec4(0.2330322265625hf, -0.1746826171875hf, 0.0933837890625hf, 0.08929443359375hf)); +const f16mat4 w0_9 = f16mat4( + f16vec4(0.027801513671875hf, -0.185302734375hf, -0.1036376953125hf, 0.376953125hf), + f16vec4(0.031097412109375hf, -0.03802490234375hf, 0.230224609375hf, -0.336181640625hf), + f16vec4(-0.326904296875hf, 0.177001953125hf, -0.2059326171875hf, -0.38037109375hf), + f16vec4(-0.34521484375hf, -0.47314453125hf, 0.06146240234375hf, -0.06927490234375hf)); +const f16mat4 w0_10 = f16mat4( + f16vec4(-0.1595458984375hf, -0.012664794921875hf, -0.0926513671875hf, -0.12890625hf), + f16vec4(0.0391845703125hf, -0.060516357421875hf, 0.1468505859375hf, -0.1195068359375hf), + f16vec4(-0.1246337890625hf, 0.10430908203125hf, -0.1690673828125hf, -0.12396240234375hf), + f16vec4(-0.1201171875hf, -0.09771728515625hf, -0.01114654541015625hf, -0.092041015625hf)); +const f16mat4 w0_11 = f16mat4( + f16vec4(-0.164306640625hf, -0.2474365234375hf, -0.08282470703125hf, 0.1876220703125hf), + f16vec4(0.02813720703125hf, 0.037872314453125hf, 0.1607666015625hf, -0.389404296875hf), + f16vec4(-0.192626953125hf, 0.05914306640625hf, 0.0257110595703125hf, 0.0012235641479492188hf), + f16vec4(-0.185546875hf, -0.29541015625hf, 0.0980224609375hf, 0.01003265380859375hf)); +const f16mat4 w0_12 = f16mat4( + f16vec4(0.017425537109375hf, -0.038299560546875hf, 0.038055419921875hf, 0.31982421875hf), + f16vec4(0.214111328125hf, -0.402099609375hf, 0.01224517822265625hf, -0.1937255859375hf), + f16vec4(-0.166748046875hf, -0.0675048828125hf, -0.186279296875hf, -0.06158447265625hf), + f16vec4(-0.260986328125hf, -0.21484375hf, -0.0302886962890625hf, -0.01078033447265625hf)); +const f16mat4 w0_13 = f16mat4( + f16vec4(0.07269287109375hf, 0.08441162109375hf, 0.006771087646484375hf, 0.1939697265625hf), + f16vec4(0.09991455078125hf, -0.39501953125hf, -0.07586669921875hf, 0.1494140625hf), + f16vec4(-0.0758056640625hf, -0.050628662109375hf, -0.2939453125hf, -0.189208984375hf), + f16vec4(-0.0401611328125hf, 0.144775390625hf, -0.11199951171875hf, -0.0987548828125hf)); +const f16mat4 w0_14 = f16mat4( + f16vec4(0.052398681640625hf, -0.1923828125hf, -0.017059326171875hf, 0.1121826171875hf), + f16vec4(0.09661865234375hf, -0.33154296875hf, -0.0277099609375hf, -0.177490234375hf), + f16vec4(-0.294921875hf, -0.175537109375hf, -0.181884765625hf, -0.2340087890625hf), + f16vec4(-0.1448974609375hf, -0.132568359375hf, -0.011077880859375hf, -0.0137481689453125hf)); +const f16mat4 w0_15 = f16mat4( + f16vec4(-0.13916015625hf, -0.1568603515625hf, -0.032745361328125hf, -0.07086181640625hf), + f16vec4(0.2406005859375hf, -0.297607421875hf, -0.187255859375hf, -0.3984375hf), + f16vec4(-0.291259765625hf, -0.0084075927734375hf, -0.60400390625hf, -0.09625244140625hf), + f16vec4(-0.2235107421875hf, -0.32763671875hf, 0.13427734375hf, -0.031585693359375hf)); +const f16mat4 w0_16 = f16mat4( + f16vec4(-0.10784912109375hf, 0.00652313232421875hf, -0.060455322265625hf, -0.012420654296875hf), + f16vec4(0.006916046142578125hf, -0.25537109375hf, -0.1658935546875hf, -0.1995849609375hf), + f16vec4(-0.191650390625hf, 0.0723876953125hf, -0.457763671875hf, -0.05706787109375hf), + f16vec4(-0.1121826171875hf, -0.0311279296875hf, 0.04241943359375hf, -0.0192413330078125hf)); +const f16mat4 w0_17 = f16mat4( + f16vec4(0.007694244384765625hf, -0.30419921875hf, -0.1334228515625hf, 0.28125hf), + f16vec4(-0.1005859375hf, -0.1812744140625hf, -0.1192626953125hf, -0.384033203125hf), + f16vec4(-0.398681640625hf, -0.0190887451171875hf, -0.273193359375hf, -0.322265625hf), + f16vec4(-0.198486328125hf, -0.322509765625hf, 0.1361083984375hf, 0.00881195068359375hf)); +const f16mat4 w0_18 = f16mat4( + f16vec4(-0.087890625hf, 0.1396484375hf, 0.1805419921875hf, -0.37744140625hf), + f16vec4(0.00989532470703125hf, -0.09918212890625hf, -0.0914306640625hf, 0.12396240234375hf), + f16vec4(0.135498046875hf, 0.155029296875hf, -0.2293701171875hf, -0.26220703125hf), + f16vec4(0.11029052734375hf, 0.1571044921875hf, 0.09527587890625hf, 0.276611328125hf)); +const f16mat4 w0_19 = f16mat4( + f16vec4(-0.0115814208984375hf, 0.03759765625hf, 0.10821533203125hf, -0.28125hf), + f16vec4(0.050872802734375hf, -0.052825927734375hf, -0.0180816650390625hf, -0.0029544830322265625hf), + f16vec4(0.08489990234375hf, -0.017242431640625hf, -0.158203125hf, -0.2139892578125hf), + f16vec4(-0.0002880096435546875hf, 0.159423828125hf, 0.049560546875hf, 0.18798828125hf)); +const f16mat4 w0_20 = f16mat4( + f16vec4(-0.07623291015625hf, 0.052947998046875hf, 0.213134765625hf, -0.3994140625hf), + f16vec4(-0.01995849609375hf, -0.2293701171875hf, -0.140380859375hf, 0.050994873046875hf), + f16vec4(0.1314697265625hf, 0.11614990234375hf, -0.23095703125hf, -0.2174072265625hf), + f16vec4(0.0684814453125hf, 0.2421875hf, -0.0557861328125hf, 0.1671142578125hf)); +const f16mat4 w0_21 = f16mat4( + f16vec4(-0.0482177734375hf, -0.12841796875hf, -0.132568359375hf, -0.181884765625hf), + f16vec4(-0.051422119140625hf, 0.03564453125hf, -0.1033935546875hf, -0.0102996826171875hf), + f16vec4(0.1529541015625hf, -0.06365966796875hf, -0.08074951171875hf, -0.1279296875hf), + f16vec4(0.04925537109375hf, 0.1280517578125hf, 0.14794921875hf, 0.126953125hf)); +const f16mat4 w0_22 = f16mat4( + f16vec4(-0.0166473388671875hf, -0.2142333984375hf, -0.1497802734375hf, -0.01305389404296875hf), + f16vec4(0.053375244140625hf, 0.049346923828125hf, -0.03851318359375hf, 0.09771728515625hf), + f16vec4(0.130859375hf, -0.211669921875hf, -0.02325439453125hf, -0.1336669921875hf), + f16vec4(-0.035125732421875hf, 0.12445068359375hf, 0.123291015625hf, 0.061798095703125hf)); +const f16mat4 w0_23 = f16mat4( + f16vec4(-0.0024471282958984375hf, -0.12890625hf, -0.1600341796875hf, -0.184814453125hf), + f16vec4(0.1392822265625hf, -0.02685546875hf, -0.062164306640625hf, 0.187255859375hf), + f16vec4(0.13916015625hf, -0.137451171875hf, -0.12164306640625hf, -0.1962890625hf), + f16vec4(-0.03240966796875hf, 0.1348876953125hf, -0.0164031982421875hf, 0.045257568359375hf)); +const f16mat4 w0_24 = f16mat4( + f16vec4(-0.21923828125hf, -0.1390380859375hf, -0.06890869140625hf, -0.409912109375hf), + f16vec4(0.148681640625hf, -0.2183837890625hf, -0.0845947265625hf, 0.0679931640625hf), + f16vec4(0.15966796875hf, 0.0268402099609375hf, -0.234619140625hf, -0.294189453125hf), + f16vec4(0.05303955078125hf, 0.18603515625hf, 0.11102294921875hf, 0.1826171875hf)); +const f16mat4 w0_25 = f16mat4( + f16vec4(-0.18798828125hf, -0.22265625hf, -0.02276611328125hf, -0.2626953125hf), + f16vec4(0.056396484375hf, -0.1968994140625hf, 0.08526611328125hf, 0.00768280029296875hf), + f16vec4(0.09368896484375hf, -0.053314208984375hf, -0.211181640625hf, -0.242919921875hf), + f16vec4(0.0645751953125hf, 0.1859130859375hf, 0.1507568359375hf, 0.1500244140625hf)); +const f16mat4 w0_26 = f16mat4( + f16vec4(-0.2015380859375hf, -0.10113525390625hf, 0.00701141357421875hf, -0.335205078125hf), + f16vec4(0.1451416015625hf, -0.2349853515625hf, 0.0714111328125hf, 0.1986083984375hf), + f16vec4(0.1292724609375hf, -0.013427734375hf, -0.308349609375hf, -0.335205078125hf), + f16vec4(0.10498046875hf, 0.318115234375hf, 0.169921875hf, 0.1463623046875hf)); +const f16mat4 w0_27 = f16mat4( + f16vec4(0.1837158203125hf, 0.013458251953125hf, 0.09674072265625hf, 0.11956787109375hf), + f16vec4(0.07159423828125hf, -0.17822265625hf, -0.296142578125hf, 0.26025390625hf), + f16vec4(0.306640625hf, 0.219482421875hf, 0.148681640625hf, 0.242919921875hf), + f16vec4(-0.22509765625hf, 0.0802001953125hf, 0.079345703125hf, -0.2470703125hf)); +const f16mat4 w0_28 = f16mat4( + f16vec4(-0.0311431884765625hf, 0.01279449462890625hf, 0.1248779296875hf, -0.053680419921875hf), + f16vec4(-0.0726318359375hf, -0.0479736328125hf, -0.2120361328125hf, 0.14599609375hf), + f16vec4(0.31005859375hf, 0.15576171875hf, 0.12286376953125hf, 0.28759765625hf), + f16vec4(-0.2034912109375hf, 0.013580322265625hf, -0.07159423828125hf, -0.190673828125hf)); +const f16mat4 w0_29 = f16mat4( + f16vec4(0.053680419921875hf, -0.047943115234375hf, -0.1339111328125hf, -0.077880859375hf), + f16vec4(0.1395263671875hf, -0.272216796875hf, -0.4990234375hf, 0.424560546875hf), + f16vec4(0.3076171875hf, 0.1785888671875hf, 0.171875hf, 0.2449951171875hf), + f16vec4(-0.40478515625hf, 0.1954345703125hf, 0.1864013671875hf, -0.388916015625hf)); +const f16mat4 w0_30 = f16mat4( + f16vec4(0.26904296875hf, 0.0703125hf, 0.1181640625hf, 0.1605224609375hf), + f16vec4(0.1480712890625hf, -0.194091796875hf, -0.2015380859375hf, 0.06439208984375hf), + f16vec4(0.3427734375hf, 0.16015625hf, 0.2401123046875hf, 0.25634765625hf), + f16vec4(-0.2056884765625hf, -0.115966796875hf, -0.051361083984375hf, -0.2059326171875hf)); +const f16mat4 w0_31 = f16mat4( + f16vec4(0.1455078125hf, -0.01317596435546875hf, 0.146240234375hf, 0.09576416015625hf), + f16vec4(-0.0626220703125hf, -0.019287109375hf, 0.0806884765625hf, -0.2425537109375hf), + f16vec4(0.3505859375hf, 0.11572265625hf, 0.2259521484375hf, 0.306884765625hf), + f16vec4(-0.1395263671875hf, -0.228759765625hf, -0.177001953125hf, -0.0802001953125hf)); +const f16mat4 w0_32 = f16mat4( + f16vec4(0.10797119140625hf, -0.052947998046875hf, 0.1279296875hf, 0.03955078125hf), + f16vec4(-0.0033111572265625hf, -0.234375hf, -0.11163330078125hf, 0.067138671875hf), + f16vec4(0.321044921875hf, 0.1629638671875hf, 0.2406005859375hf, 0.26611328125hf), + f16vec4(-0.2724609375hf, -0.095458984375hf, 0.037322998046875hf, -0.228271484375hf)); +const f16mat4 w0_33 = f16mat4( + f16vec4(0.2298583984375hf, 0.14697265625hf, 0.1978759765625hf, 0.1065673828125hf), + f16vec4(0.248046875hf, -0.370849609375hf, -0.5146484375hf, 0.465087890625hf), + f16vec4(0.34130859375hf, 0.3291015625hf, 0.238525390625hf, 0.228515625hf), + f16vec4(-0.33447265625hf, 0.0906982421875hf, -0.0755615234375hf, -0.358154296875hf)); +const f16mat4 w0_34 = f16mat4( + f16vec4(0.200439453125hf, -0.0003669261932373047hf, 0.0731201171875hf, 0.09625244140625hf), + f16vec4(0.0908203125hf, -0.12274169921875hf, -0.1595458984375hf, 0.1436767578125hf), + f16vec4(0.3330078125hf, 0.27001953125hf, 0.2357177734375hf, 0.274169921875hf), + f16vec4(-0.265869140625hf, -0.0210418701171875hf, -0.1671142578125hf, -0.2108154296875hf)); +const f16mat4 w0_35 = f16mat4( + f16vec4(0.10137939453125hf, -0.06640625hf, 0.1402587890625hf, 0.08349609375hf), + f16vec4(0.154052734375hf, -0.272216796875hf, -0.181884765625hf, 0.26708984375hf), + f16vec4(0.30419921875hf, 0.284423828125hf, 0.2315673828125hf, 0.251220703125hf), + f16vec4(-0.37939453125hf, 0.1328125hf, 0.0916748046875hf, -0.333251953125hf)); +const f16vec4 sub0 = f16vec4(-0.08868408203125hf, -0.5078125hf, -0.300048828125hf, -0.048065185546875hf); +const f16vec4 mul0 = f16vec4(0.79345703125hf, 0.82958984375hf, 1.021484375hf, 0.70849609375hf); +const f16vec4 add0 = f16vec4(-0.2037353515625hf, -0.361083984375hf, -0.384765625hf, 0.07159423828125hf); + +const f16mat4 w1_0 = f16mat4( + f16vec4(0.3310546875hf, 0.4658203125hf, 0.310546875hf, 0.379150390625hf), + f16vec4(0.269775390625hf, 0.24462890625hf, 0.266357421875hf, -0.43505859375hf), + f16vec4(-0.04632568359375hf, -0.113037109375hf, -0.1307373046875hf, -0.07147216796875hf), + f16vec4(0.1534423828125hf, 0.0419921875hf, 0.0035266876220703125hf, -0.11041259765625hf)); +const f16mat4 w1_1 = f16mat4( + f16vec4(0.2958984375hf, 0.50927734375hf, 0.1842041015625hf, 0.371826171875hf), + f16vec4(-0.0260162353515625hf, -0.0199432373046875hf, -0.0721435546875hf, -0.071533203125hf), + f16vec4(0.03240966796875hf, -0.35302734375hf, 0.0256500244140625hf, 0.1580810546875hf), + f16vec4(0.23291015625hf, -0.0031986236572265625hf, -0.1868896484375hf, -0.127685546875hf)); +const f16mat4 w1_2 = f16mat4( + f16vec4(0.313232421875hf, 0.39990234375hf, 0.27490234375hf, 0.35986328125hf), + f16vec4(0.11590576171875hf, 0.2078857421875hf, -0.128662109375hf, -0.2724609375hf), + f16vec4(0.2276611328125hf, -0.454345703125hf, 0.1043701171875hf, 0.22705078125hf), + f16vec4(0.0760498046875hf, 0.2230224609375hf, -0.443115234375hf, -0.40380859375hf)); +const f16mat4 w1_3 = f16mat4( + f16vec4(0.286865234375hf, 0.499755859375hf, 0.274658203125hf, 0.49755859375hf), + f16vec4(0.05596923828125hf, 0.2166748046875hf, 0.044677734375hf, -0.35498046875hf), + f16vec4(0.1065673828125hf, -0.034271240234375hf, -0.1397705078125hf, -0.1153564453125hf), + f16vec4(-0.0295562744140625hf, 0.11883544921875hf, -0.262939453125hf, -0.221435546875hf)); +const f16mat4 w1_4 = f16mat4( + f16vec4(0.2161865234375hf, 0.5224609375hf, 0.1845703125hf, 0.48046875hf), + f16vec4(-0.2269287109375hf, -0.07476806640625hf, -0.254150390625hf, 0.0271453857421875hf), + f16vec4(-0.0164794921875hf, 0.218017578125hf, 0.0020656585693359375hf, -0.364501953125hf), + f16vec4(0.11395263671875hf, -0.1983642578125hf, -0.33544921875hf, 0.06005859375hf)); +const f16mat4 w1_5 = f16mat4( + f16vec4(0.2481689453125hf, 0.40771484375hf, 0.2486572265625hf, 0.479736328125hf), + f16vec4(-0.0889892578125hf, 0.102294921875hf, -0.2327880859375hf, -0.1630859375hf), + f16vec4(0.1632080078125hf, -0.192138671875hf, 0.0721435546875hf, 0.01502227783203125hf), + f16vec4(-0.048614501953125hf, 0.06134033203125hf, -0.595703125hf, -0.2137451171875hf)); +const f16mat4 w1_6 = f16mat4( + f16vec4(0.38720703125hf, 0.447021484375hf, 0.2493896484375hf, 0.45263671875hf), + f16vec4(0.32666015625hf, 0.2191162109375hf, 0.202392578125hf, -0.39794921875hf), + f16vec4(-0.0244293212890625hf, -0.487060546875hf, -0.01203155517578125hf, 0.297119140625hf), + f16vec4(0.01490020751953125hf, 0.2393798828125hf, -0.0018758773803710938hf, -0.427978515625hf)); +const f16mat4 w1_7 = f16mat4( + f16vec4(0.35107421875hf, 0.4833984375hf, 0.215576171875hf, 0.44140625hf), + f16vec4(-0.07989501953125hf, 0.0682373046875hf, -0.0865478515625hf, -0.10784912109375hf), + f16vec4(-0.1846923828125hf, -0.30029296875hf, 0.025390625hf, 0.1461181640625hf), + f16vec4(0.0733642578125hf, 0.14453125hf, 0.00957489013671875hf, -0.2098388671875hf)); +const f16mat4 w1_8 = f16mat4( + f16vec4(0.398681640625hf, 0.359130859375hf, 0.2724609375hf, 0.4541015625hf), + f16vec4(0.06878662109375hf, 0.17724609375hf, 0.020294189453125hf, -0.2435302734375hf), + f16vec4(-0.0147857666015625hf, -0.1697998046875hf, 0.030975341796875hf, -0.09619140625hf), + f16vec4(-0.0307769775390625hf, 0.070068359375hf, -0.1015625hf, -0.2083740234375hf)); +const f16mat4 w1_9 = f16mat4( + f16vec4(-0.1768798828125hf, 0.031646728515625hf, 0.0139923095703125hf, -0.0070037841796875hf), + f16vec4(-0.1571044921875hf, -0.21337890625hf, -0.045623779296875hf, 0.041412353515625hf), + f16vec4(-0.046875hf, 0.2283935546875hf, 0.0850830078125hf, -0.159912109375hf), + f16vec4(-0.0306396484375hf, 0.5068359375hf, 0.3251953125hf, -0.39990234375hf)); +const f16mat4 w1_10 = f16mat4( + f16vec4(-0.07769775390625hf, 0.004444122314453125hf, 0.033050537109375hf, 0.054534912109375hf), + f16vec4(-0.2088623046875hf, -0.111328125hf, -0.1727294921875hf, -0.004627227783203125hf), + f16vec4(0.037353515625hf, 0.056640625hf, -0.161865234375hf, -0.00606536865234375hf), + f16vec4(-0.01119232177734375hf, 0.2294921875hf, 0.07891845703125hf, -0.231689453125hf)); +const f16mat4 w1_11 = f16mat4( + f16vec4(-0.09442138671875hf, 0.03515625hf, -0.2744140625hf, -0.05535888671875hf), + f16vec4(-0.2330322265625hf, -0.2310791015625hf, -0.1983642578125hf, 0.14404296875hf), + f16vec4(-0.06805419921875hf, 0.126708984375hf, -0.1778564453125hf, -0.1859130859375hf), + f16vec4(0.036865234375hf, 0.310791015625hf, 0.2264404296875hf, -0.2384033203125hf)); +const f16mat4 w1_12 = f16mat4( + f16vec4(-0.344482421875hf, 0.04119873046875hf, -0.05096435546875hf, -0.09527587890625hf), + f16vec4(0.2196044921875hf, -0.081298828125hf, 0.1048583984375hf, 0.035980224609375hf), + f16vec4(-0.0777587890625hf, 0.07061767578125hf, 0.01352691650390625hf, -0.1181640625hf), + f16vec4(-0.19873046875hf, 0.19482421875hf, 0.025482177734375hf, -0.27685546875hf)); +const f16mat4 w1_13 = f16mat4( + f16vec4(-0.455322265625hf, 0.0202484130859375hf, -0.0216522216796875hf, 0.06390380859375hf), + f16vec4(0.016357421875hf, 0.177978515625hf, 0.044586181640625hf, -0.008056640625hf), + f16vec4(0.036834716796875hf, -0.244140625hf, -0.1446533203125hf, 0.1884765625hf), + f16vec4(-0.2227783203125hf, 0.0007061958312988281hf, -0.149169921875hf, -0.17529296875hf)); +const f16mat4 w1_14 = f16mat4( + f16vec4(-0.430419921875hf, -0.037384033203125hf, -0.252197265625hf, -0.0377197265625hf), + f16vec4(-0.06121826171875hf, 0.054931640625hf, 0.01204681396484375hf, -0.01143646240234375hf), + f16vec4(-0.11431884765625hf, 0.10211181640625hf, -0.205810546875hf, -0.156494140625hf), + f16vec4(-0.204345703125hf, 0.1697998046875hf, 0.0076446533203125hf, -0.268310546875hf)); +const f16mat4 w1_15 = f16mat4( + f16vec4(-0.1531982421875hf, -0.048370361328125hf, 0.214111328125hf, -0.0809326171875hf), + f16vec4(-0.10980224609375hf, -0.1956787109375hf, -0.1597900390625hf, 0.11279296875hf), + f16vec4(-0.1109619140625hf, 0.286865234375hf, -0.00724029541015625hf, -0.277587890625hf), + f16vec4(-0.06988525390625hf, 0.286865234375hf, 0.0760498046875hf, -0.278076171875hf)); +const f16mat4 w1_16 = f16mat4( + f16vec4(-0.34130859375hf, 0.04669189453125hf, 0.154296875hf, -0.028656005859375hf), + f16vec4(-0.2470703125hf, -0.1307373046875hf, -0.196533203125hf, 0.1077880859375hf), + f16vec4(-0.003032684326171875hf, 0.06304931640625hf, -0.08270263671875hf, -0.06915283203125hf), + f16vec4(-0.1171875hf, 0.205322265625hf, -0.069580078125hf, -0.25048828125hf)); +const f16mat4 w1_17 = f16mat4( + f16vec4(-0.38427734375hf, 0.053070068359375hf, -0.0723876953125hf, -0.0548095703125hf), + f16vec4(-0.32958984375hf, -0.152587890625hf, -0.191650390625hf, 0.015472412109375hf), + f16vec4(-0.11285400390625hf, 0.1627197265625hf, -0.0165252685546875hf, -0.2003173828125hf), + f16vec4(-0.091064453125hf, 0.411376953125hf, 0.0986328125hf, -0.42333984375hf)); +const f16mat4 w1_18 = f16mat4( + f16vec4(-0.372802734375hf, 0.14453125hf, 0.14794921875hf, -0.283203125hf), + f16vec4(0.1754150390625hf, -0.326171875hf, -0.2364501953125hf, 0.07073974609375hf), + f16vec4(-0.21728515625hf, -0.46484375hf, -0.404052734375hf, 0.35595703125hf), + f16vec4(0.1768798828125hf, 0.01108551025390625hf, 0.06884765625hf, 0.039031982421875hf)); +const f16mat4 w1_19 = f16mat4( + f16vec4(-0.0863037109375hf, 0.07958984375hf, 0.0221405029296875hf, -0.205322265625hf), + f16vec4(0.045501708984375hf, -0.332763671875hf, -0.06396484375hf, 0.074951171875hf), + f16vec4(-0.165771484375hf, -0.277099609375hf, -0.1881103515625hf, 0.057952880859375hf), + f16vec4(-0.029052734375hf, 0.02734375hf, 0.048919677734375hf, 0.08349609375hf)); +const f16mat4 w1_20 = f16mat4( + f16vec4(-0.3916015625hf, 0.128662109375hf, 0.0167694091796875hf, -0.287353515625hf), + f16vec4(-0.0292816162109375hf, -0.3623046875hf, -0.221923828125hf, 0.1251220703125hf), + f16vec4(-0.363037109375hf, -0.462158203125hf, -0.362060546875hf, 0.34765625hf), + f16vec4(0.10845947265625hf, -0.002727508544921875hf, 0.161376953125hf, 0.1549072265625hf)); +const f16mat4 w1_21 = f16mat4( + f16vec4(-0.2010498046875hf, 0.00865936279296875hf, -0.08349609375hf, -0.146728515625hf), + f16vec4(0.1485595703125hf, -0.178955078125hf, -0.186279296875hf, 0.1343994140625hf), + f16vec4(-0.12286376953125hf, -0.22705078125hf, -0.0758056640625hf, 0.1317138671875hf), + f16vec4(0.0550537109375hf, 0.0234375hf, 0.04095458984375hf, 0.036834716796875hf)); +const f16mat4 w1_22 = f16mat4( + f16vec4(0.03802490234375hf, -0.07659912109375hf, -0.1412353515625hf, -0.040802001953125hf), + f16vec4(-0.06500244140625hf, -0.0675048828125hf, 0.032623291015625hf, -0.021209716796875hf), + f16vec4(-0.04852294921875hf, -0.0877685546875hf, 0.09002685546875hf, -0.161865234375hf), + f16vec4(-0.063720703125hf, 0.079833984375hf, -0.0116729736328125hf, 0.01050567626953125hf)); +const f16mat4 w1_23 = f16mat4( + f16vec4(-0.18701171875hf, -0.044708251953125hf, -0.1614990234375hf, -0.10809326171875hf), + f16vec4(-0.0391845703125hf, -0.146484375hf, -0.0977783203125hf, 0.1329345703125hf), + f16vec4(-0.269287109375hf, -0.304443359375hf, -0.102783203125hf, 0.103271484375hf), + f16vec4(0.157958984375hf, 0.04351806640625hf, 0.08087158203125hf, 0.01448822021484375hf)); +const f16mat4 w1_24 = f16mat4( + f16vec4(-0.352783203125hf, 0.07635498046875hf, 0.1221923828125hf, -0.352783203125hf), + f16vec4(0.06500244140625hf, -0.256103515625hf, -0.2303466796875hf, 0.1898193359375hf), + f16vec4(-0.1851806640625hf, -0.298095703125hf, -0.254150390625hf, 0.2266845703125hf), + f16vec4(0.17236328125hf, 0.074462890625hf, 0.0762939453125hf, 0.132080078125hf)); +const f16mat4 w1_25 = f16mat4( + f16vec4(-0.15478515625hf, 0.06536865234375hf, 0.043914794921875hf, -0.28173828125hf), + f16vec4(-0.176513671875hf, -0.1900634765625hf, -0.0723876953125hf, 0.1134033203125hf), + f16vec4(-0.154052734375hf, -0.238525390625hf, -0.10723876953125hf, 0.0723876953125hf), + f16vec4(0.1131591796875hf, 0.070556640625hf, -0.0244903564453125hf, 0.076416015625hf)); +const f16mat4 w1_26 = f16mat4( + f16vec4(-0.33056640625hf, 0.050384521484375hf, 0.08990478515625hf, -0.361083984375hf), + f16vec4(-0.1873779296875hf, -0.2020263671875hf, -0.21630859375hf, 0.11944580078125hf), + f16vec4(-0.389892578125hf, -0.52197265625hf, -0.408935546875hf, 0.436767578125hf), + f16vec4(0.33935546875hf, 0.004467010498046875hf, 0.07611083984375hf, 0.044830322265625hf)); +const f16mat4 w1_27 = f16mat4( + f16vec4(0.248291015625hf, 0.143310546875hf, 0.163330078125hf, 0.0723876953125hf), + f16vec4(0.1500244140625hf, -0.26806640625hf, -0.279541015625hf, 0.09759521484375hf), + f16vec4(0.12469482421875hf, 0.29736328125hf, 0.09130859375hf, 0.381103515625hf), + f16vec4(-0.299560546875hf, -0.25830078125hf, -0.11309814453125hf, -0.05303955078125hf)); +const f16mat4 w1_28 = f16mat4( + f16vec4(0.0655517578125hf, 0.09271240234375hf, 0.2095947265625hf, -0.021759033203125hf), + f16vec4(0.001953125hf, -0.240234375hf, -0.2529296875hf, 0.05377197265625hf), + f16vec4(0.177490234375hf, 0.37451171875hf, 0.129638671875hf, 0.343994140625hf), + f16vec4(-0.109619140625hf, -0.28466796875hf, -0.1317138671875hf, -0.0653076171875hf)); +const f16mat4 w1_29 = f16mat4( + f16vec4(0.0043182373046875hf, 0.10699462890625hf, 0.2354736328125hf, 0.05596923828125hf), + f16vec4(0.2032470703125hf, -0.219482421875hf, -0.42919921875hf, 0.09051513671875hf), + f16vec4(0.217041015625hf, 0.42333984375hf, 0.19580078125hf, 0.3388671875hf), + f16vec4(-0.39208984375hf, -0.280517578125hf, -0.272216796875hf, -0.277587890625hf)); +const f16mat4 w1_30 = f16mat4( + f16vec4(0.1783447265625hf, 0.12188720703125hf, -0.035919189453125hf, 0.1788330078125hf), + f16vec4(-0.04241943359375hf, -0.190185546875hf, -0.1541748046875hf, 0.054290771484375hf), + f16vec4(0.0819091796875hf, 0.34130859375hf, 0.12548828125hf, 0.412841796875hf), + f16vec4(-0.199462890625hf, -0.150390625hf, -0.1287841796875hf, -0.0748291015625hf)); +const f16mat4 w1_31 = f16mat4( + f16vec4(0.1162109375hf, 0.06488037109375hf, -0.07025146484375hf, 0.117431640625hf), + f16vec4(-0.208740234375hf, -0.167724609375hf, -0.055999755859375hf, 0.08001708984375hf), + f16vec4(0.12225341796875hf, 0.3876953125hf, 0.16064453125hf, 0.382080078125hf), + f16vec4(0.096923828125hf, -0.2177734375hf, -0.121826171875hf, 0.06915283203125hf)); +const f16mat4 w1_32 = f16mat4( + f16vec4(0.0723876953125hf, 0.11456298828125hf, 0.069091796875hf, 0.09185791015625hf), + f16vec4(-0.07904052734375hf, -0.1881103515625hf, -0.2498779296875hf, 0.03173828125hf), + f16vec4(0.170166015625hf, 0.411376953125hf, 0.1943359375hf, 0.3408203125hf), + f16vec4(-0.1346435546875hf, -0.1397705078125hf, -0.2386474609375hf, -0.06781005859375hf)); +const f16mat4 w1_33 = f16mat4( + f16vec4(0.0298309326171875hf, 0.223876953125hf, 0.41845703125hf, 0.1220703125hf), + f16vec4(0.1719970703125hf, -0.200927734375hf, -0.17333984375hf, -0.052154541015625hf), + f16vec4(0.148681640625hf, 0.295654296875hf, 0.0142974853515625hf, 0.49169921875hf), + f16vec4(-0.370361328125hf, -0.20751953125hf, -0.1864013671875hf, -0.1484375hf)); +const f16mat4 w1_34 = f16mat4( + f16vec4(0.097412109375hf, 0.09747314453125hf, 0.174072265625hf, 0.10894775390625hf), + f16vec4(-0.0555419921875hf, -0.166748046875hf, -0.032012939453125hf, 0.01502227783203125hf), + f16vec4(0.166259765625hf, 0.3466796875hf, 0.0667724609375hf, 0.41162109375hf), + f16vec4(-0.073486328125hf, -0.25830078125hf, -0.2052001953125hf, -0.2430419921875hf)); +const f16mat4 w1_35 = f16mat4( + f16vec4(0.06689453125hf, 0.1231689453125hf, 0.31494140625hf, 0.08050537109375hf), + f16vec4(0.0211944580078125hf, -0.208740234375hf, -0.21435546875hf, 0.06884765625hf), + f16vec4(0.19482421875hf, 0.351318359375hf, 0.0731201171875hf, 0.41455078125hf), + f16vec4(-0.268798828125hf, -0.265625hf, -0.284912109375hf, -0.27392578125hf)); +const f16vec4 sub1 = f16vec4(-0.425048828125hf, -0.11724853515625hf, -0.69140625hf, -0.32275390625hf); +const f16vec4 mul1 = f16vec4(0.837890625hf, 0.79736328125hf, 1.01171875hf, 0.88330078125hf); +const f16vec4 add1 = f16vec4(-0.38427734375hf, 0.1156005859375hf, -0.54345703125hf, 0.055908203125hf); + +const f16mat4 w2_0 = f16mat4( + f16vec4(0.5380859375hf, 0.351318359375hf, 0.2022705078125hf, 0.333740234375hf), + f16vec4(-0.09912109375hf, -0.2083740234375hf, -0.330078125hf, 0.045135498046875hf), + f16vec4(-0.1507568359375hf, 0.02197265625hf, 0.1319580078125hf, -0.2098388671875hf), + f16vec4(-0.254150390625hf, -0.2147216796875hf, -0.14892578125hf, -0.2423095703125hf)); +const f16mat4 w2_1 = f16mat4( + f16vec4(0.55615234375hf, 0.291259765625hf, 0.251953125hf, 0.23681640625hf), + f16vec4(-0.0904541015625hf, -0.12890625hf, -0.0987548828125hf, 0.01343536376953125hf), + f16vec4(-0.422607421875hf, 0.154296875hf, -0.36474609375hf, -0.002288818359375hf), + f16vec4(-0.09100341796875hf, -0.25244140625hf, -0.2200927734375hf, -0.333984375hf)); +const f16mat4 w2_2 = f16mat4( + f16vec4(0.53759765625hf, 0.34033203125hf, 0.32568359375hf, 0.308349609375hf), + f16vec4(-0.0648193359375hf, -0.09173583984375hf, -0.31201171875hf, 0.2080078125hf), + f16vec4(-0.4755859375hf, -0.234619140625hf, -0.447021484375hf, 0.183837890625hf), + f16vec4(0.243896484375hf, -0.4052734375hf, -0.189697265625hf, -0.0180511474609375hf)); +const f16mat4 w2_3 = f16mat4( + f16vec4(0.501953125hf, 0.2998046875hf, 0.14990234375hf, 0.321044921875hf), + f16vec4(0.00913238525390625hf, -0.1168212890625hf, -0.1287841796875hf, -0.225830078125hf), + f16vec4(-0.00848388671875hf, -0.1883544921875hf, 0.1943359375hf, 0.01500701904296875hf), + f16vec4(-0.057830810546875hf, -0.211669921875hf, 0.05029296875hf, -0.40234375hf)); +const f16mat4 w2_4 = f16mat4( + f16vec4(0.52587890625hf, 0.2724609375hf, 0.1845703125hf, 0.196044921875hf), + f16vec4(-0.07568359375hf, -0.1422119140625hf, 0.0567626953125hf, -0.1502685546875hf), + f16vec4(0.1505126953125hf, 0.1739501953125hf, -0.2259521484375hf, -0.005279541015625hf), + f16vec4(-0.300537109375hf, -0.042083740234375hf, -0.065673828125hf, -0.367919921875hf)); +const f16mat4 w2_5 = f16mat4( + f16vec4(0.50146484375hf, 0.307861328125hf, 0.302978515625hf, 0.268798828125hf), + f16vec4(-0.047943115234375hf, -0.04437255859375hf, -0.1839599609375hf, 0.00954437255859375hf), + f16vec4(-0.375hf, 0.36083984375hf, -0.41650390625hf, 0.2208251953125hf), + f16vec4(0.06201171875hf, -0.31298828125hf, 0.02838134765625hf, -0.1539306640625hf)); +const f16mat4 w2_6 = f16mat4( + f16vec4(0.51318359375hf, 0.337646484375hf, 0.1907958984375hf, 0.31103515625hf), + f16vec4(-0.056396484375hf, -0.19091796875hf, -0.29736328125hf, 0.0423583984375hf), + f16vec4(-0.4990234375hf, -0.1368408203125hf, 0.005191802978515625hf, -0.0867919921875hf), + f16vec4(-0.042449951171875hf, -0.344482421875hf, -0.1483154296875hf, -0.31201171875hf)); +const f16mat4 w2_7 = f16mat4( + f16vec4(0.53515625hf, 0.30517578125hf, 0.2457275390625hf, 0.2264404296875hf), + f16vec4(-0.053680419921875hf, -0.194091796875hf, -0.10394287109375hf, 0.046783447265625hf), + f16vec4(-0.25146484375hf, -0.218994140625hf, -0.146728515625hf, -0.04638671875hf), + f16vec4(-0.15771484375hf, -0.1610107421875hf, -0.235595703125hf, -0.173828125hf)); +const f16mat4 w2_8 = f16mat4( + f16vec4(0.50439453125hf, 0.33984375hf, 0.369384765625hf, 0.312255859375hf), + f16vec4(-0.147705078125hf, -0.18701171875hf, -0.30615234375hf, 0.17919921875hf), + f16vec4(-0.10693359375hf, 0.1981201171875hf, -0.237548828125hf, 0.08624267578125hf), + f16vec4(0.0011501312255859375hf, -0.26318359375hf, -0.165283203125hf, 0.09234619140625hf)); +const f16mat4 w2_9 = f16mat4( + f16vec4(-0.11962890625hf, 0.00047397613525390625hf, -0.042236328125hf, -0.11468505859375hf), + f16vec4(0.171630859375hf, -0.1270751953125hf, 0.028656005859375hf, -0.56494140625hf), + f16vec4(-0.1453857421875hf, -0.0411376953125hf, 0.041168212890625hf, -0.139404296875hf), + f16vec4(0.420166015625hf, -0.378662109375hf, -0.423583984375hf, -0.10491943359375hf)); +const f16mat4 w2_10 = f16mat4( + f16vec4(-0.126708984375hf, 0.00522613525390625hf, -0.0208740234375hf, -0.01031494140625hf), + f16vec4(-0.002216339111328125hf, -0.2403564453125hf, -0.0357666015625hf, -0.326904296875hf), + f16vec4(0.1375732421875hf, 0.04034423828125hf, 0.225830078125hf, -0.0311126708984375hf), + f16vec4(0.25146484375hf, -0.186279296875hf, -0.149658203125hf, -0.1644287109375hf)); +const f16mat4 w2_11 = f16mat4( + f16vec4(0.11578369140625hf, -0.050201416015625hf, 0.03070068359375hf, 0.038055419921875hf), + f16vec4(-0.12030029296875hf, -0.1839599609375hf, -0.09588623046875hf, -0.5322265625hf), + f16vec4(0.10211181640625hf, 0.1563720703125hf, -0.038818359375hf, 0.11517333984375hf), + f16vec4(0.27490234375hf, -0.24560546875hf, -0.33837890625hf, 0.072265625hf)); +const f16mat4 w2_12 = f16mat4( + f16vec4(0.05731201171875hf, 0.0172271728515625hf, 0.150390625hf, -0.261474609375hf), + f16vec4(0.01078033447265625hf, -0.0538330078125hf, -0.223388671875hf, -0.1944580078125hf), + f16vec4(-0.380615234375hf, 0.0165863037109375hf, 0.037384033203125hf, -0.060302734375hf), + f16vec4(0.2291259765625hf, -0.2347412109375hf, -0.169189453125hf, -0.31640625hf)); +const f16mat4 w2_13 = f16mat4( + f16vec4(-0.01282501220703125hf, 0.26904296875hf, 0.146240234375hf, -0.04718017578125hf), + f16vec4(-0.02001953125hf, -0.1983642578125hf, -0.257080078125hf, 0.1339111328125hf), + f16vec4(-0.50146484375hf, 0.10809326171875hf, 0.0447998046875hf, 0.06878662109375hf), + f16vec4(0.0693359375hf, -0.08770751953125hf, 0.053375244140625hf, -0.2685546875hf)); +const f16mat4 w2_14 = f16mat4( + f16vec4(0.012786865234375hf, -0.047760009765625hf, 0.1627197265625hf, -0.016998291015625hf), + f16vec4(-0.0477294921875hf, -0.02880859375hf, -0.418212890625hf, -0.1392822265625hf), + f16vec4(-0.08648681640625hf, 0.089599609375hf, -0.058563232421875hf, 0.1278076171875hf), + f16vec4(0.14892578125hf, -0.1805419921875hf, -0.2142333984375hf, -0.04266357421875hf)); +const f16mat4 w2_15 = f16mat4( + f16vec4(-0.13330078125hf, 0.02972412109375hf, -0.16552734375hf, -0.0140228271484375hf), + f16vec4(-0.0943603515625hf, -0.005535125732421875hf, 0.1424560546875hf, -0.414794921875hf), + f16vec4(0.1663818359375hf, -0.07586669921875hf, 0.118896484375hf, 0.06671142578125hf), + f16vec4(0.25146484375hf, -0.270751953125hf, -0.28662109375hf, -0.0948486328125hf)); +const f16mat4 w2_16 = f16mat4( + f16vec4(0.07275390625hf, 0.153076171875hf, 0.004058837890625hf, 0.1357421875hf), + f16vec4(-0.1064453125hf, -0.2352294921875hf, -0.09088134765625hf, -0.1876220703125hf), + f16vec4(-0.2449951171875hf, 0.146484375hf, 0.05792236328125hf, 0.164794921875hf), + f16vec4(0.1375732421875hf, -0.2156982421875hf, -0.150390625hf, -0.06292724609375hf)); +const f16mat4 w2_17 = f16mat4( + f16vec4(-0.00470733642578125hf, 0.07818603515625hf, -0.056915283203125hf, 0.2978515625hf), + f16vec4(-0.07305908203125hf, -0.006214141845703125hf, -0.0809326171875hf, -0.42236328125hf), + f16vec4(-0.06890869140625hf, 0.0872802734375hf, -0.222412109375hf, 0.192138671875hf), + f16vec4(0.212890625hf, -0.367919921875hf, -0.3916015625hf, 0.134521484375hf)); +const f16mat4 w2_18 = f16mat4( + f16vec4(0.1805419921875hf, -0.1689453125hf, -0.2340087890625hf, -0.15185546875hf), + f16vec4(-0.11260986328125hf, -0.01373291015625hf, -0.04986572265625hf, -0.156982421875hf), + f16vec4(-0.5009765625hf, 0.125hf, 0.26318359375hf, -0.337890625hf), + f16vec4(0.003147125244140625hf, 0.196533203125hf, -0.00267791748046875hf, 0.3623046875hf)); +const f16mat4 w2_19 = f16mat4( + f16vec4(0.1322021484375hf, -0.138671875hf, -0.147705078125hf, -0.156494140625hf), + f16vec4(-0.0278778076171875hf, -0.0618896484375hf, -0.152587890625hf, -0.06622314453125hf), + f16vec4(-0.334228515625hf, -0.0020618438720703125hf, -0.09344482421875hf, -0.07818603515625hf), + f16vec4(-0.00923919677734375hf, 0.2127685546875hf, 0.05230712890625hf, 0.17138671875hf)); +const f16mat4 w2_20 = f16mat4( + f16vec4(0.185546875hf, -0.1201171875hf, -0.29248046875hf, -0.07293701171875hf), + f16vec4(-0.10418701171875hf, -0.389892578125hf, -0.2020263671875hf, -0.141357421875hf), + f16vec4(-0.50244140625hf, 0.212158203125hf, 0.220458984375hf, -0.36376953125hf), + f16vec4(-0.08245849609375hf, 0.1375732421875hf, 0.11944580078125hf, 0.2249755859375hf)); +const f16mat4 w2_21 = f16mat4( + f16vec4(0.0207366943359375hf, -0.129638671875hf, -0.060394287109375hf, -0.08270263671875hf), + f16vec4(-0.2130126953125hf, -0.27197265625hf, 0.052978515625hf, -0.15771484375hf), + f16vec4(-0.1982421875hf, 0.0268402099609375hf, 0.0279083251953125hf, -0.1295166015625hf), + f16vec4(0.08642578125hf, 0.1407470703125hf, -0.003917694091796875hf, 0.14453125hf)); +const f16mat4 w2_22 = f16mat4( + f16vec4(-0.129638671875hf, -0.069580078125hf, 0.06414794921875hf, -0.0745849609375hf), + f16vec4(-0.10491943359375hf, -0.0626220703125hf, -0.02813720703125hf, -0.049713134765625hf), + f16vec4(-0.053314208984375hf, -0.1014404296875hf, -0.270263671875hf, 0.1514892578125hf), + f16vec4(0.08819580078125hf, 0.1640625hf, 0.01146697998046875hf, -0.052825927734375hf)); +const f16mat4 w2_23 = f16mat4( + f16vec4(-0.11077880859375hf, -0.052581787109375hf, -0.05767822265625hf, 0.01013946533203125hf), + f16vec4(-0.154052734375hf, 0.017547607421875hf, -0.069091796875hf, -0.0258026123046875hf), + f16vec4(-0.25927734375hf, 0.090087890625hf, -0.013641357421875hf, -0.1446533203125hf), + f16vec4(0.08306884765625hf, 0.044708251953125hf, 0.044708251953125hf, 0.0736083984375hf)); +const f16mat4 w2_24 = f16mat4( + f16vec4(0.189453125hf, -0.1429443359375hf, -0.32763671875hf, -0.007434844970703125hf), + f16vec4(-0.08367919921875hf, -0.033905029296875hf, 0.0638427734375hf, -0.1900634765625hf), + f16vec4(-0.30712890625hf, 0.11480712890625hf, 0.2034912109375hf, -0.1522216796875hf), + f16vec4(-0.062103271484375hf, 0.1622314453125hf, 0.10919189453125hf, 0.28125hf)); +const f16mat4 w2_25 = f16mat4( + f16vec4(0.2685546875hf, -0.0994873046875hf, -0.225830078125hf, -0.002193450927734375hf), + f16vec4(0.017364501953125hf, -0.290283203125hf, -0.0184173583984375hf, -0.1285400390625hf), + f16vec4(-0.2188720703125hf, 0.047698974609375hf, -0.05413818359375hf, 0.001209259033203125hf), + f16vec4(-0.048858642578125hf, 0.1431884765625hf, 0.06585693359375hf, 0.0016889572143554688hf)); +const f16mat4 w2_26 = f16mat4( + f16vec4(0.1888427734375hf, -0.02117919921875hf, -0.30810546875hf, 0.0888671875hf), + f16vec4(-0.0406494140625hf, -0.132080078125hf, -0.00537872314453125hf, -0.2451171875hf), + f16vec4(-0.4326171875hf, 0.258056640625hf, 0.2412109375hf, -0.426513671875hf), + f16vec4(-0.041259765625hf, 0.031646728515625hf, 0.128173828125hf, 0.0055999755859375hf)); +const f16mat4 w2_27 = f16mat4( + f16vec4(0.2103271484375hf, -0.11395263671875hf, 0.1339111328125hf, 0.0850830078125hf), + f16vec4(-0.326416015625hf, -0.19921875hf, -0.1561279296875hf, -0.08477783203125hf), + f16vec4(0.25634765625hf, 0.275146484375hf, 0.2587890625hf, 0.1673583984375hf), + f16vec4(0.1309814453125hf, 0.1278076171875hf, 0.0020771026611328125hf, -0.11566162109375hf)); +const f16mat4 w2_28 = f16mat4( + f16vec4(0.2130126953125hf, -0.0274658203125hf, 0.08197021484375hf, 0.06402587890625hf), + f16vec4(-0.266845703125hf, -0.043212890625hf, -0.1304931640625hf, 0.00257110595703125hf), + f16vec4(0.323486328125hf, 0.26171875hf, 0.1744384765625hf, 0.2242431640625hf), + f16vec4(0.0625hf, 0.07861328125hf, -0.1248779296875hf, -0.107421875hf)); +const f16mat4 w2_29 = f16mat4( + f16vec4(0.0533447265625hf, -0.0018930435180664062hf, 0.2252197265625hf, -0.11956787109375hf), + f16vec4(-0.482177734375hf, -0.1273193359375hf, -0.09197998046875hf, 0.003173828125hf), + f16vec4(0.3701171875hf, 0.2890625hf, 0.2442626953125hf, 0.285888671875hf), + f16vec4(0.19287109375hf, 0.34814453125hf, -0.18017578125hf, -0.371337890625hf)); +const f16mat4 w2_30 = f16mat4( + f16vec4(0.11236572265625hf, -0.00980377197265625hf, 0.1917724609375hf, 0.0672607421875hf), + f16vec4(-0.247802734375hf, -0.130615234375hf, -0.1251220703125hf, -0.1519775390625hf), + f16vec4(0.271240234375hf, 0.26171875hf, 0.219482421875hf, 0.1651611328125hf), + f16vec4(0.123046875hf, 0.0714111328125hf, -0.0092315673828125hf, -0.018524169921875hf)); +const f16mat4 w2_31 = f16mat4( + f16vec4(0.12152099609375hf, 0.0931396484375hf, 0.16162109375hf, 0.04425048828125hf), + f16vec4(-0.09466552734375hf, -0.0225677490234375hf, -0.10076904296875hf, -0.1021728515625hf), + f16vec4(0.3212890625hf, 0.25927734375hf, 0.1422119140625hf, 0.178955078125hf), + f16vec4(0.051177978515625hf, 0.0188751220703125hf, -0.129150390625hf, 0.07470703125hf)); +const f16mat4 w2_32 = f16mat4( + f16vec4(0.080322265625hf, 0.08026123046875hf, 0.12432861328125hf, -0.1328125hf), + f16vec4(-0.35595703125hf, -0.1856689453125hf, -0.039459228515625hf, -0.08929443359375hf), + f16vec4(0.354736328125hf, 0.2880859375hf, 0.210693359375hf, 0.2037353515625hf), + f16vec4(0.19970703125hf, 0.1817626953125hf, -0.1845703125hf, -0.1549072265625hf)); +const f16mat4 w2_33 = f16mat4( + f16vec4(0.1846923828125hf, 0.05047607421875hf, 0.1451416015625hf, 0.27685546875hf), + f16vec4(-0.374267578125hf, -0.1873779296875hf, -0.1690673828125hf, -0.0196685791015625hf), + f16vec4(0.2266845703125hf, 0.417236328125hf, 0.388671875hf, 0.11590576171875hf), + f16vec4(0.1451416015625hf, 0.1827392578125hf, 0.006130218505859375hf, -0.2183837890625hf)); +const f16mat4 w2_34 = f16mat4( + f16vec4(0.0811767578125hf, 0.056610107421875hf, 0.2188720703125hf, 0.180419921875hf), + f16vec4(-0.10992431640625hf, 0.0033473968505859375hf, -0.1170654296875hf, 0.0133819580078125hf), + f16vec4(0.2457275390625hf, 0.415283203125hf, 0.2744140625hf, 0.1451416015625hf), + f16vec4(0.07598876953125hf, 0.1356201171875hf, -0.1341552734375hf, -0.1619873046875hf)); +const f16mat4 w2_35 = f16mat4( + f16vec4(0.1324462890625hf, 0.0859375hf, 0.08172607421875hf, -0.027130126953125hf), + f16vec4(-0.25537109375hf, -0.1966552734375hf, -0.05328369140625hf, 0.0021266937255859375hf), + f16vec4(0.277099609375hf, 0.422607421875hf, 0.310302734375hf, 0.1651611328125hf), + f16vec4(0.231201171875hf, 0.299072265625hf, -0.1380615234375hf, -0.40869140625hf)); +const f16vec4 sub2 = f16vec4(-0.5546875hf, -0.3037109375hf, -0.62060546875hf, -0.6025390625hf); +const f16vec4 mul2 = f16vec4(0.8310546875hf, 0.828125hf, 0.921875hf, 0.8310546875hf); +const f16vec4 add2 = f16vec4(-0.07379150390625hf, -0.1759033203125hf, -0.431640625hf, -0.4287109375hf); + +const f16mat4 w3_0 = f16mat4( + f16vec4(0.427001953125hf, 0.316650390625hf, 0.25732421875hf, 0.56689453125hf), + f16vec4(0.135986328125hf, -0.126220703125hf, -0.21630859375hf, -0.384033203125hf), + f16vec4(-0.10540771484375hf, -0.35595703125hf, 0.07977294921875hf, -0.15380859375hf), + f16vec4(-0.03564453125hf, 0.12078857421875hf, -0.0712890625hf, 0.06500244140625hf)); +const f16mat4 w3_1 = f16mat4( + f16vec4(0.44775390625hf, 0.33203125hf, 0.14111328125hf, 0.5625hf), + f16vec4(-0.079345703125hf, -0.250244140625hf, -0.00649261474609375hf, -0.1558837890625hf), + f16vec4(-0.247314453125hf, -0.2139892578125hf, -0.06195068359375hf, 0.06024169921875hf), + f16vec4(-0.01898193359375hf, -0.055511474609375hf, -0.1278076171875hf, 0.10906982421875hf)); +const f16mat4 w3_2 = f16mat4( + f16vec4(0.31201171875hf, 0.32470703125hf, 0.320556640625hf, 0.5205078125hf), + f16vec4(0.10882568359375hf, -0.018341064453125hf, -0.1842041015625hf, -0.315673828125hf), + f16vec4(-0.0870361328125hf, -0.14208984375hf, -0.1824951171875hf, 0.12115478515625hf), + f16vec4(-0.084228515625hf, 0.1231689453125hf, -0.27880859375hf, -0.15869140625hf)); +const f16mat4 w3_3 = f16mat4( + f16vec4(0.433349609375hf, 0.296875hf, 0.230224609375hf, 0.52099609375hf), + f16vec4(0.09051513671875hf, -0.1864013671875hf, -0.08489990234375hf, -0.274169921875hf), + f16vec4(0.265869140625hf, -0.2225341796875hf, 0.14306640625hf, -0.057220458984375hf), + f16vec4(-0.160400390625hf, 0.080810546875hf, 0.08056640625hf, 0.046905517578125hf)); +const f16mat4 w3_4 = f16mat4( + f16vec4(0.427734375hf, 0.28662109375hf, 0.14599609375hf, 0.51953125hf), + f16vec4(-0.1282958984375hf, -0.2320556640625hf, 0.1373291015625hf, 0.02362060546875hf), + f16vec4(-0.060577392578125hf, -0.0122833251953125hf, 0.0225830078125hf, -0.2156982421875hf), + f16vec4(-0.289794921875hf, -0.068115234375hf, 0.058349609375hf, 0.261474609375hf)); +const f16mat4 w3_5 = f16mat4( + f16vec4(0.326171875hf, 0.326171875hf, 0.318603515625hf, 0.479736328125hf), + f16vec4(0.0162811279296875hf, -0.053558349609375hf, -0.061614990234375hf, -0.219482421875hf), + f16vec4(-0.134765625hf, 0.077880859375hf, -0.047210693359375hf, -0.1124267578125hf), + f16vec4(0.173583984375hf, 0.09844970703125hf, 0.0190887451171875hf, 0.024383544921875hf)); +const f16mat4 w3_6 = f16mat4( + f16vec4(0.44970703125hf, 0.312744140625hf, 0.236083984375hf, 0.4794921875hf), + f16vec4(0.2281494140625hf, 0.1424560546875hf, -0.270751953125hf, -0.40087890625hf), + f16vec4(0.135009765625hf, -0.1077880859375hf, 0.1875hf, 0.046112060546875hf), + f16vec4(-0.01474761962890625hf, -0.07586669921875hf, 0.1834716796875hf, -0.0662841796875hf)); +const f16mat4 w3_7 = f16mat4( + f16vec4(0.44921875hf, 0.291259765625hf, 0.1617431640625hf, 0.487060546875hf), + f16vec4(0.0226287841796875hf, 0.0221710205078125hf, -0.00995635986328125hf, -0.12060546875hf), + f16vec4(0.1453857421875hf, -0.12054443359375hf, 0.005260467529296875hf, 0.07806396484375hf), + f16vec4(-0.314453125hf, -0.09185791015625hf, 0.11676025390625hf, 0.0413818359375hf)); +const f16mat4 w3_8 = f16mat4( + f16vec4(0.343994140625hf, 0.32177734375hf, 0.31298828125hf, 0.45947265625hf), + f16vec4(0.0164642333984375hf, 0.1773681640625hf, -0.186767578125hf, -0.331787109375hf), + f16vec4(-0.12939453125hf, 0.0455322265625hf, 0.00579833984375hf, -0.07501220703125hf), + f16vec4(-0.238037109375hf, 0.034576416015625hf, 0.142333984375hf, -0.045806884765625hf)); +const f16mat4 w3_9 = f16mat4( + f16vec4(0.07489013671875hf, -0.25732421875hf, -0.2279052734375hf, -0.55712890625hf), + f16vec4(-0.416748046875hf, -0.069091796875hf, -0.1055908203125hf, 0.28271484375hf), + f16vec4(0.1387939453125hf, -0.3671875hf, 0.192138671875hf, 0.07513427734375hf), + f16vec4(0.24853515625hf, -0.22998046875hf, -0.1676025390625hf, -0.33447265625hf)); +const f16mat4 w3_10 = f16mat4( + f16vec4(0.06683349609375hf, -0.455322265625hf, -0.1600341796875hf, -0.1484375hf), + f16vec4(-0.27880859375hf, -0.0667724609375hf, -0.345458984375hf, 0.0256195068359375hf), + f16vec4(0.1817626953125hf, -0.07318115234375hf, -0.1912841796875hf, -0.00848388671875hf), + f16vec4(0.212158203125hf, -0.07867431640625hf, -0.112060546875hf, -0.171875hf)); +const f16mat4 w3_11 = f16mat4( + f16vec4(0.1405029296875hf, -0.119384765625hf, -0.19482421875hf, -0.426025390625hf), + f16vec4(-0.442626953125hf, -0.01456451416015625hf, -0.5732421875hf, 0.220458984375hf), + f16vec4(0.0193634033203125hf, -0.2073974609375hf, -0.46484375hf, -0.1708984375hf), + f16vec4(0.1776123046875hf, -0.1546630859375hf, -0.12481689453125hf, -0.368408203125hf)); +const f16mat4 w3_12 = f16mat4( + f16vec4(-0.027130126953125hf, -0.38427734375hf, 0.0413818359375hf, -0.422119140625hf), + f16vec4(-0.2354736328125hf, 0.057708740234375hf, -0.11761474609375hf, 0.167724609375hf), + f16vec4(-0.0452880859375hf, -0.3427734375hf, 0.0562744140625hf, 0.02569580078125hf), + f16vec4(0.0247802734375hf, -0.13427734375hf, -0.0841064453125hf, -0.1893310546875hf)); +const f16mat4 w3_13 = f16mat4( + f16vec4(-0.1473388671875hf, -0.419677734375hf, 0.126220703125hf, -0.12310791015625hf), + f16vec4(0.060394287109375hf, -0.005107879638671875hf, -0.1903076171875hf, -0.044097900390625hf), + f16vec4(0.07708740234375hf, -0.11541748046875hf, -0.1771240234375hf, 0.2484130859375hf), + f16vec4(0.043975830078125hf, 0.0113677978515625hf, 0.0171966552734375hf, 0.04888916015625hf)); +const f16mat4 w3_14 = f16mat4( + f16vec4(-0.2161865234375hf, -0.077880859375hf, -0.02081298828125hf, -0.384765625hf), + f16vec4(-0.2225341796875hf, 0.0163726806640625hf, -0.38134765625hf, 0.0838623046875hf), + f16vec4(0.1453857421875hf, -0.278564453125hf, -0.257568359375hf, 0.07769775390625hf), + f16vec4(0.0513916015625hf, -0.088623046875hf, -0.06597900390625hf, -0.1805419921875hf)); +const f16mat4 w3_15 = f16mat4( + f16vec4(0.0275421142578125hf, 0.10089111328125hf, -0.2283935546875hf, -0.42822265625hf), + f16vec4(-0.438232421875hf, 0.04425048828125hf, 0.2060546875hf, 0.15185546875hf), + f16vec4(0.206787109375hf, -0.331787109375hf, 0.034271240234375hf, -0.1121826171875hf), + f16vec4(0.1380615234375hf, -0.1453857421875hf, -0.157958984375hf, -0.301513671875hf)); +const f16mat4 w3_16 = f16mat4( + f16vec4(0.0875244140625hf, 0.041290283203125hf, 0.0282745361328125hf, -0.317138671875hf), + f16vec4(-0.243408203125hf, -0.0743408203125hf, 0.187255859375hf, 0.1134033203125hf), + f16vec4(0.006717681884765625hf, -0.159423828125hf, -0.2081298828125hf, 0.0296630859375hf), + f16vec4(0.10699462890625hf, -0.0634765625hf, -0.04522705078125hf, -0.118896484375hf)); +const f16mat4 w3_17 = f16mat4( + f16vec4(-0.1451416015625hf, 0.36669921875hf, -0.16943359375hf, -0.59716796875hf), + f16vec4(-0.37841796875hf, -0.07568359375hf, 0.1741943359375hf, 0.2459716796875hf), + f16vec4(-0.0721435546875hf, -0.460693359375hf, -0.1484375hf, 0.140625hf), + f16vec4(0.08251953125hf, -0.1634521484375hf, -0.10760498046875hf, -0.27294921875hf)); +const f16mat4 w3_18 = f16mat4( + f16vec4(-0.1961669921875hf, -0.231201171875hf, 0.11114501953125hf, 0.188720703125hf), + f16vec4(-0.0242462158203125hf, -0.0921630859375hf, -0.210205078125hf, -0.2200927734375hf), + f16vec4(-0.341796875hf, -0.054229736328125hf, -0.1756591796875hf, 0.1612548828125hf), + f16vec4(0.1593017578125hf, 0.10284423828125hf, 0.173095703125hf, 0.1287841796875hf)); +const f16mat4 w3_19 = f16mat4( + f16vec4(-0.048553466796875hf, -0.09405517578125hf, -0.18896484375hf, 0.12353515625hf), + f16vec4(-0.1754150390625hf, -0.21337890625hf, 0.0504150390625hf, -0.0292510986328125hf), + f16vec4(-0.198486328125hf, -0.173095703125hf, -0.2193603515625hf, 0.048370361328125hf), + f16vec4(0.1409912109375hf, 0.10614013671875hf, 0.038482666015625hf, 0.139404296875hf)); +const f16mat4 w3_20 = f16mat4( + f16vec4(-0.04205322265625hf, -0.274169921875hf, -0.451416015625hf, 0.01183319091796875hf), + f16vec4(-0.2000732421875hf, -0.14111328125hf, -0.1580810546875hf, -0.07904052734375hf), + f16vec4(-0.263916015625hf, 0.007366180419921875hf, -0.1796875hf, 0.057891845703125hf), + f16vec4(0.1910400390625hf, 0.040252685546875hf, 0.03662109375hf, 0.132568359375hf)); +const f16mat4 w3_21 = f16mat4( + f16vec4(-0.279296875hf, -0.0321044921875hf, -0.00823211669921875hf, -0.04034423828125hf), + f16vec4(0.04730224609375hf, 0.03436279296875hf, -0.09051513671875hf, -0.044281005859375hf), + f16vec4(-0.16845703125hf, -0.17138671875hf, -0.08148193359375hf, 0.0435791015625hf), + f16vec4(0.17724609375hf, -0.0048370361328125hf, 0.1002197265625hf, 0.12744140625hf)); +const f16mat4 w3_22 = f16mat4( + f16vec4(-0.2822265625hf, 0.1500244140625hf, -0.19921875hf, 0.0001099705696105957hf), + f16vec4(0.022216796875hf, -0.1224365234375hf, 0.0740966796875hf, -0.05548095703125hf), + f16vec4(-0.0570068359375hf, -0.188232421875hf, -0.0941162109375hf, -0.033111572265625hf), + f16vec4(0.204833984375hf, 0.06610107421875hf, 0.09716796875hf, 0.14453125hf)); +const f16mat4 w3_23 = f16mat4( + f16vec4(-0.27001953125hf, 0.09271240234375hf, -0.3544921875hf, 0.06842041015625hf), + f16vec4(0.052215576171875hf, 0.1573486328125hf, -0.054931640625hf, -0.1800537109375hf), + f16vec4(-0.1893310546875hf, -0.078125hf, -0.1513671875hf, -0.0228424072265625hf), + f16vec4(0.234619140625hf, 0.0200653076171875hf, 0.144775390625hf, 0.117919921875hf)); +const f16mat4 w3_24 = f16mat4( + f16vec4(-0.1368408203125hf, -0.273681640625hf, 0.194580078125hf, 0.11724853515625hf), + f16vec4(-0.175537109375hf, 0.251953125hf, -0.1973876953125hf, -0.10638427734375hf), + f16vec4(-0.308349609375hf, -0.045440673828125hf, -0.10699462890625hf, 0.059051513671875hf), + f16vec4(0.1624755859375hf, -0.007045745849609375hf, -0.155517578125hf, 0.150390625hf)); +const f16mat4 w3_25 = f16mat4( + f16vec4(-0.1270751953125hf, -0.0623779296875hf, 0.0357666015625hf, 0.0153961181640625hf), + f16vec4(-0.053192138671875hf, -0.0011587142944335938hf, 0.062408447265625hf, 0.032623291015625hf), + f16vec4(-0.2393798828125hf, -0.07525634765625hf, -0.08160400390625hf, -0.0179443359375hf), + f16vec4(0.244140625hf, 0.048065185546875hf, -0.10540771484375hf, 0.1893310546875hf)); +const f16mat4 w3_26 = f16mat4( + f16vec4(-0.287353515625hf, -0.1810302734375hf, 0.06597900390625hf, 0.12939453125hf), + f16vec4(-0.062469482421875hf, 0.1668701171875hf, -0.06610107421875hf, -0.139892578125hf), + f16vec4(-0.384765625hf, 0.07037353515625hf, -0.0457763671875hf, 0.06451416015625hf), + f16vec4(0.26611328125hf, 0.0626220703125hf, 0.0997314453125hf, 0.1990966796875hf)); +const f16mat4 w3_27 = f16mat4( + f16vec4(-0.03167724609375hf, 0.306640625hf, 0.1787109375hf, -0.0181732177734375hf), + f16vec4(0.23974609375hf, -0.10394287109375hf, -0.344970703125hf, -0.338623046875hf), + f16vec4(0.2366943359375hf, 0.25732421875hf, 0.072509765625hf, 0.346435546875hf), + f16vec4(-0.1478271484375hf, -0.182373046875hf, 0.2445068359375hf, 0.1883544921875hf)); +const f16mat4 w3_28 = f16mat4( + f16vec4(-0.135986328125hf, 0.129638671875hf, 0.10247802734375hf, 0.047119140625hf), + f16vec4(0.203857421875hf, -0.309326171875hf, -0.1805419921875hf, -0.233642578125hf), + f16vec4(0.34716796875hf, 0.19091796875hf, 0.06964111328125hf, 0.318603515625hf), + f16vec4(-0.2164306640625hf, -0.0633544921875hf, -0.1461181640625hf, 0.0648193359375hf)); +const f16mat4 w3_29 = f16mat4( + f16vec4(-0.1453857421875hf, 0.1973876953125hf, 0.05487060546875hf, 0.0217437744140625hf), + f16vec4(0.1561279296875hf, 0.2403564453125hf, -0.449951171875hf, -0.55517578125hf), + f16vec4(0.357421875hf, 0.177734375hf, 0.110595703125hf, 0.2353515625hf), + f16vec4(-0.338623046875hf, -0.406494140625hf, -0.27197265625hf, 0.31005859375hf)); +const f16mat4 w3_30 = f16mat4( + f16vec4(0.072021484375hf, 0.16064453125hf, 0.00954437255859375hf, 0.0229339599609375hf), + f16vec4(0.1431884765625hf, -0.07366943359375hf, -0.1278076171875hf, -0.2467041015625hf), + f16vec4(0.27587890625hf, 0.2022705078125hf, 0.04443359375hf, 0.3662109375hf), + f16vec4(-0.0265655517578125hf, -0.1080322265625hf, 0.0872802734375hf, 0.032867431640625hf)); +const f16mat4 w3_31 = f16mat4( + f16vec4(-0.032684326171875hf, 0.07489013671875hf, -0.037109375hf, 0.044403076171875hf), + f16vec4(0.10003662109375hf, -0.343505859375hf, 0.12890625hf, -0.052886962890625hf), + f16vec4(0.352294921875hf, 0.1370849609375hf, 0.0435791015625hf, 0.362060546875hf), + f16vec4(0.022857666015625hf, 0.12939453125hf, -0.179443359375hf, -0.1671142578125hf)); +const f16mat4 w3_32 = f16mat4( + f16vec4(-0.054962158203125hf, 0.028472900390625hf, 0.07513427734375hf, 0.036163330078125hf), + f16vec4(0.139892578125hf, 0.042999267578125hf, -0.1907958984375hf, -0.34130859375hf), + f16vec4(0.350341796875hf, 0.1435546875hf, 0.0972900390625hf, 0.29052734375hf), + f16vec4(-0.1046142578125hf, -0.1529541015625hf, -0.1748046875hf, 0.0958251953125hf)); +const f16mat4 w3_33 = f16mat4( + f16vec4(0.053924560546875hf, 0.05517578125hf, 0.234375hf, 0.03631591796875hf), + f16vec4(0.21435546875hf, 0.182861328125hf, -0.39501953125hf, -0.50927734375hf), + f16vec4(0.280029296875hf, 0.353515625hf, -0.02056884765625hf, 0.419677734375hf), + f16vec4(-0.2548828125hf, -0.381103515625hf, 0.2646484375hf, 0.270751953125hf)); +const f16mat4 w3_34 = f16mat4( + f16vec4(-0.0194244384765625hf, 0.14501953125hf, 0.125244140625hf, 0.0274200439453125hf), + f16vec4(0.1448974609375hf, -0.09625244140625hf, -0.07427978515625hf, -0.2191162109375hf), + f16vec4(0.311279296875hf, 0.245849609375hf, -0.0248260498046875hf, 0.40234375hf), + f16vec4(-0.14111328125hf, -0.1429443359375hf, 0.12255859375hf, 0.108642578125hf)); +const f16mat4 w3_35 = f16mat4( + f16vec4(-0.081298828125hf, -0.10986328125hf, 0.3359375hf, 0.060211181640625hf), + f16vec4(0.1817626953125hf, 0.266357421875hf, -0.322509765625hf, -0.3955078125hf), + f16vec4(0.317626953125hf, 0.24951171875hf, 0.0157928466796875hf, 0.325927734375hf), + f16vec4(-0.2081298828125hf, -0.389892578125hf, 0.236328125hf, 0.331787109375hf)); +const f16vec4 sub3 = f16vec4(-0.30419921875hf, -0.7197265625hf, -0.481689453125hf, -0.1953125hf); +const f16vec4 mul3 = f16vec4(0.71923828125hf, 0.921875hf, 0.92822265625hf, 0.70849609375hf); +const f16vec4 add3 = f16vec4(-0.1279296875hf, -0.454345703125hf, -0.560546875hf, 0.051239013671875hf); + +void main() +{ + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 ext = imageSize(dstA); + if (p.x >= ext.x || p.y >= ext.y) + return; + + f16vec4 t0 = padTap(srcA, p + ivec2(-1, -1)); + f16vec4 t1 = padTap(srcA, p + ivec2(-1, 0)); + f16vec4 t2 = padTap(srcA, p + ivec2(-1, 1)); + f16vec4 t3 = padTap(srcA, p + ivec2(0, -1)); + f16vec4 t4 = f16vec4(texelFetch(srcA, p, 0)); + f16vec4 t5 = padTap(srcA, p + ivec2(0, 1)); + f16vec4 t6 = padTap(srcA, p + ivec2(1, -1)); + f16vec4 t7 = padTap(srcA, p + ivec2(1, 0)); + f16vec4 t8 = padTap(srcA, p + ivec2(1, 1)); + f16vec4 t9 = padTap(srcB, p + ivec2(-1, -1)); + f16vec4 t10 = padTap(srcB, p + ivec2(-1, 0)); + f16vec4 t11 = padTap(srcB, p + ivec2(-1, 1)); + f16vec4 t12 = padTap(srcB, p + ivec2(0, -1)); + f16vec4 t13 = f16vec4(texelFetch(srcB, p, 0)); + f16vec4 t14 = padTap(srcB, p + ivec2(0, 1)); + f16vec4 t15 = padTap(srcB, p + ivec2(1, -1)); + f16vec4 t16 = padTap(srcB, p + ivec2(1, 0)); + f16vec4 t17 = padTap(srcB, p + ivec2(1, 1)); + f16vec4 t18 = padTap(srcC, p + ivec2(-1, -1)); + f16vec4 t19 = padTap(srcC, p + ivec2(-1, 0)); + f16vec4 t20 = padTap(srcC, p + ivec2(-1, 1)); + f16vec4 t21 = padTap(srcC, p + ivec2(0, -1)); + f16vec4 t22 = f16vec4(texelFetch(srcC, p, 0)); + f16vec4 t23 = padTap(srcC, p + ivec2(0, 1)); + f16vec4 t24 = padTap(srcC, p + ivec2(1, -1)); + f16vec4 t25 = padTap(srcC, p + ivec2(1, 0)); + f16vec4 t26 = padTap(srcC, p + ivec2(1, 1)); + f16vec4 t27 = padTap(srcD, p + ivec2(-1, -1)); + f16vec4 t28 = padTap(srcD, p + ivec2(-1, 0)); + f16vec4 t29 = padTap(srcD, p + ivec2(-1, 1)); + f16vec4 t30 = padTap(srcD, p + ivec2(0, -1)); + f16vec4 t31 = f16vec4(texelFetch(srcD, p, 0)); + f16vec4 t32 = padTap(srcD, p + ivec2(0, 1)); + f16vec4 t33 = padTap(srcD, p + ivec2(1, -1)); + f16vec4 t34 = padTap(srcD, p + ivec2(1, 0)); + f16vec4 t35 = padTap(srcD, p + ivec2(1, 1)); + + f16vec4 r0 = w0_0 * t0; + r0 += w0_1 * t1; + r0 += w0_2 * t2; + r0 += w0_3 * t3; + r0 += w0_4 * t4; + r0 += w0_5 * t5; + r0 += w0_6 * t6; + r0 += w0_7 * t7; + r0 += w0_8 * t8; + r0 += w0_9 * t9; + r0 += w0_10 * t10; + r0 += w0_11 * t11; + r0 += w0_12 * t12; + r0 += w0_13 * t13; + r0 += w0_14 * t14; + r0 += w0_15 * t15; + r0 += w0_16 * t16; + r0 += w0_17 * t17; + r0 += w0_18 * t18; + r0 += w0_19 * t19; + r0 += w0_20 * t20; + r0 += w0_21 * t21; + r0 += w0_22 * t22; + r0 += w0_23 * t23; + r0 += w0_24 * t24; + r0 += w0_25 * t25; + r0 += w0_26 * t26; + r0 += w0_27 * t27; + r0 += w0_28 * t28; + r0 += w0_29 * t29; + r0 += w0_30 * t30; + r0 += w0_31 * t31; + r0 += w0_32 * t32; + r0 += w0_33 * t33; + r0 += w0_34 * t34; + r0 += w0_35 * t35; + r0 = (r0 - sub0) * mul0 + add0; + imageStore(dstA, p, vec4(r0)); + + f16vec4 r1 = w1_0 * t0; + r1 += w1_1 * t1; + r1 += w1_2 * t2; + r1 += w1_3 * t3; + r1 += w1_4 * t4; + r1 += w1_5 * t5; + r1 += w1_6 * t6; + r1 += w1_7 * t7; + r1 += w1_8 * t8; + r1 += w1_9 * t9; + r1 += w1_10 * t10; + r1 += w1_11 * t11; + r1 += w1_12 * t12; + r1 += w1_13 * t13; + r1 += w1_14 * t14; + r1 += w1_15 * t15; + r1 += w1_16 * t16; + r1 += w1_17 * t17; + r1 += w1_18 * t18; + r1 += w1_19 * t19; + r1 += w1_20 * t20; + r1 += w1_21 * t21; + r1 += w1_22 * t22; + r1 += w1_23 * t23; + r1 += w1_24 * t24; + r1 += w1_25 * t25; + r1 += w1_26 * t26; + r1 += w1_27 * t27; + r1 += w1_28 * t28; + r1 += w1_29 * t29; + r1 += w1_30 * t30; + r1 += w1_31 * t31; + r1 += w1_32 * t32; + r1 += w1_33 * t33; + r1 += w1_34 * t34; + r1 += w1_35 * t35; + r1 = (r1 - sub1) * mul1 + add1; + imageStore(dstB, p, vec4(r1)); + + f16vec4 r2 = w2_0 * t0; + r2 += w2_1 * t1; + r2 += w2_2 * t2; + r2 += w2_3 * t3; + r2 += w2_4 * t4; + r2 += w2_5 * t5; + r2 += w2_6 * t6; + r2 += w2_7 * t7; + r2 += w2_8 * t8; + r2 += w2_9 * t9; + r2 += w2_10 * t10; + r2 += w2_11 * t11; + r2 += w2_12 * t12; + r2 += w2_13 * t13; + r2 += w2_14 * t14; + r2 += w2_15 * t15; + r2 += w2_16 * t16; + r2 += w2_17 * t17; + r2 += w2_18 * t18; + r2 += w2_19 * t19; + r2 += w2_20 * t20; + r2 += w2_21 * t21; + r2 += w2_22 * t22; + r2 += w2_23 * t23; + r2 += w2_24 * t24; + r2 += w2_25 * t25; + r2 += w2_26 * t26; + r2 += w2_27 * t27; + r2 += w2_28 * t28; + r2 += w2_29 * t29; + r2 += w2_30 * t30; + r2 += w2_31 * t31; + r2 += w2_32 * t32; + r2 += w2_33 * t33; + r2 += w2_34 * t34; + r2 += w2_35 * t35; + r2 = (r2 - sub2) * mul2 + add2; + imageStore(dstC, p, vec4(r2)); + + f16vec4 r3 = w3_0 * t0; + r3 += w3_1 * t1; + r3 += w3_2 * t2; + r3 += w3_3 * t3; + r3 += w3_4 * t4; + r3 += w3_5 * t5; + r3 += w3_6 * t6; + r3 += w3_7 * t7; + r3 += w3_8 * t8; + r3 += w3_9 * t9; + r3 += w3_10 * t10; + r3 += w3_11 * t11; + r3 += w3_12 * t12; + r3 += w3_13 * t13; + r3 += w3_14 * t14; + r3 += w3_15 * t15; + r3 += w3_16 * t16; + r3 += w3_17 * t17; + r3 += w3_18 * t18; + r3 += w3_19 * t19; + r3 += w3_20 * t20; + r3 += w3_21 * t21; + r3 += w3_22 * t22; + r3 += w3_23 * t23; + r3 += w3_24 * t24; + r3 += w3_25 * t25; + r3 += w3_26 * t26; + r3 += w3_27 * t27; + r3 += w3_28 * t28; + r3 += w3_29 * t29; + r3 += w3_30 * t30; + r3 += w3_31 * t31; + r3 += w3_32 * t32; + r3 += w3_33 * t33; + r3 += w3_34 * t34; + r3 += w3_35 * t35; + r3 = (r3 - sub3) * mul3 + add3; + imageStore(dstD, p, vec4(r3)); + +} diff --git a/cleanroom/glsl/shader_43.comp b/cleanroom/glsl/shader_43.comp new file mode 100644 index 0000000..309b8d3 --- /dev/null +++ b/cleanroom/glsl/shader_43.comp @@ -0,0 +1,156 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 0) uniform Params { + float reserved0; + float phase; + float reserved1; +} ub; + +layout(set = 0, binding = 32) uniform sampler2D convIn0; +layout(set = 0, binding = 33) uniform sampler2D convIn1; +layout(set = 0, binding = 34) uniform sampler2D convIn2; +layout(set = 0, binding = 35) uniform sampler2D convIn3; +layout(set = 0, binding = 36) uniform sampler2D coarseFlow; +layout(set = 0, binding = 37) uniform sampler2D maskTex; +layout(set = 0, binding = 48, rgba16f) uniform writeonly image2D flowOut; + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + if (any(greaterThanEqual(p, imageSize(flowOut)))) return; + + vec2 sz = vec2(textureSize(convIn0, 0)); + vec2 pc = vec2(p) + 0.5; + vec2 uv = pc / sz; + + // 3x3 conv, 16 channels in -> 2-channel flow correction (rx, ry). + f16vec4 tap; + float16_t rx, ry; + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(-1, -1))); + rx = dot(f16vec4(0.065673828125hf, 0.022064208984375hf, -0.18701171875hf, 0.045257568359375hf), tap); + ry = dot(f16vec4(0.0036106109619140625hf, 0.1466064453125hf, 0.09307861328125hf, -0.0278778076171875hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(-1, 0))); + rx += dot(f16vec4(0.11590576171875hf, 0.03826904296875hf, -0.242431640625hf, 0.083740234375hf), tap); + ry += dot(f16vec4(-0.0182037353515625hf, 0.1473388671875hf, 0.11614990234375hf, -0.116455078125hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(-1, 1))); + rx += dot(f16vec4(0.036773681640625hf, 0.021514892578125hf, -0.1617431640625hf, 0.02642822265625hf), tap); + ry += dot(f16vec4(0.01306915283203125hf, 0.0301055908203125hf, 0.0222320556640625hf, -0.07305908203125hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(0, -1))); + rx += dot(f16vec4(0.0615234375hf, -0.00997161865234375hf, -0.1983642578125hf, 0.0740966796875hf), tap); + ry += dot(f16vec4(-0.0033111572265625hf, 0.270263671875hf, 0.02099609375hf, -0.058807373046875hf), tap); + tap = f16vec4(textureLod(convIn0, uv, 0.0)); + rx += dot(f16vec4(0.1390380859375hf, -0.024169921875hf, -0.2783203125hf, 0.10858154296875hf), tap); + ry += dot(f16vec4(-0.015716552734375hf, 0.257568359375hf, 0.0765380859375hf, -0.128662109375hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(0, 1))); + rx += dot(f16vec4(0.08441162109375hf, -0.0160064697265625hf, -0.2392578125hf, 0.07110595703125hf), tap); + ry += dot(f16vec4(-0.0141448974609375hf, 0.180419921875hf, 0.0638427734375hf, -0.0648193359375hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(1, -1))); + rx += dot(f16vec4(0.09051513671875hf, 0.00478363037109375hf, -0.055450439453125hf, 0.02679443359375hf), tap); + ry += dot(f16vec4(0.035736083984375hf, 0.1602783203125hf, 0.0183868408203125hf, -0.051910400390625hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(1, 0))); + rx += dot(f16vec4(0.13818359375hf, -0.053436279296875hf, -0.10986328125hf, 0.08807373046875hf), tap); + ry += dot(f16vec4(-0.02508544921875hf, 0.188720703125hf, 0.051177978515625hf, -0.1129150390625hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(1, 1))); + rx += dot(f16vec4(0.07476806640625hf, -0.0672607421875hf, -0.07464599609375hf, 0.03863525390625hf), tap); + ry += dot(f16vec4(-0.01531219482421875hf, 0.042236328125hf, 0.0540771484375hf, -0.00853729248046875hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(-1, -1))); + rx += dot(f16vec4(0.10394287109375hf, -0.04095458984375hf, -0.08709716796875hf, 0.03668212890625hf), tap); + ry += dot(f16vec4(-0.1326904296875hf, -0.01971435546875hf, -0.044158935546875hf, 0.009979248046875hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(-1, 0))); + rx += dot(f16vec4(0.0794677734375hf, -0.09490966796875hf, -0.101806640625hf, 0.1077880859375hf), tap); + ry += dot(f16vec4(-0.13671875hf, -0.07879638671875hf, -0.14306640625hf, 0.052520751953125hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(-1, 1))); + rx += dot(f16vec4(0.050567626953125hf, -0.06341552734375hf, 0.003810882568359375hf, 0.08538818359375hf), tap); + ry += dot(f16vec4(-0.09210205078125hf, -0.0595703125hf, -0.0789794921875hf, 0.0679931640625hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(0, -1))); + rx += dot(f16vec4(0.10955810546875hf, -0.083740234375hf, -0.1580810546875hf, 0.10369873046875hf), tap); + ry += dot(f16vec4(-0.1983642578125hf, -0.079833984375hf, -0.10662841796875hf, 0.051025390625hf), tap); + tap = f16vec4(textureLod(convIn1, uv, 0.0)); + rx += dot(f16vec4(0.079833984375hf, -0.15625hf, -0.1318359375hf, 0.17919921875hf), tap); + ry += dot(f16vec4(-0.15576171875hf, -0.1322021484375hf, -0.1099853515625hf, 0.103515625hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(0, 1))); + rx += dot(f16vec4(0.053192138671875hf, -0.09027099609375hf, -0.10174560546875hf, 0.1162109375hf), tap); + ry += dot(f16vec4(-0.1368408203125hf, -0.08074951171875hf, -0.123046875hf, 0.060791015625hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(1, -1))); + rx += dot(f16vec4(0.05419921875hf, -0.018707275390625hf, -0.1075439453125hf, 0.048004150390625hf), tap); + ry += dot(f16vec4(-0.10491943359375hf, -0.0386962890625hf, -0.156982421875hf, 0.046630859375hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(1, 0))); + rx += dot(f16vec4(0.0897216796875hf, -0.0909423828125hf, -0.10528564453125hf, 0.0941162109375hf), tap); + ry += dot(f16vec4(-0.0963134765625hf, -0.0733642578125hf, -0.1297607421875hf, 0.050048828125hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(1, 1))); + rx += dot(f16vec4(0.0650634765625hf, -0.02984619140625hf, -0.058349609375hf, 0.037384033203125hf), tap); + ry += dot(f16vec4(-0.0771484375hf, -0.0141448974609375hf, -0.08355712890625hf, 0.0179443359375hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(-1, -1))); + rx += dot(f16vec4(-0.03717041015625hf, -0.018463134765625hf, 0.0114898681640625hf, 0.026153564453125hf), tap); + ry += dot(f16vec4(0.00493621826171875hf, 0.042724609375hf, 0.03302001953125hf, -0.05218505859375hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(-1, 0))); + rx += dot(f16vec4(-0.1119384765625hf, -0.0112152099609375hf, 0.0491943359375hf, -0.034759521484375hf), tap); + ry += dot(f16vec4(0.03271484375hf, 0.08740234375hf, 0.1494140625hf, -0.1497802734375hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(-1, 1))); + rx += dot(f16vec4(-0.0777587890625hf, -0.0009927749633789062hf, -0.00971221923828125hf, -0.06341552734375hf), tap); + ry += dot(f16vec4(-0.005268096923828125hf, 0.07232666015625hf, 0.08135986328125hf, -0.1650390625hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(0, -1))); + rx += dot(f16vec4(-0.1097412109375hf, 0.00839996337890625hf, 0.17529296875hf, -0.0129852294921875hf), tap); + ry += dot(f16vec4(0.00609588623046875hf, 0.09716796875hf, 0.08447265625hf, -0.17919921875hf), tap); + tap = f16vec4(textureLod(convIn2, uv, 0.0)); + rx += dot(f16vec4(-0.1651611328125hf, 0.0406494140625hf, 0.177978515625hf, -0.01067352294921875hf), tap); + ry += dot(f16vec4(-0.0014858245849609375hf, 0.136474609375hf, 0.1180419921875hf, -0.2176513671875hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(0, 1))); + rx += dot(f16vec4(-0.1251220703125hf, 0.0298309326171875hf, 0.16162109375hf, -0.0232391357421875hf), tap); + ry += dot(f16vec4(0.0276336669921875hf, 0.14453125hf, 0.08428955078125hf, -0.2783203125hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(1, -1))); + rx += dot(f16vec4(-0.09173583984375hf, 0.0305938720703125hf, 0.09674072265625hf, -0.10052490234375hf), tap); + ry += dot(f16vec4(-0.038299560546875hf, 0.09454345703125hf, 0.07427978515625hf, -0.104736328125hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(1, 0))); + rx += dot(f16vec4(-0.11505126953125hf, 0.0168914794921875hf, 0.13671875hf, -0.0657958984375hf), tap); + ry += dot(f16vec4(0.022003173828125hf, 0.1224365234375hf, 0.10943603515625hf, -0.159912109375hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(1, 1))); + rx += dot(f16vec4(-0.043975830078125hf, -0.00714874267578125hf, 0.069580078125hf, -0.0231475830078125hf), tap); + ry += dot(f16vec4(0.022186279296875hf, 0.08758544921875hf, 0.0030612945556640625hf, -0.255615234375hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(-1, -1))); + rx += dot(f16vec4(0.0221405029296875hf, 0.07098388671875hf, -0.17529296875hf, -0.06658935546875hf), tap); + ry += dot(f16vec4(-0.059661865234375hf, -0.03375244140625hf, 0.160400390625hf, 0.04302978515625hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(-1, 0))); + rx += dot(f16vec4(0.03680419921875hf, 0.199462890625hf, -0.1494140625hf, -0.0806884765625hf), tap); + ry += dot(f16vec4(-0.1007080078125hf, -0.046356201171875hf, 0.1778564453125hf, 0.12249755859375hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(-1, 1))); + rx += dot(f16vec4(0.006580352783203125hf, 0.1322021484375hf, 0.02862548828125hf, -0.020172119140625hf), tap); + ry += dot(f16vec4(-0.09002685546875hf, -0.02880859375hf, -0.0005640983581542969hf, 0.08990478515625hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(0, -1))); + rx += dot(f16vec4(0.00318145751953125hf, 0.2191162109375hf, -0.1788330078125hf, -0.08935546875hf), tap); + ry += dot(f16vec4(-0.10565185546875hf, -0.0570068359375hf, 0.223876953125hf, 0.08154296875hf), tap); + tap = f16vec4(textureLod(convIn3, uv, 0.0)); + rx += dot(f16vec4(0.01143646240234375hf, 0.264892578125hf, -0.1990966796875hf, -0.10845947265625hf), tap); + ry += dot(f16vec4(-0.1439208984375hf, -0.042449951171875hf, 0.22607421875hf, 0.1610107421875hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(0, 1))); + rx += dot(f16vec4(-0.005710601806640625hf, 0.281982421875hf, -0.1470947265625hf, -0.0709228515625hf), tap); + ry += dot(f16vec4(-0.12152099609375hf, -0.07122802734375hf, 0.133544921875hf, 0.076416015625hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(1, -1))); + rx += dot(f16vec4(-0.0426025390625hf, 0.0679931640625hf, -0.1444091796875hf, -0.0101776123046875hf), tap); + ry += dot(f16vec4(-0.11212158203125hf, -0.002475738525390625hf, 0.1815185546875hf, 0.0946044921875hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(1, 0))); + rx += dot(f16vec4(0.002605438232421875hf, 0.1815185546875hf, -0.191162109375hf, -0.07220458984375hf), tap); + ry += dot(f16vec4(-0.1285400390625hf, -0.04620361328125hf, 0.2462158203125hf, 0.111572265625hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(1, 1))); + rx += dot(f16vec4(0.00617218017578125hf, 0.07958984375hf, -0.1798095703125hf, -0.058349609375hf), tap); + ry += dot(f16vec4(-0.055908203125hf, -0.1090087890625hf, 0.178955078125hf, 0.032745361328125hf), tap); + rx += 0.039764404296875hf; + ry += 0.0019092559814453125hf; + + f16vec4 base = f16vec4(textureLod(coarseFlow, uv, 0.0)) * 2.0hf; + f16vec2 fwd = base.xy + f16vec2(rx, ry); + f16vec2 bwd = base.zw - f16vec2(rx, ry); + + vec2 probeF = (pc + (vec2(fwd) * (2.0 * ub.phase)) * 0.25) / sz; + float16_t wF = 1.0hf - float16_t(textureLod(maskTex, probeF, 0.0).x); + f16vec2 fwdW = fwd * wF; + + vec2 probeB = (pc + (vec2(bwd) * (2.0 * (1.0 - ub.phase))) * 0.25) / sz; + float16_t wB = 1.0hf - float16_t(textureLod(maskTex, probeB, 0.0).x); + f16vec2 bwdW = bwd * wB; + + float16_t wC = 1.0hf - float16_t(textureLod(maskTex, uv, 0.0).x); + imageStore(flowOut, p, vec4(f16vec4(fwdW.x, fwdW.y, bwdW.x, bwdW.y) * wC)); +} diff --git a/cleanroom/glsl/shader_44.comp b/cleanroom/glsl/shader_44.comp new file mode 100644 index 0000000..90ddac1 --- /dev/null +++ b/cleanroom/glsl/shader_44.comp @@ -0,0 +1,67 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 0) uniform Params { + float reserved0; + float phase; + float reserved1; +} ub; + +layout(set = 0, binding = 32) uniform sampler2D featA0; +layout(set = 0, binding = 33) uniform sampler2D featA1; +layout(set = 0, binding = 34) uniform sampler2D featA2; +layout(set = 0, binding = 35) uniform sampler2D featA3; +layout(set = 0, binding = 36) uniform sampler2D featB0; +layout(set = 0, binding = 37) uniform sampler2D featB1; +layout(set = 0, binding = 38) uniform sampler2D featB2; +layout(set = 0, binding = 39) uniform sampler2D featB3; +layout(set = 0, binding = 40) uniform sampler2D flowPair; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D costOut0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D costOut1; +layout(set = 0, binding = 50, rgba8) uniform writeonly image2D costOut2; + +// 16-channel correlation at one 3x3 offset of the warped B position. +#define CORR(o) \ + (((dot(fa0, f16vec4(textureLodOffset(featB0, uvB, 0.0, o))) + \ + dot(fa1, f16vec4(textureLodOffset(featB1, uvB, 0.0, o)))) + \ + dot(fa2, f16vec4(textureLodOffset(featB2, uvB, 0.0, o)))) + \ + dot(fa3, f16vec4(textureLodOffset(featB3, uvB, 0.0, o)))) + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + if (any(greaterThanEqual(p, imageSize(costOut0)))) return; + + vec2 sz = vec2(textureSize(featA0, 0)); + vec2 pc = vec2(p) + 0.5; + vec2 uv = pc / sz; + + f16vec4 flow = f16vec4(textureLod(flowPair, uv, 0.0)); + f16vec2 dispA = flow.xy * float16_t(ub.phase); + f16vec2 dispB = flow.zw * float16_t(1.0 - ub.phase); + + vec2 uvA = (pc + vec2(dispA)) / sz; + vec2 uvB = (pc + vec2(dispB)) / sz; + + f16vec4 fa0 = f16vec4(textureLod(featA0, uvA, 0.0)); + f16vec4 fa1 = f16vec4(textureLod(featA1, uvA, 0.0)); + f16vec4 fa2 = f16vec4(textureLod(featA2, uvA, 0.0)); + f16vec4 fa3 = f16vec4(textureLod(featA3, uvA, 0.0)); + + float16_t cCenter = ((dot(fa0, f16vec4(textureLod(featB0, uvB, 0.0))) + + dot(fa1, f16vec4(textureLod(featB1, uvB, 0.0)))) + + dot(fa2, f16vec4(textureLod(featB2, uvB, 0.0)))) + + dot(fa3, f16vec4(textureLod(featB3, uvB, 0.0))); + + f16vec4 grp1 = f16vec4(CORR(ivec2(-1, -1)), CORR(ivec2(0, -1)), + CORR(ivec2(1, -1)), CORR(ivec2(-1, 0))); + f16vec4 grp2 = f16vec4(cCenter, CORR(ivec2(1, 0)), + CORR(ivec2(-1, 1)), CORR(ivec2(0, 1))); + float16_t cLast = CORR(ivec2(1, 1)); + + imageStore(costOut0, p, vec4((grp1 - f16vec4(4.71875hf, 4.84375hf, 4.70703125hf, 4.9453125hf)) * f16vec4(0.31884765625hf, 0.345458984375hf, 0.351806640625hf, 0.349853515625hf) + f16vec4(0.1812744140625hf, 0.29150390625hf, 0.253173828125hf, 0.322509765625hf))); + imageStore(costOut1, p, vec4((grp2 - f16vec4(5.38671875hf, 4.9609375hf, 4.6953125hf, 4.83203125hf)) * f16vec4(0.2998046875hf, 0.333251953125hf, 0.334228515625hf, 0.352783203125hf) + f16vec4(0.355712890625hf, 0.298095703125hf, 0.18994140625hf, 0.32080078125hf))); + imageStore(costOut2, p, + vec4(float((cLast - 4.72265625hf) * 0.327392578125hf + 0.226318359375hf), 0.0, 0.0, 0.0)); +} diff --git a/cleanroom/glsl/shader_45.comp b/cleanroom/glsl/shader_45.comp new file mode 100644 index 0000000..ecdcbf8 --- /dev/null +++ b/cleanroom/glsl/shader_45.comp @@ -0,0 +1,594 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_45: 3x3 stride-1 conv, 9->16 channels, zero-padded texelFetch + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcA; +layout(set = 0, binding = 33) uniform sampler2D srcB; +layout(set = 0, binding = 34) uniform sampler2D srcC; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstA; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; +layout(set = 0, binding = 50, rgba8) uniform writeonly image2D dstC; +layout(set = 0, binding = 51, rgba8) uniform writeonly image2D dstD; + +// zero-padded fetch for non-center taps +f16vec4 padTap(sampler2D img, ivec2 c) +{ + bool inb = c.x >= 0 && c.y >= 0; + if (inb) { + ivec2 sz = textureSize(img, 0); + inb = c.x < sz.x && c.y < sz.y; + } + return inb ? f16vec4(texelFetch(img, c, 0)) : f16vec4(0.0hf); +} + +const f16mat4 w0_0 = f16mat4( + f16vec4(0.048004150390625hf, 0.0875244140625hf, 0.096923828125hf, 0.0151824951171875hf), + f16vec4(-0.0955810546875hf, 0.06951904296875hf, -0.04815673828125hf, -0.04315185546875hf), + f16vec4(-0.01094818115234375hf, 0.038360595703125hf, 0.197265625hf, 0.10028076171875hf), + f16vec4(-0.109130859375hf, -0.0286865234375hf, 0.23046875hf, 0.10107421875hf)); +const f16mat4 w0_1 = f16mat4( + f16vec4(-0.10919189453125hf, 0.1285400390625hf, -0.24609375hf, 0.11383056640625hf), + f16vec4(-0.1253662109375hf, 0.05572509765625hf, -0.1944580078125hf, -0.0210418701171875hf), + f16vec4(-0.1666259765625hf, -0.06622314453125hf, 0.078857421875hf, 0.05706787109375hf), + f16vec4(-0.11083984375hf, 0.0010156631469726562hf, -0.054718017578125hf, 0.055816650390625hf)); +const f16mat4 w0_2 = f16mat4( + f16vec4(0.08544921875hf, 0.183349609375hf, 0.055999755859375hf, -0.031951904296875hf), + f16vec4(-0.14013671875hf, 0.259521484375hf, -0.24267578125hf, -0.138671875hf), + f16vec4(-0.1873779296875hf, 0.1636962890625hf, 0.3505859375hf, -0.10528564453125hf), + f16vec4(-0.0106658935546875hf, -0.06524658203125hf, 0.206787109375hf, -0.003326416015625hf)); +const f16mat4 w0_3 = f16mat4( + f16vec4(-0.08203125hf, -0.0692138671875hf, 0.08489990234375hf, -0.0560302734375hf), + f16vec4(-0.036224365234375hf, 0.004055023193359375hf, 0.01345062255859375hf, -0.1470947265625hf), + f16vec4(-0.06915283203125hf, -0.045318603515625hf, 0.1195068359375hf, -0.05462646484375hf), + f16vec4(-0.04840087890625hf, -0.207275390625hf, 0.37548828125hf, -0.059051513671875hf)); +const f16mat4 w0_4 = f16mat4( + f16vec4(-0.0460205078125hf, -0.0145416259765625hf, -0.10406494140625hf, 0.0157623291015625hf), + f16vec4(-0.1580810546875hf, -0.1112060546875hf, -0.1199951171875hf, -0.182373046875hf), + f16vec4(-0.2144775390625hf, 0.006069183349609375hf, -0.13232421875hf, 0.09527587890625hf), + f16vec4(-0.2486572265625hf, -0.053985595703125hf, -0.053253173828125hf, 0.0875244140625hf)); +const f16mat4 w0_5 = f16mat4( + f16vec4(0.005878448486328125hf, 0.2327880859375hf, -0.308837890625hf, 0.0833740234375hf), + f16vec4(-0.18408203125hf, 0.2281494140625hf, -0.0816650390625hf, -0.32421875hf), + f16vec4(0.00023102760314941406hf, 0.07977294921875hf, 0.1492919921875hf, -0.04510498046875hf), + f16vec4(-0.10040283203125hf, -0.020355224609375hf, 0.1435546875hf, 0.11328125hf)); +const f16mat4 w0_6 = f16mat4( + f16vec4(0.0706787109375hf, 0.1873779296875hf, -0.1859130859375hf, 0.1905517578125hf), + f16vec4(-0.0011281967163085938hf, 0.169921875hf, -0.1812744140625hf, -0.0843505859375hf), + f16vec4(-0.080810546875hf, -0.036895751953125hf, 0.1878662109375hf, 0.04833984375hf), + f16vec4(-0.1397705078125hf, -0.185791015625hf, 0.38427734375hf, 0.178466796875hf)); +const f16mat4 w0_7 = f16mat4( + f16vec4(0.006519317626953125hf, -0.04638671875hf, -0.1751708984375hf, 0.2230224609375hf), + f16vec4(-0.082763671875hf, 0.030242919921875hf, -0.26123046875hf, -0.042266845703125hf), + f16vec4(-0.1298828125hf, 0.0095977783203125hf, 0.045654296875hf, 0.0367431640625hf), + f16vec4(-0.258056640625hf, -0.11419677734375hf, 0.28466796875hf, 0.063720703125hf)); +const f16mat4 w0_8 = f16mat4( + f16vec4(-0.038909912109375hf, 0.326171875hf, 0.0204925537109375hf, 0.1680908203125hf), + f16vec4(-0.07879638671875hf, 0.263916015625hf, -0.1588134765625hf, -0.2030029296875hf), + f16vec4(-0.11962890625hf, 0.1610107421875hf, 0.2376708984375hf, 0.12249755859375hf), + f16vec4(-0.1728515625hf, 0.0684814453125hf, 0.3271484375hf, 0.265869140625hf)); +const f16mat4 w0_9 = f16mat4( + f16vec4(0.11029052734375hf, -0.07147216796875hf, 0.1611328125hf, -0.06719970703125hf), + f16vec4(0.409423828125hf, 0.0297393798828125hf, -0.32275390625hf, -0.1429443359375hf), + f16vec4(0.2313232421875hf, 0.06622314453125hf, -0.11456298828125hf, -0.0016727447509765625hf), + f16vec4(0.25048828125hf, -0.01204681396484375hf, 0.1307373046875hf, 0.27685546875hf)); +const f16mat4 w0_10 = f16mat4( + f16vec4(-0.071533203125hf, 0.01715087890625hf, -0.044342041015625hf, 0.0150146484375hf), + f16vec4(0.1842041015625hf, 0.1641845703125hf, -0.43310546875hf, -0.1319580078125hf), + f16vec4(-0.0185546875hf, -0.12286376953125hf, -0.047210693359375hf, -0.058135986328125hf), + f16vec4(0.03204345703125hf, -0.198486328125hf, -0.0281524658203125hf, 0.2137451171875hf)); +const f16mat4 w0_11 = f16mat4( + f16vec4(-0.043182373046875hf, 0.08355712890625hf, -0.05120849609375hf, 0.018798828125hf), + f16vec4(0.297607421875hf, 0.2763671875hf, -0.295166015625hf, -0.0859375hf), + f16vec4(0.00972747802734375hf, -0.00481414794921875hf, -0.0592041015625hf, -0.070556640625hf), + f16vec4(0.138671875hf, -0.1376953125hf, 0.08203125hf, 0.1644287109375hf)); +const f16mat4 w0_12 = f16mat4( + f16vec4(-0.0045166015625hf, -0.1051025390625hf, 0.370361328125hf, -0.17822265625hf), + f16vec4(0.1461181640625hf, 0.038787841796875hf, -0.27978515625hf, -0.11663818359375hf), + f16vec4(0.1142578125hf, -0.0202484130859375hf, -0.2125244140625hf, -0.0038318634033203125hf), + f16vec4(0.1480712890625hf, -0.11749267578125hf, 0.32080078125hf, 0.11248779296875hf)); +const f16mat4 w0_13 = f16mat4( + f16vec4(-0.1754150390625hf, 0.00885772705078125hf, 0.2398681640625hf, -0.2158203125hf), + f16vec4(0.04888916015625hf, 0.10357666015625hf, -0.37353515625hf, -0.1754150390625hf), + f16vec4(-0.08587646484375hf, -0.1363525390625hf, -0.10113525390625hf, -0.062347412109375hf), + f16vec4(0.03924560546875hf, -0.1824951171875hf, -0.001552581787109375hf, 0.1258544921875hf)); +const f16mat4 w0_14 = f16mat4( + f16vec4(-0.06640625hf, 0.111328125hf, 0.0374755859375hf, -0.01186370849609375hf), + f16vec4(0.2255859375hf, 0.2406005859375hf, -0.23193359375hf, -0.1517333984375hf), + f16vec4(0.042388916015625hf, -0.09002685546875hf, -0.109375hf, -0.0169525146484375hf), + f16vec4(0.05072021484375hf, -0.093994140625hf, 0.014129638671875hf, 0.07366943359375hf)); +const f16mat4 w0_15 = f16mat4( + f16vec4(0.01013946533203125hf, -0.02899169921875hf, 0.1778564453125hf, 0.0026264190673828125hf), + f16vec4(0.164794921875hf, 0.11865234375hf, -0.19580078125hf, -0.03485107421875hf), + f16vec4(0.1956787109375hf, 0.054229736328125hf, -0.20166015625hf, 0.1375732421875hf), + f16vec4(0.302490234375hf, -0.1357421875hf, 0.1556396484375hf, 0.3056640625hf)); +const f16mat4 w0_16 = f16mat4( + f16vec4(-0.060699462890625hf, -0.016571044921875hf, 0.1824951171875hf, -0.1358642578125hf), + f16vec4(0.07562255859375hf, 0.12420654296875hf, -0.16162109375hf, -0.032440185546875hf), + f16vec4(0.240966796875hf, -0.1475830078125hf, -0.1846923828125hf, 0.06317138671875hf), + f16vec4(0.230224609375hf, -0.25048828125hf, 0.07061767578125hf, 0.10430908203125hf)); +const f16mat4 w0_17 = f16mat4( + f16vec4(-0.004322052001953125hf, 0.11419677734375hf, 0.057647705078125hf, 0.0083465576171875hf), + f16vec4(0.1561279296875hf, 0.197265625hf, -0.05572509765625hf, 0.0030117034912109375hf), + f16vec4(0.043609619140625hf, -0.045806884765625hf, -0.1650390625hf, 0.0262298583984375hf), + f16vec4(0.1375732421875hf, -0.070068359375hf, 0.040740966796875hf, 0.182373046875hf)); +const f16vec4 q0_0 = f16vec4(0.087158203125hf, -0.169921875hf, 0.2391357421875hf, -0.253662109375hf); +const f16vec4 q0_1 = f16vec4(-0.00638580322265625hf, -0.2890625hf, -0.035247802734375hf, -0.04522705078125hf); +const f16vec4 q0_2 = f16vec4(-0.04376220703125hf, -0.312255859375hf, 0.189453125hf, -0.1451416015625hf); +const f16vec4 q0_3 = f16vec4(0.01030731201171875hf, -0.207763671875hf, 0.09063720703125hf, -0.228271484375hf); +const f16vec4 q0_4 = f16vec4(-0.07818603515625hf, -0.2169189453125hf, 0.0357666015625hf, -0.2296142578125hf); +const f16vec4 q0_5 = f16vec4(-0.058258056640625hf, -0.1005859375hf, 0.01259613037109375hf, -0.1834716796875hf); +const f16vec4 q0_6 = f16vec4(-0.0305023193359375hf, -0.08551025390625hf, 0.0233306884765625hf, -0.08544921875hf); +const f16vec4 q0_7 = f16vec4(-0.01328277587890625hf, -0.373291015625hf, 0.12646484375hf, -0.1507568359375hf); +const f16vec4 q0_8 = f16vec4(-0.049530029296875hf, -0.08001708984375hf, 0.11981201171875hf, -0.02374267578125hf); +const f16vec4 sub0 = f16vec4(0.0152435302734375hf, -0.1334228515625hf, 0.256103515625hf, -0.1663818359375hf); +const f16vec4 mul0 = f16vec4(1.912109375hf, 1.99609375hf, 2.5625hf, 2.212890625hf); +const f16vec4 add0 = f16vec4(0.28369140625hf, 0.312744140625hf, 0.147705078125hf, 0.13232421875hf); + +const f16mat4 w1_0 = f16mat4( + f16vec4(-0.061126708984375hf, -0.01739501953125hf, -0.0220947265625hf, -0.0190582275390625hf), + f16vec4(-0.08233642578125hf, 0.1705322265625hf, -0.00662994384765625hf, 0.12445068359375hf), + f16vec4(-0.006195068359375hf, 0.1859130859375hf, -0.173828125hf, 0.041015625hf), + f16vec4(0.14599609375hf, 0.045654296875hf, 0.1041259765625hf, 0.040130615234375hf)); +const f16mat4 w1_1 = f16mat4( + f16vec4(0.015869140625hf, -0.18115234375hf, -0.019317626953125hf, 0.1220703125hf), + f16vec4(-0.037139892578125hf, 0.10113525390625hf, 0.07879638671875hf, 0.204833984375hf), + f16vec4(-0.056427001953125hf, 0.21630859375hf, 0.019073486328125hf, -0.036346435546875hf), + f16vec4(0.08056640625hf, -0.07354736328125hf, 0.1055908203125hf, -0.107177734375hf)); +const f16mat4 w1_2 = f16mat4( + f16vec4(-0.031280517578125hf, -0.147705078125hf, 0.1290283203125hf, -0.050140380859375hf), + f16vec4(-0.006656646728515625hf, 0.101806640625hf, -0.0743408203125hf, 0.281982421875hf), + f16vec4(-0.004482269287109375hf, 0.298828125hf, -0.233642578125hf, -0.01300811767578125hf), + f16vec4(0.218505859375hf, -0.0469970703125hf, 0.1278076171875hf, -0.07171630859375hf)); +const f16mat4 w1_3 = f16mat4( + f16vec4(0.064208984375hf, -0.1573486328125hf, 0.02374267578125hf, -0.09881591796875hf), + f16vec4(-0.06658935546875hf, -0.08740234375hf, -0.0340576171875hf, 0.13525390625hf), + f16vec4(-0.053863525390625hf, 0.0980224609375hf, -0.04058837890625hf, 0.0248260498046875hf), + f16vec4(0.341064453125hf, -0.038970947265625hf, 0.2822265625hf, -0.05926513671875hf)); +const f16mat4 w1_4 = f16mat4( + f16vec4(0.108154296875hf, 0.0179595947265625hf, -0.045257568359375hf, -0.1273193359375hf), + f16vec4(-0.0986328125hf, 0.2021484375hf, 0.0400390625hf, 0.0084228515625hf), + f16vec4(-0.10858154296875hf, 0.055419921875hf, -0.09442138671875hf, -0.055999755859375hf), + f16vec4(0.267822265625hf, -0.07745361328125hf, 0.026031494140625hf, -0.1240234375hf)); +const f16mat4 w1_5 = f16mat4( + f16vec4(0.0916748046875hf, -0.214599609375hf, -0.03515625hf, 0.1900634765625hf), + f16vec4(-0.1097412109375hf, 0.2166748046875hf, -0.152587890625hf, 0.432373046875hf), + f16vec4(-0.1304931640625hf, 0.2322998046875hf, 0.0150299072265625hf, 0.1744384765625hf), + f16vec4(0.322509765625hf, -0.09002685546875hf, 0.2098388671875hf, 0.07080078125hf)); +const f16mat4 w1_6 = f16mat4( + f16vec4(0.0419921875hf, -0.30322265625hf, -0.00537872314453125hf, 0.0736083984375hf), + f16vec4(-0.08441162109375hf, 0.08868408203125hf, 0.01204681396484375hf, 0.167724609375hf), + f16vec4(0.0020503997802734375hf, 0.1580810546875hf, -0.1202392578125hf, -0.10089111328125hf), + f16vec4(0.388427734375hf, -0.111572265625hf, 0.353515625hf, -0.1728515625hf)); +const f16mat4 w1_7 = f16mat4( + f16vec4(0.032501220703125hf, -0.140625hf, 0.2406005859375hf, 0.0294036865234375hf), + f16vec4(-0.0955810546875hf, -0.0211181640625hf, 0.0184478759765625hf, 0.3076171875hf), + f16vec4(0.06475830078125hf, 0.0253143310546875hf, -0.06805419921875hf, 0.0552978515625hf), + f16vec4(0.373779296875hf, -0.145751953125hf, 0.2275390625hf, -0.0799560546875hf)); +const f16mat4 w1_8 = f16mat4( + f16vec4(0.05963134765625hf, -0.07958984375hf, -0.03460693359375hf, -0.0271148681640625hf), + f16vec4(-0.140625hf, 0.25732421875hf, 0.01157379150390625hf, 0.29736328125hf), + f16vec4(0.086181640625hf, 0.1180419921875hf, -0.07415771484375hf, -0.0003600120544433594hf), + f16vec4(0.460205078125hf, -0.1800537109375hf, 0.329833984375hf, -0.120849609375hf)); +const f16mat4 w1_9 = f16mat4( + f16vec4(-0.1832275390625hf, 0.0806884765625hf, -0.360595703125hf, -0.290283203125hf), + f16vec4(-0.2685546875hf, 0.40185546875hf, 0.363037109375hf, -0.3212890625hf), + f16vec4(0.057403564453125hf, -0.07037353515625hf, 0.08111572265625hf, 0.00405120849609375hf), + f16vec4(0.00426483154296875hf, -0.20556640625hf, -0.1796875hf, 0.280517578125hf)); +const f16mat4 w1_10 = f16mat4( + f16vec4(-0.298095703125hf, -0.278076171875hf, -0.358154296875hf, -0.310302734375hf), + f16vec4(-0.27001953125hf, 0.202392578125hf, 0.1956787109375hf, -0.2413330078125hf), + f16vec4(-0.05999755859375hf, -0.029815673828125hf, -0.062744140625hf, 0.0219573974609375hf), + f16vec4(-0.045562744140625hf, -0.10943603515625hf, -0.086181640625hf, 0.1788330078125hf)); +const f16mat4 w1_11 = f16mat4( + f16vec4(-0.1514892578125hf, -0.2056884765625hf, -0.3212890625hf, -0.39990234375hf), + f16vec4(-0.142578125hf, 0.143798828125hf, 0.2919921875hf, -0.2032470703125hf), + f16vec4(0.0113677978515625hf, -0.061187744140625hf, -0.0718994140625hf, -0.109375hf), + f16vec4(0.0012683868408203125hf, -0.08416748046875hf, -0.096435546875hf, 0.0241851806640625hf)); +const f16mat4 w1_12 = f16mat4( + f16vec4(-0.1365966796875hf, -0.059539794921875hf, -0.2264404296875hf, -0.3310546875hf), + f16vec4(-0.1824951171875hf, 0.0626220703125hf, 0.216796875hf, 0.0272674560546875hf), + f16vec4(0.192138671875hf, -0.313232421875hf, 0.08111572265625hf, 0.0179595947265625hf), + f16vec4(-0.0008721351623535156hf, -0.1639404296875hf, -0.17041015625hf, 0.281982421875hf)); +const f16mat4 w1_13 = f16mat4( + f16vec4(-0.244140625hf, -0.0269622802734375hf, -0.430419921875hf, -0.373779296875hf), + f16vec4(-0.2486572265625hf, 0.199462890625hf, 0.1522216796875hf, -0.1693115234375hf), + f16vec4(0.06170654296875hf, -0.07879638671875hf, -0.047210693359375hf, -0.0711669921875hf), + f16vec4(-0.040802001953125hf, -0.0169525146484375hf, -0.1556396484375hf, 0.1329345703125hf)); +const f16mat4 w1_14 = f16mat4( + f16vec4(-0.104248046875hf, -0.261474609375hf, -0.278076171875hf, -0.20703125hf), + f16vec4(-0.2318115234375hf, 0.16259765625hf, 0.213134765625hf, -0.1151123046875hf), + f16vec4(0.0151519775390625hf, -0.0288848876953125hf, 0.0021915435791015625hf, 0.05718994140625hf), + f16vec4(-0.088623046875hf, -0.047027587890625hf, -0.045440673828125hf, 0.11083984375hf)); +const f16mat4 w1_15 = f16mat4( + f16vec4(-0.1192626953125hf, -0.262939453125hf, -0.35546875hf, -0.323486328125hf), + f16vec4(0.0440673828125hf, 0.0643310546875hf, 0.054473876953125hf, -0.0843505859375hf), + f16vec4(0.1634521484375hf, -0.188232421875hf, -0.0887451171875hf, 0.0143280029296875hf), + f16vec4(0.05291748046875hf, -0.1634521484375hf, -0.2005615234375hf, 0.33056640625hf)); +const f16mat4 w1_16 = f16mat4( + f16vec4(-0.2117919921875hf, -0.1937255859375hf, -0.316162109375hf, -0.291259765625hf), + f16vec4(-0.01038360595703125hf, -0.1378173828125hf, 0.1419677734375hf, -0.1002197265625hf), + f16vec4(0.08587646484375hf, -0.198486328125hf, 0.050933837890625hf, 0.1661376953125hf), + f16vec4(0.0243988037109375hf, -0.050048828125hf, -0.004058837890625hf, 0.193359375hf)); +const f16mat4 w1_17 = f16mat4( + f16vec4(-0.061859130859375hf, -0.1185302734375hf, -0.373046875hf, -0.415283203125hf), + f16vec4(0.035736083984375hf, 0.03619384765625hf, 0.10400390625hf, -0.1630859375hf), + f16vec4(-0.047271728515625hf, 0.033660888671875hf, 0.049072265625hf, -0.044342041015625hf), + f16vec4(-0.005321502685546875hf, -0.0059661865234375hf, -0.13232421875hf, 0.046539306640625hf)); +const f16vec4 q1_0 = f16vec4(0.054473876953125hf, 0.271484375hf, 0.193603515625hf, 0.0457763671875hf); +const f16vec4 q1_1 = f16vec4(0.041229248046875hf, 0.0211029052734375hf, 0.0943603515625hf, 0.23291015625hf); +const f16vec4 q1_2 = f16vec4(0.01490020751953125hf, 0.09222412109375hf, 0.1910400390625hf, -0.01190185546875hf); +const f16vec4 q1_3 = f16vec4(-0.0138092041015625hf, 0.1990966796875hf, 0.1796875hf, 0.1033935546875hf); +const f16vec4 q1_4 = f16vec4(-0.044830322265625hf, 0.3115234375hf, -0.0251312255859375hf, -0.1214599609375hf); +const f16vec4 q1_5 = f16vec4(-0.0849609375hf, 0.1151123046875hf, 0.062347412109375hf, 0.11492919921875hf); +const f16vec4 q1_6 = f16vec4(0.032470703125hf, -0.1436767578125hf, 0.11346435546875hf, 0.05853271484375hf); +const f16vec4 q1_7 = f16vec4(0.037506103515625hf, -0.0106201171875hf, 0.10150146484375hf, 0.0975341796875hf); +const f16vec4 q1_8 = f16vec4(0.044952392578125hf, 0.034271240234375hf, -0.0484619140625hf, -0.0213623046875hf); +const f16vec4 sub1 = f16vec4(-0.1884765625hf, -0.1932373046875hf, -0.292236328125hf, -0.368896484375hf); +const f16vec4 mul1 = f16vec4(2.78125hf, 1.904296875hf, 2.80078125hf, 2.69921875hf); +const f16vec4 add1 = f16vec4(0.04168701171875hf, -0.0924072265625hf, -0.1767578125hf, -0.263427734375hf); + +const f16mat4 w2_0 = f16mat4( + f16vec4(-0.11932373046875hf, 0.07183837890625hf, 0.00972747802734375hf, 0.009613037109375hf), + f16vec4(0.061248779296875hf, 0.054229736328125hf, 0.109619140625hf, 0.0794677734375hf), + f16vec4(0.1983642578125hf, 0.0011243820190429688hf, 0.04302978515625hf, -0.26513671875hf), + f16vec4(0.035400390625hf, 0.0228424072265625hf, -0.1065673828125hf, 0.119384765625hf)); +const f16mat4 w2_1 = f16mat4( + f16vec4(-0.086669921875hf, -0.0770263671875hf, 0.1287841796875hf, -0.108642578125hf), + f16vec4(0.0308380126953125hf, -0.10052490234375hf, 0.3408203125hf, 0.16162109375hf), + f16vec4(0.1455078125hf, -0.273193359375hf, 0.2288818359375hf, -0.09381103515625hf), + f16vec4(0.0219573974609375hf, -0.1729736328125hf, -0.06085205078125hf, 0.043731689453125hf)); +const f16mat4 w2_2 = f16mat4( + f16vec4(-0.15185546875hf, -0.042022705078125hf, 0.1162109375hf, -0.018798828125hf), + f16vec4(0.0361328125hf, -0.0654296875hf, 0.315673828125hf, 0.31396484375hf), + f16vec4(0.2210693359375hf, 0.10345458984375hf, 0.1650390625hf, -0.181640625hf), + f16vec4(0.0670166015625hf, 0.0970458984375hf, -0.0703125hf, 0.1539306640625hf)); +const f16mat4 w2_3 = f16mat4( + f16vec4(-0.00482940673828125hf, 0.0635986328125hf, 0.118408203125hf, -0.00250244140625hf), + f16vec4(-0.0269775390625hf, -0.00519561767578125hf, 0.032196044921875hf, 0.1644287109375hf), + f16vec4(0.047027587890625hf, 0.08270263671875hf, -0.04937744140625hf, 0.10064697265625hf), + f16vec4(0.060150146484375hf, 0.0982666015625hf, -0.0650634765625hf, 0.329833984375hf)); +const f16mat4 w2_4 = f16mat4( + f16vec4(0.0211334228515625hf, -0.1712646484375hf, 0.035369873046875hf, 0.0210418701171875hf), + f16vec4(-0.047332763671875hf, -0.280517578125hf, 0.126708984375hf, 0.1888427734375hf), + f16vec4(-0.06768798828125hf, -0.28857421875hf, 0.02899169921875hf, 0.0487060546875hf), + f16vec4(-0.0038604736328125hf, -0.12939453125hf, -0.1812744140625hf, 0.328125hf)); +const f16mat4 w2_5 = f16mat4( + f16vec4(-0.1688232421875hf, -0.06341552734375hf, 0.06866455078125hf, 0.1329345703125hf), + f16vec4(-0.1033935546875hf, -0.048980712890625hf, 0.362060546875hf, 0.1336669921875hf), + f16vec4(0.10113525390625hf, 0.03326416015625hf, 0.17822265625hf, -0.067626953125hf), + f16vec4(0.017822265625hf, 0.0007710456848144531hf, 0.0270843505859375hf, 0.1865234375hf)); +const f16mat4 w2_6 = f16mat4( + f16vec4(-0.175537109375hf, -0.058807373046875hf, 0.07879638671875hf, -0.09136962890625hf), + f16vec4(0.050689697265625hf, 0.0021457672119140625hf, 0.076904296875hf, 0.2386474609375hf), + f16vec4(0.1151123046875hf, 0.052886962890625hf, 0.027587890625hf, -0.0496826171875hf), + f16vec4(-0.0328369140625hf, -0.10107421875hf, -0.11993408203125hf, 0.2391357421875hf)); +const f16mat4 w2_7 = f16mat4( + f16vec4(-0.2271728515625hf, -0.181396484375hf, 0.1796875hf, -0.097900390625hf), + f16vec4(-0.033294677734375hf, -0.1724853515625hf, 0.275146484375hf, 0.07965087890625hf), + f16vec4(0.01514434814453125hf, -0.004833221435546875hf, 0.095703125hf, -0.1717529296875hf), + f16vec4(-0.1273193359375hf, 0.06719970703125hf, -0.05877685546875hf, 0.032135009765625hf)); +const f16mat4 w2_8 = f16mat4( + f16vec4(-0.329833984375hf, 0.0195770263671875hf, 0.2132568359375hf, 0.0595703125hf), + f16vec4(0.050628662109375hf, -0.056549072265625hf, 0.42041015625hf, 0.2432861328125hf), + f16vec4(0.2421875hf, -0.0078887939453125hf, -0.0035686492919921875hf, 0.021759033203125hf), + f16vec4(-0.0130462646484375hf, -0.09112548828125hf, -0.0838623046875hf, 0.226318359375hf)); +const f16mat4 w2_9 = f16mat4( + f16vec4(0.054901123046875hf, -0.10284423828125hf, -0.14013671875hf, -0.130859375hf), + f16vec4(0.146240234375hf, -0.1822509765625hf, -0.058135986328125hf, -0.260986328125hf), + f16vec4(0.2275390625hf, 0.09930419921875hf, -0.018585205078125hf, -0.1278076171875hf), + f16vec4(-0.041839599609375hf, 0.277587890625hf, -0.194580078125hf, -0.2088623046875hf)); +const f16mat4 w2_10 = f16mat4( + f16vec4(-0.0859375hf, -0.2188720703125hf, -0.0977783203125hf, -0.1572265625hf), + f16vec4(0.016937255859375hf, -0.007144927978515625hf, 0.053619384765625hf, -0.278564453125hf), + f16vec4(0.0146636962890625hf, 0.05169677734375hf, -0.104736328125hf, -0.078125hf), + f16vec4(-0.0123443603515625hf, 0.0794677734375hf, -0.1114501953125hf, -0.250244140625hf)); +const f16mat4 w2_11 = f16mat4( + f16vec4(0.01113128662109375hf, -0.1649169921875hf, -0.089599609375hf, -0.1505126953125hf), + f16vec4(0.1575927734375hf, -0.03729248046875hf, -0.1402587890625hf, -0.146240234375hf), + f16vec4(0.1326904296875hf, -0.00502777099609375hf, -0.02740478515625hf, 0.030242919921875hf), + f16vec4(0.022430419921875hf, 0.11895751953125hf, 0.00856781005859375hf, -0.1494140625hf)); +const f16mat4 w2_12 = f16mat4( + f16vec4(-0.09942626953125hf, -0.140869140625hf, -0.2462158203125hf, 0.021484375hf), + f16vec4(0.06817626953125hf, -0.00926971435546875hf, -0.0804443359375hf, 0.02606201171875hf), + f16vec4(0.19921875hf, 0.298828125hf, -0.056671142578125hf, 0.331298828125hf), + f16vec4(-0.154541015625hf, 0.413818359375hf, -0.1771240234375hf, -0.08575439453125hf)); +const f16mat4 w2_13 = f16mat4( + f16vec4(-0.264892578125hf, -0.15380859375hf, -0.209228515625hf, -0.1610107421875hf), + f16vec4(0.02874755859375hf, -0.11492919921875hf, -0.0498046875hf, -0.0106201171875hf), + f16vec4(0.1087646484375hf, -0.0992431640625hf, -0.1546630859375hf, 0.17626953125hf), + f16vec4(0.016143798828125hf, -0.022003173828125hf, -0.373046875hf, -0.01111602783203125hf)); +const f16mat4 w2_14 = f16mat4( + f16vec4(-0.1556396484375hf, -0.26220703125hf, -0.1749267578125hf, -0.1109619140625hf), + f16vec4(0.0738525390625hf, -0.021575927734375hf, -0.119384765625hf, -0.01300048828125hf), + f16vec4(0.052093505859375hf, 0.05035400390625hf, 0.0845947265625hf, 0.06903076171875hf), + f16vec4(-0.036102294921875hf, 0.0447998046875hf, 0.0197601318359375hf, 0.0026092529296875hf)); +const f16mat4 w2_15 = f16mat4( + f16vec4(-0.08587646484375hf, -0.1673583984375hf, -0.1640625hf, 0.006435394287109375hf), + f16vec4(0.1297607421875hf, -0.04473876953125hf, -0.062286376953125hf, -0.03729248046875hf), + f16vec4(0.1572265625hf, 0.371337890625hf, -0.1322021484375hf, -0.0158233642578125hf), + f16vec4(-0.07110595703125hf, 0.314697265625hf, -0.1300048828125hf, -0.1827392578125hf)); +const f16mat4 w2_16 = f16mat4( + f16vec4(-0.1417236328125hf, -0.09454345703125hf, -0.049102783203125hf, -0.2025146484375hf), + f16vec4(0.1138916015625hf, -0.0947265625hf, -0.05279541015625hf, -0.07421875hf), + f16vec4(0.23046875hf, 0.0582275390625hf, -0.2734375hf, -0.1329345703125hf), + f16vec4(0.11614990234375hf, 0.148681640625hf, -0.211669921875hf, -0.1558837890625hf)); +const f16mat4 w2_17 = f16mat4( + f16vec4(-0.07470703125hf, -0.1478271484375hf, -0.1434326171875hf, -0.0264892578125hf), + f16vec4(0.1617431640625hf, -0.021484375hf, -0.05474853515625hf, 0.029632568359375hf), + f16vec4(0.2381591796875hf, 0.040863037109375hf, 0.005954742431640625hf, 0.03118896484375hf), + f16vec4(0.061370849609375hf, 0.0205230712890625hf, 0.0100860595703125hf, 0.0250701904296875hf)); +const f16vec4 q2_0 = f16vec4(-0.362548828125hf, 0.288330078125hf, 0.06292724609375hf, -0.2261962890625hf); +const f16vec4 q2_1 = f16vec4(-0.1881103515625hf, 0.0132904052734375hf, -0.035247802734375hf, -0.11004638671875hf); +const f16vec4 q2_2 = f16vec4(-0.114990234375hf, 0.10009765625hf, 0.1602783203125hf, 0.0158233642578125hf); +const f16vec4 q2_3 = f16vec4(-0.23828125hf, 0.26025390625hf, 0.055511474609375hf, 0.017181396484375hf); +const f16vec4 q2_4 = f16vec4(-0.0123138427734375hf, -0.040130615234375hf, -0.1953125hf, 0.08050537109375hf); +const f16vec4 q2_5 = f16vec4(-0.11944580078125hf, 0.005859375hf, 0.10888671875hf, 0.055755615234375hf); +const f16vec4 q2_6 = f16vec4(-0.2159423828125hf, 0.04754638671875hf, 0.051544189453125hf, 0.09637451171875hf); +const f16vec4 q2_7 = f16vec4(0.007144927978515625hf, 0.0572509765625hf, -0.0272674560546875hf, 0.01318359375hf); +const f16vec4 q2_8 = f16vec4(-0.1783447265625hf, 0.0008111000061035156hf, 0.1649169921875hf, 0.099365234375hf); +const f16vec4 sub2 = f16vec4(-0.08673095703125hf, -0.30810546875hf, -0.294921875hf, 0.020355224609375hf); +const f16vec4 mul2 = f16vec4(1.7099609375hf, 2.3125hf, 2.3359375hf, 2.37109375hf); +const f16vec4 add2 = f16vec4(0.00928497314453125hf, -0.047332763671875hf, 0.0687255859375hf, 0.042083740234375hf); + +const f16mat4 w3_0 = f16mat4( + f16vec4(0.001495361328125hf, 0.2044677734375hf, -0.023468017578125hf, 0.0560302734375hf), + f16vec4(-0.04913330078125hf, -0.042755126953125hf, 0.2252197265625hf, -0.10748291015625hf), + f16vec4(-0.1077880859375hf, -0.09844970703125hf, -0.04901123046875hf, 0.161865234375hf), + f16vec4(-0.056365966796875hf, -0.0709228515625hf, 0.09710693359375hf, 0.0880126953125hf)); +const f16mat4 w3_1 = f16mat4( + f16vec4(0.04266357421875hf, 0.10662841796875hf, -0.0716552734375hf, 0.10479736328125hf), + f16vec4(0.049346923828125hf, -0.05224609375hf, 0.126708984375hf, -0.095703125hf), + f16vec4(0.0289154052734375hf, -0.19189453125hf, -0.09356689453125hf, 0.13525390625hf), + f16vec4(0.0013399124145507812hf, -0.09588623046875hf, 0.0114898681640625hf, 0.04608154296875hf)); +const f16mat4 w3_2 = f16mat4( + f16vec4(5.698204040527344e-05hf, 0.36181640625hf, -0.0241241455078125hf, 0.1759033203125hf), + f16vec4(0.060516357421875hf, 0.057220458984375hf, 0.1533203125hf, -0.140625hf), + f16vec4(-0.1033935546875hf, -0.350341796875hf, -0.13916015625hf, 0.31396484375hf), + f16vec4(0.048980712890625hf, 0.09857177734375hf, 0.01177215576171875hf, 0.10931396484375hf)); +const f16mat4 w3_3 = f16mat4( + f16vec4(-0.1016845703125hf, 0.12451171875hf, -0.0082855224609375hf, 0.0699462890625hf), + f16vec4(-0.0672607421875hf, -0.0791015625hf, -0.002971649169921875hf, -0.1754150390625hf), + f16vec4(-0.08612060546875hf, -0.046600341796875hf, -0.34130859375hf, 0.038604736328125hf), + f16vec4(-0.07891845703125hf, -0.038177490234375hf, -0.01312255859375hf, 0.115478515625hf)); +const f16mat4 w3_4 = f16mat4( + f16vec4(-0.0199737548828125hf, 0.1673583984375hf, -0.1075439453125hf, -0.09478759765625hf), + f16vec4(0.08697509765625hf, -0.04925537109375hf, -0.0289306640625hf, -0.36181640625hf), + f16vec4(0.01287078857421875hf, 0.0294952392578125hf, -0.357177734375hf, -0.0173797607421875hf), + f16vec4(-0.060699462890625hf, -0.1134033203125hf, -0.130126953125hf, -0.18896484375hf)); +const f16mat4 w3_5 = f16mat4( + f16vec4(-0.061492919921875hf, 0.30908203125hf, -0.021636962890625hf, 0.042144775390625hf), + f16vec4(0.034820556640625hf, -0.1619873046875hf, 0.180908203125hf, -0.02984619140625hf), + f16vec4(-0.06329345703125hf, -0.290771484375hf, -0.2083740234375hf, 0.1148681640625hf), + f16vec4(-0.00030493736267089844hf, -0.0192413330078125hf, -0.0016412734985351562hf, 0.05572509765625hf)); +const f16mat4 w3_6 = f16mat4( + f16vec4(0.01241302490234375hf, 0.24267578125hf, 0.1444091796875hf, 0.173095703125hf), + f16vec4(0.04974365234375hf, -0.049957275390625hf, 0.1693115234375hf, -0.11895751953125hf), + f16vec4(-0.1400146484375hf, -0.26953125hf, -0.02459716796875hf, 0.055419921875hf), + f16vec4(-0.01433563232421875hf, -0.1395263671875hf, 0.3193359375hf, 0.1448974609375hf)); +const f16mat4 w3_7 = f16mat4( + f16vec4(0.035980224609375hf, 0.4716796875hf, 0.1365966796875hf, 0.1925048828125hf), + f16vec4(0.1363525390625hf, 0.0928955078125hf, 0.212646484375hf, -0.0145721435546875hf), + f16vec4(-0.07501220703125hf, -0.07958984375hf, 0.0159454345703125hf, 0.1524658203125hf), + f16vec4(-0.121826171875hf, -0.159423828125hf, 0.2471923828125hf, 0.333984375hf)); +const f16mat4 w3_8 = f16mat4( + f16vec4(-0.160400390625hf, 0.490234375hf, 0.08880615234375hf, 0.379150390625hf), + f16vec4(0.02655029296875hf, 0.0869140625hf, 0.26220703125hf, -0.0189666748046875hf), + f16vec4(-0.12548828125hf, -0.11517333984375hf, -0.225341796875hf, 0.0753173828125hf), + f16vec4(-0.18505859375hf, -0.1396484375hf, 0.1953125hf, 0.245361328125hf)); +const f16mat4 w3_9 = f16mat4( + f16vec4(-0.1947021484375hf, 0.132568359375hf, 0.09619140625hf, -0.14990234375hf), + f16vec4(0.09368896484375hf, 0.162109375hf, -0.19091796875hf, -0.005420684814453125hf), + f16vec4(0.1053466796875hf, -0.314208984375hf, 0.138916015625hf, 0.019775390625hf), + f16vec4(0.001964569091796875hf, 0.268310546875hf, -0.202880859375hf, -0.08343505859375hf)); +const f16mat4 w3_10 = f16mat4( + f16vec4(-0.166259765625hf, -0.084228515625hf, 0.0159149169921875hf, -0.2425537109375hf), + f16vec4(-0.04205322265625hf, -0.0975341796875hf, -0.13232421875hf, 0.140869140625hf), + f16vec4(0.03729248046875hf, -0.2257080078125hf, 0.052276611328125hf, -0.0244903564453125hf), + f16vec4(-0.0931396484375hf, 0.1142578125hf, -0.11968994140625hf, -0.06427001953125hf)); +const f16mat4 w3_11 = f16mat4( + f16vec4(-0.135009765625hf, 0.11932373046875hf, -0.04510498046875hf, -0.1751708984375hf), + f16vec4(0.111083984375hf, 0.175048828125hf, -0.11529541015625hf, 0.046051025390625hf), + f16vec4(0.0135955810546875hf, -0.0970458984375hf, 0.026397705078125hf, 0.00881195068359375hf), + f16vec4(-0.03997802734375hf, 0.116455078125hf, -0.07525634765625hf, 0.0250701904296875hf)); +const f16mat4 w3_12 = f16mat4( + f16vec4(-0.2281494140625hf, 0.0028209686279296875hf, 0.0284423828125hf, -0.163330078125hf), + f16vec4(-0.021575927734375hf, 0.1385498046875hf, -0.322998046875hf, 0.0343017578125hf), + f16vec4(0.08135986328125hf, -0.156005859375hf, -0.08197021484375hf, -0.046417236328125hf), + f16vec4(-0.1986083984375hf, 0.1396484375hf, -0.10369873046875hf, 0.05157470703125hf)); +const f16mat4 w3_13 = f16mat4( + f16vec4(-0.250244140625hf, -0.27783203125hf, 0.0958251953125hf, -0.1839599609375hf), + f16vec4(-0.1546630859375hf, 0.05145263671875hf, -0.2174072265625hf, -0.11383056640625hf), + f16vec4(-0.031707763671875hf, -0.140380859375hf, -0.050537109375hf, -0.1929931640625hf), + f16vec4(-0.314697265625hf, -0.1068115234375hf, -0.0172271728515625hf, -0.2283935546875hf)); +const f16mat4 w3_14 = f16mat4( + f16vec4(-0.23828125hf, -0.19384765625hf, 0.119140625hf, -0.158203125hf), + f16vec4(-0.11798095703125hf, -0.150390625hf, -0.1986083984375hf, -0.01483154296875hf), + f16vec4(-0.020782470703125hf, -0.1397705078125hf, 0.1280517578125hf, -0.02557373046875hf), + f16vec4(-0.1241455078125hf, 0.0926513671875hf, 0.03375244140625hf, -0.1292724609375hf)); +const f16mat4 w3_15 = f16mat4( + f16vec4(-0.18505859375hf, -0.06634521484375hf, 0.1724853515625hf, -0.126953125hf), + f16vec4(-0.017242431640625hf, -0.032318115234375hf, -0.052825927734375hf, 0.08685302734375hf), + f16vec4(0.0038471221923828125hf, -0.50732421875hf, 0.3359375hf, 0.1243896484375hf), + f16vec4(-0.034149169921875hf, 0.248291015625hf, -0.00121307373046875hf, -0.06610107421875hf)); +const f16mat4 w3_16 = f16mat4( + f16vec4(-0.257568359375hf, 0.003082275390625hf, 0.2449951171875hf, -0.1265869140625hf), + f16vec4(-0.0186767578125hf, 0.2149658203125hf, -0.0428466796875hf, -0.10809326171875hf), + f16vec4(-0.124755859375hf, -0.34033203125hf, 0.313232421875hf, 0.03985595703125hf), + f16vec4(-0.1795654296875hf, 0.03045654296875hf, 0.049102783203125hf, -0.03387451171875hf)); +const f16mat4 w3_17 = f16mat4( + f16vec4(-0.28369140625hf, -0.06268310546875hf, 0.0911865234375hf, -0.08648681640625hf), + f16vec4(0.06549072265625hf, 0.09014892578125hf, -0.12445068359375hf, 0.0186309814453125hf), + f16vec4(-0.043609619140625hf, -0.2034912109375hf, 0.20947265625hf, 0.029449462890625hf), + f16vec4(-0.08551025390625hf, 0.1236572265625hf, -0.07452392578125hf, 0.00923919677734375hf)); +const f16vec4 q3_0 = f16vec4(0.44873046875hf, 0.2315673828125hf, -0.0950927734375hf, 0.053863525390625hf); +const f16vec4 q3_1 = f16vec4(0.2213134765625hf, -0.0124664306640625hf, 0.05267333984375hf, -0.0051116943359375hf); +const f16vec4 q3_2 = f16vec4(0.341796875hf, 0.2880859375hf, 0.0419921875hf, -0.0219879150390625hf); +const f16vec4 q3_3 = f16vec4(0.1912841796875hf, 0.20458984375hf, -0.1571044921875hf, -0.047882080078125hf); +const f16vec4 q3_4 = f16vec4(-0.0469970703125hf, -0.25439453125hf, -0.200927734375hf, -0.2210693359375hf); +const f16vec4 q3_5 = f16vec4(0.0657958984375hf, -0.059661865234375hf, -0.1822509765625hf, -0.043060302734375hf); +const f16vec4 q3_6 = f16vec4(0.32275390625hf, 0.089599609375hf, -0.1307373046875hf, -0.08935546875hf); +const f16vec4 q3_7 = f16vec4(0.1917724609375hf, 0.09381103515625hf, 0.0024127960205078125hf, -0.1070556640625hf); +const f16vec4 q3_8 = f16vec4(0.26953125hf, 0.064208984375hf, -0.0802001953125hf, 0.1102294921875hf); +const f16vec4 sub3 = f16vec4(-0.8623046875hf, -0.1007080078125hf, 0.005855560302734375hf, -0.25927734375hf); +const f16vec4 mul3 = f16vec4(1.2275390625hf, 1.7861328125hf, 2.587890625hf, 3.712890625hf); +const f16vec4 add3 = f16vec4(-0.333251953125hf, 0.003116607666015625hf, 0.5615234375hf, 0.01253509521484375hf); + +void main() +{ + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 ext = imageSize(dstA); + if (p.x >= ext.x || p.y >= ext.y) + return; + + f16vec4 t0 = padTap(srcA, p + ivec2(-1, -1)); + f16vec4 t1 = padTap(srcA, p + ivec2(-1, 0)); + f16vec4 t2 = padTap(srcA, p + ivec2(-1, 1)); + f16vec4 t3 = padTap(srcA, p + ivec2(0, -1)); + f16vec4 t4 = f16vec4(texelFetch(srcA, p, 0)); + f16vec4 t5 = padTap(srcA, p + ivec2(0, 1)); + f16vec4 t6 = padTap(srcA, p + ivec2(1, -1)); + f16vec4 t7 = padTap(srcA, p + ivec2(1, 0)); + f16vec4 t8 = padTap(srcA, p + ivec2(1, 1)); + f16vec4 t9 = padTap(srcB, p + ivec2(-1, -1)); + f16vec4 t10 = padTap(srcB, p + ivec2(-1, 0)); + f16vec4 t11 = padTap(srcB, p + ivec2(-1, 1)); + f16vec4 t12 = padTap(srcB, p + ivec2(0, -1)); + f16vec4 t13 = f16vec4(texelFetch(srcB, p, 0)); + f16vec4 t14 = padTap(srcB, p + ivec2(0, 1)); + f16vec4 t15 = padTap(srcB, p + ivec2(1, -1)); + f16vec4 t16 = padTap(srcB, p + ivec2(1, 0)); + f16vec4 t17 = padTap(srcB, p + ivec2(1, 1)); + float16_t s0 = padTap(srcC, p + ivec2(-1, -1)).r; + float16_t s1 = padTap(srcC, p + ivec2(-1, 0)).r; + float16_t s2 = padTap(srcC, p + ivec2(-1, 1)).r; + float16_t s3 = padTap(srcC, p + ivec2(0, -1)).r; + float16_t s4 = float16_t(texelFetch(srcC, p, 0).r); + float16_t s5 = padTap(srcC, p + ivec2(0, 1)).r; + float16_t s6 = padTap(srcC, p + ivec2(1, -1)).r; + float16_t s7 = padTap(srcC, p + ivec2(1, 0)).r; + float16_t s8 = padTap(srcC, p + ivec2(1, 1)).r; + + f16vec4 r0 = w0_0 * t0; + r0 += w0_1 * t1; + r0 += w0_2 * t2; + r0 += w0_3 * t3; + r0 += w0_4 * t4; + r0 += w0_5 * t5; + r0 += w0_6 * t6; + r0 += w0_7 * t7; + r0 += w0_8 * t8; + r0 += w0_9 * t9; + r0 += w0_10 * t10; + r0 += w0_11 * t11; + r0 += w0_12 * t12; + r0 += w0_13 * t13; + r0 += w0_14 * t14; + r0 += w0_15 * t15; + r0 += w0_16 * t16; + r0 += w0_17 * t17; + r0 += q0_0 * s0; + r0 += q0_1 * s1; + r0 += q0_2 * s2; + r0 += q0_3 * s3; + r0 += q0_4 * s4; + r0 += q0_5 * s5; + r0 += q0_6 * s6; + r0 += q0_7 * s7; + r0 += q0_8 * s8; + r0 = (r0 - sub0) * mul0 + add0; + imageStore(dstA, p, vec4(r0)); + + f16vec4 r1 = w1_0 * t0; + r1 += w1_1 * t1; + r1 += w1_2 * t2; + r1 += w1_3 * t3; + r1 += w1_4 * t4; + r1 += w1_5 * t5; + r1 += w1_6 * t6; + r1 += w1_7 * t7; + r1 += w1_8 * t8; + r1 += w1_9 * t9; + r1 += w1_10 * t10; + r1 += w1_11 * t11; + r1 += w1_12 * t12; + r1 += w1_13 * t13; + r1 += w1_14 * t14; + r1 += w1_15 * t15; + r1 += w1_16 * t16; + r1 += w1_17 * t17; + r1 += q1_0 * s0; + r1 += q1_1 * s1; + r1 += q1_2 * s2; + r1 += q1_3 * s3; + r1 += q1_4 * s4; + r1 += q1_5 * s5; + r1 += q1_6 * s6; + r1 += q1_7 * s7; + r1 += q1_8 * s8; + r1 = (r1 - sub1) * mul1 + add1; + imageStore(dstB, p, vec4(r1)); + + f16vec4 r2 = w2_0 * t0; + r2 += w2_1 * t1; + r2 += w2_2 * t2; + r2 += w2_3 * t3; + r2 += w2_4 * t4; + r2 += w2_5 * t5; + r2 += w2_6 * t6; + r2 += w2_7 * t7; + r2 += w2_8 * t8; + r2 += w2_9 * t9; + r2 += w2_10 * t10; + r2 += w2_11 * t11; + r2 += w2_12 * t12; + r2 += w2_13 * t13; + r2 += w2_14 * t14; + r2 += w2_15 * t15; + r2 += w2_16 * t16; + r2 += w2_17 * t17; + r2 += q2_0 * s0; + r2 += q2_1 * s1; + r2 += q2_2 * s2; + r2 += q2_3 * s3; + r2 += q2_4 * s4; + r2 += q2_5 * s5; + r2 += q2_6 * s6; + r2 += q2_7 * s7; + r2 += q2_8 * s8; + r2 = (r2 - sub2) * mul2 + add2; + imageStore(dstC, p, vec4(r2)); + + f16vec4 r3 = w3_0 * t0; + r3 += w3_1 * t1; + r3 += w3_2 * t2; + r3 += w3_3 * t3; + r3 += w3_4 * t4; + r3 += w3_5 * t5; + r3 += w3_6 * t6; + r3 += w3_7 * t7; + r3 += w3_8 * t8; + r3 += w3_9 * t9; + r3 += w3_10 * t10; + r3 += w3_11 * t11; + r3 += w3_12 * t12; + r3 += w3_13 * t13; + r3 += w3_14 * t14; + r3 += w3_15 * t15; + r3 += w3_16 * t16; + r3 += w3_17 * t17; + r3 += q3_0 * s0; + r3 += q3_1 * s1; + r3 += q3_2 * s2; + r3 += q3_3 * s3; + r3 += q3_4 * s4; + r3 += q3_5 * s5; + r3 += q3_6 * s6; + r3 += q3_7 * s7; + r3 += q3_8 * s8; + r3 = (r3 - sub3) * mul3 + add3; + imageStore(dstD, p, vec4(r3)); + +} diff --git a/cleanroom/glsl/shader_46.comp b/cleanroom/glsl/shader_46.comp new file mode 100644 index 0000000..0a5f716 --- /dev/null +++ b/cleanroom/glsl/shader_46.comp @@ -0,0 +1,964 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_46: 3x3 stride-1 conv, 16->16 channels, zero-padded texelFetch + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcA; +layout(set = 0, binding = 33) uniform sampler2D srcB; +layout(set = 0, binding = 34) uniform sampler2D srcC; +layout(set = 0, binding = 35) uniform sampler2D srcD; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstA; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; +layout(set = 0, binding = 50, rgba8) uniform writeonly image2D dstC; +layout(set = 0, binding = 51, rgba8) uniform writeonly image2D dstD; + +// zero-padded fetch for non-center taps +f16vec4 padTap(sampler2D img, ivec2 c) +{ + bool inb = c.x >= 0 && c.y >= 0; + if (inb) { + ivec2 sz = textureSize(img, 0); + inb = c.x < sz.x && c.y < sz.y; + } + return inb ? f16vec4(texelFetch(img, c, 0)) : f16vec4(0.0hf); +} + +const f16mat4 w0_0 = f16mat4( + f16vec4(-0.437744140625hf, -0.2152099609375hf, 0.150146484375hf, -0.50048828125hf), + f16vec4(-0.002902984619140625hf, 0.0982666015625hf, 0.1607666015625hf, -0.32177734375hf), + f16vec4(-0.00678253173828125hf, -0.136474609375hf, -0.496337890625hf, 0.1322021484375hf), + f16vec4(0.1014404296875hf, 0.01050567626953125hf, -0.4130859375hf, -0.04779052734375hf)); +const f16mat4 w0_1 = f16mat4( + f16vec4(0.0570068359375hf, 0.00521087646484375hf, 0.0259552001953125hf, -0.322021484375hf), + f16vec4(-0.0755615234375hf, -0.0234375hf, 0.0222320556640625hf, -0.317138671875hf), + f16vec4(0.0211944580078125hf, -0.01218414306640625hf, -0.284423828125hf, 0.09466552734375hf), + f16vec4(0.1942138671875hf, 0.054351806640625hf, -0.318603515625hf, -0.06390380859375hf)); +const f16mat4 w0_2 = f16mat4( + f16vec4(-0.56298828125hf, -0.111572265625hf, 0.07244873046875hf, -0.388671875hf), + f16vec4(0.20458984375hf, -0.020965576171875hf, 0.0780029296875hf, -0.20849609375hf), + f16vec4(-0.083251953125hf, -0.17138671875hf, -0.331298828125hf, 0.09027099609375hf), + f16vec4(0.1072998046875hf, -0.03289794921875hf, -0.353759765625hf, -0.044342041015625hf)); +const f16mat4 w0_3 = f16mat4( + f16vec4(-0.25048828125hf, -0.01088714599609375hf, 0.1715087890625hf, -0.390625hf), + f16vec4(0.03179931640625hf, 0.05908203125hf, -0.01209259033203125hf, -0.377685546875hf), + f16vec4(-0.024627685546875hf, -0.07293701171875hf, -0.224853515625hf, 0.168701171875hf), + f16vec4(0.0188446044921875hf, 0.07952880859375hf, -0.1610107421875hf, 0.005939483642578125hf)); +const f16mat4 w0_4 = f16mat4( + f16vec4(0.2646484375hf, 0.199462890625hf, 0.038330078125hf, -0.267578125hf), + f16vec4(-0.0274658203125hf, 0.0285797119140625hf, -0.04095458984375hf, -0.333740234375hf), + f16vec4(0.049530029296875hf, 0.048004150390625hf, -0.1951904296875hf, 0.1334228515625hf), + f16vec4(0.126708984375hf, 0.0858154296875hf, 0.037384033203125hf, -0.043212890625hf)); +const f16mat4 w0_5 = f16mat4( + f16vec4(-0.41015625hf, 0.06396484375hf, 0.040008544921875hf, -0.4306640625hf), + f16vec4(0.2442626953125hf, 0.06329345703125hf, 0.127197265625hf, -0.2376708984375hf), + f16vec4(-0.10723876953125hf, -0.10003662109375hf, -0.299072265625hf, 0.1397705078125hf), + f16vec4(0.0089569091796875hf, 0.00914764404296875hf, -0.07196044921875hf, -0.0220794677734375hf)); +const f16mat4 w0_6 = f16mat4( + f16vec4(-0.63037109375hf, -0.11236572265625hf, 0.307373046875hf, -0.253173828125hf), + f16vec4(-0.01201629638671875hf, 0.10650634765625hf, 0.0557861328125hf, -0.337890625hf), + f16vec4(-0.12548828125hf, -0.126220703125hf, -0.2408447265625hf, 0.1866455078125hf), + f16vec4(0.11370849609375hf, -0.0003540515899658203hf, -0.35546875hf, 0.040435791015625hf)); +const f16mat4 w0_7 = f16mat4( + f16vec4(-0.187255859375hf, 0.07965087890625hf, 0.2127685546875hf, -0.203125hf), + f16vec4(-0.142578125hf, 0.10302734375hf, -0.005443572998046875hf, -0.255126953125hf), + f16vec4(0.009674072265625hf, 0.00823974609375hf, -0.1739501953125hf, 0.1473388671875hf), + f16vec4(0.150634765625hf, 0.0235443115234375hf, -0.2138671875hf, -0.0265045166015625hf)); +const f16mat4 w0_8 = f16mat4( + f16vec4(-0.9248046875hf, -0.06695556640625hf, 0.1959228515625hf, -0.36328125hf), + f16vec4(0.10302734375hf, 0.1595458984375hf, 0.240478515625hf, -0.154052734375hf), + f16vec4(-0.1810302734375hf, -0.1392822265625hf, -0.416015625hf, 0.1845703125hf), + f16vec4(0.0296783447265625hf, -0.10687255859375hf, -0.1456298828125hf, -0.0156707763671875hf)); +const f16mat4 w0_9 = f16mat4( + f16vec4(0.0982666015625hf, 0.062347412109375hf, -0.00605010986328125hf, 0.1229248046875hf), + f16vec4(-0.32177734375hf, 0.027130126953125hf, 0.07647705078125hf, 0.149169921875hf), + f16vec4(0.1058349609375hf, -0.265869140625hf, 0.145263671875hf, -0.108154296875hf), + f16vec4(0.09295654296875hf, 0.380615234375hf, -0.1326904296875hf, 0.1556396484375hf)); +const f16mat4 w0_10 = f16mat4( + f16vec4(0.13720703125hf, 0.0936279296875hf, -0.052825927734375hf, 0.0963134765625hf), + f16vec4(-0.220458984375hf, 0.0091552734375hf, 0.10009765625hf, 0.0928955078125hf), + f16vec4(0.197998046875hf, -0.173828125hf, 0.11248779296875hf, -0.0192413330078125hf), + f16vec4(0.127197265625hf, 0.42724609375hf, -0.095458984375hf, 0.181396484375hf)); +const f16mat4 w0_11 = f16mat4( + f16vec4(0.1412353515625hf, 0.07574462890625hf, -0.006610870361328125hf, 0.11260986328125hf), + f16vec4(-0.280517578125hf, -0.005619049072265625hf, 0.17919921875hf, 0.218505859375hf), + f16vec4(0.047210693359375hf, -0.23876953125hf, 0.049652099609375hf, -0.1353759765625hf), + f16vec4(0.187744140625hf, 0.332275390625hf, -0.1600341796875hf, 0.12249755859375hf)); +const f16mat4 w0_12 = f16mat4( + f16vec4(-0.07171630859375hf, 0.07574462890625hf, 0.0946044921875hf, 0.07720947265625hf), + f16vec4(-0.040679931640625hf, 0.0258026123046875hf, -0.0219268798828125hf, -0.07373046875hf), + f16vec4(0.28466796875hf, -0.086181640625hf, 0.1378173828125hf, 0.0229034423828125hf), + f16vec4(0.1419677734375hf, 0.27197265625hf, -0.1387939453125hf, 0.171630859375hf)); +const f16mat4 w0_13 = f16mat4( + f16vec4(-0.0037441253662109375hf, 0.08843994140625hf, 0.0538330078125hf, 0.047088623046875hf), + f16vec4(0.020050048828125hf, -0.033233642578125hf, -0.15966796875hf, -0.106689453125hf), + f16vec4(0.30712890625hf, -0.0265960693359375hf, 0.11346435546875hf, 0.0721435546875hf), + f16vec4(0.161865234375hf, 0.28076171875hf, 0.0197296142578125hf, 0.2193603515625hf)); +const f16mat4 w0_14 = f16mat4( + f16vec4(-0.041046142578125hf, 0.07598876953125hf, 0.12359619140625hf, 0.1141357421875hf), + f16vec4(-0.04638671875hf, -0.04071044921875hf, 0.001644134521484375hf, 0.00927734375hf), + f16vec4(0.1729736328125hf, -0.136474609375hf, 0.0289306640625hf, -0.0137786865234375hf), + f16vec4(0.1787109375hf, 0.1968994140625hf, -0.109130859375hf, 0.1717529296875hf)); +const f16mat4 w0_15 = f16mat4( + f16vec4(0.039398193359375hf, 0.00311279296875hf, 0.007129669189453125hf, 0.177978515625hf), + f16vec4(-0.15234375hf, 0.11224365234375hf, 0.25244140625hf, 0.0181427001953125hf), + f16vec4(0.1533203125hf, -0.1885986328125hf, 0.0196380615234375hf, 0.0135498046875hf), + f16vec4(0.083251953125hf, 0.40869140625hf, -0.1087646484375hf, 0.2685546875hf)); +const f16mat4 w0_16 = f16mat4( + f16vec4(0.07928466796875hf, 0.043609619140625hf, 0.0030384063720703125hf, 0.1451416015625hf), + f16vec4(-0.1109619140625hf, 0.0673828125hf, 0.05841064453125hf, -0.02947998046875hf), + f16vec4(0.1651611328125hf, -0.177734375hf, 0.03265380859375hf, 0.046844482421875hf), + f16vec4(0.11798095703125hf, 0.33984375hf, -0.01294708251953125hf, 0.288330078125hf)); +const f16mat4 w0_17 = f16mat4( + f16vec4(0.0181427001953125hf, 0.014862060546875hf, 0.0758056640625hf, 0.2086181640625hf), + f16vec4(-0.2022705078125hf, 0.00921630859375hf, 0.01849365234375hf, 0.08642578125hf), + f16vec4(0.0180816650390625hf, -0.2880859375hf, -0.042022705078125hf, -0.06402587890625hf), + f16vec4(0.072265625hf, 0.23828125hf, -0.06536865234375hf, 0.2412109375hf)); +const f16mat4 w0_18 = f16mat4( + f16vec4(-0.387939453125hf, 0.1893310546875hf, 0.013519287109375hf, 0.0712890625hf), + f16vec4(-0.07147216796875hf, 0.046844482421875hf, -0.2388916015625hf, 0.050262451171875hf), + f16vec4(0.35986328125hf, -0.006378173828125hf, -0.04339599609375hf, 0.206787109375hf), + f16vec4(0.433349609375hf, -0.10125732421875hf, -0.01959228515625hf, -0.0253143310546875hf)); +const f16mat4 w0_19 = f16mat4( + f16vec4(-0.237548828125hf, 0.0712890625hf, 0.00977325439453125hf, 0.0231475830078125hf), + f16vec4(0.036529541015625hf, 0.220458984375hf, 0.0209808349609375hf, 0.05804443359375hf), + f16vec4(0.118896484375hf, -0.0794677734375hf, -0.025360107421875hf, 0.12213134765625hf), + f16vec4(0.05694580078125hf, -0.166259765625hf, 0.0189056396484375hf, -0.07733154296875hf)); +const f16mat4 w0_20 = f16mat4( + f16vec4(-0.50146484375hf, 0.0479736328125hf, 0.0281982421875hf, 0.196533203125hf), + f16vec4(-0.092529296875hf, 0.10589599609375hf, -0.035888671875hf, -0.0038318634033203125hf), + f16vec4(0.329345703125hf, -0.081787109375hf, -0.1285400390625hf, 0.128173828125hf), + f16vec4(0.262451171875hf, -0.2071533203125hf, -0.04620361328125hf, -0.13134765625hf)); +const f16mat4 w0_21 = f16mat4( + f16vec4(-0.345458984375hf, 0.026824951171875hf, 0.09173583984375hf, -0.056121826171875hf), + f16vec4(-0.00826263427734375hf, 0.1712646484375hf, -0.0899658203125hf, 0.1048583984375hf), + f16vec4(0.2264404296875hf, -0.028076171875hf, 0.01605224609375hf, 0.2281494140625hf), + f16vec4(0.07489013671875hf, -0.134765625hf, -0.0294036865234375hf, -0.04986572265625hf)); +const f16mat4 w0_22 = f16mat4( + f16vec4(-0.1370849609375hf, -0.04705810546875hf, 0.05279541015625hf, -0.0645751953125hf), + f16vec4(0.1297607421875hf, 0.364501953125hf, 0.104736328125hf, 0.054168701171875hf), + f16vec4(-0.0233917236328125hf, -0.101806640625hf, 0.083740234375hf, 0.1961669921875hf), + f16vec4(-0.2462158203125hf, -0.1959228515625hf, 0.0006198883056640625hf, -0.0869140625hf)); +const f16mat4 w0_23 = f16mat4( + f16vec4(-0.393798828125hf, 0.0267333984375hf, 0.03387451171875hf, 0.09075927734375hf), + f16vec4(-0.0635986328125hf, 0.186767578125hf, -0.10546875hf, -0.0784912109375hf), + f16vec4(0.1717529296875hf, -0.11962890625hf, -0.017242431640625hf, 0.248779296875hf), + f16vec4(-0.039581298828125hf, -0.217041015625hf, -0.05828857421875hf, -0.0794677734375hf)); +const f16mat4 w0_24 = f16mat4( + f16vec4(-0.66162109375hf, 0.04669189453125hf, 0.132080078125hf, -0.0289154052734375hf), + f16vec4(-0.1983642578125hf, 0.059600830078125hf, -0.10858154296875hf, 0.182861328125hf), + f16vec4(0.319091796875hf, 0.02825927734375hf, -0.0250701904296875hf, 0.1947021484375hf), + f16vec4(0.21875hf, -0.299072265625hf, -0.1253662109375hf, -0.09796142578125hf)); +const f16mat4 w0_25 = f16mat4( + f16vec4(-0.454345703125hf, 0.00923919677734375hf, 0.10247802734375hf, -0.045318603515625hf), + f16vec4(-0.047637939453125hf, 0.245849609375hf, 0.144287109375hf, 0.12298583984375hf), + f16vec4(0.03265380859375hf, -0.043487548828125hf, 0.09405517578125hf, 0.1964111328125hf), + f16vec4(-0.0182647705078125hf, -0.304931640625hf, -0.08306884765625hf, -0.10980224609375hf)); +const f16mat4 w0_26 = f16mat4( + f16vec4(-0.6748046875hf, 0.11529541015625hf, 0.12255859375hf, 0.138916015625hf), + f16vec4(-0.30029296875hf, 0.050567626953125hf, -0.1456298828125hf, -0.05352783203125hf), + f16vec4(0.18212890625hf, -0.0499267578125hf, 0.056732177734375hf, 0.267333984375hf), + f16vec4(0.2254638671875hf, -0.346923828125hf, -0.11279296875hf, -0.08575439453125hf)); +const f16mat4 w0_27 = f16mat4( + f16vec4(-0.159912109375hf, 0.03173828125hf, -0.034820556640625hf, -0.158935546875hf), + f16vec4(0.175048828125hf, -0.310302734375hf, -0.1422119140625hf, -0.5576171875hf), + f16vec4(0.1756591796875hf, -0.183349609375hf, -0.28076171875hf, -0.1475830078125hf), + f16vec4(0.1932373046875hf, 0.17724609375hf, 0.00630950927734375hf, 0.137939453125hf)); +const f16mat4 w0_28 = f16mat4( + f16vec4(-0.1319580078125hf, 0.1541748046875hf, -0.08502197265625hf, -0.1392822265625hf), + f16vec4(0.0518798828125hf, -0.1265869140625hf, -0.11187744140625hf, -0.44189453125hf), + f16vec4(0.0821533203125hf, -0.1783447265625hf, -0.3466796875hf, -0.1612548828125hf), + f16vec4(0.0494384765625hf, 0.1737060546875hf, 0.035552978515625hf, 0.1319580078125hf)); +const f16mat4 w0_29 = f16mat4( + f16vec4(-0.255126953125hf, 0.11187744140625hf, -0.2481689453125hf, -0.25732421875hf), + f16vec4(0.031951904296875hf, -0.2099609375hf, -0.1317138671875hf, -0.60595703125hf), + f16vec4(0.2430419921875hf, -0.293701171875hf, -0.435302734375hf, -0.26416015625hf), + f16vec4(0.0999755859375hf, 0.24951171875hf, 0.046173095703125hf, 0.2303466796875hf)); +const f16mat4 w0_30 = f16mat4( + f16vec4(-0.07244873046875hf, 0.07763671875hf, -0.2073974609375hf, -0.055633544921875hf), + f16vec4(0.046722412109375hf, -0.124267578125hf, 0.00872039794921875hf, -0.5166015625hf), + f16vec4(-0.0306243896484375hf, -0.0751953125hf, -0.0167694091796875hf, -0.051239013671875hf), + f16vec4(0.0634765625hf, 0.154541015625hf, 0.1153564453125hf, 0.0792236328125hf)); +const f16mat4 w0_31 = f16mat4( + f16vec4(-0.03143310546875hf, 0.1807861328125hf, -0.10809326171875hf, -0.00601959228515625hf), + f16vec4(-9.799003601074219e-05hf, 0.0025501251220703125hf, 0.02740478515625hf, -0.44921875hf), + f16vec4(-0.09576416015625hf, -0.00637054443359375hf, 0.0036602020263671875hf, -0.022125244140625hf), + f16vec4(-0.035858154296875hf, 0.2042236328125hf, 0.1358642578125hf, 0.07269287109375hf)); +const f16mat4 w0_32 = f16mat4( + f16vec4(-0.142333984375hf, 0.08636474609375hf, -0.272705078125hf, -0.156005859375hf), + f16vec4(-0.014251708984375hf, -0.1551513671875hf, -0.169921875hf, -0.56787109375hf), + f16vec4(0.006366729736328125hf, -0.1297607421875hf, -0.1239013671875hf, -0.07745361328125hf), + f16vec4(0.01605224609375hf, 0.287841796875hf, 0.15283203125hf, 0.1611328125hf)); +const f16mat4 w0_33 = f16mat4( + f16vec4(-0.2225341796875hf, 0.033599853515625hf, -0.2958984375hf, -0.09564208984375hf), + f16vec4(0.035980224609375hf, -0.1793212890625hf, -0.0877685546875hf, -0.63916015625hf), + f16vec4(0.269287109375hf, -0.1800537109375hf, -0.272216796875hf, -0.054779052734375hf), + f16vec4(0.222412109375hf, 0.17333984375hf, 0.1246337890625hf, 0.107421875hf)); +const f16mat4 w0_34 = f16mat4( + f16vec4(-0.216064453125hf, 0.0814208984375hf, -0.133056640625hf, -0.059051513671875hf), + f16vec4(-0.0036678314208984375hf, -0.12017822265625hf, 0.0802001953125hf, -0.55908203125hf), + f16vec4(0.1702880859375hf, -0.072509765625hf, -0.2371826171875hf, 0.03704833984375hf), + f16vec4(0.103515625hf, 0.208984375hf, 0.1700439453125hf, 0.1094970703125hf)); +const f16mat4 w0_35 = f16mat4( + f16vec4(-0.3310546875hf, -0.07879638671875hf, -0.1768798828125hf, -0.1126708984375hf), + f16vec4(0.017181396484375hf, -0.35986328125hf, -0.03900146484375hf, -0.7265625hf), + f16vec4(0.2349853515625hf, -0.1434326171875hf, -0.319091796875hf, -0.0303955078125hf), + f16vec4(0.053131103515625hf, 0.281005859375hf, 0.1455078125hf, 0.1849365234375hf)); +const f16vec4 sub0 = f16vec4(0.5068359375hf, 0.365966796875hf, -1.6884765625hf, -1.353515625hf); +const f16vec4 mul0 = f16vec4(0.357666015625hf, 0.3359375hf, 0.362548828125hf, 0.2496337890625hf); +const f16vec4 add0 = f16vec4(-0.1533203125hf, 0.06610107421875hf, -0.037841796875hf, -0.1932373046875hf); + +const f16mat4 w1_0 = f16mat4( + f16vec4(-0.06317138671875hf, -0.22705078125hf, 0.303955078125hf, -0.1878662109375hf), + f16vec4(0.06463623046875hf, 0.0045318603515625hf, 0.035308837890625hf, 0.0706787109375hf), + f16vec4(-0.32666015625hf, -0.13427734375hf, -0.048797607421875hf, -0.53125hf), + f16vec4(0.037872314453125hf, -0.25341796875hf, -0.05560302734375hf, -0.11199951171875hf)); +const f16mat4 w1_1 = f16mat4( + f16vec4(0.0309295654296875hf, -0.10821533203125hf, 0.1397705078125hf, -0.019622802734375hf), + f16vec4(-0.034576416015625hf, -0.155517578125hf, -0.0284576416015625hf, -0.21142578125hf), + f16vec4(-0.348388671875hf, -0.16357421875hf, 0.1451416015625hf, 0.0175933837890625hf), + f16vec4(0.006046295166015625hf, -0.08465576171875hf, -0.205078125hf, -0.36962890625hf)); +const f16mat4 w1_2 = f16mat4( + f16vec4(0.0123291015625hf, -0.35888671875hf, 0.382568359375hf, -0.23193359375hf), + f16vec4(-0.1253662109375hf, -0.0404052734375hf, 0.0726318359375hf, 0.1435546875hf), + f16vec4(-0.4501953125hf, -0.2010498046875hf, 0.09765625hf, -0.2132568359375hf), + f16vec4(0.00848388671875hf, -0.221435546875hf, -0.0797119140625hf, -0.71875hf)); +const f16mat4 w1_3 = f16mat4( + f16vec4(-0.056182861328125hf, -0.10223388671875hf, 0.052642822265625hf, -0.1611328125hf), + f16vec4(0.1982421875hf, -0.10955810546875hf, 0.1507568359375hf, 0.01580810546875hf), + f16vec4(-0.3603515625hf, -0.08465576171875hf, 0.0292816162109375hf, -0.2191162109375hf), + f16vec4(0.028594970703125hf, -0.1802978515625hf, 0.040191650390625hf, 0.283447265625hf)); +const f16mat4 w1_4 = f16mat4( + f16vec4(0.06744384765625hf, 0.016387939453125hf, -0.0821533203125hf, -0.01279449462890625hf), + f16vec4(0.08929443359375hf, -0.2200927734375hf, -0.0760498046875hf, -0.262451171875hf), + f16vec4(-0.36083984375hf, -0.1195068359375hf, 0.281982421875hf, 0.2340087890625hf), + f16vec4(0.0233001708984375hf, -0.03546142578125hf, -0.2099609375hf, 0.0926513671875hf)); +const f16mat4 w1_5 = f16mat4( + f16vec4(0.028045654296875hf, -0.2257080078125hf, 0.19091796875hf, -0.17578125hf), + f16vec4(-0.0231781005859375hf, 0.0162506103515625hf, -0.017486572265625hf, 0.1519775390625hf), + f16vec4(-0.459228515625hf, -0.2052001953125hf, 0.206787109375hf, -0.051513671875hf), + f16vec4(0.00028395652770996094hf, -0.20703125hf, -0.099365234375hf, -0.1165771484375hf)); +const f16mat4 w1_6 = f16mat4( + f16vec4(-0.07794189453125hf, -0.26318359375hf, 0.2303466796875hf, -0.1029052734375hf), + f16vec4(0.08306884765625hf, -0.09796142578125hf, 0.12200927734375hf, 0.21435546875hf), + f16vec4(-0.39453125hf, -0.10614013671875hf, -0.06787109375hf, -0.361083984375hf), + f16vec4(0.1104736328125hf, -0.238037109375hf, 0.1102294921875hf, -0.2236328125hf)); +const f16mat4 w1_7 = f16mat4( + f16vec4(0.04998779296875hf, -0.10736083984375hf, 0.09442138671875hf, 0.04376220703125hf), + f16vec4(-0.0236968994140625hf, -0.26953125hf, 0.040374755859375hf, -0.10198974609375hf), + f16vec4(-0.37646484375hf, -0.06683349609375hf, 0.1619873046875hf, 0.09368896484375hf), + f16vec4(0.07177734375hf, -0.0836181640625hf, -0.1109619140625hf, -0.482666015625hf)); +const f16mat4 w1_8 = f16mat4( + f16vec4(0.020904541015625hf, -0.249755859375hf, 0.42529296875hf, -0.041778564453125hf), + f16vec4(-0.1353759765625hf, 0.0022563934326171875hf, -0.045989990234375hf, 0.2156982421875hf), + f16vec4(-0.4541015625hf, -0.28173828125hf, 0.189697265625hf, -0.21630859375hf), + f16vec4(0.043853759765625hf, -0.227783203125hf, -0.11248779296875hf, -0.440673828125hf)); +const f16mat4 w1_9 = f16mat4( + f16vec4(-0.08404541015625hf, -0.044921875hf, -0.1822509765625hf, -0.2445068359375hf), + f16vec4(-0.2275390625hf, 0.12408447265625hf, -0.06243896484375hf, 0.274658203125hf), + f16vec4(-0.07269287109375hf, -0.287841796875hf, 0.04022216796875hf, 0.08221435546875hf), + f16vec4(0.36669921875hf, 0.0026493072509765625hf, 0.1456298828125hf, 0.205810546875hf)); +const f16mat4 w1_10 = f16mat4( + f16vec4(-0.035125732421875hf, 0.2000732421875hf, -0.30859375hf, -0.247314453125hf), + f16vec4(-0.1517333984375hf, 0.0833740234375hf, -0.2191162109375hf, 0.1488037109375hf), + f16vec4(-0.0191497802734375hf, -0.09521484375hf, -0.0304718017578125hf, -0.010345458984375hf), + f16vec4(0.323974609375hf, 0.0025043487548828125hf, 0.0364990234375hf, 0.08258056640625hf)); +const f16mat4 w1_11 = f16mat4( + f16vec4(-0.07025146484375hf, 0.0482177734375hf, -0.3037109375hf, -0.397216796875hf), + f16vec4(-0.255126953125hf, 0.0858154296875hf, -0.08953857421875hf, 0.463134765625hf), + f16vec4(0.040435791015625hf, -0.317626953125hf, 0.08953857421875hf, 0.039337158203125hf), + f16vec4(0.319580078125hf, 0.0848388671875hf, 0.07733154296875hf, 0.192626953125hf)); +const f16mat4 w1_12 = f16mat4( + f16vec4(-0.0609130859375hf, 0.0845947265625hf, -0.046600341796875hf, 0.00910186767578125hf), + f16vec4(-0.11322021484375hf, 0.12493896484375hf, -0.2486572265625hf, -0.01515960693359375hf), + f16vec4(-0.025726318359375hf, -0.12310791015625hf, -0.11810302734375hf, -0.0672607421875hf), + f16vec4(0.2398681640625hf, 0.0445556640625hf, 0.11260986328125hf, 0.0904541015625hf)); +const f16mat4 w1_13 = f16mat4( + f16vec4(-0.053070068359375hf, 0.2998046875hf, -0.208251953125hf, -0.0126495361328125hf), + f16vec4(-0.036773681640625hf, 0.046112060546875hf, -0.3408203125hf, -0.1265869140625hf), + f16vec4(0.055328369140625hf, 0.10101318359375hf, -0.12237548828125hf, -0.13330078125hf), + f16vec4(0.1990966796875hf, 0.052093505859375hf, -0.0218505859375hf, 0.052520751953125hf)); +const f16mat4 w1_14 = f16mat4( + f16vec4(-0.10467529296875hf, 0.055084228515625hf, -0.12445068359375hf, -0.0931396484375hf), + f16vec4(-0.10498046875hf, 0.134033203125hf, -0.251220703125hf, 0.162841796875hf), + f16vec4(0.0477294921875hf, -0.2078857421875hf, -0.036224365234375hf, -0.1004638671875hf), + f16vec4(0.1575927734375hf, 0.158447265625hf, 0.01065826416015625hf, 0.1290283203125hf)); +const f16mat4 w1_15 = f16mat4( + f16vec4(-0.0943603515625hf, 0.0389404296875hf, -0.25390625hf, -0.321044921875hf), + f16vec4(-0.1302490234375hf, 0.064208984375hf, -0.08636474609375hf, 0.259521484375hf), + f16vec4(-0.04168701171875hf, -0.269775390625hf, -0.005096435546875hf, 0.031097412109375hf), + f16vec4(0.48291015625hf, 0.0140533447265625hf, 0.194580078125hf, 0.1463623046875hf)); +const f16mat4 w1_16 = f16mat4( + f16vec4(-0.080810546875hf, 0.25048828125hf, -0.40771484375hf, -0.316650390625hf), + f16vec4(-0.07196044921875hf, -0.0552978515625hf, -0.0826416015625hf, 0.139404296875hf), + f16vec4(0.00568389892578125hf, -0.0237884521484375hf, -0.04541015625hf, -0.05072021484375hf), + f16vec4(0.38037109375hf, 0.00931549072265625hf, -0.009552001953125hf, 0.083251953125hf)); +const f16mat4 w1_17 = f16mat4( + f16vec4(-0.1434326171875hf, -0.09600830078125hf, -0.375244140625hf, -0.33447265625hf), + f16vec4(-0.14306640625hf, -0.0853271484375hf, -0.0216522216796875hf, 0.3779296875hf), + f16vec4(0.002445220947265625hf, -0.375244140625hf, 0.0263671875hf, -0.00122833251953125hf), + f16vec4(0.31982421875hf, 0.10211181640625hf, 0.0302886962890625hf, 0.1859130859375hf)); +const f16mat4 w1_18 = f16mat4( + f16vec4(-0.04278564453125hf, 0.155029296875hf, -0.423828125hf, 0.06817626953125hf), + f16vec4(0.0294647216796875hf, 0.051513671875hf, -0.0318603515625hf, -0.13916015625hf), + f16vec4(0.033599853515625hf, 0.403076171875hf, -0.1014404296875hf, -0.033782958984375hf), + f16vec4(0.09423828125hf, 0.09979248046875hf, -0.5390625hf, -0.0938720703125hf)); +const f16mat4 w1_19 = f16mat4( + f16vec4(-0.00888824462890625hf, 0.2039794921875hf, -0.40380859375hf, -0.11614990234375hf), + f16vec4(-0.015869140625hf, -0.06683349609375hf, -0.07501220703125hf, -0.07989501953125hf), + f16vec4(-0.0177154541015625hf, -0.01557159423828125hf, -0.043914794921875hf, -0.1126708984375hf), + f16vec4(0.09600830078125hf, 0.12188720703125hf, -0.1580810546875hf, -0.0218505859375hf)); +const f16mat4 w1_20 = f16mat4( + f16vec4(-0.0033321380615234375hf, 0.1669921875hf, -0.374267578125hf, -0.0299835205078125hf), + f16vec4(-0.035369873046875hf, -0.0694580078125hf, -0.044647216796875hf, -0.30712890625hf), + f16vec4(-0.11456298828125hf, 0.490478515625hf, -0.19482421875hf, -0.05999755859375hf), + f16vec4(0.03729248046875hf, 0.10076904296875hf, -0.247802734375hf, -0.0335693359375hf)); +const f16mat4 w1_21 = f16mat4( + f16vec4(-0.04693603515625hf, 0.0369873046875hf, -0.331298828125hf, 0.00232696533203125hf), + f16vec4(-0.05499267578125hf, 0.038116455078125hf, -0.08441162109375hf, -0.280517578125hf), + f16vec4(0.156982421875hf, 0.2587890625hf, -0.0689697265625hf, -0.0015573501586914062hf), + f16vec4(0.10821533203125hf, 0.1033935546875hf, -0.3779296875hf, -0.234130859375hf)); +const f16mat4 w1_22 = f16mat4( + f16vec4(0.006256103515625hf, 0.10760498046875hf, -0.27880859375hf, -0.10943603515625hf), + f16vec4(-0.07257080078125hf, -0.1182861328125hf, -0.1590576171875hf, -0.176513671875hf), + f16vec4(0.09857177734375hf, -0.103759765625hf, -0.07073974609375hf, -0.058502197265625hf), + f16vec4(0.06280517578125hf, 0.1348876953125hf, 0.0271148681640625hf, -0.2435302734375hf)); +const f16mat4 w1_23 = f16mat4( + f16vec4(0.0389404296875hf, 0.08056640625hf, -0.269287109375hf, -0.037109375hf), + f16vec4(-0.0836181640625hf, -0.1259765625hf, -0.1302490234375hf, -0.446533203125hf), + f16vec4(-0.01351165771484375hf, 0.339599609375hf, -0.17919921875hf, -0.033355712890625hf), + f16vec4(-0.0052947998046875hf, 0.06597900390625hf, -0.093505859375hf, -0.2352294921875hf)); +const f16mat4 w1_24 = f16mat4( + f16vec4(-0.10858154296875hf, 0.01983642578125hf, -0.311767578125hf, 0.1756591796875hf), + f16vec4(-0.0367431640625hf, -0.010406494140625hf, -0.0006017684936523438hf, -0.208984375hf), + f16vec4(0.01114654541015625hf, 0.31787109375hf, -0.056396484375hf, 0.04571533203125hf), + f16vec4(0.1392822265625hf, 0.21240234375hf, -0.449462890625hf, -0.22900390625hf)); +const f16mat4 w1_25 = f16mat4( + f16vec4(-0.0159759521484375hf, 0.1307373046875hf, -0.2320556640625hf, 0.0919189453125hf), + f16vec4(-0.029327392578125hf, -0.08935546875hf, -0.12646484375hf, -0.0302276611328125hf), + f16vec4(-0.0941162109375hf, -0.01287841796875hf, -0.0452880859375hf, 0.0106353759765625hf), + f16vec4(0.08770751953125hf, 0.1700439453125hf, -0.138427734375hf, -0.26708984375hf)); +const f16mat4 w1_26 = f16mat4( + f16vec4(0.02001953125hf, 0.09033203125hf, -0.1903076171875hf, 0.172119140625hf), + f16vec4(-0.044891357421875hf, -0.11480712890625hf, -0.08990478515625hf, -0.26611328125hf), + f16vec4(-0.2093505859375hf, 0.4453125hf, -0.11163330078125hf, 0.0689697265625hf), + f16vec4(-0.018524169921875hf, 0.06683349609375hf, -0.43115234375hf, -0.2509765625hf)); +const f16mat4 w1_27 = f16mat4( + f16vec4(-0.044921875hf, -0.11566162109375hf, 0.0297393798828125hf, -0.237548828125hf), + f16vec4(0.027130126953125hf, 0.158203125hf, -0.0115814208984375hf, -0.53759765625hf), + f16vec4(-0.037567138671875hf, -0.08148193359375hf, -0.477783203125hf, -0.032257080078125hf), + f16vec4(0.1597900390625hf, 0.08392333984375hf, -0.039947509765625hf, -0.06964111328125hf)); +const f16mat4 w1_28 = f16mat4( + f16vec4(-0.0576171875hf, -0.1651611328125hf, -0.0694580078125hf, -0.2269287109375hf), + f16vec4(0.0117340087890625hf, 0.061981201171875hf, 0.0535888671875hf, -0.447265625hf), + f16vec4(-0.0162811279296875hf, -0.08856201171875hf, -0.232177734375hf, 0.11883544921875hf), + f16vec4(0.059783935546875hf, -0.007221221923828125hf, -0.07684326171875hf, -0.11370849609375hf)); +const f16mat4 w1_29 = f16mat4( + f16vec4(-0.0802001953125hf, -0.261962890625hf, -0.054718017578125hf, -0.1566162109375hf), + f16vec4(0.0278472900390625hf, 0.141357421875hf, -0.03704833984375hf, -0.55078125hf), + f16vec4(-0.10137939453125hf, 0.0200042724609375hf, -0.3974609375hf, 0.111572265625hf), + f16vec4(0.027008056640625hf, 0.10345458984375hf, 0.007465362548828125hf, -0.06976318359375hf)); +const f16mat4 w1_30 = f16mat4( + f16vec4(0.038299560546875hf, -0.047760009765625hf, -0.1605224609375hf, -0.2066650390625hf), + f16vec4(0.07452392578125hf, 0.105224609375hf, -0.0616455078125hf, -0.093017578125hf), + f16vec4(-0.046356201171875hf, -0.05889892578125hf, -0.0117034912109375hf, 0.152587890625hf), + f16vec4(0.202392578125hf, 0.1439208984375hf, 0.0226593017578125hf, 0.022186279296875hf)); +const f16mat4 w1_31 = f16mat4( + f16vec4(0.0233001708984375hf, -0.041778564453125hf, -0.2371826171875hf, -0.156005859375hf), + f16vec4(0.0670166015625hf, 0.005855560302734375hf, 0.10809326171875hf, -0.0484619140625hf), + f16vec4(-0.0214996337890625hf, -0.10162353515625hf, 0.09783935546875hf, 0.28857421875hf), + f16vec4(0.1158447265625hf, 0.033966064453125hf, -0.1221923828125hf, -0.07611083984375hf)); +const f16mat4 w1_32 = f16mat4( + f16vec4(-0.0020465850830078125hf, -0.1292724609375hf, -0.2037353515625hf, -0.071533203125hf), + f16vec4(0.036346435546875hf, 0.00371551513671875hf, 0.10504150390625hf, -0.2476806640625hf), + f16vec4(-0.11962890625hf, -0.09814453125hf, -0.067138671875hf, 0.27294921875hf), + f16vec4(0.06829833984375hf, 0.07635498046875hf, 0.0090789794921875hf, -0.0002460479736328125hf)); +const f16mat4 w1_33 = f16mat4( + f16vec4(-0.0309295654296875hf, -0.2169189453125hf, 0.0052032470703125hf, -0.12054443359375hf), + f16vec4(0.06500244140625hf, 0.10003662109375hf, 0.1119384765625hf, -0.348388671875hf), + f16vec4(-0.0703125hf, 0.10198974609375hf, -0.5439453125hf, -0.0830078125hf), + f16vec4(0.1663818359375hf, 0.152099609375hf, 0.0034923553466796875hf, -0.060516357421875hf)); +const f16mat4 w1_34 = f16mat4( + f16vec4(-0.05108642578125hf, -0.1470947265625hf, -0.075927734375hf, -0.06085205078125hf), + f16vec4(0.01338958740234375hf, 0.07464599609375hf, 0.098388671875hf, -0.1793212890625hf), + f16vec4(-0.0406494140625hf, 0.056396484375hf, -0.3564453125hf, 0.09326171875hf), + f16vec4(0.0743408203125hf, 0.055267333984375hf, -0.0440673828125hf, -0.1119384765625hf)); +const f16mat4 w1_35 = f16mat4( + f16vec4(-0.053314208984375hf, -0.188232421875hf, -0.0183868408203125hf, 0.078369140625hf), + f16vec4(-0.0155029296875hf, 0.06341552734375hf, 0.2073974609375hf, -0.283447265625hf), + f16vec4(-0.158447265625hf, 0.0193328857421875hf, -0.326171875hf, 0.1048583984375hf), + f16vec4(0.030487060546875hf, 0.09185791015625hf, 0.0626220703125hf, -0.1019287109375hf)); +const f16vec4 sub1 = f16vec4(-0.454833984375hf, -0.425537109375hf, -3.1328125hf, -2.787109375hf); +const f16vec4 mul1 = f16vec4(0.459228515625hf, 0.374267578125hf, 0.3330078125hf, 0.262451171875hf); +const f16vec4 add1 = f16vec4(-0.440673828125hf, 0.2147216796875hf, 0.11212158203125hf, 0.1390380859375hf); + +const f16mat4 w2_0 = f16mat4( + f16vec4(-0.487548828125hf, -0.081298828125hf, 0.0794677734375hf, -0.06427001953125hf), + f16vec4(-0.154541015625hf, -0.313232421875hf, -0.67041015625hf, -0.282470703125hf), + f16vec4(-0.0782470703125hf, 0.0217132568359375hf, -0.0452880859375hf, 0.267822265625hf), + f16vec4(-0.2154541015625hf, 0.04876708984375hf, 0.028533935546875hf, 0.253662109375hf)); +const f16mat4 w2_1 = f16mat4( + f16vec4(-0.348876953125hf, -0.11090087890625hf, -0.1123046875hf, 0.00818634033203125hf), + f16vec4(-0.1688232421875hf, -0.0914306640625hf, -0.58203125hf, -0.2069091796875hf), + f16vec4(0.1697998046875hf, -0.01114654541015625hf, -0.08026123046875hf, 0.0267791748046875hf), + f16vec4(-0.458740234375hf, -0.03936767578125hf, -0.04473876953125hf, -0.0501708984375hf)); +const f16mat4 w2_2 = f16mat4( + f16vec4(-0.410888671875hf, -0.0447998046875hf, 0.126953125hf, -0.071044921875hf), + f16vec4(-0.08990478515625hf, -0.259521484375hf, -0.7158203125hf, -0.1658935546875hf), + f16vec4(0.2271728515625hf, 0.2083740234375hf, 0.0172119140625hf, -0.048370361328125hf), + f16vec4(-0.268310546875hf, 0.1148681640625hf, -0.1683349609375hf, 0.57177734375hf)); +const f16mat4 w2_3 = f16mat4( + f16vec4(-0.244140625hf, 0.1107177734375hf, 0.007293701171875hf, -0.10736083984375hf), + f16vec4(-0.218994140625hf, -0.11614990234375hf, -0.239013671875hf, -0.1400146484375hf), + f16vec4(-0.0089263916015625hf, -0.181884765625hf, -0.07562255859375hf, -0.08502197265625hf), + f16vec4(-0.2100830078125hf, -0.06524658203125hf, 0.09039306640625hf, 0.2724609375hf)); +const f16mat4 w2_4 = f16mat4( + f16vec4(-0.066650390625hf, 0.07049560546875hf, -0.2108154296875hf, -0.068603515625hf), + f16vec4(-0.20654296875hf, 0.09405517578125hf, -0.1290283203125hf, -0.09295654296875hf), + f16vec4(0.2301025390625hf, -0.267333984375hf, -0.089599609375hf, -0.053070068359375hf), + f16vec4(-0.406982421875hf, -0.1214599609375hf, 0.1243896484375hf, -0.2822265625hf)); +const f16mat4 w2_5 = f16mat4( + f16vec4(-0.1103515625hf, 0.09869384765625hf, 0.09991455078125hf, -0.038299560546875hf), + f16vec4(-0.1048583984375hf, -0.067138671875hf, -0.263916015625hf, -0.30712890625hf), + f16vec4(0.1715087890625hf, -0.0032825469970703125hf, 0.049774169921875hf, -0.0173492431640625hf), + f16vec4(-0.166259765625hf, -0.10198974609375hf, 0.0207061767578125hf, 0.083984375hf)); +const f16mat4 w2_6 = f16mat4( + f16vec4(-0.47607421875hf, -0.1624755859375hf, 0.18408203125hf, -0.0576171875hf), + f16vec4(-0.170166015625hf, -0.365478515625hf, -0.5703125hf, -0.352294921875hf), + f16vec4(-0.1507568359375hf, 0.0222930908203125hf, -0.0130767822265625hf, 0.0011310577392578125hf), + f16vec4(-0.2578125hf, 0.073974609375hf, -0.048828125hf, 0.58642578125hf)); +const f16mat4 w2_7 = f16mat4( + f16vec4(-0.33349609375hf, -0.198486328125hf, -0.018707275390625hf, -0.1387939453125hf), + f16vec4(-0.24560546875hf, -0.1673583984375hf, -0.43994140625hf, -0.1312255859375hf), + f16vec4(0.10968017578125hf, -0.114501953125hf, -0.039154052734375hf, -0.217041015625hf), + f16vec4(-0.486572265625hf, -0.0016145706176757812hf, 0.060760498046875hf, 0.275146484375hf)); +const f16mat4 w2_8 = f16mat4( + f16vec4(-0.41552734375hf, -0.1617431640625hf, 0.29443359375hf, -0.0640869140625hf), + f16vec4(-0.20556640625hf, -0.34716796875hf, -0.5263671875hf, -0.337890625hf), + f16vec4(0.0216522216796875hf, 0.11553955078125hf, 0.08837890625hf, -0.003894805908203125hf), + f16vec4(-0.24462890625hf, 0.05426025390625hf, 0.0364990234375hf, 0.337158203125hf)); +const f16mat4 w2_9 = f16mat4( + f16vec4(0.1802978515625hf, 0.19580078125hf, -0.1011962890625hf, 0.03985595703125hf), + f16vec4(-0.37060546875hf, -0.53857421875hf, 0.034576416015625hf, -0.3076171875hf), + f16vec4(-0.06439208984375hf, 0.0002340078353881836hf, 0.01459503173828125hf, -0.2091064453125hf), + f16vec4(-0.1549072265625hf, 0.07275390625hf, 0.183837890625hf, 0.0030460357666015625hf)); +const f16mat4 w2_10 = f16mat4( + f16vec4(-0.11181640625hf, -0.08172607421875hf, -0.05352783203125hf, -0.1392822265625hf), + f16vec4(-0.383544921875hf, -0.1392822265625hf, 0.037078857421875hf, -0.163330078125hf), + f16vec4(-0.12115478515625hf, 0.1331787109375hf, 0.153076171875hf, -0.06695556640625hf), + f16vec4(-0.1351318359375hf, 0.0650634765625hf, 0.1519775390625hf, 0.1470947265625hf)); +const f16mat4 w2_11 = f16mat4( + f16vec4(0.164306640625hf, 0.148193359375hf, -0.1514892578125hf, 0.022125244140625hf), + f16vec4(-0.263427734375hf, -0.57421875hf, 0.027679443359375hf, -0.423828125hf), + f16vec4(0.06988525390625hf, 0.050628662109375hf, 0.09918212890625hf, -0.1605224609375hf), + f16vec4(-0.01406097412109375hf, -0.0078582763671875hf, 0.08941650390625hf, 0.0574951171875hf)); +const f16mat4 w2_12 = f16mat4( + f16vec4(0.08502197265625hf, -0.0440673828125hf, 0.037689208984375hf, -0.06707763671875hf), + f16vec4(-0.373291015625hf, -0.2125244140625hf, -0.00434112548828125hf, -0.1134033203125hf), + f16vec4(-0.1719970703125hf, 0.09716796875hf, 0.048736572265625hf, -0.1656494140625hf), + f16vec4(-0.23193359375hf, 0.11456298828125hf, 0.0826416015625hf, 0.10906982421875hf)); +const f16mat4 w2_13 = f16mat4( + f16vec4(-0.256103515625hf, -0.3154296875hf, 0.142578125hf, -0.1280517578125hf), + f16vec4(-0.37255859375hf, 0.26416015625hf, 0.004581451416015625hf, 0.2093505859375hf), + f16vec4(-0.2413330078125hf, 0.2386474609375hf, 0.1346435546875hf, -0.1015625hf), + f16vec4(-0.1990966796875hf, 0.176025390625hf, 0.04302978515625hf, 0.125244140625hf)); +const f16mat4 w2_14 = f16mat4( + f16vec4(-0.0006570816040039062hf, -0.09197998046875hf, 0.1116943359375hf, 0.0283203125hf), + f16vec4(-0.236083984375hf, -0.11865234375hf, -0.0187225341796875hf, -0.1219482421875hf), + f16vec4(-0.0718994140625hf, 0.134765625hf, 0.081298828125hf, 0.0204925537109375hf), + f16vec4(-0.0609130859375hf, 0.1365966796875hf, -0.026123046875hf, 0.0958251953125hf)); +const f16mat4 w2_15 = f16mat4( + f16vec4(0.345947265625hf, 0.320556640625hf, -0.1737060546875hf, -0.04107666015625hf), + f16vec4(-0.18896484375hf, -0.54931640625hf, 0.0333251953125hf, -0.57666015625hf), + f16vec4(0.061309814453125hf, 0.04693603515625hf, 0.0120086669921875hf, -0.07000732421875hf), + f16vec4(-0.0191497802734375hf, -0.0626220703125hf, 0.164794921875hf, 0.09295654296875hf)); +const f16mat4 w2_16 = f16mat4( + f16vec4(0.0285797119140625hf, 0.03546142578125hf, -0.06494140625hf, -0.1309814453125hf), + f16vec4(-0.1845703125hf, -0.0894775390625hf, -0.029327392578125hf, -0.270263671875hf), + f16vec4(-0.0182342529296875hf, 0.216552734375hf, 0.082763671875hf, -0.150390625hf), + f16vec4(-0.051849365234375hf, 0.00582122802734375hf, 0.147216796875hf, 0.1932373046875hf)); +const f16mat4 w2_17 = f16mat4( + f16vec4(0.213623046875hf, 0.238037109375hf, -0.033203125hf, 0.0660400390625hf), + f16vec4(-0.08795166015625hf, -0.4541015625hf, -0.09637451171875hf, -0.364013671875hf), + f16vec4(0.12255859375hf, 0.1617431640625hf, 0.03314208984375hf, -0.05438232421875hf), + f16vec4(0.0775146484375hf, -0.050384521484375hf, 0.109375hf, 0.11553955078125hf)); +const f16mat4 w2_18 = f16mat4( + f16vec4(-0.2305908203125hf, 0.1927490234375hf, -0.32373046875hf, 0.0228118896484375hf), + f16vec4(-0.334228515625hf, 0.2225341796875hf, 0.240478515625hf, 0.0179290771484375hf), + f16vec4(0.3095703125hf, -0.25927734375hf, -0.11114501953125hf, 0.07391357421875hf), + f16vec4(0.1790771484375hf, 0.0745849609375hf, -0.446533203125hf, 0.01071929931640625hf)); +const f16mat4 w2_19 = f16mat4( + f16vec4(-0.227294921875hf, 0.1695556640625hf, -0.311279296875hf, 0.050537109375hf), + f16vec4(-0.408447265625hf, 0.038604736328125hf, -0.1063232421875hf, -0.032928466796875hf), + f16vec4(0.00435638427734375hf, 0.10687255859375hf, 0.12939453125hf, 0.1568603515625hf), + f16vec4(0.006229400634765625hf, 0.070556640625hf, -0.1727294921875hf, -0.1290283203125hf)); +const f16mat4 w2_20 = f16mat4( + f16vec4(-0.28759765625hf, 0.221435546875hf, -0.277099609375hf, 0.08868408203125hf), + f16vec4(-0.458251953125hf, 0.086669921875hf, 0.1793212890625hf, -0.1844482421875hf), + f16vec4(0.1123046875hf, -0.24951171875hf, 0.04693603515625hf, 0.1595458984375hf), + f16vec4(0.2489013671875hf, 0.081787109375hf, -0.199951171875hf, 0.02154541015625hf)); +const f16mat4 w2_21 = f16mat4( + f16vec4(-0.15087890625hf, 0.1436767578125hf, -0.146728515625hf, -0.0606689453125hf), + f16vec4(-0.2890625hf, 0.1142578125hf, 0.1580810546875hf, -0.11907958984375hf), + f16vec4(0.1181640625hf, -0.09722900390625hf, -0.005970001220703125hf, -0.010101318359375hf), + f16vec4(-0.1751708984375hf, -0.06561279296875hf, -0.2091064453125hf, 0.010162353515625hf)); +const f16mat4 w2_22 = f16mat4( + f16vec4(-0.08343505859375hf, 0.128662109375hf, -0.1395263671875hf, -0.047149658203125hf), + f16vec4(-0.438720703125hf, -0.026397705078125hf, -0.26904296875hf, -0.05120849609375hf), + f16vec4(-0.1348876953125hf, 0.23388671875hf, 0.2247314453125hf, 0.022735595703125hf), + f16vec4(-0.323974609375hf, -0.060302734375hf, 0.045806884765625hf, -0.1566162109375hf)); +const f16mat4 w2_23 = f16mat4( + f16vec4(-0.1259765625hf, 0.2030029296875hf, -0.11083984375hf, -0.02154541015625hf), + f16vec4(-0.546875hf, 0.11883544921875hf, 0.137939453125hf, -0.08734130859375hf), + f16vec4(-0.003269195556640625hf, -0.11993408203125hf, 0.0938720703125hf, 0.08636474609375hf), + f16vec4(-0.13037109375hf, 0.033355712890625hf, -0.047210693359375hf, 0.0088653564453125hf)); +const f16mat4 w2_24 = f16mat4( + f16vec4(-0.25048828125hf, -0.0167083740234375hf, -0.25244140625hf, -0.048187255859375hf), + f16vec4(-0.33447265625hf, 0.1854248046875hf, 0.30078125hf, 0.097900390625hf), + f16vec4(0.19140625hf, -0.3935546875hf, -0.005817413330078125hf, 0.06390380859375hf), + f16vec4(0.04705810546875hf, 0.09796142578125hf, -0.375732421875hf, 0.0276641845703125hf)); +const f16mat4 w2_25 = f16mat4( + f16vec4(-0.1629638671875hf, 0.0036182403564453125hf, -0.221435546875hf, -0.0687255859375hf), + f16vec4(-0.513671875hf, -0.036407470703125hf, -0.1263427734375hf, -0.08984375hf), + f16vec4(-0.033050537109375hf, -0.027252197265625hf, 0.1912841796875hf, 0.06390380859375hf), + f16vec4(-0.070068359375hf, 0.09368896484375hf, -0.078125hf, -0.1290283203125hf)); +const f16mat4 w2_26 = f16mat4( + f16vec4(-0.1839599609375hf, 0.060791015625hf, -0.1339111328125hf, -0.02239990234375hf), + f16vec4(-0.63134765625hf, 0.1759033203125hf, 0.1549072265625hf, 0.042205810546875hf), + f16vec4(0.119140625hf, -0.37646484375hf, 0.0384521484375hf, 0.048797607421875hf), + f16vec4(0.12744140625hf, 0.206787109375hf, -0.166259765625hf, 0.01137542724609375hf)); +const f16mat4 w2_27 = f16mat4( + f16vec4(-0.1273193359375hf, 0.037994384765625hf, 0.2447509765625hf, -0.76025390625hf), + f16vec4(-0.09002685546875hf, -0.478515625hf, -0.043365478515625hf, -0.1492919921875hf), + f16vec4(0.1124267578125hf, -0.007350921630859375hf, -0.275146484375hf, 0.071044921875hf), + f16vec4(0.0400390625hf, 0.1751708984375hf, -0.057769775390625hf, 0.058013916015625hf)); +const f16mat4 w2_28 = f16mat4( + f16vec4(-0.1651611328125hf, 0.035125732421875hf, 0.260009765625hf, -0.432373046875hf), + f16vec4(-0.1422119140625hf, -0.18701171875hf, -0.023406982421875hf, -0.0003681182861328125hf), + f16vec4(0.09466552734375hf, 0.047271728515625hf, -0.29736328125hf, 0.1007080078125hf), + f16vec4(-0.01320648193359375hf, 0.2626953125hf, -0.0252532958984375hf, 0.1475830078125hf)); +const f16mat4 w2_29 = f16mat4( + f16vec4(0.003246307373046875hf, 0.039031982421875hf, 0.2041015625hf, -0.4482421875hf), + f16vec4(-0.051513671875hf, -0.369384765625hf, -0.03692626953125hf, -0.272705078125hf), + f16vec4(0.1558837890625hf, 0.127197265625hf, -0.362548828125hf, 0.023712158203125hf), + f16vec4(0.2047119140625hf, 0.244384765625hf, -0.041656494140625hf, 0.1650390625hf)); +const f16mat4 w2_30 = f16mat4( + f16vec4(-0.11767578125hf, 0.273193359375hf, 0.1456298828125hf, -0.60205078125hf), + f16vec4(-0.047607421875hf, -0.37158203125hf, -0.056915283203125hf, -0.26904296875hf), + f16vec4(0.0011129379272460938hf, -0.04217529296875hf, -0.055694580078125hf, -0.04315185546875hf), + f16vec4(0.018463134765625hf, 0.12103271484375hf, 0.036590576171875hf, -0.091796875hf)); +const f16mat4 w2_31 = f16mat4( + f16vec4(-0.1790771484375hf, 0.261962890625hf, 0.1461181640625hf, -0.372314453125hf), + f16vec4(-0.05450439453125hf, -0.16845703125hf, -0.07098388671875hf, -0.09832763671875hf), + f16vec4(0.050537109375hf, -0.03179931640625hf, -0.0139923095703125hf, -0.0195159912109375hf), + f16vec4(-0.058013916015625hf, 0.1390380859375hf, 0.103759765625hf, 0.0149688720703125hf)); +const f16mat4 w2_32 = f16mat4( + f16vec4(-0.06719970703125hf, 0.2469482421875hf, 0.0672607421875hf, -0.381591796875hf), + f16vec4(0.03546142578125hf, -0.447021484375hf, -0.0843505859375hf, -0.1392822265625hf), + f16vec4(0.05194091796875hf, 0.0193023681640625hf, -0.07379150390625hf, 0.08270263671875hf), + f16vec4(0.1968994140625hf, 0.1922607421875hf, 0.139892578125hf, 0.1220703125hf)); +const f16mat4 w2_33 = f16mat4( + f16vec4(0.002819061279296875hf, 0.05047607421875hf, 0.2177734375hf, -0.432373046875hf), + f16vec4(-0.21142578125hf, -0.6669921875hf, 0.08209228515625hf, -0.09515380859375hf), + f16vec4(-0.06646728515625hf, 0.08929443359375hf, -0.324462890625hf, 0.037933349609375hf), + f16vec4(0.080078125hf, -0.04071044921875hf, -0.11773681640625hf, -0.07159423828125hf)); +const f16mat4 w2_34 = f16mat4( + f16vec4(-0.165283203125hf, 0.02099609375hf, 0.164306640625hf, -0.313232421875hf), + f16vec4(-0.248291015625hf, -0.440185546875hf, 0.0859375hf, -0.101318359375hf), + f16vec4(0.032989501953125hf, 0.0836181640625hf, -0.2578125hf, -0.092041015625hf), + f16vec4(0.0604248046875hf, -0.0070343017578125hf, -0.0709228515625hf, -0.1046142578125hf)); +const f16mat4 w2_35 = f16mat4( + f16vec4(-0.10186767578125hf, -0.01415252685546875hf, 0.10955810546875hf, -0.47216796875hf), + f16vec4(-0.144287109375hf, -0.69921875hf, 0.0259246826171875hf, -0.162841796875hf), + f16vec4(0.0809326171875hf, 0.1402587890625hf, -0.2421875hf, -0.025299072265625hf), + f16vec4(0.279541015625hf, 0.0479736328125hf, -0.02197265625hf, 0.072998046875hf)); +const f16vec4 sub2 = f16vec4(-4.2265625hf, -0.83447265625hf, -2.34765625hf, -1.6376953125hf); +const f16vec4 mul2 = f16vec4(0.2484130859375hf, 0.415771484375hf, 0.3251953125hf, 0.55810546875hf); +const f16vec4 add2 = f16vec4(0.057342529296875hf, -0.372802734375hf, -0.1763916015625hf, -0.06488037109375hf); + +const f16mat4 w3_0 = f16mat4( + f16vec4(-0.1553955078125hf, -0.033905029296875hf, 0.1793212890625hf, 0.0224151611328125hf), + f16vec4(-0.279052734375hf, -0.09326171875hf, 0.09930419921875hf, -0.56982421875hf), + f16vec4(-0.10479736328125hf, -0.1424560546875hf, 0.254150390625hf, 0.061279296875hf), + f16vec4(0.0310516357421875hf, -0.08795166015625hf, 0.11407470703125hf, 0.07843017578125hf)); +const f16mat4 w3_1 = f16mat4( + f16vec4(-0.1142578125hf, 0.07940673828125hf, 0.1846923828125hf, -0.09674072265625hf), + f16vec4(-0.1778564453125hf, -0.08721923828125hf, 0.1585693359375hf, -0.226318359375hf), + f16vec4(-0.00428009033203125hf, -0.08551025390625hf, 0.252685546875hf, -0.0513916015625hf), + f16vec4(0.2398681640625hf, -0.06317138671875hf, 0.1351318359375hf, -0.0863037109375hf)); +const f16mat4 w3_2 = f16mat4( + f16vec4(-0.18505859375hf, -0.037506103515625hf, -0.01137542724609375hf, -0.00904083251953125hf), + f16vec4(-0.1649169921875hf, -0.18994140625hf, 0.1168212890625hf, -0.479736328125hf), + f16vec4(-0.10919189453125hf, -0.0828857421875hf, 0.348388671875hf, 0.25048828125hf), + f16vec4(0.08941650390625hf, -0.046844482421875hf, 0.17138671875hf, 0.027099609375hf)); +const f16mat4 w3_3 = f16mat4( + f16vec4(-0.10968017578125hf, 0.07061767578125hf, 0.09783935546875hf, -0.1165771484375hf), + f16vec4(-0.2337646484375hf, -0.089111328125hf, 0.11090087890625hf, -0.1968994140625hf), + f16vec4(-0.04400634765625hf, -0.048065185546875hf, 0.152587890625hf, 0.08807373046875hf), + f16vec4(0.10394287109375hf, -0.01288604736328125hf, 0.209716796875hf, -0.01190185546875hf)); +const f16mat4 w3_4 = f16mat4( + f16vec4(-0.046051025390625hf, 0.1549072265625hf, 0.063232421875hf, -0.2066650390625hf), + f16vec4(-0.1585693359375hf, 0.0038280487060546875hf, 0.125732421875hf, -0.06524658203125hf), + f16vec4(0.09600830078125hf, -0.016143798828125hf, 0.1318359375hf, -0.0655517578125hf), + f16vec4(0.2529296875hf, -0.00768280029296875hf, 0.20263671875hf, -0.1619873046875hf)); +const f16mat4 w3_5 = f16mat4( + f16vec4(-0.13623046875hf, 0.03460693359375hf, -0.08428955078125hf, -0.125hf), + f16vec4(-0.200927734375hf, -0.06719970703125hf, 0.173828125hf, -0.1500244140625hf), + f16vec4(-0.048614501953125hf, -0.0139007568359375hf, 0.2470703125hf, 0.08538818359375hf), + f16vec4(0.141845703125hf, 0.0120849609375hf, 0.2161865234375hf, -0.057708740234375hf)); +const f16mat4 w3_6 = f16mat4( + f16vec4(-0.3408203125hf, 0.0784912109375hf, 0.046112060546875hf, 0.03778076171875hf), + f16vec4(-0.319091796875hf, -0.1697998046875hf, 0.2088623046875hf, -0.27587890625hf), + f16vec4(-0.151123046875hf, -0.0208892822265625hf, 0.1181640625hf, 0.04949951171875hf), + f16vec4(0.049713134765625hf, -0.07440185546875hf, 0.11199951171875hf, 0.08270263671875hf)); +const f16mat4 w3_7 = f16mat4( + f16vec4(-0.2568359375hf, 0.2000732421875hf, 0.041839599609375hf, -0.07489013671875hf), + f16vec4(-0.27294921875hf, -0.054901123046875hf, 0.2069091796875hf, -0.228271484375hf), + f16vec4(-0.01303863525390625hf, -0.0130462646484375hf, 0.158935546875hf, 0.044403076171875hf), + f16vec4(0.1885986328125hf, -0.0623779296875hf, 0.1640625hf, -0.1429443359375hf)); +const f16mat4 w3_8 = f16mat4( + f16vec4(-0.346923828125hf, 0.08148193359375hf, -0.07220458984375hf, 0.043365478515625hf), + f16vec4(-0.36669921875hf, -0.0447998046875hf, 0.1800537109375hf, -0.51806640625hf), + f16vec4(-0.1551513671875hf, -0.0364990234375hf, 0.264892578125hf, 0.259521484375hf), + f16vec4(0.04156494140625hf, -0.041168212890625hf, 0.18115234375hf, 0.0085601806640625hf)); +const f16mat4 w3_9 = f16mat4( + f16vec4(0.00270843505859375hf, 0.017913818359375hf, -0.11151123046875hf, 0.27685546875hf), + f16vec4(-0.309814453125hf, 0.027130126953125hf, 0.078857421875hf, -0.390380859375hf), + f16vec4(0.285400390625hf, 0.428955078125hf, -0.063720703125hf, -0.228759765625hf), + f16vec4(-0.11993408203125hf, -0.125244140625hf, -0.00252532958984375hf, -0.0809326171875hf)); +const f16mat4 w3_10 = f16mat4( + f16vec4(0.07464599609375hf, 0.046600341796875hf, -0.041900634765625hf, 0.08154296875hf), + f16vec4(-0.280029296875hf, 0.08514404296875hf, 0.0960693359375hf, -0.269287109375hf), + f16vec4(0.11309814453125hf, 0.2734375hf, 0.049560546875hf, -0.07672119140625hf), + f16vec4(0.052734375hf, -0.032562255859375hf, -0.1102294921875hf, -0.158447265625hf)); +const f16mat4 w3_11 = f16mat4( + f16vec4(-0.054962158203125hf, 0.08856201171875hf, -0.187255859375hf, 0.2220458984375hf), + f16vec4(-0.373046875hf, -0.046905517578125hf, 0.1065673828125hf, -0.1080322265625hf), + f16vec4(0.294921875hf, 0.30517578125hf, -0.1260986328125hf, -0.0811767578125hf), + f16vec4(-0.11767578125hf, -0.12408447265625hf, -0.06549072265625hf, -0.10687255859375hf)); +const f16mat4 w3_12 = f16mat4( + f16vec4(0.0248870849609375hf, 0.15625hf, -0.04864501953125hf, 0.05816650390625hf), + f16vec4(-0.1595458984375hf, 0.08123779296875hf, 0.1265869140625hf, -0.32080078125hf), + f16vec4(0.287841796875hf, 0.360107421875hf, -0.020599365234375hf, -0.217529296875hf), + f16vec4(-0.035675048828125hf, -0.007061004638671875hf, 0.0224151611328125hf, -0.1912841796875hf)); +const f16mat4 w3_13 = f16mat4( + f16vec4(0.0758056640625hf, 0.158447265625hf, 0.056549072265625hf, -0.158447265625hf), + f16vec4(-0.1112060546875hf, 0.1597900390625hf, 0.180908203125hf, -0.3505859375hf), + f16vec4(0.1365966796875hf, 0.1966552734375hf, 0.081787109375hf, -0.0391845703125hf), + f16vec4(0.1307373046875hf, 0.0826416015625hf, -0.0157470703125hf, -0.173095703125hf)); +const f16mat4 w3_14 = f16mat4( + f16vec4(-0.0210418701171875hf, 0.1920166015625hf, -0.085693359375hf, -0.0679931640625hf), + f16vec4(-0.126953125hf, 0.05035400390625hf, 0.177978515625hf, -0.1744384765625hf), + f16vec4(0.3388671875hf, 0.254638671875hf, -0.0933837890625hf, -0.173828125hf), + f16vec4(-0.0209503173828125hf, -0.007808685302734375hf, -0.0086822509765625hf, -0.12457275390625hf)); +const f16mat4 w3_15 = f16mat4( + f16vec4(-0.0244140625hf, 0.0260467529296875hf, -0.08636474609375hf, 0.2314453125hf), + f16vec4(-0.2410888671875hf, 0.00673675537109375hf, 0.01192474365234375hf, -0.462158203125hf), + f16vec4(0.232666015625hf, 0.314453125hf, -0.05450439453125hf, -0.1507568359375hf), + f16vec4(-0.1329345703125hf, -0.11700439453125hf, -0.11163330078125hf, -0.04864501953125hf)); +const f16mat4 w3_16 = f16mat4( + f16vec4(0.050323486328125hf, 0.032135009765625hf, 0.0282135009765625hf, -0.007022857666015625hf), + f16vec4(-0.186767578125hf, 0.06939697265625hf, 0.05126953125hf, -0.177001953125hf), + f16vec4(0.053253173828125hf, 0.1947021484375hf, 0.0113525390625hf, -0.0029811859130859375hf), + f16vec4(0.050994873046875hf, -0.0189056396484375hf, -0.1746826171875hf, -0.11346435546875hf)); +const f16mat4 w3_17 = f16mat4( + f16vec4(-0.03399658203125hf, 0.047119140625hf, -0.09552001953125hf, 0.12384033203125hf), + f16vec4(-0.20361328125hf, 0.012359619140625hf, 0.05914306640625hf, -0.1571044921875hf), + f16vec4(0.26416015625hf, 0.2626953125hf, -0.1534423828125hf, -0.0902099609375hf), + f16vec4(-0.0814208984375hf, -0.134521484375hf, -0.1546630859375hf, -0.04248046875hf)); +const f16mat4 w3_18 = f16mat4( + f16vec4(0.0203704833984375hf, 0.10479736328125hf, 0.348388671875hf, -0.32421875hf), + f16vec4(-0.00714874267578125hf, -0.157958984375hf, -0.1724853515625hf, 0.039794921875hf), + f16vec4(0.049560546875hf, 0.055206298828125hf, -0.14697265625hf, -0.595703125hf), + f16vec4(-0.1629638671875hf, -0.31640625hf, 0.2296142578125hf, -0.260009765625hf)); +const f16mat4 w3_19 = f16mat4( + f16vec4(-0.00814056396484375hf, 0.12371826171875hf, 0.324951171875hf, -0.326171875hf), + f16vec4(0.032562255859375hf, -0.061798095703125hf, -0.1600341796875hf, -0.1700439453125hf), + f16vec4(0.09649658203125hf, 0.071533203125hf, -0.014801025390625hf, -0.2174072265625hf), + f16vec4(-0.1463623046875hf, -0.274169921875hf, 0.1546630859375hf, -0.1251220703125hf)); +const f16mat4 w3_20 = f16mat4( + f16vec4(-0.0794677734375hf, 0.00926971435546875hf, 0.2059326171875hf, -0.1097412109375hf), + f16vec4(-0.150146484375hf, -0.0802001953125hf, -0.14013671875hf, -0.0859375hf), + f16vec4(0.12261962890625hf, -0.1302490234375hf, -0.2060546875hf, -0.481201171875hf), + f16vec4(-0.1854248046875hf, -0.3330078125hf, 0.1561279296875hf, -0.0985107421875hf)); +const f16mat4 w3_21 = f16mat4( + f16vec4(0.01293182373046875hf, 0.04254150390625hf, 0.277099609375hf, -0.28125hf), + f16vec4(0.03656005859375hf, -0.07220458984375hf, -0.0631103515625hf, -0.18115234375hf), + f16vec4(-0.04034423828125hf, 0.1279296875hf, -0.12158203125hf, -0.395263671875hf), + f16vec4(-0.112060546875hf, -0.21484375hf, 0.278564453125hf, -0.305908203125hf)); +const f16mat4 w3_22 = f16mat4( + f16vec4(0.033966064453125hf, 0.119140625hf, 0.275390625hf, -0.2474365234375hf), + f16vec4(0.1153564453125hf, -0.0205078125hf, -0.05877685546875hf, -0.387451171875hf), + f16vec4(0.0032329559326171875hf, 0.189453125hf, 0.0266876220703125hf, -0.00347900390625hf), + f16vec4(-0.0643310546875hf, -0.178955078125hf, 0.220703125hf, -0.236083984375hf)); +const f16mat4 w3_23 = f16mat4( + f16vec4(-0.0172576904296875hf, 0.04144287109375hf, 0.2156982421875hf, -0.0823974609375hf), + f16vec4(-0.00959014892578125hf, -0.04559326171875hf, 0.0081634521484375hf, -0.271240234375hf), + f16vec4(-0.006458282470703125hf, 0.041290283203125hf, -0.11810302734375hf, -0.239501953125hf), + f16vec4(-0.11865234375hf, -0.232666015625hf, 0.24267578125hf, -0.2379150390625hf)); +const f16mat4 w3_24 = f16mat4( + f16vec4(-0.091064453125hf, -0.048126220703125hf, 0.287353515625hf, -0.34130859375hf), + f16vec4(-0.12384033203125hf, -0.100830078125hf, -0.1378173828125hf, 0.00905609130859375hf), + f16vec4(0.0447998046875hf, 0.0210723876953125hf, -0.165283203125hf, -0.75634765625hf), + f16vec4(-0.1292724609375hf, -0.435302734375hf, 0.264404296875hf, -0.259033203125hf)); +const f16mat4 w3_25 = f16mat4( + f16vec4(-0.04022216796875hf, 0.06243896484375hf, 0.2303466796875hf, -0.35693359375hf), + f16vec4(-0.009979248046875hf, -0.0574951171875hf, -0.09246826171875hf, -0.1514892578125hf), + f16vec4(0.0014123916625976562hf, 0.1201171875hf, -0.0019254684448242188hf, -0.3466796875hf), + f16vec4(-0.1134033203125hf, -0.46142578125hf, 0.230712890625hf, -0.1883544921875hf)); +const f16mat4 w3_26 = f16mat4( + f16vec4(-0.04010009765625hf, 0.04559326171875hf, 0.1282958984375hf, -0.1708984375hf), + f16vec4(-0.1080322265625hf, -0.1622314453125hf, -0.039306640625hf, 0.0035915374755859375hf), + f16vec4(-0.041748046875hf, 0.00295257568359375hf, -0.168212890625hf, -0.53369140625hf), + f16vec4(-0.103759765625hf, -0.52490234375hf, 0.22265625hf, -0.1868896484375hf)); +const f16mat4 w3_27 = f16mat4( + f16vec4(-0.12109375hf, 0.08819580078125hf, 0.459716796875hf, 0.03729248046875hf), + f16vec4(0.033203125hf, -0.1221923828125hf, 0.281005859375hf, -0.408935546875hf), + f16vec4(-0.07318115234375hf, -0.42578125hf, 0.0743408203125hf, -0.261474609375hf), + f16vec4(0.69384765625hf, 0.26220703125hf, -0.2381591796875hf, 0.169921875hf)); +const f16mat4 w3_28 = f16mat4( + f16vec4(-0.10089111328125hf, 0.04827880859375hf, 0.37255859375hf, -0.04754638671875hf), + f16vec4(0.037322998046875hf, -0.018310546875hf, 0.225341796875hf, -0.40234375hf), + f16vec4(-0.0474853515625hf, -0.477783203125hf, 0.053466796875hf, -0.18408203125hf), + f16vec4(0.56982421875hf, 0.1944580078125hf, -0.1795654296875hf, 0.056884765625hf)); +const f16mat4 w3_29 = f16mat4( + f16vec4(-0.07452392578125hf, 0.062469482421875hf, 0.39208984375hf, -0.0711669921875hf), + f16vec4(0.1700439453125hf, -0.084228515625hf, 0.2646484375hf, -0.475341796875hf), + f16vec4(-0.1832275390625hf, -0.34130859375hf, -0.07421875hf, -0.153564453125hf), + f16vec4(0.47705078125hf, 0.215576171875hf, -0.208251953125hf, 0.1942138671875hf)); +const f16mat4 w3_30 = f16mat4( + f16vec4(-0.07012939453125hf, 0.1202392578125hf, 0.375hf, -0.176513671875hf), + f16vec4(0.006557464599609375hf, -0.133056640625hf, 0.25537109375hf, -0.1510009765625hf), + f16vec4(-0.122314453125hf, -0.1319580078125hf, 0.05120849609375hf, -0.131591796875hf), + f16vec4(0.267578125hf, 0.252197265625hf, -0.2139892578125hf, 0.2076416015625hf)); +const f16mat4 w3_31 = f16mat4( + f16vec4(-0.0672607421875hf, 0.06854248046875hf, 0.345703125hf, -0.1898193359375hf), + f16vec4(-0.00791168212890625hf, -0.07598876953125hf, 0.20654296875hf, -0.00373077392578125hf), + f16vec4(-0.07891845703125hf, -0.22314453125hf, -0.022003173828125hf, -0.024749755859375hf), + f16vec4(0.296630859375hf, 0.1707763671875hf, -0.1917724609375hf, 0.1273193359375hf)); +const f16mat4 w3_32 = f16mat4( + f16vec4(-0.07012939453125hf, 0.061126708984375hf, 0.40771484375hf, -0.09033203125hf), + f16vec4(0.050201416015625hf, -0.14208984375hf, 0.322021484375hf, -0.12127685546875hf), + f16vec4(-0.185791015625hf, -0.1759033203125hf, -0.0743408203125hf, -0.06085205078125hf), + f16vec4(0.2626953125hf, 0.235107421875hf, -0.197998046875hf, 0.2420654296875hf)); +const f16mat4 w3_33 = f16mat4( + f16vec4(-0.0751953125hf, 0.036956787109375hf, 0.26123046875hf, -0.1834716796875hf), + f16vec4(0.07489013671875hf, -0.1363525390625hf, 0.291015625hf, -0.5322265625hf), + f16vec4(-0.190673828125hf, -0.062164306640625hf, 0.15478515625hf, -0.257568359375hf), + f16vec4(0.391357421875hf, 0.31201171875hf, -0.1849365234375hf, 0.08062744140625hf)); +const f16mat4 w3_34 = f16mat4( + f16vec4(-0.09521484375hf, 0.0194854736328125hf, 0.2108154296875hf, -0.18603515625hf), + f16vec4(0.014404296875hf, -0.09722900390625hf, 0.2222900390625hf, -0.393310546875hf), + f16vec4(-0.1473388671875hf, -0.186279296875hf, 0.12451171875hf, -0.2103271484375hf), + f16vec4(0.377197265625hf, 0.25439453125hf, -0.17919921875hf, -0.01012420654296875hf)); +const f16mat4 w3_35 = f16mat4( + f16vec4(-0.1331787109375hf, 0.0217132568359375hf, 0.28759765625hf, -0.0304412841796875hf), + f16vec4(-0.001758575439453125hf, -0.26708984375hf, 0.33154296875hf, -0.3173828125hf), + f16vec4(-0.2420654296875hf, -0.1978759765625hf, 0.0225067138671875hf, -0.2548828125hf), + f16vec4(0.22802734375hf, 0.327880859375hf, -0.2200927734375hf, 0.1466064453125hf)); +const f16vec4 sub3 = f16vec4(-0.748046875hf, -0.45361328125hf, 2.2578125hf, -5.984375hf); +const f16vec4 mul3 = f16vec4(0.365234375hf, 0.385986328125hf, 0.52197265625hf, 0.293701171875hf); +const f16vec4 add3 = f16vec4(-0.294921875hf, -0.353759765625hf, 1.9140625hf, 0.0504150390625hf); + +void main() +{ + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 ext = imageSize(dstA); + if (p.x >= ext.x || p.y >= ext.y) + return; + + f16vec4 t0 = padTap(srcA, p + ivec2(-1, -1)); + f16vec4 t1 = padTap(srcA, p + ivec2(-1, 0)); + f16vec4 t2 = padTap(srcA, p + ivec2(-1, 1)); + f16vec4 t3 = padTap(srcA, p + ivec2(0, -1)); + f16vec4 t4 = f16vec4(texelFetch(srcA, p, 0)); + f16vec4 t5 = padTap(srcA, p + ivec2(0, 1)); + f16vec4 t6 = padTap(srcA, p + ivec2(1, -1)); + f16vec4 t7 = padTap(srcA, p + ivec2(1, 0)); + f16vec4 t8 = padTap(srcA, p + ivec2(1, 1)); + f16vec4 t9 = padTap(srcB, p + ivec2(-1, -1)); + f16vec4 t10 = padTap(srcB, p + ivec2(-1, 0)); + f16vec4 t11 = padTap(srcB, p + ivec2(-1, 1)); + f16vec4 t12 = padTap(srcB, p + ivec2(0, -1)); + f16vec4 t13 = f16vec4(texelFetch(srcB, p, 0)); + f16vec4 t14 = padTap(srcB, p + ivec2(0, 1)); + f16vec4 t15 = padTap(srcB, p + ivec2(1, -1)); + f16vec4 t16 = padTap(srcB, p + ivec2(1, 0)); + f16vec4 t17 = padTap(srcB, p + ivec2(1, 1)); + f16vec4 t18 = padTap(srcC, p + ivec2(-1, -1)); + f16vec4 t19 = padTap(srcC, p + ivec2(-1, 0)); + f16vec4 t20 = padTap(srcC, p + ivec2(-1, 1)); + f16vec4 t21 = padTap(srcC, p + ivec2(0, -1)); + f16vec4 t22 = f16vec4(texelFetch(srcC, p, 0)); + f16vec4 t23 = padTap(srcC, p + ivec2(0, 1)); + f16vec4 t24 = padTap(srcC, p + ivec2(1, -1)); + f16vec4 t25 = padTap(srcC, p + ivec2(1, 0)); + f16vec4 t26 = padTap(srcC, p + ivec2(1, 1)); + f16vec4 t27 = padTap(srcD, p + ivec2(-1, -1)); + f16vec4 t28 = padTap(srcD, p + ivec2(-1, 0)); + f16vec4 t29 = padTap(srcD, p + ivec2(-1, 1)); + f16vec4 t30 = padTap(srcD, p + ivec2(0, -1)); + f16vec4 t31 = f16vec4(texelFetch(srcD, p, 0)); + f16vec4 t32 = padTap(srcD, p + ivec2(0, 1)); + f16vec4 t33 = padTap(srcD, p + ivec2(1, -1)); + f16vec4 t34 = padTap(srcD, p + ivec2(1, 0)); + f16vec4 t35 = padTap(srcD, p + ivec2(1, 1)); + + f16vec4 r0 = w0_0 * t0; + r0 += w0_1 * t1; + r0 += w0_2 * t2; + r0 += w0_3 * t3; + r0 += w0_4 * t4; + r0 += w0_5 * t5; + r0 += w0_6 * t6; + r0 += w0_7 * t7; + r0 += w0_8 * t8; + r0 += w0_9 * t9; + r0 += w0_10 * t10; + r0 += w0_11 * t11; + r0 += w0_12 * t12; + r0 += w0_13 * t13; + r0 += w0_14 * t14; + r0 += w0_15 * t15; + r0 += w0_16 * t16; + r0 += w0_17 * t17; + r0 += w0_18 * t18; + r0 += w0_19 * t19; + r0 += w0_20 * t20; + r0 += w0_21 * t21; + r0 += w0_22 * t22; + r0 += w0_23 * t23; + r0 += w0_24 * t24; + r0 += w0_25 * t25; + r0 += w0_26 * t26; + r0 += w0_27 * t27; + r0 += w0_28 * t28; + r0 += w0_29 * t29; + r0 += w0_30 * t30; + r0 += w0_31 * t31; + r0 += w0_32 * t32; + r0 += w0_33 * t33; + r0 += w0_34 * t34; + r0 += w0_35 * t35; + r0 = (r0 - sub0) * mul0 + add0; + imageStore(dstA, p, vec4(r0)); + + f16vec4 r1 = w1_0 * t0; + r1 += w1_1 * t1; + r1 += w1_2 * t2; + r1 += w1_3 * t3; + r1 += w1_4 * t4; + r1 += w1_5 * t5; + r1 += w1_6 * t6; + r1 += w1_7 * t7; + r1 += w1_8 * t8; + r1 += w1_9 * t9; + r1 += w1_10 * t10; + r1 += w1_11 * t11; + r1 += w1_12 * t12; + r1 += w1_13 * t13; + r1 += w1_14 * t14; + r1 += w1_15 * t15; + r1 += w1_16 * t16; + r1 += w1_17 * t17; + r1 += w1_18 * t18; + r1 += w1_19 * t19; + r1 += w1_20 * t20; + r1 += w1_21 * t21; + r1 += w1_22 * t22; + r1 += w1_23 * t23; + r1 += w1_24 * t24; + r1 += w1_25 * t25; + r1 += w1_26 * t26; + r1 += w1_27 * t27; + r1 += w1_28 * t28; + r1 += w1_29 * t29; + r1 += w1_30 * t30; + r1 += w1_31 * t31; + r1 += w1_32 * t32; + r1 += w1_33 * t33; + r1 += w1_34 * t34; + r1 += w1_35 * t35; + r1 = (r1 - sub1) * mul1 + add1; + imageStore(dstB, p, vec4(r1)); + + f16vec4 r2 = w2_0 * t0; + r2 += w2_1 * t1; + r2 += w2_2 * t2; + r2 += w2_3 * t3; + r2 += w2_4 * t4; + r2 += w2_5 * t5; + r2 += w2_6 * t6; + r2 += w2_7 * t7; + r2 += w2_8 * t8; + r2 += w2_9 * t9; + r2 += w2_10 * t10; + r2 += w2_11 * t11; + r2 += w2_12 * t12; + r2 += w2_13 * t13; + r2 += w2_14 * t14; + r2 += w2_15 * t15; + r2 += w2_16 * t16; + r2 += w2_17 * t17; + r2 += w2_18 * t18; + r2 += w2_19 * t19; + r2 += w2_20 * t20; + r2 += w2_21 * t21; + r2 += w2_22 * t22; + r2 += w2_23 * t23; + r2 += w2_24 * t24; + r2 += w2_25 * t25; + r2 += w2_26 * t26; + r2 += w2_27 * t27; + r2 += w2_28 * t28; + r2 += w2_29 * t29; + r2 += w2_30 * t30; + r2 += w2_31 * t31; + r2 += w2_32 * t32; + r2 += w2_33 * t33; + r2 += w2_34 * t34; + r2 += w2_35 * t35; + r2 = (r2 - sub2) * mul2 + add2; + imageStore(dstC, p, vec4(r2)); + + f16vec4 r3 = w3_0 * t0; + r3 += w3_1 * t1; + r3 += w3_2 * t2; + r3 += w3_3 * t3; + r3 += w3_4 * t4; + r3 += w3_5 * t5; + r3 += w3_6 * t6; + r3 += w3_7 * t7; + r3 += w3_8 * t8; + r3 += w3_9 * t9; + r3 += w3_10 * t10; + r3 += w3_11 * t11; + r3 += w3_12 * t12; + r3 += w3_13 * t13; + r3 += w3_14 * t14; + r3 += w3_15 * t15; + r3 += w3_16 * t16; + r3 += w3_17 * t17; + r3 += w3_18 * t18; + r3 += w3_19 * t19; + r3 += w3_20 * t20; + r3 += w3_21 * t21; + r3 += w3_22 * t22; + r3 += w3_23 * t23; + r3 += w3_24 * t24; + r3 += w3_25 * t25; + r3 += w3_26 * t26; + r3 += w3_27 * t27; + r3 += w3_28 * t28; + r3 += w3_29 * t29; + r3 += w3_30 * t30; + r3 += w3_31 * t31; + r3 += w3_32 * t32; + r3 += w3_33 * t33; + r3 += w3_34 * t34; + r3 += w3_35 * t35; + r3 = (r3 - sub3) * mul3 + add3; + imageStore(dstD, p, vec4(r3)); + +} diff --git a/cleanroom/glsl/shader_47.comp b/cleanroom/glsl/shader_47.comp new file mode 100644 index 0000000..96a0f05 --- /dev/null +++ b/cleanroom/glsl/shader_47.comp @@ -0,0 +1,964 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_47: 3x3 stride-1 conv, 16->16 channels, zero-padded texelFetch + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcA; +layout(set = 0, binding = 33) uniform sampler2D srcB; +layout(set = 0, binding = 34) uniform sampler2D srcC; +layout(set = 0, binding = 35) uniform sampler2D srcD; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstA; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstB; +layout(set = 0, binding = 50, rgba8) uniform writeonly image2D dstC; +layout(set = 0, binding = 51, rgba8) uniform writeonly image2D dstD; + +// zero-padded fetch for non-center taps +f16vec4 padTap(sampler2D img, ivec2 c) +{ + bool inb = c.x >= 0 && c.y >= 0; + if (inb) { + ivec2 sz = textureSize(img, 0); + inb = c.x < sz.x && c.y < sz.y; + } + return inb ? f16vec4(texelFetch(img, c, 0)) : f16vec4(0.0hf); +} + +const f16mat4 w0_0 = f16mat4( + f16vec4(0.0870361328125hf, -0.281494140625hf, 0.08905029296875hf, -0.17919921875hf), + f16vec4(-0.11309814453125hf, -0.1065673828125hf, 0.23828125hf, -0.0124664306640625hf), + f16vec4(-0.09271240234375hf, 0.357177734375hf, 0.03509521484375hf, -0.2978515625hf), + f16vec4(0.18359375hf, 0.462890625hf, -0.1851806640625hf, -0.02301025390625hf)); +const f16mat4 w0_1 = f16mat4( + f16vec4(0.0222625732421875hf, -0.080078125hf, 0.03326416015625hf, -0.150390625hf), + f16vec4(-0.046417236328125hf, -0.0213623046875hf, 0.23876953125hf, -0.01036834716796875hf), + f16vec4(0.0204620361328125hf, 0.10943603515625hf, 0.004474639892578125hf, -0.2198486328125hf), + f16vec4(0.1368408203125hf, 0.46875hf, -0.0860595703125hf, -0.043548583984375hf)); +const f16mat4 w0_2 = f16mat4( + f16vec4(0.06658935546875hf, -0.24658203125hf, 0.128662109375hf, -0.178955078125hf), + f16vec4(-0.05120849609375hf, 0.0279541015625hf, 0.1636962890625hf, 0.035614013671875hf), + f16vec4(-0.06561279296875hf, 0.61279296875hf, -0.039642333984375hf, -0.1693115234375hf), + f16vec4(0.091796875hf, 0.48583984375hf, -0.046356201171875hf, -0.00519561767578125hf)); +const f16mat4 w0_3 = f16mat4( + f16vec4(0.1956787109375hf, -0.1875hf, -0.0164642333984375hf, -0.191650390625hf), + f16vec4(-0.008453369140625hf, 0.0751953125hf, 0.194091796875hf, -0.0168304443359375hf), + f16vec4(-0.0849609375hf, 0.01477813720703125hf, 0.07257080078125hf, -0.21728515625hf), + f16vec4(0.10498046875hf, 0.255859375hf, -0.045379638671875hf, -0.031494140625hf)); +const f16mat4 w0_4 = f16mat4( + f16vec4(0.0869140625hf, -0.050140380859375hf, -0.006145477294921875hf, -0.1900634765625hf), + f16vec4(0.0614013671875hf, 0.10467529296875hf, 0.2379150390625hf, 0.01953125hf), + f16vec4(0.0897216796875hf, -0.054351806640625hf, 0.06878662109375hf, -0.1419677734375hf), + f16vec4(0.09765625hf, 0.334716796875hf, 0.0031223297119140625hf, -0.043487548828125hf)); +const f16mat4 w0_5 = f16mat4( + f16vec4(0.093994140625hf, -0.299072265625hf, 0.0897216796875hf, -0.2203369140625hf), + f16vec4(0.0350341796875hf, 0.0986328125hf, 0.1959228515625hf, 0.0533447265625hf), + f16vec4(0.08306884765625hf, 0.1949462890625hf, 0.04034423828125hf, -0.107177734375hf), + f16vec4(0.1243896484375hf, 0.4033203125hf, -0.0281982421875hf, 0.010589599609375hf)); +const f16mat4 w0_6 = f16mat4( + f16vec4(0.06646728515625hf, -0.26513671875hf, 0.060760498046875hf, -0.21044921875hf), + f16vec4(-0.062469482421875hf, 0.060089111328125hf, 0.12744140625hf, -0.007083892822265625hf), + f16vec4(-0.1910400390625hf, 0.49560546875hf, -0.0167236328125hf, -0.235107421875hf), + f16vec4(-0.02130126953125hf, 0.170166015625hf, -0.083251953125hf, -0.0032367706298828125hf)); +const f16mat4 w0_7 = f16mat4( + f16vec4(-0.0726318359375hf, -0.20849609375hf, 0.08087158203125hf, -0.1934814453125hf), + f16vec4(-0.011322021484375hf, 0.0203704833984375hf, 0.1844482421875hf, -0.0018529891967773438hf), + f16vec4(0.00627899169921875hf, 0.2320556640625hf, 0.0299072265625hf, -0.1865234375hf), + f16vec4(0.0174713134765625hf, 0.29638671875hf, -0.0855712890625hf, -0.00177764892578125hf)); +const f16mat4 w0_8 = f16mat4( + f16vec4(-0.09307861328125hf, -0.50634765625hf, 0.2347412109375hf, -0.20556640625hf), + f16vec4(-0.06805419921875hf, -0.027435302734375hf, 0.15234375hf, 0.034149169921875hf), + f16vec4(0.03900146484375hf, 0.483642578125hf, 0.00862884521484375hf, -0.150634765625hf), + f16vec4(0.09283447265625hf, 0.4404296875hf, -0.1826171875hf, 0.06951904296875hf)); +const f16mat4 w0_9 = f16mat4( + f16vec4(-0.1258544921875hf, -0.134521484375hf, -0.0841064453125hf, -0.0277099609375hf), + f16vec4(0.037353515625hf, 0.0982666015625hf, 0.27197265625hf, -0.00881195068359375hf), + f16vec4(-0.10565185546875hf, 0.0491943359375hf, -0.307373046875hf, -0.16845703125hf), + f16vec4(-0.08038330078125hf, -0.08038330078125hf, 0.09820556640625hf, -0.06964111328125hf)); +const f16mat4 w0_10 = f16mat4( + f16vec4(-0.12457275390625hf, -0.11407470703125hf, -0.053497314453125hf, 0.044219970703125hf), + f16vec4(-0.0775146484375hf, 0.11279296875hf, 0.136474609375hf, 0.032257080078125hf), + f16vec4(-0.0242156982421875hf, -0.015899658203125hf, -0.09759521484375hf, -0.1077880859375hf), + f16vec4(-0.0287628173828125hf, -0.067138671875hf, 0.04827880859375hf, -0.040313720703125hf)); +const f16mat4 w0_11 = f16mat4( + f16vec4(-0.1258544921875hf, -0.06640625hf, -0.07257080078125hf, 0.08892822265625hf), + f16vec4(-0.089111328125hf, -0.0046844482421875hf, 0.436279296875hf, 0.04388427734375hf), + f16vec4(-0.113525390625hf, 0.0259552001953125hf, -0.16455078125hf, -0.2120361328125hf), + f16vec4(-0.0789794921875hf, -0.04522705078125hf, 0.10040283203125hf, -0.05987548828125hf)); +const f16mat4 w0_12 = f16mat4( + f16vec4(-0.1231689453125hf, -0.10040283203125hf, 0.0750732421875hf, -0.033294677734375hf), + f16vec4(-0.0810546875hf, 0.053314208984375hf, 0.0819091796875hf, -0.082763671875hf), + f16vec4(-0.1766357421875hf, -0.0738525390625hf, -0.270263671875hf, -0.10205078125hf), + f16vec4(-0.160888671875hf, -0.1314697265625hf, 0.06280517578125hf, -0.1463623046875hf)); +const f16mat4 w0_13 = f16mat4( + f16vec4(-0.10272216796875hf, -0.080322265625hf, 0.09527587890625hf, 0.0499267578125hf), + f16vec4(-0.1474609375hf, 0.0985107421875hf, 0.04248046875hf, -0.05889892578125hf), + f16vec4(-0.08087158203125hf, -0.126220703125hf, -0.058135986328125hf, -0.06201171875hf), + f16vec4(-0.08697509765625hf, -0.1422119140625hf, 0.0364990234375hf, -0.102294921875hf)); +const f16mat4 w0_14 = f16mat4( + f16vec4(-0.08746337890625hf, -0.0310211181640625hf, 0.0916748046875hf, 0.0953369140625hf), + f16vec4(-0.09814453125hf, 0.01129150390625hf, 0.107666015625hf, -0.0164337158203125hf), + f16vec4(-0.1788330078125hf, -0.06927490234375hf, -0.2198486328125hf, -0.1573486328125hf), + f16vec4(-0.1707763671875hf, -0.1102294921875hf, 0.05859375hf, -0.08709716796875hf)); +const f16mat4 w0_15 = f16mat4( + f16vec4(-0.1396484375hf, -0.1641845703125hf, -0.1405029296875hf, -0.00904083251953125hf), + f16vec4(-0.01535797119140625hf, 0.07745361328125hf, 0.374267578125hf, 0.0208282470703125hf), + f16vec4(-0.0863037109375hf, 0.09503173828125hf, -0.1959228515625hf, -0.1546630859375hf), + f16vec4(-0.17333984375hf, 0.0258026123046875hf, 0.040924072265625hf, -0.12005615234375hf)); +const f16mat4 w0_16 = f16mat4( + f16vec4(-0.11883544921875hf, -0.1435546875hf, -0.0999755859375hf, 0.08306884765625hf), + f16vec4(-0.0206451416015625hf, 0.159423828125hf, 0.1829833984375hf, 0.06640625hf), + f16vec4(0.0271148681640625hf, 0.0626220703125hf, -0.0850830078125hf, -0.155029296875hf), + f16vec4(-0.1085205078125hf, -0.0201873779296875hf, 0.06256103515625hf, -0.09149169921875hf)); +const f16mat4 w0_17 = f16mat4( + f16vec4(-0.1009521484375hf, -0.08282470703125hf, -0.10711669921875hf, 0.154541015625hf), + f16vec4(0.06365966796875hf, 0.11279296875hf, 0.331787109375hf, 0.08935546875hf), + f16vec4(-0.049072265625hf, 0.1387939453125hf, -0.357177734375hf, -0.2705078125hf), + f16vec4(-0.1763916015625hf, 0.011962890625hf, 0.08837890625hf, -0.0411376953125hf)); +const f16mat4 w0_18 = f16mat4( + f16vec4(-0.0263214111328125hf, -0.4384765625hf, 0.33154296875hf, -0.1436767578125hf), + f16vec4(-0.09002685546875hf, -0.1658935546875hf, -0.39599609375hf, 0.0257415771484375hf), + f16vec4(0.004917144775390625hf, 0.14697265625hf, -0.1275634765625hf, 0.192138671875hf), + f16vec4(-0.32177734375hf, -0.415283203125hf, 0.124755859375hf, -0.0333251953125hf)); +const f16mat4 w0_19 = f16mat4( + f16vec4(-0.23681640625hf, -0.2449951171875hf, -0.0357666015625hf, -0.09442138671875hf), + f16vec4(-0.1461181640625hf, -0.18212890625hf, -0.339111328125hf, -0.101318359375hf), + f16vec4(0.053863525390625hf, 0.2032470703125hf, -0.07958984375hf, 0.1788330078125hf), + f16vec4(-0.34814453125hf, -0.2374267578125hf, 0.04296875hf, -0.080322265625hf)); +const f16mat4 w0_20 = f16mat4( + f16vec4(-0.0726318359375hf, -0.35888671875hf, 0.0440673828125hf, -0.0667724609375hf), + f16vec4(-0.09307861328125hf, -0.2431640625hf, -0.53369140625hf, -0.165283203125hf), + f16vec4(0.071533203125hf, 0.13818359375hf, -0.0260772705078125hf, 0.0787353515625hf), + f16vec4(-0.288330078125hf, -0.3916015625hf, 0.059906005859375hf, -0.0875244140625hf)); +const f16mat4 w0_21 = f16mat4( + f16vec4(0.004047393798828125hf, -0.1715087890625hf, 0.1363525390625hf, -0.1614990234375hf), + f16vec4(-0.0183563232421875hf, -0.30712890625hf, -0.267578125hf, 0.0176544189453125hf), + f16vec4(-0.0212554931640625hf, 0.09332275390625hf, -0.1383056640625hf, 0.245361328125hf), + f16vec4(-0.2247314453125hf, -0.49462890625hf, -0.02001953125hf, -0.050445556640625hf)); +const f16mat4 w0_22 = f16mat4( + f16vec4(-0.1497802734375hf, 0.0736083984375hf, -0.20654296875hf, -0.0791015625hf), + f16vec4(-0.05853271484375hf, -0.244384765625hf, -0.10833740234375hf, -0.06439208984375hf), + f16vec4(0.043487548828125hf, 0.18701171875hf, -0.105712890625hf, 0.260986328125hf), + f16vec4(-0.1318359375hf, -0.2125244140625hf, -0.0599365234375hf, -0.051483154296875hf)); +const f16mat4 w0_23 = f16mat4( + f16vec4(-0.0482177734375hf, -0.08709716796875hf, -0.1070556640625hf, -0.0487060546875hf), + f16vec4(-0.0406494140625hf, -0.28662109375hf, -0.24267578125hf, -0.07421875hf), + f16vec4(-0.004764556884765625hf, 0.1126708984375hf, -0.0545654296875hf, 0.13720703125hf), + f16vec4(-0.1800537109375hf, -0.41650390625hf, -0.0240325927734375hf, -0.0543212890625hf)); +const f16mat4 w0_24 = f16mat4( + f16vec4(-0.006961822509765625hf, -0.2705078125hf, 0.13427734375hf, -0.145751953125hf), + f16vec4(-0.09747314453125hf, -0.447998046875hf, -0.7275390625hf, -0.00899505615234375hf), + f16vec4(0.03411865234375hf, 0.2098388671875hf, -0.061309814453125hf, 0.1767578125hf), + f16vec4(-0.332763671875hf, -0.474365234375hf, 0.059112548828125hf, -0.078857421875hf)); +const f16mat4 w0_25 = f16mat4( + f16vec4(-0.2220458984375hf, -0.22412109375hf, -0.1552734375hf, -0.0987548828125hf), + f16vec4(-0.12493896484375hf, -0.328857421875hf, -0.5400390625hf, -0.075927734375hf), + f16vec4(0.06707763671875hf, 0.326904296875hf, -0.058624267578125hf, 0.157470703125hf), + f16vec4(-0.296875hf, -0.201904296875hf, 0.01094818115234375hf, -0.08868408203125hf)); +const f16mat4 w0_26 = f16mat4( + f16vec4(-0.0909423828125hf, -0.39013671875hf, -0.07025146484375hf, -0.058929443359375hf), + f16vec4(-0.0919189453125hf, -0.280029296875hf, -0.57666015625hf, -0.04217529296875hf), + f16vec4(0.01309967041015625hf, 0.256591796875hf, -0.03662109375hf, 0.04095458984375hf), + f16vec4(-0.2388916015625hf, -0.282958984375hf, 0.08203125hf, -0.06695556640625hf)); +const f16mat4 w0_27 = f16mat4( + f16vec4(-0.2314453125hf, 0.0863037109375hf, 0.236572265625hf, 0.030029296875hf), + f16vec4(0.469482421875hf, -0.27099609375hf, -0.10150146484375hf, -0.0892333984375hf), + f16vec4(-0.35302734375hf, -0.2115478515625hf, -0.31005859375hf, -0.2724609375hf), + f16vec4(-0.00304412841796875hf, 0.082275390625hf, -0.399658203125hf, -0.06884765625hf)); +const f16mat4 w0_28 = f16mat4( + f16vec4(-0.252197265625hf, 0.0963134765625hf, 0.25341796875hf, 0.0293121337890625hf), + f16vec4(0.309326171875hf, 0.0908203125hf, -0.0255279541015625hf, -0.0390625hf), + f16vec4(-0.513671875hf, -0.433349609375hf, -0.58935546875hf, -0.1876220703125hf), + f16vec4(-0.208740234375hf, -0.08074951171875hf, -0.56787109375hf, -0.083740234375hf)); +const f16mat4 w0_29 = f16mat4( + f16vec4(-0.2200927734375hf, 0.1429443359375hf, 0.328857421875hf, 0.07275390625hf), + f16vec4(0.525390625hf, -0.148193359375hf, -0.049041748046875hf, -0.04937744140625hf), + f16vec4(-0.39013671875hf, -0.24853515625hf, -0.556640625hf, -0.3525390625hf), + f16vec4(-0.0513916015625hf, 0.0254669189453125hf, -0.279296875hf, -0.158203125hf)); +const f16mat4 w0_30 = f16mat4( + f16vec4(-0.1671142578125hf, 0.168212890625hf, 0.22705078125hf, 0.01486968994140625hf), + f16vec4(0.214599609375hf, -0.1676025390625hf, -0.06671142578125hf, -0.01230621337890625hf), + f16vec4(-0.480224609375hf, -0.609375hf, -0.45068359375hf, -0.1854248046875hf), + f16vec4(-0.057098388671875hf, -0.034393310546875hf, -0.25244140625hf, -0.0007371902465820312hf)); +const f16mat4 w0_31 = f16mat4( + f16vec4(-0.2012939453125hf, 0.1812744140625hf, 0.1805419921875hf, 0.01300811767578125hf), + f16vec4(0.106689453125hf, 0.156005859375hf, 0.0202178955078125hf, 0.02392578125hf), + f16vec4(-0.603515625hf, -0.82421875hf, -0.74658203125hf, -0.08624267578125hf), + f16vec4(-0.202880859375hf, -0.1778564453125hf, -0.1982421875hf, -0.0311737060546875hf)); +const f16mat4 w0_32 = f16mat4( + f16vec4(-0.1837158203125hf, 0.1988525390625hf, 0.25390625hf, 0.046905517578125hf), + f16vec4(0.298095703125hf, -0.1060791015625hf, 0.04949951171875hf, -0.01386260986328125hf), + f16vec4(-0.470458984375hf, -0.5859375hf, -0.6484375hf, -0.2249755859375hf), + f16vec4(-0.091064453125hf, -0.0261993408203125hf, -0.03680419921875hf, -0.053253173828125hf)); +const f16mat4 w0_33 = f16mat4( + f16vec4(-0.134765625hf, 0.19580078125hf, 0.31982421875hf, 0.0296173095703125hf), + f16vec4(0.490966796875hf, -0.2578125hf, -0.1497802734375hf, -0.0234375hf), + f16vec4(-0.384521484375hf, -0.18115234375hf, -0.224365234375hf, -0.251220703125hf), + f16vec4(-0.0205230712890625hf, 0.03192138671875hf, -0.474365234375hf, -0.0555419921875hf)); +const f16mat4 w0_34 = f16mat4( + f16vec4(-0.214111328125hf, 0.180908203125hf, 0.2763671875hf, 0.07440185546875hf), + f16vec4(0.3349609375hf, 0.086669921875hf, -0.01837158203125hf, 0.005756378173828125hf), + f16vec4(-0.472412109375hf, -0.417236328125hf, -0.53515625hf, -0.1566162109375hf), + f16vec4(-0.25146484375hf, -0.1419677734375hf, -0.51806640625hf, -0.11236572265625hf)); +const f16mat4 w0_35 = f16mat4( + f16vec4(-0.208251953125hf, 0.1845703125hf, 0.2724609375hf, 0.1114501953125hf), + f16vec4(0.5029296875hf, -0.174560546875hf, 0.03466796875hf, -0.04534912109375hf), + f16vec4(-0.351806640625hf, -0.1756591796875hf, -0.488525390625hf, -0.298095703125hf), + f16vec4(-0.05328369140625hf, 0.022735595703125hf, -0.2410888671875hf, -0.1473388671875hf)); +const f16vec4 sub0 = f16vec4(-5.40234375hf, -4.203125hf, -4.46875hf, -3.583984375hf); +const f16vec4 mul0 = f16vec4(0.6669921875hf, 0.60888671875hf, 0.52880859375hf, 0.380615234375hf); +const f16vec4 add0 = f16vec4(-0.572265625hf, -0.17822265625hf, -0.246337890625hf, -0.480712890625hf); + +const f16mat4 w1_0 = f16mat4( + f16vec4(0.0311431884765625hf, -0.33935546875hf, -0.16845703125hf, -0.2059326171875hf), + f16vec4(0.126953125hf, -0.256103515625hf, 0.09747314453125hf, 0.0958251953125hf), + f16vec4(0.1278076171875hf, -0.08123779296875hf, 0.0167083740234375hf, 0.01328277587890625hf), + f16vec4(0.01485443115234375hf, 0.150390625hf, -0.11431884765625hf, 0.033477783203125hf)); +const f16mat4 w1_1 = f16mat4( + f16vec4(0.065185546875hf, -0.17919921875hf, -0.160400390625hf, -0.2076416015625hf), + f16vec4(0.02874755859375hf, -0.0845947265625hf, 0.0843505859375hf, 0.132080078125hf), + f16vec4(-0.051239013671875hf, -0.09454345703125hf, 0.025238037109375hf, 0.0811767578125hf), + f16vec4(0.0307769775390625hf, 0.03656005859375hf, -0.0970458984375hf, 0.06939697265625hf)); +const f16mat4 w1_2 = f16mat4( + f16vec4(0.04962158203125hf, -0.357421875hf, -0.155517578125hf, -0.173583984375hf), + f16vec4(0.07940673828125hf, -0.0157928466796875hf, 0.0816650390625hf, 0.0423583984375hf), + f16vec4(0.042877197265625hf, 0.037506103515625hf, 0.00510406494140625hf, -0.019012451171875hf), + f16vec4(0.193603515625hf, 0.10650634765625hf, -0.049285888671875hf, -0.01326751708984375hf)); +const f16mat4 w1_3 = f16mat4( + f16vec4(0.04931640625hf, -0.2421875hf, -0.1590576171875hf, -0.1629638671875hf), + f16vec4(0.0908203125hf, -0.051544189453125hf, 0.0897216796875hf, 0.155029296875hf), + f16vec4(0.059478759765625hf, 0.0216064453125hf, 0.0228424072265625hf, 0.030609130859375hf), + f16vec4(-0.2130126953125hf, 0.115234375hf, -0.057586669921875hf, -0.00542449951171875hf)); +const f16mat4 w1_4 = f16mat4( + f16vec4(0.134033203125hf, -0.127197265625hf, -0.16748046875hf, -0.1793212890625hf), + f16vec4(0.0101470947265625hf, 0.1116943359375hf, 0.08062744140625hf, 0.17431640625hf), + f16vec4(-0.099853515625hf, -0.0295257568359375hf, 0.027862548828125hf, 0.1226806640625hf), + f16vec4(-0.269775390625hf, 0.0213470458984375hf, -0.054901123046875hf, 0.07171630859375hf)); +const f16mat4 w1_5 = f16mat4( + f16vec4(0.15380859375hf, -0.392333984375hf, -0.12939453125hf, -0.1826171875hf), + f16vec4(0.06951904296875hf, 0.09136962890625hf, 0.06195068359375hf, 0.11895751953125hf), + f16vec4(-0.030792236328125hf, 0.04974365234375hf, 0.0122222900390625hf, 0.012786865234375hf), + f16vec4(-0.20703125hf, 0.1240234375hf, -0.007808685302734375hf, 0.01435089111328125hf)); +const f16mat4 w1_6 = f16mat4( + f16vec4(-0.036407470703125hf, -0.36572265625hf, -0.1475830078125hf, -0.2135009765625hf), + f16vec4(0.08599853515625hf, -0.0828857421875hf, 0.10748291015625hf, 0.06756591796875hf), + f16vec4(0.08111572265625hf, 0.06964111328125hf, -0.0640869140625hf, -0.08575439453125hf), + f16vec4(0.10992431640625hf, 0.1510009765625hf, -0.0672607421875hf, -0.06658935546875hf)); +const f16mat4 w1_7 = f16mat4( + f16vec4(0.054931640625hf, -0.299072265625hf, -0.1317138671875hf, -0.227783203125hf), + f16vec4(0.046722412109375hf, 0.0217132568359375hf, 0.063720703125hf, 0.1318359375hf), + f16vec4(-0.041473388671875hf, -0.053375244140625hf, -0.0556640625hf, -0.00714874267578125hf), + f16vec4(-0.004608154296875hf, 0.09490966796875hf, -0.05694580078125hf, 0.052764892578125hf)); +const f16mat4 w1_8 = f16mat4( + f16vec4(0.1275634765625hf, -0.6025390625hf, -0.07330322265625hf, -0.24609375hf), + f16vec4(0.1324462890625hf, -0.0278472900390625hf, 0.023284912109375hf, 0.0634765625hf), + f16vec4(0.017181396484375hf, -0.00397491455078125hf, -0.0640869140625hf, -0.0921630859375hf), + f16vec4(-0.02264404296875hf, 0.222412109375hf, -0.0250244140625hf, 0.040618896484375hf)); +const f16mat4 w1_9 = f16mat4( + f16vec4(0.09521484375hf, 0.0174560546875hf, -0.038818359375hf, 0.064208984375hf), + f16vec4(0.04608154296875hf, 0.033050537109375hf, -0.053863525390625hf, -0.0086517333984375hf), + f16vec4(-0.7470703125hf, 0.0175933837890625hf, -0.04150390625hf, -0.1546630859375hf), + f16vec4(-0.56689453125hf, -0.2178955078125hf, -0.0267486572265625hf, -0.2401123046875hf)); +const f16mat4 w1_10 = f16mat4( + f16vec4(0.109375hf, 0.0743408203125hf, 0.0081939697265625hf, 0.014129638671875hf), + f16vec4(0.10919189453125hf, 0.0452880859375hf, -0.06524658203125hf, -0.0278472900390625hf), + f16vec4(-0.27587890625hf, -0.08447265625hf, -0.0677490234375hf, -0.059295654296875hf), + f16vec4(-0.490966796875hf, -0.499755859375hf, -0.04833984375hf, -0.1798095703125hf)); +const f16mat4 w1_11 = f16mat4( + f16vec4(0.1544189453125hf, 0.1058349609375hf, 0.06097412109375hf, -0.048828125hf), + f16vec4(0.0821533203125hf, 0.08209228515625hf, 0.007434844970703125hf, -0.10650634765625hf), + f16vec4(-0.470703125hf, 0.074951171875hf, -0.21484375hf, -0.1209716796875hf), + f16vec4(-0.78125hf, -0.492431640625hf, -0.030029296875hf, -0.2139892578125hf)); +const f16mat4 w1_12 = f16mat4( + f16vec4(0.124267578125hf, 0.036285400390625hf, -0.0192108154296875hf, 0.03448486328125hf), + f16vec4(0.01114654541015625hf, -0.0977783203125hf, -0.0828857421875hf, 0.0230560302734375hf), + f16vec4(-0.45458984375hf, -0.02911376953125hf, -0.093017578125hf, -0.170654296875hf), + f16vec4(-0.47021484375hf, -0.0570068359375hf, -0.06671142578125hf, -0.314453125hf)); +const f16mat4 w1_13 = f16mat4( + f16vec4(0.1495361328125hf, 0.11163330078125hf, 0.0098876953125hf, -0.0133819580078125hf), + f16vec4(0.024688720703125hf, -0.11212158203125hf, -0.075439453125hf, 0.05780029296875hf), + f16vec4(0.02105712890625hf, -0.13720703125hf, -0.162841796875hf, -0.09332275390625hf), + f16vec4(-0.1817626953125hf, -0.2744140625hf, -0.096923828125hf, -0.271728515625hf)); +const f16mat4 w1_14 = f16mat4( + f16vec4(0.15185546875hf, 0.1336669921875hf, 0.08197021484375hf, -0.04522705078125hf), + f16vec4(-0.0662841796875hf, -0.05682373046875hf, 0.05517578125hf, -0.0035266876220703125hf), + f16vec4(-0.47216796875hf, 0.015655517578125hf, -0.326171875hf, -0.139892578125hf), + f16vec4(-0.429931640625hf, -0.15966796875hf, -0.06732177734375hf, -0.307861328125hf)); +const f16mat4 w1_15 = f16mat4( + f16vec4(0.09521484375hf, 0.017303466796875hf, -0.0192718505859375hf, 0.05145263671875hf), + f16vec4(0.156494140625hf, 0.0098114013671875hf, -0.08154296875hf, -0.077392578125hf), + f16vec4(-0.365966796875hf, 0.108642578125hf, -0.1229248046875hf, -0.24267578125hf), + f16vec4(-0.90625hf, -0.3408203125hf, -0.09930419921875hf, -0.30419921875hf)); +const f16mat4 w1_16 = f16mat4( + f16vec4(0.08526611328125hf, 0.108154296875hf, 0.00707244873046875hf, 0.0038814544677734375hf), + f16vec4(0.1331787109375hf, 0.0244140625hf, -0.052337646484375hf, 0.01128387451171875hf), + f16vec4(-0.1014404296875hf, 0.00397491455078125hf, -0.20556640625hf, -0.158447265625hf), + f16vec4(-0.5302734375hf, -0.48095703125hf, -0.10699462890625hf, -0.244873046875hf)); +const f16mat4 w1_17 = f16mat4( + f16vec4(0.06494140625hf, 0.1392822265625hf, 0.0968017578125hf, -0.0244140625hf), + f16vec4(-0.00984954833984375hf, 0.07427978515625hf, 0.12890625hf, 0.017364501953125hf), + f16vec4(-0.62353515625hf, 0.1351318359375hf, -0.3916015625hf, -0.2452392578125hf), + f16vec4(-0.5615234375hf, -0.1982421875hf, -0.068359375hf, -0.32373046875hf)); +const f16mat4 w1_18 = f16mat4( + f16vec4(0.2154541015625hf, -0.68994140625hf, 0.0445556640625hf, -0.052093505859375hf), + f16vec4(0.164306640625hf, 0.08184814453125hf, -0.09197998046875hf, -0.349609375hf), + f16vec4(-0.04119873046875hf, 0.7529296875hf, 0.171875hf, -0.130859375hf), + f16vec4(0.30712890625hf, 0.273681640625hf, -0.0175018310546875hf, -0.1417236328125hf)); +const f16mat4 w1_19 = f16mat4( + f16vec4(0.00531005859375hf, -0.5009765625hf, 0.0031414031982421875hf, -0.06744384765625hf), + f16vec4(0.04302978515625hf, 0.017608642578125hf, -0.10498046875hf, -0.332763671875hf), + f16vec4(0.0175628662109375hf, 0.28173828125hf, 0.1246337890625hf, -0.043701171875hf), + f16vec4(0.0858154296875hf, 0.17138671875hf, -0.0599365234375hf, -0.12237548828125hf)); +const f16mat4 w1_20 = f16mat4( + f16vec4(0.1673583984375hf, -0.6494140625hf, -0.0130767822265625hf, -0.016326904296875hf), + f16vec4(0.2198486328125hf, 0.1864013671875hf, -0.1837158203125hf, -0.33984375hf), + f16vec4(0.014434814453125hf, 0.467041015625hf, 0.036468505859375hf, -0.041107177734375hf), + f16vec4(0.11260986328125hf, 0.27197265625hf, -0.111572265625hf, -0.1627197265625hf)); +const f16mat4 w1_21 = f16mat4( + f16vec4(0.037353515625hf, -0.2763671875hf, -0.02862548828125hf, -0.0014352798461914062hf), + f16vec4(0.10760498046875hf, 0.14697265625hf, 0.019866943359375hf, -0.2607421875hf), + f16vec4(-0.199462890625hf, 0.2093505859375hf, 0.173095703125hf, -0.05169677734375hf), + f16vec4(-0.043060302734375hf, 0.0252685546875hf, -0.0012407302856445312hf, -0.07666015625hf)); +const f16mat4 w1_22 = f16mat4( + f16vec4(-0.1822509765625hf, 0.056610107421875hf, -0.0306243896484375hf, -0.0224151611328125hf), + f16vec4(-0.08905029296875hf, 0.084716796875hf, 0.03460693359375hf, -0.23046875hf), + f16vec4(-0.1317138671875hf, -0.07708740234375hf, 0.08087158203125hf, -0.00727081298828125hf), + f16vec4(-0.133056640625hf, -0.0950927734375hf, -0.03680419921875hf, -0.042022705078125hf)); +const f16mat4 w1_23 = f16mat4( + f16vec4(0.005939483642578125hf, -0.294189453125hf, -0.0216064453125hf, 0.00995635986328125hf), + f16vec4(0.05548095703125hf, 0.2213134765625hf, -0.040863037109375hf, -0.287841796875hf), + f16vec4(-0.125732421875hf, 0.2034912109375hf, -0.028106689453125hf, -0.054779052734375hf), + f16vec4(-0.09332275390625hf, -0.01433563232421875hf, -0.09197998046875hf, -0.1365966796875hf)); +const f16mat4 w1_24 = f16mat4( + f16vec4(0.13671875hf, -0.58935546875hf, -0.04833984375hf, 0.026519775390625hf), + f16vec4(0.427490234375hf, 0.1783447265625hf, -0.06610107421875hf, -0.32275390625hf), + f16vec4(-0.10357666015625hf, 0.46337890625hf, 0.1539306640625hf, -0.09124755859375hf), + f16vec4(0.04132080078125hf, 0.2578125hf, -0.055694580078125hf, -0.1717529296875hf)); +const f16mat4 w1_25 = f16mat4( + f16vec4(-0.06103515625hf, -0.423095703125hf, -0.05712890625hf, 0.0194091796875hf), + f16vec4(0.1751708984375hf, 0.08270263671875hf, -0.03594970703125hf, -0.29052734375hf), + f16vec4(-0.026397705078125hf, 0.175048828125hf, 0.066162109375hf, -0.0579833984375hf), + f16vec4(-0.07061767578125hf, 0.11578369140625hf, -0.09222412109375hf, -0.11151123046875hf)); +const f16mat4 w1_26 = f16mat4( + f16vec4(0.03741455078125hf, -0.77099609375hf, -0.01506805419921875hf, 0.042633056640625hf), + f16vec4(0.23388671875hf, 0.186767578125hf, -0.1083984375hf, -0.33154296875hf), + f16vec4(-0.01204681396484375hf, 0.65771484375hf, -0.058013916015625hf, -0.1759033203125hf), + f16vec4(0.01629638671875hf, 0.16552734375hf, -0.1412353515625hf, -0.1873779296875hf)); +const f16mat4 w1_27 = f16mat4( + f16vec4(-0.08758544921875hf, -0.036773681640625hf, 0.01114654541015625hf, 0.0164794921875hf), + f16vec4(0.044158935546875hf, -0.036102294921875hf, -0.010498046875hf, 0.0804443359375hf), + f16vec4(-0.27587890625hf, -0.37890625hf, -0.126708984375hf, -0.273681640625hf), + f16vec4(0.17236328125hf, 0.025482177734375hf, -0.0205230712890625hf, -0.10302734375hf)); +const f16mat4 w1_28 = f16mat4( + f16vec4(0.111083984375hf, -0.050506591796875hf, 0.04547119140625hf, 0.0284881591796875hf), + f16vec4(0.038665771484375hf, -0.0187530517578125hf, -0.003177642822265625hf, 0.13818359375hf), + f16vec4(-0.3466796875hf, -0.67578125hf, -0.11016845703125hf, -0.2110595703125hf), + f16vec4(0.0394287109375hf, -0.1722412109375hf, -0.060089111328125hf, -0.0823974609375hf)); +const f16mat4 w1_29 = f16mat4( + f16vec4(-0.0634765625hf, -0.0938720703125hf, 0.056365966796875hf, 0.0809326171875hf), + f16vec4(0.034149169921875hf, -0.05584716796875hf, 0.00708770751953125hf, 0.0732421875hf), + f16vec4(-0.1834716796875hf, -0.227783203125hf, -0.2086181640625hf, -0.260986328125hf), + f16vec4(0.2244873046875hf, 0.1220703125hf, -0.0933837890625hf, -0.095458984375hf)); +const f16mat4 w1_30 = f16mat4( + f16vec4(-0.0191802978515625hf, -0.02911376953125hf, 0.034393310546875hf, 0.07061767578125hf), + f16vec4(0.03887939453125hf, -0.0804443359375hf, -0.00020694732666015625hf, 0.14208984375hf), + f16vec4(-0.77490234375hf, -0.611328125hf, -0.05828857421875hf, -0.08746337890625hf), + f16vec4(-0.04925537109375hf, -0.07611083984375hf, -0.01358795166015625hf, -0.0207977294921875hf)); +const f16mat4 w1_31 = f16mat4( + f16vec4(0.1773681640625hf, -0.01258087158203125hf, 0.05682373046875hf, 0.06988525390625hf), + f16vec4(0.057586669921875hf, -0.07855224609375hf, 0.005096435546875hf, 0.255126953125hf), + f16vec4(-0.85595703125hf, -0.8818359375hf, -0.08648681640625hf, -0.0186309814453125hf), + f16vec4(-0.16015625hf, -0.2724609375hf, -0.0245819091796875hf, -0.01141357421875hf)); +const f16mat4 w1_32 = f16mat4( + f16vec4(0.045379638671875hf, -0.07098388671875hf, 0.049102783203125hf, 0.1016845703125hf), + f16vec4(0.0179901123046875hf, -0.1075439453125hf, -0.00789642333984375hf, 0.2093505859375hf), + f16vec4(-0.703125hf, -0.4697265625hf, -0.09649658203125hf, -0.06396484375hf), + f16vec4(0.0275115966796875hf, 0.036834716796875hf, -0.057037353515625hf, -0.0533447265625hf)); +const f16mat4 w1_33 = f16mat4( + f16vec4(-0.0335693359375hf, -0.08502197265625hf, 0.060546875hf, 0.0631103515625hf), + f16vec4(0.0136871337890625hf, -0.0026798248291015625hf, -0.03985595703125hf, -0.024017333984375hf), + f16vec4(-0.444091796875hf, -0.58251953125hf, -0.086669921875hf, -0.26513671875hf), + f16vec4(0.08062744140625hf, 0.033599853515625hf, -0.05303955078125hf, -0.04595947265625hf)); +const f16mat4 w1_34 = f16mat4( + f16vec4(0.139892578125hf, -0.03826904296875hf, 0.07318115234375hf, 0.048797607421875hf), + f16vec4(-0.0013551712036132812hf, 0.0010061264038085938hf, -0.08099365234375hf, 0.08563232421875hf), + f16vec4(-0.458740234375hf, -0.71728515625hf, -0.10137939453125hf, -0.200927734375hf), + f16vec4(-0.016815185546875hf, -0.1494140625hf, -0.0928955078125hf, -0.016326904296875hf)); +const f16mat4 w1_35 = f16mat4( + f16vec4(0.046295166015625hf, -0.053070068359375hf, 0.0748291015625hf, 0.0654296875hf), + f16vec4(-0.028411865234375hf, -0.04412841796875hf, -0.0771484375hf, 0.08990478515625hf), + f16vec4(-0.332275390625hf, -0.2373046875hf, -0.09906005859375hf, -0.252197265625hf), + f16vec4(0.1417236328125hf, 0.1636962890625hf, -0.11407470703125hf, -0.08331298828125hf)); +const f16vec4 sub1 = f16vec4(-5.49609375hf, -5.83203125hf, -2.1171875hf, -3.5234375hf); +const f16vec4 mul1 = f16vec4(0.5185546875hf, 0.541015625hf, 0.62744140625hf, 0.427734375hf); +const f16vec4 add1 = f16vec4(-0.148193359375hf, -0.2403564453125hf, -0.57861328125hf, -0.68798828125hf); + +const f16mat4 w2_0 = f16mat4( + f16vec4(-0.10540771484375hf, -0.12744140625hf, -0.060791015625hf, -0.028533935546875hf), + f16vec4(0.1014404296875hf, 0.1502685546875hf, 0.151611328125hf, -0.08306884765625hf), + f16vec4(0.0211944580078125hf, 0.058502197265625hf, -0.10321044921875hf, 0.04852294921875hf), + f16vec4(-0.12109375hf, -0.2088623046875hf, 0.260498046875hf, -0.06427001953125hf)); +const f16mat4 w2_1 = f16mat4( + f16vec4(0.056243896484375hf, -0.15771484375hf, 0.06866455078125hf, 0.032684326171875hf), + f16vec4(0.0804443359375hf, 0.1455078125hf, 0.06768798828125hf, -0.07745361328125hf), + f16vec4(-0.1328125hf, 0.1673583984375hf, -0.1104736328125hf, -0.034881591796875hf), + f16vec4(0.0219573974609375hf, -0.1561279296875hf, 0.21533203125hf, 0.00478363037109375hf)); +const f16mat4 w2_2 = f16mat4( + f16vec4(-0.042083740234375hf, -0.12115478515625hf, 0.10723876953125hf, -0.0201873779296875hf), + f16vec4(0.043182373046875hf, 0.1473388671875hf, 0.00785064697265625hf, -0.11529541015625hf), + f16vec4(0.02923583984375hf, -0.155029296875hf, -0.1986083984375hf, 0.03143310546875hf), + f16vec4(-0.09173583984375hf, -0.2049560546875hf, 0.2666015625hf, -0.03741455078125hf)); +const f16mat4 w2_3 = f16mat4( + f16vec4(0.06402587890625hf, -0.06890869140625hf, 0.054779052734375hf, 0.0167694091796875hf), + f16vec4(0.0860595703125hf, 0.12225341796875hf, -0.0118255615234375hf, -0.118408203125hf), + f16vec4(-0.027679443359375hf, 0.2313232421875hf, -0.053558349609375hf, 0.06390380859375hf), + f16vec4(-0.02801513671875hf, -0.162109375hf, 0.224609375hf, -0.031646728515625hf)); +const f16mat4 w2_4 = f16mat4( + f16vec4(0.2257080078125hf, -0.10455322265625hf, 0.159423828125hf, 0.075439453125hf), + f16vec4(0.094970703125hf, 0.1060791015625hf, -0.050750732421875hf, -0.07537841796875hf), + f16vec4(-0.16552734375hf, 0.36181640625hf, -0.055389404296875hf, -0.0086517333984375hf), + f16vec4(0.086181640625hf, -0.11090087890625hf, 0.1881103515625hf, 0.04351806640625hf)); +const f16mat4 w2_5 = f16mat4( + f16vec4(0.11614990234375hf, -0.1177978515625hf, 0.143310546875hf, 0.023345947265625hf), + f16vec4(0.0904541015625hf, 0.11651611328125hf, -0.034393310546875hf, -0.05804443359375hf), + f16vec4(-0.056121826171875hf, 0.08184814453125hf, -0.0972900390625hf, 0.045989990234375hf), + f16vec4(-0.007434844970703125hf, -0.138427734375hf, 0.2449951171875hf, -0.051239013671875hf)); +const f16mat4 w2_6 = f16mat4( + f16vec4(0.1041259765625hf, -0.11077880859375hf, -0.038909912109375hf, -0.029571533203125hf), + f16vec4(0.0167999267578125hf, 0.06317138671875hf, 0.040771484375hf, -0.1751708984375hf), + f16vec4(0.0110626220703125hf, 0.352294921875hf, -0.125244140625hf, 0.007213592529296875hf), + f16vec4(-0.08758544921875hf, -0.17041015625hf, 0.27734375hf, -0.125244140625hf)); +const f16mat4 w2_7 = f16mat4( + f16vec4(0.2313232421875hf, -0.14697265625hf, 0.04034423828125hf, -0.003627777099609375hf), + f16vec4(0.052459716796875hf, 0.050872802734375hf, 0.042205810546875hf, -0.0604248046875hf), + f16vec4(-0.1285400390625hf, 0.496826171875hf, -0.044769287109375hf, -0.0255126953125hf), + f16vec4(0.0217742919921875hf, -0.10784912109375hf, 0.2391357421875hf, -0.089599609375hf)); +const f16mat4 w2_8 = f16mat4( + f16vec4(0.0980224609375hf, -0.1614990234375hf, -0.005626678466796875hf, -0.033050537109375hf), + f16vec4(0.0802001953125hf, 0.051422119140625hf, 0.07720947265625hf, -0.036651611328125hf), + f16vec4(-0.0355224609375hf, 0.2607421875hf, -0.057373046875hf, -0.004337310791015625hf), + f16vec4(-0.08880615234375hf, -0.12109375hf, 0.270751953125hf, -0.190673828125hf)); +const f16mat4 w2_9 = f16mat4( + f16vec4(-0.071044921875hf, 0.073486328125hf, 0.3369140625hf, -0.0517578125hf), + f16vec4(-0.08978271484375hf, -0.05902099609375hf, -0.104736328125hf, -0.051544189453125hf), + f16vec4(-0.09564208984375hf, -0.12091064453125hf, 0.06005859375hf, -0.203857421875hf), + f16vec4(-0.174072265625hf, -0.1785888671875hf, -0.036834716796875hf, -0.11187744140625hf)); +const f16mat4 w2_10 = f16mat4( + f16vec4(-0.042236328125hf, 0.0692138671875hf, 0.142578125hf, -0.0643310546875hf), + f16vec4(-0.02471923828125hf, -0.01055145263671875hf, 0.047637939453125hf, -0.045257568359375hf), + f16vec4(-0.140380859375hf, -0.0994873046875hf, -0.004650115966796875hf, -0.162353515625hf), + f16vec4(-0.32861328125hf, -0.108642578125hf, -0.0177001953125hf, -0.2039794921875hf)); +const f16mat4 w2_11 = f16mat4( + f16vec4(-0.042755126953125hf, 0.10064697265625hf, 0.407470703125hf, -0.0418701171875hf), + f16vec4(0.015411376953125hf, -0.09271240234375hf, 0.08648681640625hf, 0.006526947021484375hf), + f16vec4(0.0038661956787109375hf, -0.189453125hf, 0.0006051063537597656hf, -0.053131103515625hf), + f16vec4(-0.272216796875hf, -0.277587890625hf, -0.043121337890625hf, -0.2373046875hf)); +const f16mat4 w2_12 = f16mat4( + f16vec4(-0.0614013671875hf, 0.029327392578125hf, 0.12646484375hf, -0.06744384765625hf), + f16vec4(-0.01074981689453125hf, -0.03192138671875hf, 0.12060546875hf, -0.01776123046875hf), + f16vec4(0.054443359375hf, -0.042205810546875hf, -0.1368408203125hf, -0.0723876953125hf), + f16vec4(-0.1046142578125hf, -0.060028076171875hf, 0.006267547607421875hf, -0.0775146484375hf)); +const f16mat4 w2_13 = f16mat4( + f16vec4(-0.021148681640625hf, 0.027191162109375hf, -0.00389862060546875hf, -0.0462646484375hf), + f16vec4(-0.001033782958984375hf, 0.040435791015625hf, 0.2239990234375hf, -0.056854248046875hf), + f16vec4(0.03515625hf, -0.0213470458984375hf, -0.15869140625hf, -0.03961181640625hf), + f16vec4(-0.1590576171875hf, -0.01470184326171875hf, 0.035797119140625hf, -0.10919189453125hf)); +const f16mat4 w2_14 = f16mat4( + f16vec4(-0.044281005859375hf, 0.06866455078125hf, 0.286376953125hf, -0.0533447265625hf), + f16vec4(0.0014944076538085938hf, -0.027099609375hf, 0.2578125hf, -0.06561279296875hf), + f16vec4(0.06591796875hf, -0.12298583984375hf, -0.2093505859375hf, -0.042938232421875hf), + f16vec4(-0.150634765625hf, -0.1767578125hf, 0.0144195556640625hf, -0.13134765625hf)); +const f16mat4 w2_15 = f16mat4( + f16vec4(-0.055999755859375hf, -0.0233154296875hf, 0.33056640625hf, -0.038482666015625hf), + f16vec4(-0.000102996826171875hf, -0.0740966796875hf, -0.0198211669921875hf, 0.051361083984375hf), + f16vec4(0.052825927734375hf, -0.004199981689453125hf, 0.04595947265625hf, 0.0204010009765625hf), + f16vec4(-0.294921875hf, -0.040863037109375hf, -0.11383056640625hf, -0.12042236328125hf)); +const f16mat4 w2_16 = f16mat4( + f16vec4(-0.024810791015625hf, -0.00896453857421875hf, 0.16259765625hf, -0.046478271484375hf), + f16vec4(-0.012481689453125hf, 0.0311279296875hf, 0.1260986328125hf, -0.0316162109375hf), + f16vec4(-0.0007758140563964844hf, 0.01168060302734375hf, 0.001033782958984375hf, -0.047821044921875hf), + f16vec4(-0.299072265625hf, 0.03826904296875hf, 0.0027027130126953125hf, -0.16552734375hf)); +const f16mat4 w2_17 = f16mat4( + f16vec4(-0.060272216796875hf, 0.041534423828125hf, 0.392822265625hf, -0.09210205078125hf), + f16vec4(-0.09039306640625hf, -0.0394287109375hf, 0.11761474609375hf, -0.06243896484375hf), + f16vec4(0.005405426025390625hf, -0.10845947265625hf, -0.023223876953125hf, -0.10247802734375hf), + f16vec4(-0.2176513671875hf, -0.1329345703125hf, -0.0286712646484375hf, -0.1353759765625hf)); +const f16mat4 w2_18 = f16mat4( + f16vec4(-0.08746337890625hf, 0.0384521484375hf, -0.2103271484375hf, 0.013214111328125hf), + f16vec4(0.11212158203125hf, -0.0229949951171875hf, -0.25634765625hf, 0.1298828125hf), + f16vec4(-0.130859375hf, -0.04779052734375hf, -0.18212890625hf, -0.10321044921875hf), + f16vec4(-0.367431640625hf, -0.0579833984375hf, 0.0177154541015625hf, -0.08258056640625hf)); +const f16mat4 w2_19 = f16mat4( + f16vec4(-0.1063232421875hf, -0.0138702392578125hf, -0.326171875hf, -0.0474853515625hf), + f16vec4(0.11944580078125hf, -0.034576416015625hf, -0.1617431640625hf, 0.1602783203125hf), + f16vec4(-0.12353515625hf, 0.0252685546875hf, -0.1512451171875hf, -0.0809326171875hf), + f16vec4(-0.276123046875hf, -0.09002685546875hf, -0.058074951171875hf, -0.05499267578125hf)); +const f16mat4 w2_20 = f16mat4( + f16vec4(-0.2384033203125hf, 0.14990234375hf, -0.35302734375hf, -0.11737060546875hf), + f16vec4(-0.059295654296875hf, 0.0228271484375hf, -0.27587890625hf, 0.117919921875hf), + f16vec4(-0.09881591796875hf, -0.036376953125hf, -0.191162109375hf, -0.048187255859375hf), + f16vec4(-0.37939453125hf, -0.03692626953125hf, -0.087890625hf, -0.0321044921875hf)); +const f16mat4 w2_21 = f16mat4( + f16vec4(-0.09783935546875hf, 0.06884765625hf, -0.1302490234375hf, -0.05255126953125hf), + f16vec4(0.2117919921875hf, -0.01499176025390625hf, -0.327880859375hf, 0.165283203125hf), + f16vec4(-0.1669921875hf, -0.031341552734375hf, -0.2119140625hf, -0.130126953125hf), + f16vec4(-0.22705078125hf, -0.09613037109375hf, -0.129150390625hf, -0.1427001953125hf)); +const f16mat4 w2_22 = f16mat4( + f16vec4(-0.1143798828125hf, 0.0279693603515625hf, -0.2469482421875hf, -0.09918212890625hf), + f16vec4(0.250244140625hf, -0.0051727294921875hf, -0.24072265625hf, 0.2161865234375hf), + f16vec4(-0.159912109375hf, 0.032440185546875hf, -0.1727294921875hf, -0.1468505859375hf), + f16vec4(-0.132080078125hf, -0.11041259765625hf, -0.1978759765625hf, -0.09619140625hf)); +const f16mat4 w2_23 = f16mat4( + f16vec4(-0.216796875hf, 0.13134765625hf, -0.274658203125hf, -0.140625hf), + f16vec4(0.1348876953125hf, 0.019927978515625hf, -0.310302734375hf, 0.182861328125hf), + f16vec4(-0.09405517578125hf, -0.06494140625hf, -0.2376708984375hf, -0.06640625hf), + f16vec4(-0.2359619140625hf, -0.0535888671875hf, -0.2301025390625hf, -0.057159423828125hf)); +const f16mat4 w2_24 = f16mat4( + f16vec4(-0.162109375hf, 0.0445556640625hf, -0.324951171875hf, -0.0745849609375hf), + f16vec4(0.2401123046875hf, -0.059326171875hf, -0.3671875hf, 0.126708984375hf), + f16vec4(-0.2457275390625hf, -0.03826904296875hf, -0.1248779296875hf, -0.1468505859375hf), + f16vec4(-0.161865234375hf, -0.08099365234375hf, -0.06396484375hf, -0.1571044921875hf)); +const f16mat4 w2_25 = f16mat4( + f16vec4(-0.12841796875hf, -0.008087158203125hf, -0.342041015625hf, -0.09283447265625hf), + f16vec4(0.313720703125hf, -0.059814453125hf, -0.250732421875hf, 0.18310546875hf), + f16vec4(-0.2193603515625hf, -0.01134490966796875hf, -0.11962890625hf, -0.162109375hf), + f16vec4(-0.07586669921875hf, -0.08990478515625hf, -0.09234619140625hf, -0.11651611328125hf)); +const f16mat4 w2_26 = f16mat4( + f16vec4(-0.2178955078125hf, 0.0965576171875hf, -0.32568359375hf, -0.156005859375hf), + f16vec4(0.2384033203125hf, -0.004299163818359375hf, -0.3076171875hf, 0.1856689453125hf), + f16vec4(-0.1356201171875hf, -0.129638671875hf, -0.180419921875hf, -0.088134765625hf), + f16vec4(-0.192138671875hf, -0.039337158203125hf, -0.10772705078125hf, -0.08526611328125hf)); +const f16mat4 w2_27 = f16mat4( + f16vec4(-0.08074951171875hf, 0.1170654296875hf, -0.1749267578125hf, 0.345458984375hf), + f16vec4(0.061737060546875hf, -0.165771484375hf, -0.0782470703125hf, -0.10882568359375hf), + f16vec4(-0.290283203125hf, -0.304443359375hf, -0.39404296875hf, -0.319580078125hf), + f16vec4(-0.10357666015625hf, 0.01239013671875hf, 0.06549072265625hf, -0.1275634765625hf)); +const f16mat4 w2_28 = f16mat4( + f16vec4(-0.0116119384765625hf, 0.1278076171875hf, -0.091796875hf, 0.2318115234375hf), + f16vec4(0.01163482666015625hf, -0.113037109375hf, -0.0872802734375hf, -0.1285400390625hf), + f16vec4(-0.245849609375hf, -0.249755859375hf, -0.343994140625hf, -0.4013671875hf), + f16vec4(-0.073486328125hf, 0.040985107421875hf, 0.059661865234375hf, -0.204345703125hf)); +const f16mat4 w2_29 = f16mat4( + f16vec4(-0.06689453125hf, 0.1671142578125hf, -0.105224609375hf, 0.34326171875hf), + f16vec4(0.07720947265625hf, -0.2027587890625hf, -0.1837158203125hf, -0.1136474609375hf), + f16vec4(-0.353515625hf, -0.2685546875hf, -0.3125hf, -0.325927734375hf), + f16vec4(-0.09808349609375hf, 0.0865478515625hf, 0.380615234375hf, -0.05438232421875hf)); +const f16mat4 w2_30 = f16mat4( + f16vec4(-0.1026611328125hf, 0.1590576171875hf, -0.0684814453125hf, 0.1761474609375hf), + f16vec4(0.055023193359375hf, -0.05731201171875hf, -0.064208984375hf, -0.07177734375hf), + f16vec4(-0.248046875hf, -0.298095703125hf, -0.456787109375hf, -0.505859375hf), + f16vec4(-0.078125hf, -0.01910400390625hf, -0.11627197265625hf, -0.1707763671875hf)); +const f16mat4 w2_31 = f16mat4( + f16vec4(-0.0017108917236328125hf, 0.1497802734375hf, 0.00434112548828125hf, 0.15576171875hf), + f16vec4(-0.0202178955078125hf, 0.01317596435546875hf, -0.0345458984375hf, -0.04998779296875hf), + f16vec4(-0.203369140625hf, -0.2003173828125hf, -0.395263671875hf, -0.64111328125hf), + f16vec4(-0.08050537109375hf, -0.01032257080078125hf, -0.0599365234375hf, -0.286865234375hf)); +const f16mat4 w2_32 = f16mat4( + f16vec4(-0.052978515625hf, 0.1893310546875hf, -0.051666259765625hf, 0.2408447265625hf), + f16vec4(0.03082275390625hf, -0.10516357421875hf, -0.0838623046875hf, -0.0635986328125hf), + f16vec4(-0.326904296875hf, -0.2044677734375hf, -0.385498046875hf, -0.55126953125hf), + f16vec4(-0.09051513671875hf, 0.041717529296875hf, 0.1717529296875hf, -0.1641845703125hf)); +const f16mat4 w2_33 = f16mat4( + f16vec4(-0.064208984375hf, 0.20751953125hf, -0.0254058837890625hf, 0.3330078125hf), + f16vec4(0.074951171875hf, 0.087646484375hf, -0.1044921875hf, -0.08294677734375hf), + f16vec4(-0.360595703125hf, -0.364501953125hf, -0.395751953125hf, -0.310546875hf), + f16vec4(-0.07818603515625hf, -0.075439453125hf, 0.0003819465637207031hf, -0.1558837890625hf)); +const f16mat4 w2_34 = f16mat4( + f16vec4(0.057769775390625hf, 0.1798095703125hf, 0.002025604248046875hf, 0.273681640625hf), + f16vec4(0.0156707763671875hf, 0.1407470703125hf, -0.049652099609375hf, -0.07373046875hf), + f16vec4(-0.305419921875hf, -0.286865234375hf, -0.325927734375hf, -0.443359375hf), + f16vec4(-0.058380126953125hf, -0.063232421875hf, 0.1019287109375hf, -0.260498046875hf)); +const f16mat4 w2_35 = f16mat4( + f16vec4(0.0196380615234375hf, 0.205322265625hf, -0.130615234375hf, 0.434326171875hf), + f16vec4(0.06109619140625hf, 0.06292724609375hf, -0.0660400390625hf, -0.093017578125hf), + f16vec4(-0.450439453125hf, -0.271728515625hf, -0.35791015625hf, -0.3955078125hf), + f16vec4(-0.11822509765625hf, -0.0124664306640625hf, 0.320068359375hf, -0.1761474609375hf)); +const f16vec4 sub2 = f16vec4(-4.2890625hf, -2.470703125hf, -3.9140625hf, -5.2265625hf); +const f16vec4 mul2 = f16vec4(0.458984375hf, 0.3779296875hf, 0.712890625hf, 0.7177734375hf); +const f16vec4 add2 = f16vec4(-0.5712890625hf, -0.37548828125hf, -0.58984375hf, -0.494384765625hf); + +const f16mat4 w3_0 = f16mat4( + f16vec4(0.0179901123046875hf, -0.0863037109375hf, -0.07708740234375hf, -0.057464599609375hf), + f16vec4(0.21875hf, -0.0711669921875hf, 0.2486572265625hf, 0.056793212890625hf), + f16vec4(-0.18701171875hf, -0.022369384765625hf, -0.296875hf, -0.13916015625hf), + f16vec4(-0.07196044921875hf, -0.0443115234375hf, -0.1346435546875hf, -0.102783203125hf)); +const f16mat4 w3_1 = f16mat4( + f16vec4(0.04534912109375hf, -0.2342529296875hf, -0.042236328125hf, -0.013214111328125hf), + f16vec4(0.2110595703125hf, -0.003475189208984375hf, 0.2032470703125hf, 0.08599853515625hf), + f16vec4(-0.1798095703125hf, -0.005584716796875hf, -0.2568359375hf, -0.060760498046875hf), + f16vec4(-0.04248046875hf, -0.12005615234375hf, -0.1370849609375hf, -0.06695556640625hf)); +const f16mat4 w3_2 = f16mat4( + f16vec4(-0.041351318359375hf, -0.2364501953125hf, -0.1934814453125hf, -0.03619384765625hf), + f16vec4(0.2109375hf, 0.044464111328125hf, 0.460693359375hf, 0.10455322265625hf), + f16vec4(-0.2626953125hf, -0.0418701171875hf, -0.201416015625hf, -0.037017822265625hf), + f16vec4(-0.109375hf, -0.197998046875hf, -0.1580810546875hf, -0.09381103515625hf)); +const f16mat4 w3_3 = f16mat4( + f16vec4(0.1129150390625hf, -0.04638671875hf, -0.10516357421875hf, -0.074951171875hf), + f16vec4(0.1983642578125hf, -0.0027141571044921875hf, 0.19140625hf, 0.0601806640625hf), + f16vec4(-0.09686279296875hf, 0.0065765380859375hf, -0.264404296875hf, -0.09027099609375hf), + f16vec4(-0.01503753662109375hf, -0.00113677978515625hf, -0.1663818359375hf, -0.1265869140625hf)); +const f16mat4 w3_4 = f16mat4( + f16vec4(0.14599609375hf, -0.2222900390625hf, -0.078369140625hf, -0.0178985595703125hf), + f16vec4(0.1722412109375hf, 0.0582275390625hf, 0.18359375hf, 0.1260986328125hf), + f16vec4(-0.08209228515625hf, 0.0753173828125hf, -0.21240234375hf, -0.044097900390625hf), + f16vec4(0.031524658203125hf, -0.0311431884765625hf, -0.1717529296875hf, -0.09375hf)); +const f16mat4 w3_5 = f16mat4( + f16vec4(0.046478271484375hf, -0.2381591796875hf, -0.225341796875hf, -0.0684814453125hf), + f16vec4(0.1959228515625hf, 0.096435546875hf, 0.4111328125hf, 0.1715087890625hf), + f16vec4(-0.20068359375hf, 0.036956787109375hf, -0.1783447265625hf, -0.0565185546875hf), + f16vec4(0.006591796875hf, -0.0975341796875hf, -0.179443359375hf, -0.11871337890625hf)); +const f16mat4 w3_6 = f16mat4( + f16vec4(0.0650634765625hf, -0.04730224609375hf, -0.11224365234375hf, -0.158935546875hf), + f16vec4(0.1683349609375hf, -0.034942626953125hf, 0.363037109375hf, 0.044097900390625hf), + f16vec4(-0.2093505859375hf, -0.044891357421875hf, -0.2379150390625hf, -0.0257720947265625hf), + f16vec4(-0.08612060546875hf, -0.035736083984375hf, -0.223876953125hf, -0.12200927734375hf)); +const f16mat4 w3_7 = f16mat4( + f16vec4(0.032470703125hf, -0.2181396484375hf, -0.07318115234375hf, -0.1409912109375hf), + f16vec4(0.16259765625hf, 0.01155853271484375hf, 0.26416015625hf, 0.1297607421875hf), + f16vec4(-0.18017578125hf, 0.0279693603515625hf, -0.2095947265625hf, -0.0275726318359375hf), + f16vec4(0.0010519027709960938hf, -0.0477294921875hf, -0.1646728515625hf, -0.1258544921875hf)); +const f16mat4 w3_8 = f16mat4( + f16vec4(-0.08099365234375hf, -0.267578125hf, -0.2193603515625hf, -0.162109375hf), + f16vec4(0.187744140625hf, 0.00759124755859375hf, 0.41943359375hf, 0.188232421875hf), + f16vec4(-0.22998046875hf, 0.040863037109375hf, -0.1932373046875hf, -0.0675048828125hf), + f16vec4(-0.03424072265625hf, -0.0748291015625hf, -0.1551513671875hf, -0.1375732421875hf)); +const f16mat4 w3_9 = f16mat4( + f16vec4(-0.01024627685546875hf, 0.0869140625hf, -0.14599609375hf, 0.033111572265625hf), + f16vec4(0.00012505054473876953hf, 0.2313232421875hf, 0.06634521484375hf, -0.11737060546875hf), + f16vec4(0.045623779296875hf, -0.1815185546875hf, -0.11871337890625hf, -0.06396484375hf), + f16vec4(-0.0255126953125hf, -0.1282958984375hf, -0.051361083984375hf, -0.1937255859375hf)); +const f16mat4 w3_10 = f16mat4( + f16vec4(0.043914794921875hf, 0.06268310546875hf, -0.08447265625hf, 0.06805419921875hf), + f16vec4(-0.02789306640625hf, 0.04278564453125hf, 0.0732421875hf, -0.054351806640625hf), + f16vec4(0.044189453125hf, -0.1126708984375hf, -0.09552001953125hf, -0.0023021697998046875hf), + f16vec4(-0.07763671875hf, -0.11309814453125hf, -0.09637451171875hf, -0.1551513671875hf)); +const f16mat4 w3_11 = f16mat4( + f16vec4(-0.006191253662109375hf, -0.0325927734375hf, -0.07489013671875hf, 0.055938720703125hf), + f16vec4(-0.2061767578125hf, -0.1275634765625hf, 0.032867431640625hf, -0.06341552734375hf), + f16vec4(0.041778564453125hf, -0.065185546875hf, -0.053741455078125hf, -0.06536865234375hf), + f16vec4(-0.1510009765625hf, -0.2469482421875hf, -0.12335205078125hf, -0.213134765625hf)); +const f16mat4 w3_12 = f16mat4( + f16vec4(-0.000926971435546875hf, 0.0789794921875hf, -0.1427001953125hf, 0.0701904296875hf), + f16vec4(0.1407470703125hf, 0.158447265625hf, -0.08294677734375hf, -0.09039306640625hf), + f16vec4(-0.031890869140625hf, -0.26904296875hf, -0.06927490234375hf, 0.007843017578125hf), + f16vec4(0.0151214599609375hf, -0.167236328125hf, -0.17822265625hf, -0.1737060546875hf)); +const f16mat4 w3_13 = f16mat4( + f16vec4(0.08282470703125hf, 0.07061767578125hf, -0.049224853515625hf, 0.09820556640625hf), + f16vec4(0.14111328125hf, 0.00971221923828125hf, -0.060455322265625hf, -0.042144775390625hf), + f16vec4(-0.050689697265625hf, -0.209716796875hf, -0.047882080078125hf, 0.05230712890625hf), + f16vec4(-0.0845947265625hf, -0.17822265625hf, -0.1915283203125hf, -0.107666015625hf)); +const f16mat4 w3_14 = f16mat4( + f16vec4(0.048309326171875hf, 0.011474609375hf, -0.045928955078125hf, 0.0965576171875hf), + f16vec4(-0.08056640625hf, -0.11285400390625hf, -0.0810546875hf, -0.08428955078125hf), + f16vec4(-0.035247802734375hf, -0.129638671875hf, -0.0224456787109375hf, -0.0256500244140625hf), + f16vec4(-0.1527099609375hf, -0.334716796875hf, -0.165283203125hf, -0.133544921875hf)); +const f16mat4 w3_15 = f16mat4( + f16vec4(-0.04730224609375hf, 0.036590576171875hf, -0.1968994140625hf, 0.0227508544921875hf), + f16vec4(0.0252532958984375hf, 0.1353759765625hf, 0.039764404296875hf, -0.043701171875hf), + f16vec4(0.05010986328125hf, -0.1854248046875hf, 0.016815185546875hf, 0.0031719207763671875hf), + f16vec4(-0.0206146240234375hf, -0.10272216796875hf, -0.150634765625hf, -0.1356201171875hf)); +const f16mat4 w3_16 = f16mat4( + f16vec4(0.0230712890625hf, 0.0024623870849609375hf, -0.08380126953125hf, 0.081298828125hf), + f16vec4(0.048187255859375hf, 0.0604248046875hf, 0.082275390625hf, -0.009246826171875hf), + f16vec4(0.067138671875hf, -0.061004638671875hf, 0.007602691650390625hf, 0.00846099853515625hf), + f16vec4(-0.067138671875hf, -0.1004638671875hf, -0.18994140625hf, -0.10235595703125hf)); +const f16mat4 w3_17 = f16mat4( + f16vec4(0.01146697998046875hf, -0.01885986328125hf, -0.03839111328125hf, 0.08807373046875hf), + f16vec4(-0.1263427734375hf, -0.0016489028930664062hf, 0.1124267578125hf, -0.0877685546875hf), + f16vec4(0.08612060546875hf, -0.0008077621459960938hf, 0.00917816162109375hf, -0.10546875hf), + f16vec4(-0.1507568359375hf, -0.27001953125hf, -0.08282470703125hf, -0.0921630859375hf)); +const f16mat4 w3_18 = f16mat4( + f16vec4(-0.05804443359375hf, -0.044403076171875hf, 0.11370849609375hf, -0.145751953125hf), + f16vec4(-0.2493896484375hf, -0.26171875hf, 0.08685302734375hf, 0.015167236328125hf), + f16vec4(-0.218505859375hf, -0.06280517578125hf, 0.1390380859375hf, -0.0858154296875hf), + f16vec4(-0.10357666015625hf, -0.1837158203125hf, 0.1282958984375hf, -0.150634765625hf)); +const f16mat4 w3_19 = f16mat4( + f16vec4(-0.165771484375hf, -0.138916015625hf, -0.04888916015625hf, -0.1063232421875hf), + f16vec4(-0.2484130859375hf, -0.2198486328125hf, -0.0295562744140625hf, -0.02825927734375hf), + f16vec4(-0.127685546875hf, -0.01556396484375hf, 0.1595458984375hf, -0.037506103515625hf), + f16vec4(-0.08587646484375hf, -0.0953369140625hf, 0.09478759765625hf, -0.08477783203125hf)); +const f16mat4 w3_20 = f16mat4( + f16vec4(-0.149169921875hf, -0.162841796875hf, -0.034454345703125hf, -0.17041015625hf), + f16vec4(-0.187744140625hf, -0.18505859375hf, -0.019775390625hf, -0.08697509765625hf), + f16vec4(-0.11370849609375hf, 0.107421875hf, 0.1915283203125hf, -0.0865478515625hf), + f16vec4(-0.1806640625hf, -0.0877685546875hf, 0.1253662109375hf, -0.1239013671875hf)); +const f16mat4 w3_21 = f16mat4( + f16vec4(-0.04559326171875hf, -0.06634521484375hf, 0.046051025390625hf, -0.1568603515625hf), + f16vec4(-0.1968994140625hf, -0.1695556640625hf, 0.12396240234375hf, 0.056121826171875hf), + f16vec4(-0.2054443359375hf, -0.1246337890625hf, 0.10467529296875hf, -0.06610107421875hf), + f16vec4(-0.18408203125hf, -0.156982421875hf, 0.06610107421875hf, -0.17578125hf)); +const f16mat4 w3_22 = f16mat4( + f16vec4(-0.1424560546875hf, -0.0972900390625hf, -0.061614990234375hf, -0.12200927734375hf), + f16vec4(-0.171875hf, -0.103759765625hf, 0.037384033203125hf, 0.056976318359375hf), + f16vec4(-0.176025390625hf, -0.0728759765625hf, 0.1265869140625hf, -0.0074310302734375hf), + f16vec4(-0.135498046875hf, -0.0079803466796875hf, 0.029022216796875hf, -0.12408447265625hf)); +const f16mat4 w3_23 = f16mat4( + f16vec4(-0.09466552734375hf, -0.154541015625hf, -0.004364013671875hf, -0.176025390625hf), + f16vec4(-0.1282958984375hf, -0.0989990234375hf, 0.06951904296875hf, 0.045318603515625hf), + f16vec4(-0.184814453125hf, -0.01197052001953125hf, 0.17431640625hf, -0.027862548828125hf), + f16vec4(-0.2354736328125hf, -0.0692138671875hf, 0.061279296875hf, -0.12384033203125hf)); +const f16mat4 w3_24 = f16mat4( + f16vec4(-0.093505859375hf, -0.0487060546875hf, 0.146240234375hf, -0.2047119140625hf), + f16vec4(-0.2452392578125hf, -0.208984375hf, 0.10430908203125hf, -0.0193634033203125hf), + f16vec4(-0.10247802734375hf, -0.054656982421875hf, 0.1529541015625hf, -0.09722900390625hf), + f16vec4(-0.0928955078125hf, -0.2022705078125hf, 0.0906982421875hf, -0.211181640625hf)); +const f16mat4 w3_25 = f16mat4( + f16vec4(-0.166748046875hf, -0.10498046875hf, 0.0162200927734375hf, -0.1639404296875hf), + f16vec4(-0.2137451171875hf, -0.1341552734375hf, 0.02783203125hf, 0.0096435546875hf), + f16vec4(-0.08770751953125hf, -0.017547607421875hf, 0.152587890625hf, -0.0386962890625hf), + f16vec4(-0.03485107421875hf, -0.06463623046875hf, 0.06195068359375hf, -0.123779296875hf)); +const f16mat4 w3_26 = f16mat4( + f16vec4(-0.10870361328125hf, -0.132568359375hf, 0.0777587890625hf, -0.2291259765625hf), + f16vec4(-0.126953125hf, -0.1373291015625hf, 0.057342529296875hf, 0.025848388671875hf), + f16vec4(-0.1455078125hf, 0.04498291015625hf, 0.1201171875hf, -0.06292724609375hf), + f16vec4(-0.059814453125hf, -0.058990478515625hf, 0.10369873046875hf, -0.139404296875hf)); +const f16mat4 w3_27 = f16mat4( + f16vec4(-0.07293701171875hf, 0.00836181640625hf, -0.085205078125hf, 0.1405029296875hf), + f16vec4(0.05609130859375hf, -0.020111083984375hf, -0.04931640625hf, -0.11279296875hf), + f16vec4(-0.23046875hf, -0.1826171875hf, -0.445556640625hf, -0.2421875hf), + f16vec4(-0.04461669921875hf, -0.12005615234375hf, -0.2235107421875hf, -0.21875hf)); +const f16mat4 w3_28 = f16mat4( + f16vec4(-0.048858642578125hf, -0.00732421875hf, -0.051239013671875hf, 0.1544189453125hf), + f16vec4(0.06585693359375hf, -0.01082611083984375hf, -0.01528167724609375hf, -0.07708740234375hf), + f16vec4(-0.304443359375hf, -0.18310546875hf, -0.46923828125hf, -0.10125732421875hf), + f16vec4(-0.07391357421875hf, -0.093994140625hf, -0.29931640625hf, -0.108642578125hf)); +const f16mat4 w3_29 = f16mat4( + f16vec4(0.0287933349609375hf, 0.052032470703125hf, -0.072021484375hf, 0.1497802734375hf), + f16vec4(0.00789642333984375hf, 0.01155853271484375hf, -0.00974273681640625hf, -0.0892333984375hf), + f16vec4(-0.297119140625hf, -0.1630859375hf, -0.49072265625hf, -0.2354736328125hf), + f16vec4(0.0268402099609375hf, -0.083251953125hf, -0.288330078125hf, -0.2242431640625hf)); +const f16mat4 w3_30 = f16mat4( + f16vec4(-0.05682373046875hf, 0.05126953125hf, -0.10931396484375hf, 0.08843994140625hf), + f16vec4(0.09130859375hf, -0.0231170654296875hf, -0.04461669921875hf, -0.0853271484375hf), + f16vec4(-0.2054443359375hf, -0.2080078125hf, -0.52392578125hf, -0.189208984375hf), + f16vec4(-0.118408203125hf, -0.1136474609375hf, -0.1573486328125hf, -0.09393310546875hf)); +const f16mat4 w3_31 = f16mat4( + f16vec4(-0.04913330078125hf, -0.004817962646484375hf, -0.054931640625hf, 0.1466064453125hf), + f16vec4(0.151611328125hf, 0.050811767578125hf, -0.01432037353515625hf, -0.06097412109375hf), + f16vec4(-0.275390625hf, -0.1292724609375hf, -0.537109375hf, -0.07666015625hf), + f16vec4(-0.1292724609375hf, -0.0631103515625hf, -0.256103515625hf, -0.048583984375hf)); +const f16mat4 w3_32 = f16mat4( + f16vec4(-0.0005311965942382812hf, 0.059906005859375hf, -0.0838623046875hf, 0.1683349609375hf), + f16vec4(0.10662841796875hf, 0.07904052734375hf, -0.0234527587890625hf, -0.07916259765625hf), + f16vec4(-0.272216796875hf, -0.1788330078125hf, -0.50146484375hf, -0.243896484375hf), + f16vec4(-0.0841064453125hf, -0.079833984375hf, -0.2193603515625hf, -0.133056640625hf)); +const f16mat4 w3_33 = f16mat4( + f16vec4(0.01508331298828125hf, 0.08160400390625hf, -0.12164306640625hf, 0.0251922607421875hf), + f16vec4(0.0011625289916992188hf, -0.0904541015625hf, -0.006618499755859375hf, -0.06793212890625hf), + f16vec4(-0.1990966796875hf, -0.2705078125hf, -0.4541015625hf, -0.3193359375hf), + f16vec4(-0.10308837890625hf, -0.102294921875hf, -0.204833984375hf, -0.1756591796875hf)); +const f16mat4 w3_34 = f16mat4( + f16vec4(-0.0270233154296875hf, 0.011199951171875hf, -0.0557861328125hf, 0.06878662109375hf), + f16vec4(0.09588623046875hf, -0.026702880859375hf, 0.0194549560546875hf, -0.049224853515625hf), + f16vec4(-0.25439453125hf, -0.1661376953125hf, -0.45849609375hf, -0.1722412109375hf), + f16vec4(-0.130126953125hf, -0.0543212890625hf, -0.306640625hf, -0.0958251953125hf)); +const f16mat4 w3_35 = f16mat4( + f16vec4(0.032135009765625hf, 0.0579833984375hf, -0.042236328125hf, 0.13623046875hf), + f16vec4(0.0745849609375hf, 0.01983642578125hf, 0.0016546249389648438hf, -0.08160400390625hf), + f16vec4(-0.26806640625hf, -0.184814453125hf, -0.412109375hf, -0.34423828125hf), + f16vec4(-0.060302734375hf, -0.050262451171875hf, -0.250244140625hf, -0.204833984375hf)); +const f16vec4 sub3 = f16vec4(-3.376953125hf, -3.587890625hf, -4.859375hf, -3.671875hf); +const f16vec4 mul3 = f16vec4(0.609375hf, 0.55712890625hf, 0.6328125hf, 0.52197265625hf); +const f16vec4 add3 = f16vec4(-0.5205078125hf, -0.52294921875hf, -0.73291015625hf, -0.65380859375hf); + +void main() +{ + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 ext = imageSize(dstA); + if (p.x >= ext.x || p.y >= ext.y) + return; + + f16vec4 t0 = padTap(srcA, p + ivec2(-1, -1)); + f16vec4 t1 = padTap(srcA, p + ivec2(-1, 0)); + f16vec4 t2 = padTap(srcA, p + ivec2(-1, 1)); + f16vec4 t3 = padTap(srcA, p + ivec2(0, -1)); + f16vec4 t4 = f16vec4(texelFetch(srcA, p, 0)); + f16vec4 t5 = padTap(srcA, p + ivec2(0, 1)); + f16vec4 t6 = padTap(srcA, p + ivec2(1, -1)); + f16vec4 t7 = padTap(srcA, p + ivec2(1, 0)); + f16vec4 t8 = padTap(srcA, p + ivec2(1, 1)); + f16vec4 t9 = padTap(srcB, p + ivec2(-1, -1)); + f16vec4 t10 = padTap(srcB, p + ivec2(-1, 0)); + f16vec4 t11 = padTap(srcB, p + ivec2(-1, 1)); + f16vec4 t12 = padTap(srcB, p + ivec2(0, -1)); + f16vec4 t13 = f16vec4(texelFetch(srcB, p, 0)); + f16vec4 t14 = padTap(srcB, p + ivec2(0, 1)); + f16vec4 t15 = padTap(srcB, p + ivec2(1, -1)); + f16vec4 t16 = padTap(srcB, p + ivec2(1, 0)); + f16vec4 t17 = padTap(srcB, p + ivec2(1, 1)); + f16vec4 t18 = padTap(srcC, p + ivec2(-1, -1)); + f16vec4 t19 = padTap(srcC, p + ivec2(-1, 0)); + f16vec4 t20 = padTap(srcC, p + ivec2(-1, 1)); + f16vec4 t21 = padTap(srcC, p + ivec2(0, -1)); + f16vec4 t22 = f16vec4(texelFetch(srcC, p, 0)); + f16vec4 t23 = padTap(srcC, p + ivec2(0, 1)); + f16vec4 t24 = padTap(srcC, p + ivec2(1, -1)); + f16vec4 t25 = padTap(srcC, p + ivec2(1, 0)); + f16vec4 t26 = padTap(srcC, p + ivec2(1, 1)); + f16vec4 t27 = padTap(srcD, p + ivec2(-1, -1)); + f16vec4 t28 = padTap(srcD, p + ivec2(-1, 0)); + f16vec4 t29 = padTap(srcD, p + ivec2(-1, 1)); + f16vec4 t30 = padTap(srcD, p + ivec2(0, -1)); + f16vec4 t31 = f16vec4(texelFetch(srcD, p, 0)); + f16vec4 t32 = padTap(srcD, p + ivec2(0, 1)); + f16vec4 t33 = padTap(srcD, p + ivec2(1, -1)); + f16vec4 t34 = padTap(srcD, p + ivec2(1, 0)); + f16vec4 t35 = padTap(srcD, p + ivec2(1, 1)); + + f16vec4 r0 = w0_0 * t0; + r0 += w0_1 * t1; + r0 += w0_2 * t2; + r0 += w0_3 * t3; + r0 += w0_4 * t4; + r0 += w0_5 * t5; + r0 += w0_6 * t6; + r0 += w0_7 * t7; + r0 += w0_8 * t8; + r0 += w0_9 * t9; + r0 += w0_10 * t10; + r0 += w0_11 * t11; + r0 += w0_12 * t12; + r0 += w0_13 * t13; + r0 += w0_14 * t14; + r0 += w0_15 * t15; + r0 += w0_16 * t16; + r0 += w0_17 * t17; + r0 += w0_18 * t18; + r0 += w0_19 * t19; + r0 += w0_20 * t20; + r0 += w0_21 * t21; + r0 += w0_22 * t22; + r0 += w0_23 * t23; + r0 += w0_24 * t24; + r0 += w0_25 * t25; + r0 += w0_26 * t26; + r0 += w0_27 * t27; + r0 += w0_28 * t28; + r0 += w0_29 * t29; + r0 += w0_30 * t30; + r0 += w0_31 * t31; + r0 += w0_32 * t32; + r0 += w0_33 * t33; + r0 += w0_34 * t34; + r0 += w0_35 * t35; + r0 = (r0 - sub0) * mul0 + add0; + imageStore(dstA, p, vec4(r0)); + + f16vec4 r1 = w1_0 * t0; + r1 += w1_1 * t1; + r1 += w1_2 * t2; + r1 += w1_3 * t3; + r1 += w1_4 * t4; + r1 += w1_5 * t5; + r1 += w1_6 * t6; + r1 += w1_7 * t7; + r1 += w1_8 * t8; + r1 += w1_9 * t9; + r1 += w1_10 * t10; + r1 += w1_11 * t11; + r1 += w1_12 * t12; + r1 += w1_13 * t13; + r1 += w1_14 * t14; + r1 += w1_15 * t15; + r1 += w1_16 * t16; + r1 += w1_17 * t17; + r1 += w1_18 * t18; + r1 += w1_19 * t19; + r1 += w1_20 * t20; + r1 += w1_21 * t21; + r1 += w1_22 * t22; + r1 += w1_23 * t23; + r1 += w1_24 * t24; + r1 += w1_25 * t25; + r1 += w1_26 * t26; + r1 += w1_27 * t27; + r1 += w1_28 * t28; + r1 += w1_29 * t29; + r1 += w1_30 * t30; + r1 += w1_31 * t31; + r1 += w1_32 * t32; + r1 += w1_33 * t33; + r1 += w1_34 * t34; + r1 += w1_35 * t35; + r1 = (r1 - sub1) * mul1 + add1; + imageStore(dstB, p, vec4(r1)); + + f16vec4 r2 = w2_0 * t0; + r2 += w2_1 * t1; + r2 += w2_2 * t2; + r2 += w2_3 * t3; + r2 += w2_4 * t4; + r2 += w2_5 * t5; + r2 += w2_6 * t6; + r2 += w2_7 * t7; + r2 += w2_8 * t8; + r2 += w2_9 * t9; + r2 += w2_10 * t10; + r2 += w2_11 * t11; + r2 += w2_12 * t12; + r2 += w2_13 * t13; + r2 += w2_14 * t14; + r2 += w2_15 * t15; + r2 += w2_16 * t16; + r2 += w2_17 * t17; + r2 += w2_18 * t18; + r2 += w2_19 * t19; + r2 += w2_20 * t20; + r2 += w2_21 * t21; + r2 += w2_22 * t22; + r2 += w2_23 * t23; + r2 += w2_24 * t24; + r2 += w2_25 * t25; + r2 += w2_26 * t26; + r2 += w2_27 * t27; + r2 += w2_28 * t28; + r2 += w2_29 * t29; + r2 += w2_30 * t30; + r2 += w2_31 * t31; + r2 += w2_32 * t32; + r2 += w2_33 * t33; + r2 += w2_34 * t34; + r2 += w2_35 * t35; + r2 = (r2 - sub2) * mul2 + add2; + imageStore(dstC, p, vec4(r2)); + + f16vec4 r3 = w3_0 * t0; + r3 += w3_1 * t1; + r3 += w3_2 * t2; + r3 += w3_3 * t3; + r3 += w3_4 * t4; + r3 += w3_5 * t5; + r3 += w3_6 * t6; + r3 += w3_7 * t7; + r3 += w3_8 * t8; + r3 += w3_9 * t9; + r3 += w3_10 * t10; + r3 += w3_11 * t11; + r3 += w3_12 * t12; + r3 += w3_13 * t13; + r3 += w3_14 * t14; + r3 += w3_15 * t15; + r3 += w3_16 * t16; + r3 += w3_17 * t17; + r3 += w3_18 * t18; + r3 += w3_19 * t19; + r3 += w3_20 * t20; + r3 += w3_21 * t21; + r3 += w3_22 * t22; + r3 += w3_23 * t23; + r3 += w3_24 * t24; + r3 += w3_25 * t25; + r3 += w3_26 * t26; + r3 += w3_27 * t27; + r3 += w3_28 * t28; + r3 += w3_29 * t29; + r3 += w3_30 * t30; + r3 += w3_31 * t31; + r3 += w3_32 * t32; + r3 += w3_33 * t33; + r3 += w3_34 * t34; + r3 += w3_35 * t35; + r3 = (r3 - sub3) * mul3 + add3; + imageStore(dstD, p, vec4(r3)); + +} diff --git a/cleanroom/glsl/shader_48.comp b/cleanroom/glsl/shader_48.comp new file mode 100644 index 0000000..3c1cdd6 --- /dev/null +++ b/cleanroom/glsl/shader_48.comp @@ -0,0 +1,156 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 0) uniform Params { + float reserved0; + float phase; + float reserved1; +} ub; + +layout(set = 0, binding = 32) uniform sampler2D convIn0; +layout(set = 0, binding = 33) uniform sampler2D convIn1; +layout(set = 0, binding = 34) uniform sampler2D convIn2; +layout(set = 0, binding = 35) uniform sampler2D convIn3; +layout(set = 0, binding = 36) uniform sampler2D coarseFlow; +layout(set = 0, binding = 37) uniform sampler2D maskTex; +layout(set = 0, binding = 48, rgba16f) uniform writeonly image2D flowOut; + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + if (any(greaterThanEqual(p, imageSize(flowOut)))) return; + + vec2 sz = vec2(textureSize(convIn0, 0)); + vec2 pc = vec2(p) + 0.5; + vec2 uv = pc / sz; + + // 3x3 conv, 16 channels in -> 2-channel flow correction (rx, ry). + f16vec4 tap; + float16_t rx, ry; + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(-1, -1))); + rx = dot(f16vec4(-0.0185546875hf, -0.0380859375hf, 0.0002999305725097656hf, -0.038543701171875hf), tap); + ry = dot(f16vec4(0.0010690689086914062hf, -0.0005688667297363281hf, 0.01380157470703125hf, -0.0543212890625hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(-1, 0))); + rx += dot(f16vec4(-0.1787109375hf, -0.1768798828125hf, 0.0006561279296875hf, -0.05657958984375hf), tap); + ry += dot(f16vec4(0.0006651878356933594hf, 0.0002789497375488281hf, 0.1224365234375hf, -0.179931640625hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(-1, 1))); + rx += dot(f16vec4(0.0333251953125hf, -0.053253173828125hf, -0.0007839202880859375hf, -0.0521240234375hf), tap); + ry += dot(f16vec4(-0.00783538818359375hf, 2.9802322387695312e-06hf, 0.0555419921875hf, -0.12127685546875hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(0, -1))); + rx += dot(f16vec4(-0.125732421875hf, -0.1270751953125hf, 0.0001519918441772461hf, -0.0186309814453125hf), tap); + ry += dot(f16vec4(0.0058746337890625hf, 0.0006461143493652344hf, 0.137939453125hf, -0.201416015625hf), tap); + tap = f16vec4(textureLod(convIn0, uv, 0.0)); + rx += dot(f16vec4(-0.325927734375hf, -0.252685546875hf, -0.0007309913635253906hf, -0.0233154296875hf), tap); + ry += dot(f16vec4(-0.0025787353515625hf, -0.0004169940948486328hf, 0.2342529296875hf, -0.298583984375hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(0, 1))); + rx += dot(f16vec4(-0.11627197265625hf, -0.133544921875hf, 0.0003120899200439453hf, -0.00241851806640625hf), tap); + ry += dot(f16vec4(0.0079803466796875hf, 0.00021600723266601562hf, 0.179443359375hf, -0.258544921875hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(1, -1))); + rx += dot(f16vec4(-0.006229400634765625hf, -0.0209503173828125hf, -0.0005078315734863281hf, -0.05609130859375hf), tap); + ry += dot(f16vec4(-0.006816864013671875hf, -0.0001590251922607422hf, 0.044158935546875hf, -0.058013916015625hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(1, 0))); + rx += dot(f16vec4(-0.2095947265625hf, -0.146728515625hf, 0.0003800392150878906hf, -0.054046630859375hf), tap); + ry += dot(f16vec4(0.0011148452758789062hf, 0.00032210350036621094hf, 0.1417236328125hf, -0.1551513671875hf), tap); + tap = f16vec4(textureLodOffset(convIn0, uv, 0.0, ivec2(1, 1))); + rx += dot(f16vec4(-0.05963134765625hf, -0.044219970703125hf, 0.0002340078353881836hf, -0.01398468017578125hf), tap); + ry += dot(f16vec4(-0.0001499652862548828hf, -0.0003669261932373047hf, 0.0694580078125hf, -0.09356689453125hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(-1, -1))); + rx += dot(f16vec4(0.0034313201904296875hf, -6.002187728881836e-05hf, 0.004528045654296875hf, -0.13232421875hf), tap); + ry += dot(f16vec4(-0.00025200843811035156hf, -0.03887939453125hf, -0.0185089111328125hf, 0.096435546875hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(-1, 0))); + rx += dot(f16vec4(0.12646484375hf, -0.00045990943908691406hf, -0.031097412109375hf, -0.2288818359375hf), tap); + ry += dot(f16vec4(0.0007171630859375hf, -0.144287109375hf, -0.131591796875hf, 0.0833740234375hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(-1, 1))); + rx += dot(f16vec4(0.0208587646484375hf, 0.0005860328674316406hf, -0.007266998291015625hf, -0.1253662109375hf), tap); + ry += dot(f16vec4(-0.0005221366882324219hf, -0.043182373046875hf, -0.13134765625hf, 0.0023975372314453125hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(0, -1))); + rx += dot(f16vec4(0.1219482421875hf, -0.00016605854034423828hf, -0.1170654296875hf, -0.2430419921875hf), tap); + ry += dot(f16vec4(0.0007958412170410156hf, -0.162109375hf, -0.0357666015625hf, 0.061920166015625hf), tap); + tap = f16vec4(textureLod(convIn1, uv, 0.0)); + rx += dot(f16vec4(0.2548828125hf, 0.00013005733489990234hf, -0.138916015625hf, -0.3720703125hf), tap); + ry += dot(f16vec4(-0.0014734268188476562hf, -0.225830078125hf, -0.16259765625hf, 0.06658935546875hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(0, 1))); + rx += dot(f16vec4(0.133056640625hf, 4.601478576660156e-05hf, -0.11334228515625hf, -0.269775390625hf), tap); + ry += dot(f16vec4(0.0008292198181152344hf, -0.1378173828125hf, -0.1640625hf, 0.050140380859375hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(1, -1))); + rx += dot(f16vec4(0.0653076171875hf, 0.00039005279541015625hf, -0.08538818359375hf, -0.12646484375hf), tap); + ry += dot(f16vec4(-0.0006117820739746094hf, -0.06719970703125hf, -0.056915283203125hf, 0.0091094970703125hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(1, 0))); + rx += dot(f16vec4(0.191650390625hf, -7.998943328857422e-05hf, -0.0887451171875hf, -0.2294921875hf), tap); + ry += dot(f16vec4(0.0008521080017089844hf, -0.1402587890625hf, -0.1572265625hf, 0.059844970703125hf), tap); + tap = f16vec4(textureLodOffset(convIn1, uv, 0.0, ivec2(1, 1))); + rx += dot(f16vec4(0.0819091796875hf, -0.0003991127014160156hf, -0.037750244140625hf, -0.169677734375hf), tap); + ry += dot(f16vec4(-0.00032806396484375hf, -0.039794921875hf, -0.10675048828125hf, 0.08465576171875hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(-1, -1))); + rx += dot(f16vec4(0.11761474609375hf, 0.01514434814453125hf, -0.004123687744140625hf, 0.005062103271484375hf), tap); + ry += dot(f16vec4(-0.0233306884765625hf, 0.004283905029296875hf, -0.0246734619140625hf, -0.0010919570922851562hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(-1, 0))); + rx += dot(f16vec4(0.2890625hf, -0.138671875hf, 0.0010557174682617188hf, 0.1334228515625hf), tap); + ry += dot(f16vec4(0.0018663406372070312hf, 0.0014486312866210938hf, 0.1470947265625hf, -0.0021495819091796875hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(-1, 1))); + rx += dot(f16vec4(0.10443115234375hf, 0.0123291015625hf, 0.0019817352294921875hf, -0.01263427734375hf), tap); + ry += dot(f16vec4(-0.004329681396484375hf, -0.007602691650390625hf, 0.01317596435546875hf, -0.0003330707550048828hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(0, -1))); + rx += dot(f16vec4(0.207275390625hf, -0.0482177734375hf, -0.0018672943115234375hf, 0.12200927734375hf), tap); + ry += dot(f16vec4(0.0012693405151367188hf, 0.004482269287109375hf, 0.1785888671875hf, -0.0020275115966796875hf), tap); + tap = f16vec4(textureLod(convIn2, uv, 0.0)); + rx += dot(f16vec4(0.394775390625hf, -0.1968994140625hf, 0.004192352294921875hf, 0.291015625hf), tap); + ry += dot(f16vec4(0.0005888938903808594hf, -0.0037631988525390625hf, 0.3310546875hf, 0.005359649658203125hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(0, 1))); + rx += dot(f16vec4(0.206787109375hf, -0.0545654296875hf, -0.0011138916015625hf, 0.138916015625hf), tap); + ry += dot(f16vec4(-0.032073974609375hf, -0.007671356201171875hf, 0.2042236328125hf, 0.004871368408203125hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(1, -1))); + rx += dot(f16vec4(0.09173583984375hf, -0.0174713134765625hf, 0.00264739990234375hf, 0.03515625hf), tap); + ry += dot(f16vec4(0.0196075439453125hf, -0.0007371902465820312hf, 0.0247039794921875hf, 0.003162384033203125hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(1, 0))); + rx += dot(f16vec4(0.264404296875hf, -0.20068359375hf, 0.0028839111328125hf, 0.189697265625hf), tap); + ry += dot(f16vec4(-0.0026874542236328125hf, 0.0006909370422363281hf, 0.14697265625hf, -0.003154754638671875hf), tap); + tap = f16vec4(textureLodOffset(convIn2, uv, 0.0, ivec2(1, 1))); + rx += dot(f16vec4(0.11456298828125hf, -0.05401611328125hf, -0.006969451904296875hf, 0.09893798828125hf), tap); + ry += dot(f16vec4(-0.0706787109375hf, 0.00809478759765625hf, -0.01338958740234375hf, -0.0036773681640625hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(-1, -1))); + rx += dot(f16vec4(0.0100860595703125hf, -0.05108642578125hf, 0.0017480850219726562hf, -0.0007948875427246094hf), tap); + ry += dot(f16vec4(0.0382080078125hf, -0.0892333984375hf, -0.0109710693359375hf, -0.01383209228515625hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(-1, 0))); + rx += dot(f16vec4(-0.0162353515625hf, -0.09490966796875hf, -0.0029392242431640625hf, 0.01459503173828125hf), tap); + ry += dot(f16vec4(0.1142578125hf, 0.0001569986343383789hf, -0.134521484375hf, -0.05950927734375hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(-1, 1))); + rx += dot(f16vec4(0.01861572265625hf, 0.045867919921875hf, -0.0001239776611328125hf, -0.06634521484375hf), tap); + ry += dot(f16vec4(0.08984375hf, 0.048919677734375hf, 0.003589630126953125hf, 0.034637451171875hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(0, -1))); + rx += dot(f16vec4(-0.01226043701171875hf, -0.1632080078125hf, 0.005344390869140625hf, 0.07958984375hf), tap); + ry += dot(f16vec4(0.0753173828125hf, -0.08404541015625hf, -0.20361328125hf, -0.057037353515625hf), tap); + tap = f16vec4(textureLod(convIn3, uv, 0.0)); + rx += dot(f16vec4(-0.039794921875hf, -0.243408203125hf, -0.0034770965576171875hf, 0.125732421875hf), tap); + ry += dot(f16vec4(0.1663818359375hf, 0.017425537109375hf, -0.3173828125hf, -0.1070556640625hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(0, 1))); + rx += dot(f16vec4(-0.0241241455078125hf, -0.134765625hf, 0.0009222030639648438hf, 0.08734130859375hf), tap); + ry += dot(f16vec4(0.1500244140625hf, 0.1092529296875hf, -0.1485595703125hf, -0.052978515625hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(1, -1))); + rx += dot(f16vec4(0.0259857177734375hf, -0.003025054931640625hf, -0.0038967132568359375hf, 0.00701141357421875hf), tap); + ry += dot(f16vec4(0.0328369140625hf, -0.11712646484375hf, -0.06341552734375hf, 0.0207366943359375hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(1, 0))); + rx += dot(f16vec4(-0.01474761962890625hf, -0.079345703125hf, 0.00021505355834960938hf, 0.08404541015625hf), tap); + ry += dot(f16vec4(0.11285400390625hf, 0.015777587890625hf, -0.15380859375hf, -0.04156494140625hf), tap); + tap = f16vec4(textureLodOffset(convIn3, uv, 0.0, ivec2(1, 1))); + rx += dot(f16vec4(0.01357269287109375hf, -0.03155517578125hf, 0.002582550048828125hf, 0.094970703125hf), tap); + ry += dot(f16vec4(0.11920166015625hf, 0.10693359375hf, 0.027435302734375hf, -0.0004010200500488281hf), tap); + rx += 1.0132789611816406e-06hf; + ry += -2.0265579223632812e-06hf; + + f16vec4 base = f16vec4(textureLod(coarseFlow, uv, 0.0)) * 2.0hf; + f16vec2 fwd = base.xy + f16vec2(rx, ry); + f16vec2 bwd = base.zw - f16vec2(rx, ry); + + vec2 probeF = (pc + (vec2(fwd) * (2.0 * ub.phase)) * 0.25) / sz; + float16_t wF = 1.0hf - float16_t(textureLod(maskTex, probeF, 0.0).x); + f16vec2 fwdW = fwd * wF; + + vec2 probeB = (pc + (vec2(bwd) * (2.0 * (1.0 - ub.phase))) * 0.25) / sz; + float16_t wB = 1.0hf - float16_t(textureLod(maskTex, probeB, 0.0).x); + f16vec2 bwdW = bwd * wB; + + float16_t wC = 1.0hf - float16_t(textureLod(maskTex, uv, 0.0).x); + imageStore(flowOut, p, vec4(f16vec4(fwdW.x, fwdW.y, bwdW.x, bwdW.y) * wC)); +} diff --git a/cleanroom/glsl/shader_49.comp b/cleanroom/glsl/shader_49.comp new file mode 100644 index 0000000..f88ba14 --- /dev/null +++ b/cleanroom/glsl/shader_49.comp @@ -0,0 +1,200 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 0) uniform Params { + float reserved0; + float phase; + float reserved1; +} ub; + +layout(set = 0, binding = 32) uniform sampler2D featA0; +layout(set = 0, binding = 33) uniform sampler2D featA1; +layout(set = 0, binding = 34) uniform sampler2D featA2; +layout(set = 0, binding = 35) uniform sampler2D featA3; +layout(set = 0, binding = 36) uniform sampler2D featB0; +layout(set = 0, binding = 37) uniform sampler2D featB1; +layout(set = 0, binding = 38) uniform sampler2D featB2; +layout(set = 0, binding = 39) uniform sampler2D featB3; +layout(set = 0, binding = 40) uniform sampler2D flowP; +layout(set = 0, binding = 41) uniform sampler2D flowQ; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D encOut0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D encOut1; + +const ivec2 TAPS[9] = ivec2[9]( + ivec2(-1, -1), ivec2(0, -1), ivec2(1, -1), ivec2(-1, 0), ivec2(0, 0), + ivec2(1, 0), ivec2(-1, 1), ivec2(0, 1), ivec2(1, 1)); + +const f16vec4 NORM1_M = f16vec4(4.66015625hf, 4.79296875hf, 4.64453125hf, 4.90625hf); +const f16vec4 NORM1_S = f16vec4(0.61474609375hf, 0.41455078125hf, 0.3701171875hf, 0.501953125hf); +const f16vec4 NORM1_B = f16vec4(-0.34375hf, 0.11907958984375hf, -0.1085205078125hf, -0.01666259765625hf); +const f16vec4 NORM2_M = f16vec4(5.34765625hf, 4.90625hf, 4.64453125hf, 4.796875hf); +const f16vec4 NORM2_S = f16vec4(0.236328125hf, 0.42919921875hf, 0.289794921875hf, 0.44091796875hf); +const f16vec4 NORM2_B = f16vec4(0.453125hf, 0.2607421875hf, 0.08062744140625hf, 0.0902099609375hf); + +// Step along one flow direction, then re-read the flow at the stepped position. +void chase(sampler2D flowTex, vec2 pc, vec2 uv, vec2 sz, + float16_t wFwd, float16_t wBwd, out vec2 uvFwd, out vec2 uvBwd) { + f16vec4 v = f16vec4(textureLod(flowTex, uv, 0.0)); + vec2 probeF = (pc + vec2(v.xy * wFwd)) / sz; + f16vec2 stepF = f16vec2(textureLod(flowTex, probeF, 0.0).xy); + uvFwd = (pc + vec2(stepF)) / sz; + vec2 probeB = (pc + vec2(v.zw * wBwd)) / sz; + f16vec2 stepB = f16vec2(textureLod(flowTex, probeB, 0.0).zw); + uvBwd = (pc + vec2(stepB)) / sz; +} + +// 3x3 neighborhood: clamped integer fetches, except the sampled center. +void gatherTaps(sampler2D tex, ivec2 p, ivec2 lim, vec2 uv, out f16vec4 taps[9]) { + for (int k = 0; k < 9; ++k) { + taps[k] = (k == 4) + ? f16vec4(textureLod(tex, uv, 0.0)) + : f16vec4(texelFetch(tex, clamp(p + TAPS[k], ivec2(0), lim), 0)); + } +} + +void corrBundle(f16vec4 m0, f16vec4 m1, f16vec4 m2, f16vec4 m3, + f16vec4 t0[9], f16vec4 t1[9], f16vec4 t2[9], f16vec4 t3[9], + out f16vec4 q1, out f16vec4 q2, out float16_t s) { + float16_t c[9]; + for (int k = 0; k < 9; ++k) { + c[k] = ((dot(m0, t0[k]) + dot(m1, t1[k])) + dot(m2, t2[k])) + dot(m3, t3[k]); + } + q1 = clamp((f16vec4(c[0], c[1], c[2], c[3]) - NORM1_M) * NORM1_S + NORM1_B, + f16vec4(0.0hf), f16vec4(1.0hf)); + q2 = clamp((f16vec4(c[4], c[5], c[6], c[7]) - NORM2_M) * NORM2_S + NORM2_B, + f16vec4(0.0hf), f16vec4(1.0hf)); + s = clamp((c[8] - 4.6640625hf) * 0.54345703125hf + (-0.2110595703125hf), + 0.0hf, 1.0hf); +} + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + if (any(greaterThanEqual(p, imageSize(encOut0)))) return; + + ivec2 szI = textureSize(featA0, 0); + vec2 sz = vec2(szI); + ivec2 lim = szI - ivec2(1); + vec2 pc = vec2(p) + 0.5; + vec2 uv = pc / sz; + float16_t wFwd = float16_t(1.0 - ub.phase); + float16_t wBwd = float16_t(ub.phase); + + vec2 uvPF, uvPB, uvQF, uvQB; + chase(flowP, pc, uv, sz, wFwd, wBwd, uvPF, uvPB); + chase(flowQ, pc, uv, sz, wFwd, wBwd, uvQF, uvQB); + + f16vec4 tA0[9], tA1[9], tA2[9], tA3[9]; + f16vec4 tB0[9], tB1[9], tB2[9], tB3[9]; + gatherTaps(featA0, p, lim, uv, tA0); + gatherTaps(featA1, p, lim, uv, tA1); + gatherTaps(featA2, p, lim, uv, tA2); + gatherTaps(featA3, p, lim, uv, tA3); + gatherTaps(featB0, p, lim, uv, tB0); + gatherTaps(featB1, p, lim, uv, tB1); + gatherTaps(featB2, p, lim, uv, tB2); + gatherTaps(featB3, p, lim, uv, tB3); + + f16vec4 q1K0, q2K0, q1K1, q2K1, q1K2, q2K2, q1K3, q2K3; + float16_t sK0, sK1, sK2, sK3; + corrBundle(f16vec4(textureLod(featA0, uvPF, 0.0)), + f16vec4(textureLod(featA1, uvPF, 0.0)), + f16vec4(textureLod(featA2, uvPF, 0.0)), + f16vec4(textureLod(featA3, uvPF, 0.0)), + tB0, tB1, tB2, tB3, q1K0, q2K0, sK0); + corrBundle(f16vec4(textureLod(featA0, uvQF, 0.0)), + f16vec4(textureLod(featA1, uvQF, 0.0)), + f16vec4(textureLod(featA2, uvQF, 0.0)), + f16vec4(textureLod(featA3, uvQF, 0.0)), + tB0, tB1, tB2, tB3, q1K1, q2K1, sK1); + corrBundle(f16vec4(textureLod(featB0, uvPB, 0.0)), + f16vec4(textureLod(featB1, uvPB, 0.0)), + f16vec4(textureLod(featB2, uvPB, 0.0)), + f16vec4(textureLod(featB3, uvPB, 0.0)), + tA0, tA1, tA2, tA3, q1K2, q2K2, sK2); + corrBundle(f16vec4(textureLod(featB0, uvQB, 0.0)), + f16vec4(textureLod(featB1, uvQB, 0.0)), + f16vec4(textureLod(featB2, uvQB, 0.0)), + f16vec4(textureLod(featB3, uvQB, 0.0)), + tA0, tA1, tA2, tA3, q1K3, q2K3, sK3); + + f16vec4 acc0; + acc0 = f16vec4(dot(f16vec4(0.084228515625hf, -0.037353515625hf, -0.041534423828125hf, 0.08636474609375hf), q1K0), + dot(f16vec4(0.1263427734375hf, -0.07769775390625hf, 0.02191162109375hf, -0.0233001708984375hf), q1K0), + dot(f16vec4(0.06903076171875hf, 0.1834716796875hf, 0.096435546875hf, 0.04931640625hf), q1K0), + dot(f16vec4(-0.33740234375hf, -0.33349609375hf, 0.0035152435302734375hf, -0.335693359375hf), q1K0)); + acc0 += f16vec4(dot(f16vec4(0.125hf, -0.1964111328125hf, 0.0194244384765625hf, 0.08056640625hf), q2K0), + dot(f16vec4(0.152587890625hf, -0.126220703125hf, 0.141845703125hf, 0.0266265869140625hf), q2K0), + dot(f16vec4(0.251953125hf, 0.2174072265625hf, -0.015869140625hf, 0.08819580078125hf), q2K0), + dot(f16vec4(-0.1832275390625hf, -0.2156982421875hf, -0.27392578125hf, -0.475341796875hf), q2K0)); + acc0 += f16vec4(0.050933837890625hf, 0.03753662109375hf, 0.0916748046875hf, -0.31201171875hf) * sK0; + acc0 += f16vec4(dot(f16vec4(-0.054168701171875hf, 0.038665771484375hf, -0.026031494140625hf, -0.10418701171875hf), q1K2), + dot(f16vec4(-0.2283935546875hf, -0.1536865234375hf, -0.04046630859375hf, -0.310791015625hf), q1K2), + dot(f16vec4(0.0189056396484375hf, 0.01367950439453125hf, -0.09637451171875hf, 0.049835205078125hf), q1K2), + dot(f16vec4(0.00545501708984375hf, -0.146728515625hf, 0.0860595703125hf, -0.022674560546875hf), q1K2)); + acc0 += f16vec4(dot(f16vec4(0.11053466796875hf, 0.0804443359375hf, -0.1878662109375hf, -0.1099853515625hf), q2K2), + dot(f16vec4(-0.08685302734375hf, -0.09515380859375hf, -0.09637451171875hf, -0.32421875hf), q2K2), + dot(f16vec4(-0.055450439453125hf, -0.09613037109375hf, 0.07147216796875hf, 0.06884765625hf), q2K2), + dot(f16vec4(0.256103515625hf, -0.1787109375hf, -0.06427001953125hf, -0.080078125hf), q2K2)); + acc0 += f16vec4(-0.031280517578125hf, -0.2337646484375hf, -0.0787353515625hf, 0.051483154296875hf) * sK2; + acc0 += f16vec4(dot(f16vec4(0.1856689453125hf, -0.103271484375hf, -0.10601806640625hf, 0.27392578125hf), q1K1), + dot(f16vec4(0.1527099609375hf, 0.279541015625hf, 0.1771240234375hf, 0.049102783203125hf), q1K1), + dot(f16vec4(0.08477783203125hf, -0.03338623046875hf, -0.056243896484375hf, -0.040435791015625hf), q1K1), + dot(f16vec4(0.04296875hf, 0.02252197265625hf, -0.04718017578125hf, 0.2376708984375hf), q1K1)); + acc0 += f16vec4(dot(f16vec4(-0.12152099609375hf, -0.201416015625hf, 0.261474609375hf, 0.19580078125hf), q2K1), + dot(f16vec4(0.10760498046875hf, 0.14111328125hf, -0.0283966064453125hf, 0.08740234375hf), q2K1), + dot(f16vec4(-0.04412841796875hf, -0.004535675048828125hf, -0.0010519027709960938hf, -0.0859375hf), q2K1), + dot(f16vec4(0.13525390625hf, 0.04058837890625hf, -0.0110931396484375hf, 0.1695556640625hf), q2K1)); + acc0 += f16vec4(-0.1436767578125hf, 0.24609375hf, -0.035247802734375hf, -0.08746337890625hf) * sK1; + acc0 += f16vec4(dot(f16vec4(-0.186767578125hf, 0.044586181640625hf, 0.1192626953125hf, -0.197021484375hf), q1K3), + dot(f16vec4(0.1082763671875hf, -0.04852294921875hf, -0.1304931640625hf, 0.1298828125hf), q1K3), + dot(f16vec4(-0.10791015625hf, -0.10052490234375hf, -0.011016845703125hf, -0.1949462890625hf), q1K3), + dot(f16vec4(0.051788330078125hf, 0.320556640625hf, 0.2498779296875hf, 0.1866455078125hf), q1K3)); + acc0 += f16vec4(dot(f16vec4(-0.20654296875hf, 0.2454833984375hf, -0.136962890625hf, -0.345458984375hf), q2K3), + dot(f16vec4(0.0113677978515625hf, 0.037750244140625hf, 0.1578369140625hf, 0.1524658203125hf), q2K3), + dot(f16vec4(-0.209228515625hf, -0.06378173828125hf, -0.01239776611328125hf, -0.0931396484375hf), q2K3), + dot(f16vec4(0.40185546875hf, 0.1748046875hf, -0.1484375hf, 0.144775390625hf), q2K3)); + acc0 += f16vec4(0.163818359375hf, 0.05706787109375hf, 0.0005230903625488281hf, 0.17626953125hf) * sK3; + + f16vec4 acc1; + acc1 = f16vec4(dot(f16vec4(0.17138671875hf, 0.177734375hf, 0.138916015625hf, 0.15283203125hf), q1K0), + dot(f16vec4(0.0787353515625hf, -0.07293701171875hf, 0.082763671875hf, -0.08148193359375hf), q1K0), + dot(f16vec4(0.0225982666015625hf, 0.0325927734375hf, 0.037322998046875hf, -0.06927490234375hf), q1K0), + dot(f16vec4(0.12139892578125hf, 0.2139892578125hf, 0.07806396484375hf, 0.2459716796875hf), q1K0)); + acc1 += f16vec4(dot(f16vec4(-0.039031982421875hf, 0.0999755859375hf, 0.118896484375hf, 0.15966796875hf), q2K0), + dot(f16vec4(-0.1368408203125hf, -0.036529541015625hf, 0.0816650390625hf, -0.090087890625hf), q2K0), + dot(f16vec4(0.10089111328125hf, 0.0223846435546875hf, -0.04541015625hf, -0.11126708984375hf), q2K0), + dot(f16vec4(0.54296875hf, 0.0943603515625hf, 0.092529296875hf, 0.1903076171875hf), q2K0)); + acc1 += f16vec4(0.1949462890625hf, 0.09661865234375hf, 0.0122528076171875hf, 0.2120361328125hf) * sK0; + acc1 += f16vec4(dot(f16vec4(-0.07342529296875hf, -0.0176239013671875hf, 0.03924560546875hf, 0.01009368896484375hf), q1K2), + dot(f16vec4(-0.26513671875hf, -0.30126953125hf, -0.2047119140625hf, -0.3359375hf), q1K2), + dot(f16vec4(-0.036102294921875hf, -0.0684814453125hf, -0.10369873046875hf, 0.10858154296875hf), q1K2), + dot(f16vec4(-0.062744140625hf, 0.019256591796875hf, -0.0614013671875hf, -0.05120849609375hf), q1K2)); + acc1 += f16vec4(dot(f16vec4(-0.1982421875hf, -0.0188751220703125hf, 0.0272216796875hf, -0.0080413818359375hf), q2K2), + dot(f16vec4(-0.482666015625hf, -0.200439453125hf, -0.06982421875hf, -0.251708984375hf), q2K2), + dot(f16vec4(0.2379150390625hf, -0.11962890625hf, -0.10894775390625hf, 0.09930419921875hf), q2K2), + dot(f16vec4(0.044342041015625hf, 0.05950927734375hf, -0.12493896484375hf, 0.023834228515625hf), q2K2)); + acc1 += f16vec4(-0.04339599609375hf, -0.22314453125hf, -0.0885009765625hf, -0.077392578125hf) * sK2; + acc1 += f16vec4(dot(f16vec4(-0.0018291473388671875hf, -0.00991058349609375hf, -0.07147216796875hf, 0.059173583984375hf), q1K1), + dot(f16vec4(0.0164031982421875hf, 0.055450439453125hf, -0.042205810546875hf, 0.05706787109375hf), q1K1), + dot(f16vec4(-0.2025146484375hf, 0.1937255859375hf, 0.169921875hf, -0.324462890625hf), q1K1), + dot(f16vec4(-0.1600341796875hf, -0.211669921875hf, -0.191650390625hf, -0.2325439453125hf), q1K1)); + acc1 += f16vec4(dot(f16vec4(0.8330078125hf, -0.1278076171875hf, -0.1534423828125hf, -0.039093017578125hf), q2K1), + dot(f16vec4(-0.0219573974609375hf, 0.004306793212890625hf, -0.07159423828125hf, -0.022308349609375hf), q2K1), + dot(f16vec4(-0.255126953125hf, 0.25390625hf, -0.226318359375hf, -0.46142578125hf), q2K1), + dot(f16vec4(0.145263671875hf, -0.2763671875hf, -0.345703125hf, -0.280029296875hf), q2K1)); + acc1 += f16vec4(-0.039093017578125hf, -0.0806884765625hf, 0.1533203125hf, -0.13134765625hf) * sK1; + acc1 += f16vec4(dot(f16vec4(-0.1458740234375hf, -0.2412109375hf, -0.0206756591796875hf, -0.1263427734375hf), q1K3), + dot(f16vec4(-0.024749755859375hf, 0.16162109375hf, 0.071044921875hf, 0.10711669921875hf), q1K3), + dot(f16vec4(0.2379150390625hf, -0.341552734375hf, -0.09423828125hf, 0.382080078125hf), q1K3), + dot(f16vec4(-0.12396240234375hf, -0.04632568359375hf, 0.0146484375hf, -0.041351318359375hf), q1K3)); + acc1 += f16vec4(dot(f16vec4(0.51025390625hf, -0.15234375hf, -0.10357666015625hf, -0.1815185546875hf), q2K3), + dot(f16vec4(0.02880859375hf, 0.2138671875hf, 0.1695556640625hf, 0.229248046875hf), q2K3), + dot(f16vec4(-0.10406494140625hf, -0.2978515625hf, 0.217041015625hf, 0.2861328125hf), q2K3), + dot(f16vec4(0.06494140625hf, 0.0728759765625hf, 0.065673828125hf, 0.09600830078125hf), q2K3)); + acc1 += f16vec4(-0.055450439453125hf, 0.1341552734375hf, -0.1595458984375hf, 0.10400390625hf) * sK3; + + imageStore(encOut0, p, vec4((acc0 - f16vec4(-0.09844970703125hf, 0.11541748046875hf, -0.034637451171875hf, 0.1334228515625hf)) * f16vec4(5.953125hf, 4.66015625hf, 4.6328125hf, 2.9296875hf) + f16vec4(-0.0016355514526367188hf, 0.22119140625hf, 0.1632080078125hf, 0.1156005859375hf))); + imageStore(encOut1, p, vec4((acc1 - f16vec4(0.390869140625hf, -0.35009765625hf, -0.1348876953125hf, 0.2462158203125hf)) * f16vec4(2.1328125hf, 4.02734375hf, 5.4765625hf, 5.1796875hf) + f16vec4(0.1199951171875hf, 0.17041015625hf, 0.1051025390625hf, 0.69140625hf))); +} diff --git a/cleanroom/glsl/shader_50.comp b/cleanroom/glsl/shader_50.comp new file mode 100644 index 0000000..814918a --- /dev/null +++ b/cleanroom/glsl/shader_50.comp @@ -0,0 +1,211 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_50: 3x3 fp16 conv over two RGBA inputs, two affine-remapped RGBA8 outputs. +// Weights baked per member; columns of the 18 4x4 matrices, head A then head B. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcFeat0; +layout(set = 0, binding = 33) uniform sampler2D srcFeat1; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstFlow0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstFlow1; + +const f16vec4 kColsA[72] = f16vec4[72]( + f16vec4(0.0445556640625hf, 0.10589599609375hf, -0.03924560546875hf, -0.00684356689453125hf), + f16vec4(-0.039581298828125hf, 0.25hf, -0.01126861572265625hf, 0.1856689453125hf), + f16vec4(-0.0237579345703125hf, 0.0838623046875hf, -0.125244140625hf, -0.173828125hf), + f16vec4(-0.1734619140625hf, 0.35986328125hf, 0.16943359375hf, -0.0361328125hf), + f16vec4(0.01448822021484375hf, 0.1649169921875hf, -0.028839111328125hf, 0.0295867919921875hf), + f16vec4(-0.0728759765625hf, 0.113037109375hf, -0.0237884521484375hf, 0.20361328125hf), + f16vec4(-0.006305694580078125hf, 0.1517333984375hf, -0.1456298828125hf, -0.1544189453125hf), + f16vec4(-0.1282958984375hf, 0.2242431640625hf, 0.103515625hf, 0.06329345703125hf), + f16vec4(0.048004150390625hf, 0.2371826171875hf, -0.01445770263671875hf, -0.01377105712890625hf), + f16vec4(-0.124267578125hf, 0.240478515625hf, 0.003936767578125hf, 0.1319580078125hf), + f16vec4(0.04058837890625hf, 0.12371826171875hf, -0.294677734375hf, -0.177490234375hf), + f16vec4(-0.18359375hf, 0.21533203125hf, 0.27685546875hf, -0.08819580078125hf), + f16vec4(0.0518798828125hf, 0.0672607421875hf, 0.034942626953125hf, 0.08856201171875hf), + f16vec4(-0.08648681640625hf, 0.2001953125hf, -0.06268310546875hf, 0.04705810546875hf), + f16vec4(-0.0166168212890625hf, 0.0826416015625hf, -0.135009765625hf, 0.07086181640625hf), + f16vec4(-0.2044677734375hf, 0.208740234375hf, 0.120361328125hf, -0.1300048828125hf), + f16vec4(0.02960205078125hf, 0.025421142578125hf, 0.07391357421875hf, 0.2125244140625hf), + f16vec4(-0.05206298828125hf, 0.122314453125hf, -0.0088348388671875hf, -0.1220703125hf), + f16vec4(0.00505828857421875hf, -0.03155517578125hf, -0.175048828125hf, 0.219482421875hf), + f16vec4(-0.0936279296875hf, 0.218017578125hf, 0.030975341796875hf, -0.2366943359375hf), + f16vec4(0.0474853515625hf, 0.155517578125hf, 0.01934814453125hf, 0.1048583984375hf), + f16vec4(-0.1502685546875hf, 0.08734130859375hf, 0.03326416015625hf, -0.02191162109375hf), + f16vec4(0.04718017578125hf, 0.06695556640625hf, -0.244140625hf, 0.0215301513671875hf), + f16vec4(-0.1500244140625hf, 0.0889892578125hf, 0.1483154296875hf, -0.193359375hf), + f16vec4(0.0306243896484375hf, 0.08843994140625hf, 0.10638427734375hf, 0.019561767578125hf), + f16vec4(-0.05902099609375hf, 0.339111328125hf, -0.141845703125hf, -0.09210205078125hf), + f16vec4(-0.077392578125hf, 0.051666259765625hf, -0.283447265625hf, 0.134765625hf), + f16vec4(-0.1861572265625hf, 0.19140625hf, 0.186279296875hf, -0.355224609375hf), + f16vec4(0.018402099609375hf, 0.034912109375hf, 0.1435546875hf, 0.1287841796875hf), + f16vec4(-0.1123046875hf, 0.06927490234375hf, -0.1339111328125hf, -0.31982421875hf), + f16vec4(-0.012969970703125hf, 0.168212890625hf, -0.2139892578125hf, 0.336181640625hf), + f16vec4(-0.151123046875hf, -0.070556640625hf, 0.09039306640625hf, -0.61767578125hf), + f16vec4(0.0272216796875hf, 0.106689453125hf, 0.07763671875hf, 0.056243896484375hf), + f16vec4(-0.11505126953125hf, 0.1982421875hf, -0.0160064697265625hf, -0.2174072265625hf), + f16vec4(0.015350341796875hf, 0.009613037109375hf, -0.26708984375hf, 0.10650634765625hf), + f16vec4(-0.172607421875hf, 0.126708984375hf, 0.2178955078125hf, -0.46533203125hf), + f16vec4(-0.42724609375hf, 0.1741943359375hf, -0.1195068359375hf, -0.0211944580078125hf), + f16vec4(0.283203125hf, 0.1275634765625hf, -0.135009765625hf, 0.25244140625hf), + f16vec4(0.056488037109375hf, 0.1082763671875hf, 0.01486968994140625hf, -0.098876953125hf), + f16vec4(-0.254150390625hf, 0.183349609375hf, -0.2447509765625hf, -0.1292724609375hf), + f16vec4(-0.325927734375hf, -0.0022296905517578125hf, -0.312255859375hf, 0.03399658203125hf), + f16vec4(0.1856689453125hf, 0.1778564453125hf, -0.1593017578125hf, 0.174072265625hf), + f16vec4(0.06927490234375hf, 0.08392333984375hf, 0.04132080078125hf, -0.06158447265625hf), + f16vec4(-0.1234130859375hf, 0.20068359375hf, -0.28759765625hf, -0.07501220703125hf), + f16vec4(-0.25927734375hf, 0.023040771484375hf, -0.445556640625hf, -0.055633544921875hf), + f16vec4(0.258544921875hf, 0.64892578125hf, -0.037384033203125hf, 0.2435302734375hf), + f16vec4(0.032470703125hf, 0.05126953125hf, 0.07012939453125hf, -0.12200927734375hf), + f16vec4(-0.12481689453125hf, 0.1683349609375hf, -0.55419921875hf, -0.1385498046875hf), + f16vec4(-0.3447265625hf, 0.12890625hf, -0.034393310546875hf, -0.0267333984375hf), + f16vec4(0.276123046875hf, 0.30859375hf, -0.071044921875hf, 0.06756591796875hf), + f16vec4(0.03656005859375hf, 0.07513427734375hf, -0.0278778076171875hf, 0.054901123046875hf), + f16vec4(-0.2073974609375hf, 0.1536865234375hf, -0.270751953125hf, 0.009002685546875hf), + f16vec4(-0.2159423828125hf, 0.006282806396484375hf, -0.2203369140625hf, -0.1063232421875hf), + f16vec4(0.15478515625hf, 0.398681640625hf, -0.06280517578125hf, -0.1773681640625hf), + f16vec4(0.056732177734375hf, 0.080322265625hf, -0.001598358154296875hf, 0.1488037109375hf), + f16vec4(-0.10699462890625hf, -0.0020847320556640625hf, -0.357421875hf, 0.08355712890625hf), + f16vec4(-0.177734375hf, -0.1170654296875hf, -0.402587890625hf, -0.04705810546875hf), + f16vec4(0.14501953125hf, 0.5400390625hf, -0.01053619384765625hf, 0.0258331298828125hf), + f16vec4(0.08026123046875hf, 0.03570556640625hf, 0.0499267578125hf, -0.01219940185546875hf), + f16vec4(-0.03521728515625hf, 0.1392822265625hf, -0.54248046875hf, -0.01383209228515625hf), + f16vec4(-0.40966796875hf, 0.1739501953125hf, -0.264892578125hf, -0.127685546875hf), + f16vec4(0.380126953125hf, 0.6962890625hf, 0.01126861572265625hf, -0.03924560546875hf), + f16vec4(0.045257568359375hf, 0.042938232421875hf, -0.042510986328125hf, -0.01090240478515625hf), + f16vec4(-0.280029296875hf, 0.0836181640625hf, -0.6015625hf, 0.0625hf), + f16vec4(-0.2310791015625hf, -0.11279296875hf, -0.39794921875hf, -0.1624755859375hf), + f16vec4(0.1630859375hf, 0.533203125hf, -0.01529693603515625hf, -0.291015625hf), + f16vec4(0.052276611328125hf, 0.11676025390625hf, -0.03570556640625hf, 0.10546875hf), + f16vec4(-0.103271484375hf, 0.029266357421875hf, -0.5390625hf, 0.1588134765625hf), + f16vec4(-0.1351318359375hf, -0.094970703125hf, -0.4833984375hf, -0.16162109375hf), + f16vec4(0.170166015625hf, 0.5703125hf, 0.07891845703125hf, -0.097412109375hf), + f16vec4(0.0838623046875hf, 0.10162353515625hf, 0.024200439453125hf, -0.03497314453125hf), + f16vec4(-0.0863037109375hf, -0.01078033447265625hf, -0.63916015625hf, 0.007030487060546875hf) +); +const f16vec4 kMuA = f16vec4(-0.89013671875hf, 4.3671875hf, -2.875hf, -0.66015625hf); +const f16vec4 kSigmaA = f16vec4(0.54248046875hf, 0.45654296875hf, 0.368408203125hf, 0.82421875hf); +const f16vec4 kBetaA = f16vec4(-0.410888671875hf, -0.12939453125hf, -0.297607421875hf, 0.08770751953125hf); + +const f16vec4 kColsB[72] = f16vec4[72]( + f16vec4(0.260498046875hf, 0.0439453125hf, -0.483154296875hf, -0.1368408203125hf), + f16vec4(0.044464111328125hf, 0.00856781005859375hf, 0.293212890625hf, -0.3212890625hf), + f16vec4(0.06884765625hf, 0.032318115234375hf, -0.359375hf, 0.2183837890625hf), + f16vec4(-0.0335693359375hf, 0.262939453125hf, -0.0665283203125hf, -0.50537109375hf), + f16vec4(0.145751953125hf, -0.00016796588897705078hf, -0.260009765625hf, 0.0703125hf), + f16vec4(0.205322265625hf, -0.00821685791015625hf, 0.140869140625hf, 0.07635498046875hf), + f16vec4(0.223876953125hf, 0.1575927734375hf, -0.02374267578125hf, 0.09466552734375hf), + f16vec4(-0.08837890625hf, 0.0022220611572265625hf, -0.147216796875hf, -0.1937255859375hf), + f16vec4(0.0513916015625hf, 0.2005615234375hf, -0.6220703125hf, 0.0308837890625hf), + f16vec4(0.10546875hf, 0.0777587890625hf, 0.34814453125hf, -0.1400146484375hf), + f16vec4(0.273681640625hf, 0.06689453125hf, -0.2437744140625hf, 0.186767578125hf), + f16vec4(-0.28515625hf, 0.19580078125hf, -0.14404296875hf, -0.292236328125hf), + f16vec4(-0.08843994140625hf, -0.1302490234375hf, -0.314697265625hf, 0.043853759765625hf), + f16vec4(-0.1654052734375hf, 0.047454833984375hf, 0.1156005859375hf, -0.0070343017578125hf), + f16vec4(-0.18505859375hf, 0.11053466796875hf, -0.0855712890625hf, 0.136962890625hf), + f16vec4(0.41845703125hf, 0.040496826171875hf, -0.0196533203125hf, -0.1470947265625hf), + f16vec4(0.1351318359375hf, -0.2646484375hf, -0.064208984375hf, 0.09112548828125hf), + f16vec4(-0.12939453125hf, 0.1348876953125hf, 0.018463134765625hf, 0.311767578125hf), + f16vec4(-0.08740234375hf, -0.03472900390625hf, -0.047882080078125hf, 0.0555419921875hf), + f16vec4(0.279052734375hf, 0.10443115234375hf, 0.0321044921875hf, 0.003570556640625hf), + f16vec4(0.11798095703125hf, -0.031585693359375hf, -0.352783203125hf, 0.1182861328125hf), + f16vec4(-0.0036449432373046875hf, 0.02557373046875hf, 0.10089111328125hf, 0.1632080078125hf), + f16vec4(0.255126953125hf, 0.0889892578125hf, -0.037689208984375hf, 0.049041748046875hf), + f16vec4(-0.231201171875hf, 0.09027099609375hf, -0.09173583984375hf, -0.076416015625hf), + f16vec4(-0.022857666015625hf, 0.05010986328125hf, -0.61669921875hf, 0.007503509521484375hf), + f16vec4(0.2225341796875hf, 0.0262451171875hf, 0.357177734375hf, -0.141845703125hf), + f16vec4(0.21435546875hf, 0.0888671875hf, -0.452880859375hf, -0.0245361328125hf), + f16vec4(-0.02874755859375hf, 0.2159423828125hf, -0.031585693359375hf, -0.1490478515625hf), + f16vec4(-0.0103607177734375hf, -0.04632568359375hf, -0.40185546875hf, -0.008270263671875hf), + f16vec4(0.10919189453125hf, -0.04608154296875hf, 0.0733642578125hf, 0.355224609375hf), + f16vec4(0.08819580078125hf, 0.1837158203125hf, -0.12298583984375hf, -0.1177978515625hf), + f16vec4(0.07305908203125hf, -0.034149169921875hf, -0.09063720703125hf, 0.09228515625hf), + f16vec4(0.1553955078125hf, 0.0728759765625hf, -0.5380859375hf, -0.057220458984375hf), + f16vec4(0.005428314208984375hf, -0.00855255126953125hf, 0.230712890625hf, 0.2230224609375hf), + f16vec4(0.224609375hf, 0.07958984375hf, -0.30126953125hf, -0.1328125hf), + f16vec4(-0.1815185546875hf, 0.1875hf, -0.074462890625hf, 0.003757476806640625hf), + f16vec4(-0.09857177734375hf, 0.0092010498046875hf, 0.02874755859375hf, -0.10516357421875hf), + f16vec4(-0.045928955078125hf, 0.03729248046875hf, 0.01049041748046875hf, -0.40380859375hf), + f16vec4(-0.0343017578125hf, -0.78759765625hf, 0.1075439453125hf, -0.0213165283203125hf), + f16vec4(0.1358642578125hf, -0.171875hf, -0.1583251953125hf, 0.24609375hf), + f16vec4(-0.002887725830078125hf, 0.007717132568359375hf, 0.04534912109375hf, -0.2152099609375hf), + f16vec4(-0.046875hf, 0.0103912353515625hf, -0.047210693359375hf, -0.08203125hf), + f16vec4(-0.027191162109375hf, -0.37255859375hf, 0.0274505615234375hf, -0.05450439453125hf), + f16vec4(0.01222991943359375hf, -0.08135986328125hf, 0.0031223297119140625hf, 0.1578369140625hf), + f16vec4(-0.10791015625hf, -0.0145416259765625hf, -0.03155517578125hf, -0.48779296875hf), + f16vec4(-0.15625hf, 0.14453125hf, 0.0806884765625hf, -0.1502685546875hf), + f16vec4(0.1715087890625hf, -0.82470703125hf, 0.1497802734375hf, 0.0182647705078125hf), + f16vec4(0.0499267578125hf, -0.25634765625hf, -0.1148681640625hf, 0.04266357421875hf), + f16vec4(-0.47119140625hf, 0.173583984375hf, 0.0947265625hf, 0.0484619140625hf), + f16vec4(-0.049560546875hf, -0.025909423828125hf, -0.02093505859375hf, -0.0714111328125hf), + f16vec4(0.22021484375hf, -0.49609375hf, -0.01337432861328125hf, 0.014801025390625hf), + f16vec4(-0.033416748046875hf, -0.031463623046875hf, 0.0209808349609375hf, 0.09722900390625hf), + f16vec4(-0.4287109375hf, 0.2186279296875hf, 0.1734619140625hf, -0.0179901123046875hf), + f16vec4(-0.0228729248046875hf, 0.00720977783203125hf, 0.032684326171875hf, 0.187255859375hf), + f16vec4(-0.118896484375hf, -0.025299072265625hf, -0.12646484375hf, 0.03643798828125hf), + f16vec4(-0.062042236328125hf, -0.06890869140625hf, -0.012115478515625hf, 0.040618896484375hf), + f16vec4(-0.111328125hf, 0.031951904296875hf, 0.056182861328125hf, -0.27001953125hf), + f16vec4(-0.11602783203125hf, 0.02215576171875hf, 0.0203857421875hf, 0.1322021484375hf), + f16vec4(0.0152587890625hf, -0.4384765625hf, -0.000518798828125hf, 0.042572021484375hf), + f16vec4(0.0115814208984375hf, -0.022216796875hf, -0.08416748046875hf, 0.0289459228515625hf), + f16vec4(-0.170166015625hf, 0.08636474609375hf, -0.04095458984375hf, -0.09552001953125hf), + f16vec4(-0.1033935546875hf, 0.243408203125hf, 0.0482177734375hf, -0.09442138671875hf), + f16vec4(0.10772705078125hf, -1.0498046875hf, 0.1453857421875hf, -0.14453125hf), + f16vec4(-0.07379150390625hf, -0.0888671875hf, -0.289794921875hf, -0.0791015625hf), + f16vec4(-0.2069091796875hf, 0.136962890625hf, -0.0154266357421875hf, -0.0022449493408203125hf), + f16vec4(-0.044097900390625hf, 0.01430511474609375hf, 0.0299072265625hf, 0.324951171875hf), + f16vec4(0.06903076171875hf, -0.5068359375hf, 0.018798828125hf, -0.1400146484375hf), + f16vec4(0.0182037353515625hf, -0.02777099609375hf, -0.07000732421875hf, -0.107177734375hf), + f16vec4(-0.14013671875hf, 0.017822265625hf, -0.10052490234375hf, -0.3115234375hf), + f16vec4(-0.15380859375hf, 0.17333984375hf, 0.0362548828125hf, 0.295654296875hf), + f16vec4(0.09539794921875hf, -0.8642578125hf, 0.1279296875hf, -0.1396484375hf), + f16vec4(0.138916015625hf, -0.11248779296875hf, -0.172607421875hf, -0.21142578125hf) +); +const f16vec4 kMuB = f16vec4(0.1737060546875hf, -1.3681640625hf, -1.31640625hf, -0.40283203125hf); +const f16vec4 kSigmaB = f16vec4(0.92138671875hf, 0.479248046875hf, 0.51025390625hf, 0.463134765625hf); +const f16vec4 kBetaB = f16vec4(0.284423828125hf, -0.377685546875hf, -0.340576171875hf, 0.375732421875hf); + +f16vec4 borderTap(sampler2D s, ivec2 q) { + if (all(greaterThanEqual(q, ivec2(0))) && all(lessThan(q, textureSize(s, 0)))) { + return f16vec4(texelFetch(s, q, 0)); + } + return f16vec4(0.0hf); +} + +f16vec4 runHead(const f16vec4 cols[72], f16vec4 mu, f16vec4 sigma, f16vec4 beta, + const f16vec4 taps[18]) { + f16vec4 acc = cols[0] * taps[0].x + cols[1] * taps[0].y + + cols[2] * taps[0].z + cols[3] * taps[0].w; + for (int k = 1; k < 18; ++k) { + int b = 4 * k; + acc += cols[b] * taps[k].x + cols[b + 1] * taps[k].y + + cols[b + 2] * taps[k].z + cols[b + 3] * taps[k].w; + } + return (acc - mu) * sigma + beta; +} + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 outSize = imageSize(dstFlow0); + if (p.x >= outSize.x || p.y >= outSize.y) { + return; + } + + f16vec4 taps[18]; + for (int t = 0; t < 9; ++t) { + if (t == 4) { + // center tap is deliberately unguarded (inputs assumed >= output size) + taps[4] = f16vec4(texelFetch(srcFeat0, p, 0)); + taps[13] = f16vec4(texelFetch(srcFeat1, p, 0)); + } else { + ivec2 q = p + ivec2(t / 3 - 1, t % 3 - 1); + taps[t] = borderTap(srcFeat0, q); + taps[t + 9] = borderTap(srcFeat1, q); + } + } + + imageStore(dstFlow0, p, vec4(runHead(kColsA, kMuA, kSigmaA, kBetaA, taps))); + imageStore(dstFlow1, p, vec4(runHead(kColsB, kMuB, kSigmaB, kBetaB, taps))); +} diff --git a/cleanroom/glsl/shader_51.comp b/cleanroom/glsl/shader_51.comp new file mode 100644 index 0000000..74c4a26 --- /dev/null +++ b/cleanroom/glsl/shader_51.comp @@ -0,0 +1,211 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_51: 3x3 fp16 conv over two RGBA inputs, two affine-remapped RGBA8 outputs. +// Weights baked per member; columns of the 18 4x4 matrices, head A then head B. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcFeat0; +layout(set = 0, binding = 33) uniform sampler2D srcFeat1; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstFlow0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstFlow1; + +const f16vec4 kColsA[72] = f16vec4[72]( + f16vec4(0.552734375hf, 0.2076416015625hf, -0.2183837890625hf, 0.07293701171875hf), + f16vec4(0.0667724609375hf, 0.248291015625hf, -0.2529296875hf, -0.06024169921875hf), + f16vec4(0.2232666015625hf, 0.275146484375hf, -0.16845703125hf, -0.004184722900390625hf), + f16vec4(0.108642578125hf, 0.1475830078125hf, -0.06005859375hf, 0.08770751953125hf), + f16vec4(0.081787109375hf, 0.00266265869140625hf, 0.0260772705078125hf, -0.07666015625hf), + f16vec4(-0.0312347412109375hf, 0.20751953125hf, -0.1669921875hf, 0.0160064697265625hf), + f16vec4(0.0255584716796875hf, 0.164794921875hf, 0.0677490234375hf, -0.0972900390625hf), + f16vec4(0.09014892578125hf, 0.261962890625hf, -0.0103912353515625hf, 0.19189453125hf), + f16vec4(0.291748046875hf, -0.07562255859375hf, -0.054718017578125hf, -0.0994873046875hf), + f16vec4(0.171142578125hf, 0.292724609375hf, -0.2841796875hf, 0.09027099609375hf), + f16vec4(0.330322265625hf, 0.303955078125hf, -0.052001953125hf, -0.036834716796875hf), + f16vec4(0.0887451171875hf, -0.10504150390625hf, 0.0021877288818359375hf, 0.1695556640625hf), + f16vec4(0.2069091796875hf, 0.09228515625hf, -0.092529296875hf, 0.057220458984375hf), + f16vec4(-0.0309295654296875hf, 0.2432861328125hf, -0.10284423828125hf, -0.1761474609375hf), + f16vec4(-0.040008544921875hf, 0.23828125hf, -0.11346435546875hf, -0.0589599609375hf), + f16vec4(0.08648681640625hf, -0.051727294921875hf, -0.068359375hf, -0.241943359375hf), + f16vec4(-0.240478515625hf, -0.08636474609375hf, 0.1285400390625hf, -0.0386962890625hf), + f16vec4(-0.12158203125hf, 0.159423828125hf, 0.05303955078125hf, 0.2142333984375hf), + f16vec4(-0.2120361328125hf, 0.1595458984375hf, 0.124755859375hf, -0.09063720703125hf), + f16vec4(0.0770263671875hf, 0.2132568359375hf, -0.167724609375hf, -0.07977294921875hf), + f16vec4(-0.016387939453125hf, -0.14404296875hf, 0.0294647216796875hf, -0.1072998046875hf), + f16vec4(0.065673828125hf, 0.237060546875hf, -0.08563232421875hf, -0.07659912109375hf), + f16vec4(0.135986328125hf, 0.340087890625hf, -0.08294677734375hf, -0.040771484375hf), + f16vec4(0.10601806640625hf, -0.059326171875hf, -0.1986083984375hf, -0.0880126953125hf), + f16vec4(0.52783203125hf, 0.0258026123046875hf, -0.6416015625hf, 0.145751953125hf), + f16vec4(0.1976318359375hf, 0.31201171875hf, -0.352783203125hf, 0.1015625hf), + f16vec4(0.33642578125hf, 0.273193359375hf, -0.54248046875hf, 0.045196533203125hf), + f16vec4(0.0077972412109375hf, -0.6142578125hf, 0.13525390625hf, -0.03924560546875hf), + f16vec4(0.0279693603515625hf, -0.1478271484375hf, -0.41943359375hf, -0.01611328125hf), + f16vec4(0.0699462890625hf, 0.2254638671875hf, -0.15966796875hf, 0.129638671875hf), + f16vec4(0.1259765625hf, 0.1771240234375hf, -0.2371826171875hf, -0.0675048828125hf), + f16vec4(0.0953369140625hf, -0.0687255859375hf, -0.0221710205078125hf, -0.0714111328125hf), + f16vec4(0.253662109375hf, -0.16552734375hf, -0.483154296875hf, -0.0867919921875hf), + f16vec4(0.248046875hf, 0.330810546875hf, -0.405029296875hf, 0.0897216796875hf), + f16vec4(0.50390625hf, 0.404296875hf, -0.51953125hf, 0.04107666015625hf), + f16vec4(0.0865478515625hf, -0.343994140625hf, -0.00646209716796875hf, 0.044342041015625hf), + f16vec4(0.3076171875hf, 0.284912109375hf, 0.06121826171875hf, -0.4736328125hf), + f16vec4(0.2646484375hf, 0.1923828125hf, -0.1695556640625hf, 0.13037109375hf), + f16vec4(0.310546875hf, 0.31591796875hf, -0.1568603515625hf, 0.052642822265625hf), + f16vec4(-0.1890869140625hf, -0.546875hf, 0.1937255859375hf, -0.040252685546875hf), + f16vec4(0.09771728515625hf, 0.044464111328125hf, 0.1492919921875hf, -0.353271484375hf), + f16vec4(0.18359375hf, 0.11767578125hf, -0.205078125hf, 0.0987548828125hf), + f16vec4(0.1781005859375hf, 0.1739501953125hf, -0.1041259765625hf, -0.03662109375hf), + f16vec4(-0.058258056640625hf, -0.396728515625hf, 0.10174560546875hf, -0.1304931640625hf), + f16vec4(0.009490966796875hf, 0.035186767578125hf, 0.07757568359375hf, -0.5322265625hf), + f16vec4(0.32958984375hf, 0.124267578125hf, -0.0203857421875hf, 0.062103271484375hf), + f16vec4(0.2244873046875hf, 0.1392822265625hf, 0.029266357421875hf, 0.2159423828125hf), + f16vec4(0.10882568359375hf, -0.1876220703125hf, -0.0012788772583007812hf, 0.244384765625hf), + f16vec4(0.2327880859375hf, 0.228271484375hf, 0.1173095703125hf, -0.2452392578125hf), + f16vec4(0.1505126953125hf, 0.251708984375hf, -0.2054443359375hf, -0.017669677734375hf), + f16vec4(0.1822509765625hf, 0.285888671875hf, -0.325439453125hf, 0.170654296875hf), + f16vec4(-0.0277099609375hf, -0.279296875hf, 0.1658935546875hf, -0.2222900390625hf), + f16vec4(-0.01806640625hf, -0.03070068359375hf, 0.1319580078125hf, -0.1500244140625hf), + f16vec4(0.051788330078125hf, 0.1865234375hf, -0.276123046875hf, 0.369140625hf), + f16vec4(0.0865478515625hf, 0.2423095703125hf, -0.306640625hf, 0.1746826171875hf), + f16vec4(0.011444091796875hf, -0.1912841796875hf, 0.183349609375hf, -0.7470703125hf), + f16vec4(0.00836944580078125hf, -0.040435791015625hf, 0.111328125hf, -0.2386474609375hf), + f16vec4(0.168701171875hf, 0.1982421875hf, -0.1302490234375hf, 0.1334228515625hf), + f16vec4(0.1329345703125hf, 0.279541015625hf, -0.2078857421875hf, 0.12298583984375hf), + f16vec4(0.2220458984375hf, 0.06781005859375hf, 0.01270294189453125hf, 0.194580078125hf), + f16vec4(0.400390625hf, 0.253173828125hf, 0.058135986328125hf, -0.55224609375hf), + f16vec4(0.326171875hf, 0.276123046875hf, -0.205322265625hf, 0.058563232421875hf), + f16vec4(0.280029296875hf, 0.279296875hf, -0.3642578125hf, 0.421142578125hf), + f16vec4(0.0858154296875hf, -0.1063232421875hf, 0.08349609375hf, -0.3759765625hf), + f16vec4(0.149169921875hf, -0.0269317626953125hf, 0.07794189453125hf, -0.3291015625hf), + f16vec4(0.1787109375hf, 0.179931640625hf, -0.26708984375hf, 0.0955810546875hf), + f16vec4(0.17041015625hf, 0.2269287109375hf, -0.3583984375hf, 0.166259765625hf), + f16vec4(0.1517333984375hf, 0.009918212890625hf, -0.0073394775390625hf, -0.0307464599609375hf), + f16vec4(0.10467529296875hf, 0.059814453125hf, 0.10986328125hf, -0.38623046875hf), + f16vec4(0.2734375hf, 0.313232421875hf, -0.160888671875hf, 0.06658935546875hf), + f16vec4(0.256103515625hf, 0.3740234375hf, -0.32958984375hf, 0.225341796875hf), + f16vec4(0.3837890625hf, 0.390625hf, -0.275634765625hf, 0.12347412109375hf) +); +const f16vec4 kMuA = f16vec4(2.005859375hf, 0.85107421875hf, -0.8251953125hf, -1.2265625hf); +const f16vec4 kSigmaA = f16vec4(0.50390625hf, 0.1522216796875hf, 0.4150390625hf, 0.5546875hf); +const f16vec4 kBetaA = f16vec4(-0.69873046875hf, 0.7841796875hf, -0.0305023193359375hf, -0.517578125hf); + +const f16vec4 kColsB[72] = f16vec4[72]( + f16vec4(-0.7607421875hf, -0.20703125hf, 0.0168304443359375hf, 0.251953125hf), + f16vec4(-0.4208984375hf, -0.09619140625hf, 0.06805419921875hf, -0.1514892578125hf), + f16vec4(-0.59912109375hf, -0.038299560546875hf, 0.103759765625hf, 0.09918212890625hf), + f16vec4(-0.283447265625hf, 0.0919189453125hf, 0.02081298828125hf, 0.11505126953125hf), + f16vec4(-0.12841796875hf, -0.1844482421875hf, 0.006122589111328125hf, 0.26025390625hf), + f16vec4(-0.1165771484375hf, -0.13671875hf, -0.044158935546875hf, -0.146728515625hf), + f16vec4(-0.2440185546875hf, -0.08489990234375hf, -0.02984619140625hf, 0.120849609375hf), + f16vec4(-0.0162506103515625hf, -0.0660400390625hf, 0.203125hf, 0.08660888671875hf), + f16vec4(-0.1058349609375hf, -0.5791015625hf, 0.07867431640625hf, 0.06646728515625hf), + f16vec4(-0.0850830078125hf, -0.29736328125hf, 0.238525390625hf, -0.308349609375hf), + f16vec4(-0.2205810546875hf, -0.5068359375hf, 0.2137451171875hf, -0.09368896484375hf), + f16vec4(-0.07147216796875hf, -0.1641845703125hf, 0.047698974609375hf, 0.2188720703125hf), + f16vec4(-0.400146484375hf, 0.1463623046875hf, -0.02276611328125hf, 0.283203125hf), + f16vec4(-0.1109619140625hf, 0.050048828125hf, -0.07427978515625hf, 0.0169219970703125hf), + f16vec4(-0.2169189453125hf, 0.1392822265625hf, -0.041046142578125hf, 0.156005859375hf), + f16vec4(-0.07159423828125hf, 0.2396240234375hf, -0.069580078125hf, 0.0860595703125hf), + f16vec4(0.07000732421875hf, 0.11346435546875hf, -0.0799560546875hf, 0.2978515625hf), + f16vec4(0.028472900390625hf, 0.01265716552734375hf, -0.0936279296875hf, 0.0794677734375hf), + f16vec4(0.053314208984375hf, 0.08154296875hf, -0.156005859375hf, 0.1514892578125hf), + f16vec4(0.10736083984375hf, 0.054962158203125hf, 0.07049560546875hf, -0.11395263671875hf), + f16vec4(-0.0037860870361328125hf, -0.1505126953125hf, -0.0517578125hf, 0.111083984375hf), + f16vec4(-0.0191802978515625hf, -0.1312255859375hf, -0.03289794921875hf, -0.03155517578125hf), + f16vec4(-0.00762939453125hf, -0.155517578125hf, 0.0770263671875hf, -0.0305633544921875hf), + f16vec4(-0.005035400390625hf, 0.085693359375hf, -0.08642578125hf, 0.005329132080078125hf), + f16vec4(-0.480712890625hf, 0.27880859375hf, 0.034027099609375hf, 0.1273193359375hf), + f16vec4(-0.2125244140625hf, 0.197509765625hf, 0.1939697265625hf, -0.20458984375hf), + f16vec4(-0.39892578125hf, 0.2333984375hf, 0.1448974609375hf, 0.00907135009765625hf), + f16vec4(-0.102783203125hf, 0.0760498046875hf, -0.1988525390625hf, 0.300537109375hf), + f16vec4(0.047393798828125hf, 0.1429443359375hf, -0.049560546875hf, 0.1749267578125hf), + f16vec4(-0.10595703125hf, 0.05157470703125hf, 0.0113677978515625hf, -0.1119384765625hf), + f16vec4(-0.025360107421875hf, 0.0540771484375hf, 0.01003265380859375hf, 0.039520263671875hf), + f16vec4(0.06365966796875hf, -0.12939453125hf, -0.093994140625hf, 0.156494140625hf), + f16vec4(0.10491943359375hf, -0.11822509765625hf, -0.050445556640625hf, -0.0172271728515625hf), + f16vec4(-0.0203399658203125hf, -0.0670166015625hf, 0.2342529296875hf, -0.15673828125hf), + f16vec4(0.00762176513671875hf, -0.21728515625hf, 0.2347412109375hf, -0.18408203125hf), + f16vec4(-0.039276123046875hf, 0.015167236328125hf, -0.218994140625hf, 0.2440185546875hf), + f16vec4(-0.07177734375hf, 0.037384033203125hf, -0.341796875hf, -0.0369873046875hf), + f16vec4(-0.365234375hf, -0.054443359375hf, 0.11907958984375hf, -0.265380859375hf), + f16vec4(-0.412109375hf, -0.1119384765625hf, 0.1585693359375hf, -0.29296875hf), + f16vec4(0.01195526123046875hf, 0.09759521484375hf, -0.175537109375hf, 0.26904296875hf), + f16vec4(0.09686279296875hf, -0.04693603515625hf, -0.1317138671875hf, 0.0947265625hf), + f16vec4(-0.0875244140625hf, -0.181884765625hf, 0.1131591796875hf, 0.0014810562133789062hf), + f16vec4(-0.12396240234375hf, -0.1419677734375hf, 0.163818359375hf, -0.01219940185546875hf), + f16vec4(-0.005748748779296875hf, 0.123046875hf, -0.1475830078125hf, 0.336669921875hf), + f16vec4(-0.06866455078125hf, 0.1298828125hf, -0.435302734375hf, 0.15234375hf), + f16vec4(-0.084716796875hf, -0.374755859375hf, 0.170654296875hf, -0.281982421875hf), + f16vec4(-0.06439208984375hf, -0.50048828125hf, 0.274658203125hf, -0.320556640625hf), + f16vec4(-0.257080078125hf, 0.11767578125hf, -0.223876953125hf, 0.0640869140625hf), + f16vec4(-0.05224609375hf, 0.055419921875hf, -0.246826171875hf, 0.0007681846618652344hf), + f16vec4(-0.242431640625hf, 0.054931640625hf, 0.11798095703125hf, -0.12103271484375hf), + f16vec4(-0.26611328125hf, 0.0095367431640625hf, 0.1483154296875hf, -0.054962158203125hf), + f16vec4(-0.11138916015625hf, -0.0225677490234375hf, -0.146728515625hf, 0.17822265625hf), + f16vec4(0.07635498046875hf, -0.11669921875hf, -0.06011962890625hf, 0.09405517578125hf), + f16vec4(-0.04644775390625hf, -0.06292724609375hf, 0.1865234375hf, 0.1702880859375hf), + f16vec4(-0.07501220703125hf, 0.01421356201171875hf, 0.156005859375hf, 0.264404296875hf), + f16vec4(-0.0416259765625hf, -0.0885009765625hf, -0.0982666015625hf, 0.2440185546875hf), + f16vec4(0.0178985595703125hf, 0.00305938720703125hf, -0.28955078125hf, 0.07208251953125hf), + f16vec4(-0.0011796951293945312hf, -0.19091796875hf, 0.140625hf, -0.145751953125hf), + f16vec4(0.01175689697265625hf, -0.2364501953125hf, 0.1700439453125hf, -0.1170654296875hf), + f16vec4(-0.14794921875hf, -0.046844482421875hf, -0.11309814453125hf, 0.120849609375hf), + f16vec4(-0.10186767578125hf, 0.239501953125hf, -0.3564453125hf, -0.06500244140625hf), + f16vec4(-0.293701171875hf, 0.21826171875hf, 0.192626953125hf, -0.351806640625hf), + f16vec4(-0.374755859375hf, 0.181640625hf, 0.267822265625hf, -0.33447265625hf), + f16vec4(-0.240966796875hf, 0.058319091796875hf, -0.1822509765625hf, 0.0692138671875hf), + f16vec4(0.1259765625hf, -0.07965087890625hf, -0.09515380859375hf, 0.038970947265625hf), + f16vec4(-0.1187744140625hf, 0.0026264190673828125hf, 0.1392822265625hf, -0.11602783203125hf), + f16vec4(-0.1337890625hf, 0.05694580078125hf, 0.2105712890625hf, -0.1094970703125hf), + f16vec4(-0.045654296875hf, -0.081298828125hf, 0.117431640625hf, 0.152587890625hf), + f16vec4(-0.01922607421875hf, 0.034088134765625hf, -0.336669921875hf, -0.01039886474609375hf), + f16vec4(-0.10736083984375hf, -0.10430908203125hf, 0.189208984375hf, -0.430908203125hf), + f16vec4(-0.05950927734375hf, -0.2109375hf, 0.2369384765625hf, -0.462158203125hf), + f16vec4(-0.12744140625hf, -0.12017822265625hf, -0.03900146484375hf, -0.105224609375hf) +); +const f16vec4 kMuB = f16vec4(-1.482421875hf, -0.26806640625hf, -0.7265625hf, 0.5732421875hf); +const f16vec4 kSigmaB = f16vec4(0.2392578125hf, 0.57177734375hf, 0.50927734375hf, 0.64111328125hf); +const f16vec4 kBetaB = f16vec4(0.82470703125hf, 0.11224365234375hf, -0.6650390625hf, 0.169189453125hf); + +f16vec4 borderTap(sampler2D s, ivec2 q) { + if (all(greaterThanEqual(q, ivec2(0))) && all(lessThan(q, textureSize(s, 0)))) { + return f16vec4(texelFetch(s, q, 0)); + } + return f16vec4(0.0hf); +} + +f16vec4 runHead(const f16vec4 cols[72], f16vec4 mu, f16vec4 sigma, f16vec4 beta, + const f16vec4 taps[18]) { + f16vec4 acc = cols[0] * taps[0].x + cols[1] * taps[0].y + + cols[2] * taps[0].z + cols[3] * taps[0].w; + for (int k = 1; k < 18; ++k) { + int b = 4 * k; + acc += cols[b] * taps[k].x + cols[b + 1] * taps[k].y + + cols[b + 2] * taps[k].z + cols[b + 3] * taps[k].w; + } + return (acc - mu) * sigma + beta; +} + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 outSize = imageSize(dstFlow0); + if (p.x >= outSize.x || p.y >= outSize.y) { + return; + } + + f16vec4 taps[18]; + for (int t = 0; t < 9; ++t) { + if (t == 4) { + // center tap is deliberately unguarded (inputs assumed >= output size) + taps[4] = f16vec4(texelFetch(srcFeat0, p, 0)); + taps[13] = f16vec4(texelFetch(srcFeat1, p, 0)); + } else { + ivec2 q = p + ivec2(t / 3 - 1, t % 3 - 1); + taps[t] = borderTap(srcFeat0, q); + taps[t + 9] = borderTap(srcFeat1, q); + } + } + + imageStore(dstFlow0, p, vec4(runHead(kColsA, kMuA, kSigmaA, kBetaA, taps))); + imageStore(dstFlow1, p, vec4(runHead(kColsB, kMuB, kSigmaB, kBetaB, taps))); +} diff --git a/cleanroom/glsl/shader_52.comp b/cleanroom/glsl/shader_52.comp new file mode 100644 index 0000000..4c36295 --- /dev/null +++ b/cleanroom/glsl/shader_52.comp @@ -0,0 +1,211 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_52: 3x3 fp16 conv over two RGBA inputs, two affine-remapped RGBA8 outputs. +// Weights baked per member; columns of the 18 4x4 matrices, head A then head B. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcFeat0; +layout(set = 0, binding = 33) uniform sampler2D srcFeat1; +layout(set = 0, binding = 48, rgba8) uniform writeonly image2D dstFlow0; +layout(set = 0, binding = 49, rgba8) uniform writeonly image2D dstFlow1; + +const f16vec4 kColsA[72] = f16vec4[72]( + f16vec4(0.162841796875hf, 0.4599609375hf, 0.52978515625hf, 0.18212890625hf), + f16vec4(-0.258544921875hf, 0.3447265625hf, 0.0176849365234375hf, 0.1331787109375hf), + f16vec4(-0.316650390625hf, -0.04644775390625hf, 0.122802734375hf, -0.155517578125hf), + f16vec4(-0.1319580078125hf, 0.2381591796875hf, -0.09503173828125hf, 0.047821044921875hf), + f16vec4(-0.09552001953125hf, 0.2047119140625hf, 0.220458984375hf, -0.06707763671875hf), + f16vec4(-0.098388671875hf, 0.100341796875hf, 0.042755126953125hf, 0.272705078125hf), + f16vec4(-0.1112060546875hf, 0.049163818359375hf, 0.09716796875hf, -0.0167388916015625hf), + f16vec4(0.0968017578125hf, 0.1312255859375hf, -0.03472900390625hf, 0.06475830078125hf), + f16vec4(0.1602783203125hf, 0.428955078125hf, 0.59619140625hf, 0.133544921875hf), + f16vec4(-0.3310546875hf, 0.048583984375hf, -0.005550384521484375hf, 0.0142669677734375hf), + f16vec4(-0.25634765625hf, 0.1134033203125hf, 0.210205078125hf, 0.02935791015625hf), + f16vec4(-0.014434814453125hf, 0.1845703125hf, -0.1724853515625hf, 0.10760498046875hf), + f16vec4(-0.04248046875hf, 0.25732421875hf, 0.1923828125hf, 0.043304443359375hf), + f16vec4(-0.0628662109375hf, 0.2344970703125hf, -0.021453857421875hf, 0.17626953125hf), + f16vec4(-0.046112060546875hf, 0.050048828125hf, 0.1776123046875hf, -0.054168701171875hf), + f16vec4(0.007236480712890625hf, 0.19091796875hf, 0.010040283203125hf, -0.041259765625hf), + f16vec4(-0.311279296875hf, -0.005401611328125hf, -0.2086181640625hf, -0.2381591796875hf), + f16vec4(0.1817626953125hf, 0.0858154296875hf, 0.10272216796875hf, 0.323486328125hf), + f16vec4(0.0338134765625hf, 0.144287109375hf, 0.07659912109375hf, 0.033843994140625hf), + f16vec4(0.240234375hf, 0.0125579833984375hf, 0.0401611328125hf, -0.06671142578125hf), + f16vec4(-0.0689697265625hf, 0.1846923828125hf, 0.156005859375hf, -0.038665771484375hf), + f16vec4(-0.058868408203125hf, -0.001575469970703125hf, 0.005260467529296875hf, 0.02886962890625hf), + f16vec4(-0.1507568359375hf, 0.06640625hf, 0.11322021484375hf, -0.0165557861328125hf), + f16vec4(0.085693359375hf, 0.146728515625hf, -0.051361083984375hf, -0.0186767578125hf), + f16vec4(0.254638671875hf, 0.5263671875hf, 0.44091796875hf, 0.3916015625hf), + f16vec4(-0.438720703125hf, 0.31640625hf, -0.110595703125hf, 0.1470947265625hf), + f16vec4(-0.19189453125hf, -0.017425537109375hf, 0.40478515625hf, -0.483154296875hf), + f16vec4(-0.13427734375hf, 0.29736328125hf, 0.005893707275390625hf, -0.0546875hf), + f16vec4(-0.003452301025390625hf, 0.27734375hf, 0.056488037109375hf, 0.1793212890625hf), + f16vec4(-0.1982421875hf, 0.10638427734375hf, -0.03656005859375hf, 0.24755859375hf), + f16vec4(-0.05364990234375hf, 0.1485595703125hf, 0.35888671875hf, -0.1788330078125hf), + f16vec4(0.0195159912109375hf, 0.1788330078125hf, 0.057952880859375hf, -0.058624267578125hf), + f16vec4(0.309326171875hf, 0.5439453125hf, 0.42529296875hf, 0.375244140625hf), + f16vec4(-0.31787109375hf, 0.2159423828125hf, 0.035797119140625hf, 0.1749267578125hf), + f16vec4(-0.5654296875hf, -0.0682373046875hf, 0.2015380859375hf, -0.463134765625hf), + f16vec4(-0.09765625hf, 0.26953125hf, -0.02911376953125hf, -0.0177154541015625hf), + f16vec4(-0.476806640625hf, -0.416748046875hf, -0.400390625hf, -0.64990234375hf), + f16vec4(-0.06219482421875hf, -0.1966552734375hf, -0.0341796875hf, 0.0755615234375hf), + f16vec4(-0.0391845703125hf, 0.07672119140625hf, 0.250244140625hf, 0.1319580078125hf), + f16vec4(0.0158233642578125hf, -0.2371826171875hf, -0.401611328125hf, 0.12005615234375hf), + f16vec4(0.09307861328125hf, 0.05218505859375hf, -0.03460693359375hf, 0.00870513916015625hf), + f16vec4(0.1907958984375hf, -0.0968017578125hf, 0.06488037109375hf, -0.021087646484375hf), + f16vec4(0.0714111328125hf, 0.0185699462890625hf, 0.14990234375hf, 0.088623046875hf), + f16vec4(0.1468505859375hf, 0.046600341796875hf, 0.12091064453125hf, 0.033050537109375hf), + f16vec4(-0.50390625hf, 0.0155029296875hf, -0.418701171875hf, -0.19580078125hf), + f16vec4(-0.470458984375hf, -0.320068359375hf, -0.251220703125hf, -0.2646484375hf), + f16vec4(0.1610107421875hf, 0.25634765625hf, 0.3388671875hf, 0.276611328125hf), + f16vec4(-0.0193634033203125hf, -0.287841796875hf, -0.466796875hf, 0.06976318359375hf), + f16vec4(0.4443359375hf, -0.005336761474609375hf, 0.15869140625hf, 0.09796142578125hf), + f16vec4(0.00719451904296875hf, -0.0096435546875hf, 0.0181427001953125hf, -0.01491546630859375hf), + f16vec4(-0.0345458984375hf, -0.0928955078125hf, 0.1541748046875hf, -0.0131683349609375hf), + f16vec4(0.05657958984375hf, -0.0921630859375hf, -0.1917724609375hf, 0.047393798828125hf), + f16vec4(0.72607421875hf, 0.3505859375hf, 0.340087890625hf, 0.5107421875hf), + f16vec4(0.27490234375hf, -0.000621795654296875hf, 0.180419921875hf, -0.226318359375hf), + f16vec4(0.08599853515625hf, -0.2401123046875hf, -0.044097900390625hf, -0.10772705078125hf), + f16vec4(0.209716796875hf, 0.039215087890625hf, 0.09283447265625hf, -0.0633544921875hf), + f16vec4(0.2061767578125hf, 0.254638671875hf, -0.02154541015625hf, 0.185302734375hf), + f16vec4(0.0139007568359375hf, 0.07720947265625hf, 0.271728515625hf, -0.263916015625hf), + f16vec4(0.11846923828125hf, 0.04864501953125hf, 0.150634765625hf, 0.1070556640625hf), + f16vec4(0.0267791748046875hf, -0.11328125hf, -0.250244140625hf, 0.0953369140625hf), + f16vec4(-0.1595458984375hf, -0.314208984375hf, -0.13671875hf, -0.70703125hf), + f16vec4(0.183837890625hf, 0.193115234375hf, 0.1156005859375hf, 0.451171875hf), + f16vec4(-0.08453369140625hf, 0.04193115234375hf, 0.36767578125hf, 0.11431884765625hf), + f16vec4(0.0657958984375hf, -0.350830078125hf, -0.458251953125hf, 0.04412841796875hf), + f16vec4(0.268798828125hf, 0.09881591796875hf, 0.07989501953125hf, -0.0242156982421875hf), + f16vec4(0.185302734375hf, 0.038482666015625hf, 0.08428955078125hf, 0.09234619140625hf), + f16vec4(-0.04888916015625hf, -0.059051513671875hf, 0.182861328125hf, 0.09368896484375hf), + f16vec4(0.1690673828125hf, -0.027923583984375hf, 0.0679931640625hf, 0.03131103515625hf), + f16vec4(-0.468505859375hf, -0.0908203125hf, -0.324462890625hf, -0.57568359375hf), + f16vec4(-0.1339111328125hf, -0.0665283203125hf, 0.067138671875hf, -0.21533203125hf), + f16vec4(0.0146331787109375hf, 0.21630859375hf, 0.3984375hf, 0.281494140625hf), + f16vec4(0.00018894672393798828hf, -0.296875hf, -0.439208984375hf, 0.0711669921875hf) +); +const f16vec4 kMuA = f16vec4(-1.1064453125hf, 0.90673828125hf, -0.67333984375hf, -0.006450653076171875hf); +const f16vec4 kSigmaA = f16vec4(1.150390625hf, 1.1953125hf, 0.974609375hf, 0.7099609375hf); +const f16vec4 kBetaA = f16vec4(0.00890350341796875hf, 0.9267578125hf, 0.1617431640625hf, 0.4150390625hf); + +const f16vec4 kColsB[72] = f16vec4[72]( + f16vec4(-0.2430419921875hf, 0.41748046875hf, -6.598234176635742e-05hf, -0.5419921875hf), + f16vec4(-0.446533203125hf, -0.205078125hf, 0.1142578125hf, -0.45947265625hf), + f16vec4(0.26025390625hf, 0.07806396484375hf, -0.271484375hf, 0.041259765625hf), + f16vec4(-0.464111328125hf, 0.181396484375hf, -0.36669921875hf, 0.08447265625hf), + f16vec4(0.09356689453125hf, 0.269775390625hf, -0.2222900390625hf, -0.2802734375hf), + f16vec4(-0.08465576171875hf, -0.314208984375hf, 0.1807861328125hf, -0.1519775390625hf), + f16vec4(0.04632568359375hf, -0.06378173828125hf, 0.001369476318359375hf, -0.048736572265625hf), + f16vec4(-0.43212890625hf, 0.33056640625hf, -0.353759765625hf, -0.054107666015625hf), + f16vec4(-0.09930419921875hf, 0.40185546875hf, -0.169921875hf, -0.475341796875hf), + f16vec4(-0.298583984375hf, -0.1549072265625hf, 0.0112152099609375hf, -0.28271484375hf), + f16vec4(0.05029296875hf, 0.028961181640625hf, -0.07806396484375hf, -0.1260986328125hf), + f16vec4(-0.42333984375hf, 0.22705078125hf, -0.421142578125hf, 0.006977081298828125hf), + f16vec4(0.0758056640625hf, 0.30322265625hf, -0.10943603515625hf, -0.398193359375hf), + f16vec4(0.041229248046875hf, -0.2469482421875hf, 0.00849151611328125hf, -0.134765625hf), + f16vec4(0.11639404296875hf, 0.089599609375hf, -0.11767578125hf, -0.053863525390625hf), + f16vec4(-0.357666015625hf, 0.219970703125hf, -0.26806640625hf, -0.0232696533203125hf), + f16vec4(0.371337890625hf, 0.10394287109375hf, -0.3857421875hf, -0.141357421875hf), + f16vec4(0.301513671875hf, -0.2529296875hf, 0.117431640625hf, 0.033660888671875hf), + f16vec4(-0.00891876220703125hf, 0.0299835205078125hf, 0.08648681640625hf, -0.0721435546875hf), + f16vec4(-0.294921875hf, 0.422607421875hf, -0.31298828125hf, -0.1834716796875hf), + f16vec4(0.1173095703125hf, 0.253662109375hf, -0.2734375hf, -0.349365234375hf), + f16vec4(0.08612060546875hf, -0.1767578125hf, -0.0179595947265625hf, -0.130859375hf), + f16vec4(0.0889892578125hf, -0.004749298095703125hf, -0.08392333984375hf, -0.06805419921875hf), + f16vec4(-0.352783203125hf, 0.265869140625hf, -0.33837890625hf, -0.109130859375hf), + f16vec4(-0.223876953125hf, 0.43994140625hf, 0.036376953125hf, -0.67919921875hf), + f16vec4(-0.200927734375hf, -0.07183837890625hf, 0.0225067138671875hf, -0.362548828125hf), + f16vec4(0.34619140625hf, 0.0455322265625hf, -0.5029296875hf, -0.04150390625hf), + f16vec4(-0.415771484375hf, 0.1759033203125hf, -0.35986328125hf, 0.038909912109375hf), + f16vec4(0.03173828125hf, 0.25390625hf, -0.1934814453125hf, -0.4599609375hf), + f16vec4(0.071044921875hf, -0.361328125hf, 0.09539794921875hf, -0.1455078125hf), + f16vec4(0.249755859375hf, 0.088623046875hf, -0.174072265625hf, -0.08984375hf), + f16vec4(-0.339599609375hf, 0.298095703125hf, -0.345703125hf, -0.1300048828125hf), + f16vec4(-0.225341796875hf, 0.3623046875hf, -0.08062744140625hf, -0.65185546875hf), + f16vec4(-0.328125hf, -0.1185302734375hf, 0.050262451171875hf, -0.4052734375hf), + f16vec4(0.471435546875hf, 0.047760009765625hf, -0.429443359375hf, -0.01904296875hf), + f16vec4(-0.368408203125hf, 0.1519775390625hf, -0.365234375hf, -0.038360595703125hf), + f16vec4(0.29150390625hf, 0.0985107421875hf, -0.421142578125hf, 0.0950927734375hf), + f16vec4(0.05096435546875hf, 0.009857177734375hf, -0.1708984375hf, 0.042205810546875hf), + f16vec4(-0.192626953125hf, 0.29638671875hf, -0.3095703125hf, -0.14013671875hf), + f16vec4(-0.146240234375hf, -0.186767578125hf, -0.07177734375hf, 0.05377197265625hf), + f16vec4(0.151123046875hf, 0.178466796875hf, -0.11212158203125hf, 0.033966064453125hf), + f16vec4(0.140869140625hf, 0.1417236328125hf, -0.19091796875hf, 0.10626220703125hf), + f16vec4(-0.207275390625hf, 0.27490234375hf, -0.291748046875hf, -0.26708984375hf), + f16vec4(0.00385284423828125hf, -0.1258544921875hf, -0.005039215087890625hf, 0.018096923828125hf), + f16vec4(-0.131591796875hf, 0.06707763671875hf, -0.026275634765625hf, -0.209228515625hf), + f16vec4(0.39404296875hf, 0.2269287109375hf, -0.40625hf, 0.217529296875hf), + f16vec4(-0.294677734375hf, 0.3037109375hf, -0.2529296875hf, -0.22216796875hf), + f16vec4(-0.10113525390625hf, -0.188232421875hf, -0.1143798828125hf, 0.07989501953125hf), + f16vec4(0.1636962890625hf, 0.2734375hf, -0.2095947265625hf, 0.0625hf), + f16vec4(-0.1455078125hf, -0.311767578125hf, 0.1888427734375hf, -0.034271240234375hf), + f16vec4(-0.126953125hf, 0.326904296875hf, -0.334228515625hf, -0.2470703125hf), + f16vec4(0.032073974609375hf, -0.1707763671875hf, -0.041656494140625hf, 0.12188720703125hf), + f16vec4(0.07977294921875hf, 0.296630859375hf, 0.040924072265625hf, -0.00844573974609375hf), + f16vec4(-0.032806396484375hf, -0.08343505859375hf, 0.07830810546875hf, 0.05352783203125hf), + f16vec4(-0.1270751953125hf, 0.330322265625hf, -0.41064453125hf, -0.41796875hf), + f16vec4(0.1717529296875hf, 0.0211181640625hf, 0.029266357421875hf, 0.048492431640625hf), + f16vec4(-0.0748291015625hf, 0.1260986328125hf, 0.07720947265625hf, -0.1549072265625hf), + f16vec4(0.1551513671875hf, 0.1962890625hf, -0.02056884765625hf, 0.01302337646484375hf), + f16vec4(-0.24609375hf, 0.290283203125hf, -0.39208984375hf, -0.3310546875hf), + f16vec4(0.04913330078125hf, -0.044830322265625hf, -0.08319091796875hf, 0.135986328125hf), + f16vec4(-0.04425048828125hf, 0.1966552734375hf, -0.247802734375hf, -0.044036865234375hf), + f16vec4(-0.3759765625hf, -0.1427001953125hf, 0.259033203125hf, -0.25146484375hf), + f16vec4(-0.196533203125hf, 0.4052734375hf, -0.2802734375hf, -0.25390625hf), + f16vec4(-0.045867919921875hf, -0.31103515625hf, -0.230224609375hf, 0.2041015625hf), + f16vec4(0.06231689453125hf, 0.1480712890625hf, 0.04302978515625hf, -0.0692138671875hf), + f16vec4(-0.101806640625hf, -0.1788330078125hf, 0.04998779296875hf, -0.0606689453125hf), + f16vec4(-0.1937255859375hf, 0.369873046875hf, -0.33447265625hf, -0.447021484375hf), + f16vec4(0.09356689453125hf, -0.07196044921875hf, -0.115966796875hf, 0.08795166015625hf), + f16vec4(-0.1256103515625hf, 0.13427734375hf, 1.5020370483398438e-05hf, -0.247314453125hf), + f16vec4(0.1104736328125hf, 0.016387939453125hf, -0.1475830078125hf, -0.0325927734375hf), + f16vec4(-0.309814453125hf, 0.36474609375hf, -0.29345703125hf, -0.355224609375hf), + f16vec4(-0.0214080810546875hf, -0.2012939453125hf, -0.2049560546875hf, 0.193115234375hf) +); +const f16vec4 kMuB = f16vec4(-0.418212890625hf, -0.2056884765625hf, -1.3056640625hf, -2.015625hf); +const f16vec4 kSigmaB = f16vec4(0.69921875hf, 1.0205078125hf, 0.64794921875hf, 0.7783203125hf); +const f16vec4 kBetaB = f16vec4(0.00441741943359375hf, -0.2744140625hf, 0.7880859375hf, 0.51123046875hf); + +f16vec4 borderTap(sampler2D s, ivec2 q) { + if (all(greaterThanEqual(q, ivec2(0))) && all(lessThan(q, textureSize(s, 0)))) { + return f16vec4(texelFetch(s, q, 0)); + } + return f16vec4(0.0hf); +} + +f16vec4 runHead(const f16vec4 cols[72], f16vec4 mu, f16vec4 sigma, f16vec4 beta, + const f16vec4 taps[18]) { + f16vec4 acc = cols[0] * taps[0].x + cols[1] * taps[0].y + + cols[2] * taps[0].z + cols[3] * taps[0].w; + for (int k = 1; k < 18; ++k) { + int b = 4 * k; + acc += cols[b] * taps[k].x + cols[b + 1] * taps[k].y + + cols[b + 2] * taps[k].z + cols[b + 3] * taps[k].w; + } + return (acc - mu) * sigma + beta; +} + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 outSize = imageSize(dstFlow0); + if (p.x >= outSize.x || p.y >= outSize.y) { + return; + } + + f16vec4 taps[18]; + for (int t = 0; t < 9; ++t) { + if (t == 4) { + // center tap is deliberately unguarded (inputs assumed >= output size) + taps[4] = f16vec4(texelFetch(srcFeat0, p, 0)); + taps[13] = f16vec4(texelFetch(srcFeat1, p, 0)); + } else { + ivec2 q = p + ivec2(t / 3 - 1, t % 3 - 1); + taps[t] = borderTap(srcFeat0, q); + taps[t + 9] = borderTap(srcFeat1, q); + } + } + + imageStore(dstFlow0, p, vec4(runHead(kColsA, kMuA, kSigmaA, kBetaA, taps))); + imageStore(dstFlow1, p, vec4(runHead(kColsB, kMuB, kSigmaB, kBetaB, taps))); +} diff --git a/cleanroom/glsl/shader_53.comp b/cleanroom/glsl/shader_53.comp new file mode 100644 index 0000000..42ee90b --- /dev/null +++ b/cleanroom/glsl/shader_53.comp @@ -0,0 +1,138 @@ +#version 460 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +// shader_53: 3x3 fp16 conv (2x RGBA in -> RGBA out) + bias + verbatim center +// skip from a third texture; Rgba16f output, no clamping. + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +layout(set = 0, binding = 32) uniform sampler2D srcFeatA; +layout(set = 0, binding = 33) uniform sampler2D srcFeatB; +layout(set = 0, binding = 34) uniform sampler2D srcSkip; +layout(set = 0, binding = 48, rgba16f) uniform writeonly image2D dstConv; + +const f16vec4 kBias = f16vec4(0.362060546875hf, 0.449951171875hf, 0.169677734375hf, 0.217529296875hf); + +const f16mat4 kWX1 = f16mat4( + f16vec4(-0.0478515625hf, -0.038970947265625hf, 0.01129913330078125hf, 0.023284912109375hf), + f16vec4(0.0926513671875hf, 0.10833740234375hf, 0.1795654296875hf, 0.167236328125hf), + f16vec4(-0.11505126953125hf, -0.109375hf, 0.10943603515625hf, 0.1292724609375hf), + f16vec4(-0.1014404296875hf, -0.0950927734375hf, 0.10028076171875hf, 0.0987548828125hf)); +const f16mat4 kWX2 = f16mat4( + f16vec4(0.0386962890625hf, 0.0255584716796875hf, 0.2646484375hf, 0.255126953125hf), + f16vec4(0.205322265625hf, 0.197998046875hf, 0.262939453125hf, 0.2509765625hf), + f16vec4(0.007358551025390625hf, -0.006702423095703125hf, 0.23974609375hf, 0.2286376953125hf), + f16vec4(0.2078857421875hf, 0.1934814453125hf, 0.185302734375hf, 0.19091796875hf)); +const f16mat4 kWX3 = f16mat4( + f16vec4(-0.08477783203125hf, -0.086669921875hf, 0.0897216796875hf, 0.07391357421875hf), + f16vec4(0.13037109375hf, 0.1373291015625hf, 0.1717529296875hf, 0.1793212890625hf), + f16vec4(-0.13818359375hf, -0.1363525390625hf, 0.1480712890625hf, 0.1446533203125hf), + f16vec4(-0.03204345703125hf, -0.0202789306640625hf, 0.06121826171875hf, 0.059326171875hf)); +const f16mat4 kWX4 = f16mat4( + f16vec4(0.097412109375hf, 0.1046142578125hf, 0.2181396484375hf, 0.2086181640625hf), + f16vec4(0.19482421875hf, 0.182861328125hf, 0.25390625hf, 0.26513671875hf), + f16vec4(0.0869140625hf, 0.0865478515625hf, 0.22265625hf, 0.20166015625hf), + f16vec4(0.0845947265625hf, 0.059051513671875hf, 0.272705078125hf, 0.27392578125hf)); +const f16mat4 kWX5 = f16mat4( + f16vec4(0.1083984375hf, 0.1165771484375hf, 0.454833984375hf, 0.465576171875hf), + f16vec4(0.281982421875hf, 0.298583984375hf, 0.353759765625hf, 0.337158203125hf), + f16vec4(0.1640625hf, 0.11968994140625hf, 0.32470703125hf, 0.328857421875hf), + f16vec4(0.36669921875hf, 0.32861328125hf, 0.381591796875hf, 0.365234375hf)); +const f16mat4 kWX6 = f16mat4( + f16vec4(0.068603515625hf, 0.07830810546875hf, 0.279541015625hf, 0.273681640625hf), + f16vec4(0.267333984375hf, 0.2464599609375hf, 0.265869140625hf, 0.263427734375hf), + f16vec4(0.05487060546875hf, 0.03399658203125hf, 0.204345703125hf, 0.205810546875hf), + f16vec4(0.1568603515625hf, 0.1385498046875hf, 0.229736328125hf, 0.23779296875hf)); +const f16mat4 kWX7 = f16mat4( + f16vec4(-0.00026607513427734375hf, 0.003936767578125hf, 0.033233642578125hf, 0.03118896484375hf), + f16vec4(0.126708984375hf, 0.11627197265625hf, 0.18359375hf, 0.17333984375hf), + f16vec4(-0.014923095703125hf, -0.00921630859375hf, 0.11004638671875hf, 0.11785888671875hf), + f16vec4(-0.2232666015625hf, -0.2001953125hf, 0.1898193359375hf, 0.1810302734375hf)); +const f16mat4 kWX8 = f16mat4( + f16vec4(0.05279541015625hf, 0.06573486328125hf, 0.26904296875hf, 0.259521484375hf), + f16vec4(0.2279052734375hf, 0.2366943359375hf, 0.25341796875hf, 0.267333984375hf), + f16vec4(0.098876953125hf, 0.10748291015625hf, 0.2156982421875hf, 0.2139892578125hf), + f16vec4(0.07373046875hf, 0.07537841796875hf, 0.2724609375hf, 0.2802734375hf)); +const f16mat4 kWX9 = f16mat4( + f16vec4(-0.052337646484375hf, -0.049041748046875hf, 0.0850830078125hf, 0.09173583984375hf), + f16vec4(0.1756591796875hf, 0.1712646484375hf, 0.1688232421875hf, 0.1671142578125hf), + f16vec4(-0.05718994140625hf, -0.046661376953125hf, 0.12261962890625hf, 0.1285400390625hf), + f16vec4(-0.1673583984375hf, -0.1495361328125hf, 0.1448974609375hf, 0.1363525390625hf)); + +const f16mat4 kWY1 = f16mat4( + f16vec4(0.22607421875hf, 0.2393798828125hf, -0.290283203125hf, -0.279052734375hf), + f16vec4(-0.28369140625hf, -0.3876953125hf, 0.1517333984375hf, 0.1474609375hf), + f16vec4(0.07269287109375hf, 0.08331298828125hf, 0.2490234375hf, 0.2548828125hf), + f16vec4(0.250244140625hf, 0.266357421875hf, -0.10498046875hf, -0.1322021484375hf)); +const f16mat4 kWY2 = f16mat4( + f16vec4(0.30224609375hf, 0.331298828125hf, -0.152099609375hf, -0.1463623046875hf), + f16vec4(-0.599609375hf, -0.5302734375hf, 0.228271484375hf, 0.2332763671875hf), + f16vec4(0.262939453125hf, 0.2685546875hf, 0.309326171875hf, 0.314453125hf), + f16vec4(0.3720703125hf, 0.349365234375hf, 0.10284423828125hf, 0.11151123046875hf)); +const f16mat4 kWY3 = f16mat4( + f16vec4(0.2406005859375hf, 0.22119140625hf, -0.29541015625hf, -0.301513671875hf), + f16vec4(-0.33056640625hf, -0.3935546875hf, 0.1455078125hf, 0.1488037109375hf), + f16vec4(0.10736083984375hf, 0.10601806640625hf, 0.2222900390625hf, 0.21826171875hf), + f16vec4(0.259033203125hf, 0.26953125hf, -0.15478515625hf, -0.1461181640625hf)); +const f16mat4 kWY4 = f16mat4( + f16vec4(0.318115234375hf, 0.30126953125hf, -0.151611328125hf, -0.1605224609375hf), + f16vec4(-0.427490234375hf, -0.44775390625hf, 0.2412109375hf, 0.23388671875hf), + f16vec4(0.1942138671875hf, 0.1878662109375hf, 0.312744140625hf, 0.306396484375hf), + f16vec4(0.378662109375hf, 0.351318359375hf, 0.059539794921875hf, 0.0628662109375hf)); +const f16mat4 kWY5 = f16mat4( + f16vec4(0.401123046875hf, 0.404296875hf, -0.00365447998046875hf, -0.0214080810546875hf), + f16vec4(-0.78955078125hf, -0.666015625hf, 0.298095703125hf, 0.288818359375hf), + f16vec4(0.3525390625hf, 0.343017578125hf, 0.371826171875hf, 0.34619140625hf), + f16vec4(0.453369140625hf, 0.451904296875hf, 0.328857421875hf, 0.332275390625hf)); +const f16mat4 kWY6 = f16mat4( + f16vec4(0.31396484375hf, 0.32080078125hf, -0.1513671875hf, -0.154052734375hf), + f16vec4(-0.46337890625hf, -0.45068359375hf, 0.22509765625hf, 0.2237548828125hf), + f16vec4(0.2293701171875hf, 0.21533203125hf, 0.281005859375hf, 0.28759765625hf), + f16vec4(0.361083984375hf, 0.31982421875hf, 0.04925537109375hf, 0.05413818359375hf)); +const f16mat4 kWY7 = f16mat4( + f16vec4(0.2176513671875hf, 0.2264404296875hf, -0.2705078125hf, -0.26220703125hf), + f16vec4(-0.3701171875hf, -0.467041015625hf, 0.159423828125hf, 0.168701171875hf), + f16vec4(0.06243896484375hf, 0.07415771484375hf, 0.253662109375hf, 0.25927734375hf), + f16vec4(0.280517578125hf, 0.2705078125hf, -0.211181640625hf, -0.2237548828125hf)); +const f16mat4 kWY8 = f16mat4( + f16vec4(0.298095703125hf, 0.2841796875hf, -0.12939453125hf, -0.1337890625hf), + f16vec4(-0.69091796875hf, -0.61865234375hf, 0.238037109375hf, 0.231689453125hf), + f16vec4(0.26171875hf, 0.2734375hf, 0.29345703125hf, 0.293212890625hf), + f16vec4(0.347412109375hf, 0.347900390625hf, 0.042022705078125hf, 0.04852294921875hf)); +const f16mat4 kWY9 = f16mat4( + f16vec4(0.197998046875hf, 0.19970703125hf, -0.2265625hf, -0.23291015625hf), + f16vec4(-0.364013671875hf, -0.4228515625hf, 0.157470703125hf, 0.1573486328125hf), + f16vec4(0.10968017578125hf, 0.094970703125hf, 0.23388671875hf, 0.2291259765625hf), + f16vec4(0.265625hf, 0.258056640625hf, -0.18896484375hf, -0.18896484375hf)); + +void main() { + ivec2 p = ivec2(gl_GlobalInvocationID.xy); + ivec2 lim = imageSize(dstConv); + if (p.x >= lim.x || p.y >= lim.y) { + return; + } + vec2 uv = (vec2(p) + 0.5) / vec2(textureSize(srcFeatA, 0)); + + f16vec4 acc; + acc = kWX1 * f16vec4(textureLodOffset(srcFeatA, uv, 0.0, ivec2(-1, -1))); + acc += kWX2 * f16vec4(textureLodOffset(srcFeatA, uv, 0.0, ivec2(-1, 0))); + acc += kWX3 * f16vec4(textureLodOffset(srcFeatA, uv, 0.0, ivec2(-1, 1))); + acc += kWX4 * f16vec4(textureLodOffset(srcFeatA, uv, 0.0, ivec2( 0, -1))); + acc += kWX5 * f16vec4(textureLod(srcFeatA, uv, 0.0)); + acc += kWX6 * f16vec4(textureLodOffset(srcFeatA, uv, 0.0, ivec2( 0, 1))); + acc += kWX7 * f16vec4(textureLodOffset(srcFeatA, uv, 0.0, ivec2( 1, -1))); + acc += kWX8 * f16vec4(textureLodOffset(srcFeatA, uv, 0.0, ivec2( 1, 0))); + acc += kWX9 * f16vec4(textureLodOffset(srcFeatA, uv, 0.0, ivec2( 1, 1))); + acc += kWY1 * f16vec4(textureLodOffset(srcFeatB, uv, 0.0, ivec2(-1, -1))); + acc += kWY2 * f16vec4(textureLodOffset(srcFeatB, uv, 0.0, ivec2(-1, 0))); + acc += kWY3 * f16vec4(textureLodOffset(srcFeatB, uv, 0.0, ivec2(-1, 1))); + acc += kWY4 * f16vec4(textureLodOffset(srcFeatB, uv, 0.0, ivec2( 0, -1))); + acc += kWY5 * f16vec4(textureLod(srcFeatB, uv, 0.0)); + acc += kWY6 * f16vec4(textureLodOffset(srcFeatB, uv, 0.0, ivec2( 0, 1))); + acc += kWY7 * f16vec4(textureLodOffset(srcFeatB, uv, 0.0, ivec2( 1, -1))); + acc += kWY8 * f16vec4(textureLodOffset(srcFeatB, uv, 0.0, ivec2( 1, 0))); + acc += kWY9 * f16vec4(textureLodOffset(srcFeatB, uv, 0.0, ivec2( 1, 1))); + acc += kBias; + acc += f16vec4(textureLod(srcSkip, uv, 0.0)); + imageStore(dstConv, p, vec4(acc)); +} diff --git a/cleanroom/specs/03-pyramid.md b/cleanroom/specs/03-pyramid.md new file mode 100644 index 0000000..9016c05 --- /dev/null +++ b/cleanroom/specs/03-pyramid.md @@ -0,0 +1,163 @@ +# shader_03 — luminance pyramid build (7 levels) + +Source of truth: `asm/shader_03.spvasm`. One compute pass that converts a color +frame to luminance and produces a 7-level mip-style pyramid (each level half +the resolution of the previous) in a single dispatch, using workgroup shared +memory for the in-workgroup reductions. + +## 1. Interface + +- Workgroup size: **16 x 16 x 1**. +- Built-ins used: `gl_WorkGroupID`, `gl_LocalInvocationID` (NOT + `gl_GlobalInvocationID`). +- All descriptors are in **set 0**: + +| binding | kind | format | access | role | +|---|---|---|---|---| +| 0 | UBO | struct, see below | read | parameters | +| 32 | combined image sampler, 2D float | (sampled, format unknown to shader) | read | source color frame | +| 48 | storage image 2D | `r8` | write-only (`NonReadable`) | pyramid level 0 (finest) | +| 49 | storage image 2D | `r8` | write-only | pyramid level 1 | +| 50 | storage image 2D | `r8` | write-only | pyramid level 2 | +| 51 | storage image 2D | `r8` | write-only | pyramid level 3 | +| 52 | storage image 2D | `r8` | write-only | pyramid level 4 | +| 53 | storage image 2D | `r8` | write-only | pyramid level 5 | +| 54 | storage image 2D | `r8` | write-only | pyramid level 6 (coarsest) | + +- UBO layout (std140-compatible; all three members are 32-bit floats): + +| offset | type | role | +|---|---|---| +| 0 | float | `srcCoordScale` — multiplies level-0 output pixel coordinates to produce source-frame pixel coordinates (see 2.1). This is the only member the shader reads. | +| 4 | float | declared, **never read** by this shader | +| 8 | float | declared, **never read** by this shader | + +- No push constants. No spec constants. +- Shared memory: one `float16_t tile[32][32]` array (indexed `tile[x][y]` below; + first index is the x/horizontal index). Requires FP16 arithmetic + (`GL_EXT_shader_explicit_arithmetic_types_float16` in GLSL); all luminance + math below is performed in IEEE half precision unless stated otherwise. + +## 2. Behavior + +Notation: + +``` +wg = gl_WorkGroupID.xy (uvec2) +lid = gl_LocalInvocationID.xy (uvec2, 0..15 each) +srcSize = vec2(textureSize(src, 0)) // source sampler, LOD 0, as floats +s = ubo.srcCoordScale +luma(v3) = dot(f16vec3(v.rgb), f16vec3(W)) // half-precision dot +W = (0x1.32p-2, 0x1.2c8p-1, 0x1.d2cp-4) + = (0.298828125, 0.5869140625, 0.11395263671875) // fp16-exact +``` + +(Interpretation: W is Rec.601 luma weights rounded to fp16.) + +Each workgroup produces one 64x64 tile of level 0, one 32x32 tile of level 1, +16x16 of level 2, 8x8 of level 3, 4x4 of level 4, 2x2 of level 5 and 1 texel +of level 6. Tile origins: level 0 at `wg*64`, level 1 at `wg*32`, level k at +`wg*(64 >> k)`. + +### 2.1 Phase 1 — sample source, write levels 0 and 1 + +Two nested loops, outer `j = 0,1` (y), inner `i = 0,1` (x). Per (i, j): + +``` +p = wg*32 + lid*2 + uvec2(i, j) // level-1 texel this iteration produces +q = p * 2 // level-0 base texel (even coords) +``` + +Four source samples are taken at the four level-0 texels +`q + d` for `d in D = [(0,0), (1,0), (1,1), (0,1)]` (exactly this order): + +``` +uv(t) = (vec2(t) + 0.5) * s / srcSize // t is an integer texel coord +L_d = luma(textureLod(src, uv(q + d), 0.0).rgb) // fp16 result +``` + +Notes on the sample coordinate: the `+0.5` texel-center offset is added +**before** multiplying by `s`; the division is by the *source* texture's +level-0 size. LOD is explicitly 0. If `s * level0Size > srcSize` the UV +exceeds [0,1]; addressing is left to the externally supplied sampler. + +Writes: + +- **Level 0** (binding 48): for each `d` in D, if + `all(lessThan(ivec2(q + d), imageSize(level0)))`, store + `float(L_d)` (splatted to rgba; format `r8` keeps `.r`) at `ivec2(q + d)`. +- **Level 1** (binding 49): compute, in fp16 and in exactly this + association order, + + ``` + m = 0.25h * (((L_(0,0) + L_(1,0)) + L_(1,1)) + L_(0,1)) + ``` + + If `all(lessThan(ivec2(p), imageSize(level1)))`, store `float(m)` at + `ivec2(p)`. +- Shared: `tile[lid.x*2 + i][lid.y*2 + j] = m` (unconditionally). + +So after phase 1 `tile` holds the workgroup's full 32x32 level-1 tile in +local coordinates. + +### 2.2 Phase 2 — five in-place reduction rounds, write levels 2..6 + +Five identical rounds with parameters `(n, dst)`: + +| round | n | dst binding | dst level | +|---|---|---|---| +| 1 | 16 | 50 | 2 | +| 2 | 8 | 51 | 3 | +| 3 | 4 | 52 | 4 | +| 4 | 2 | 53 | 5 | +| 5 | 1 | 54 | 6 | + +Each round is preceded by `barrier()` (workgroup control barrier with +workgroup-memory acquire/release semantics; SPIR-V semantics value 264 = +AcquireRelease | WorkgroupMemory). Round body, executed only by threads with +`lid.x < n && lid.y < n` (for round 1, n = 16, this predicate is trivially +true for the whole workgroup): + +``` +x = lid.x; y = lid.y +a = tile[2x ][2y ] +b = tile[2x + 1][2y ] +c = tile[2x ][2y + 1] +d = tile[2x + 1][2y + 1] +m = 0.25h * (((a + b) + c) + d) // fp16, this association order +outCoord = ivec2(wg * n + lid) +if (all(lessThan(outCoord, imageSize(dst)))) imageStore(dst, outCoord, vec4(float(m))) +tile[x][y] = m +``` + +There is no barrier after round 5; the shader then returns. (Within a round, +each active thread reads only elements it or other active threads wrote in +the *previous* round, and writes `tile[x][y]` with `x,y < n`, which no other +thread of the same round reads, so the read-then-write in one round is safe.) + +## 3. Control flow summary + +- Phase-1 loops: outer y-loop trip count 2, inner x-loop trip count 2 (fully + deterministic, no data-dependent exits). +- 5 barriers total, one before each reduction round; every thread reaches all + of them (the round bodies are predicated, the barriers are not — do NOT put + the barrier inside the `if`). +- No early return. + +## 4. Boundary behavior + +- Every `imageStore` is individually guarded by + `all(lessThan(ivec2(coord), imageSize(thatImage)))` — signed compare against + the destination image's own size. Coordinates are non-negative by + construction, so only the upper bound matters. +- Nothing clamps the source-sample UV; out-of-range sampling behavior comes + from the bound sampler. +- The shader therefore tolerates dispatches whose tiles overhang any level's + extent; the shared-memory tile is always fully computed regardless. + +## 5. Precision requirements + +Bit-exact reproduction requires fp16 arithmetic for: the luma dot product, +the 4-way averages (association order as written), and the shared-memory +storage type. Values are widened to float32 only immediately before each +`imageStore` (where `r8` storage then quantizes to unorm8). diff --git a/cleanroom/specs/04-synthesis.md b/cleanroom/specs/04-synthesis.md new file mode 100644 index 0000000..47edbe9 --- /dev/null +++ b/cleanroom/specs/04-synthesis.md @@ -0,0 +1,130 @@ +# Spec: shader_04 — final frame synthesis + +Functional specification derived solely from `asm/shader_04.spvasm` (spirv-dis +output of a stripped SPIR-V 1.0 compute shader, generated by Shaderc/Glslang). +Role names below (prevFrame, flowScale, ...) are functional labels chosen by +the spec author; the binary contains no names. + +## 1. Interface + +- Entry point: GLCompute `main`, workgroup size **16 x 16 x 1** + (`OpExecutionMode LocalSize 16 16 1`). +- No push constants. No specialization constants. +- All descriptors are in **set 0**: + +| Binding | Kind | Role name | Notes | +|---|---|---|---| +| 0 | UBO (std140 `Block`) | params | 3 x float, see below | +| 32 | combined image sampler, 2D float | prevFrame | sampled, explicit LOD 0 only; also queried with `textureSize(.,0)` | +| 33 | combined image sampler, 2D float | currFrame | sampled, explicit LOD 0 only | +| 34 | combined image sampler, 2D float | flowA | sampled, explicit LOD 0 only | +| 35 | combined image sampler, 2D float | flowB | sampled, explicit LOD 0 only | +| 36 | combined image sampler, 2D float | confidence | sampled, explicit LOD 0 only | +| 48 | storage image, 2D float | outFrame | **write-only** (`NonReadable`), **no declared format** (`Unknown`; the module declares `StorageImageWriteWithoutFormat`). Declare it `writeonly` with no `layout(format)` in GLSL. Queried with `imageSize`, written exactly once per surviving invocation. | + +UBO member layout (block of 3 scalars): + +| Offset | Type | Role name | Used? | +|---|---|---|---| +| 0 | float | flowScale | yes — multiplies both flow-field samples | +| 4 | float | alpha (interpolation phase `t`) | yes | +| 8 | float | (third member; pipeline role name "epsilon") | **never read by this shader** — it exists only in the layout | + +## 2. Per-invocation behavior + +Let `gid = gl_GlobalInvocationID`. All arithmetic is 32-bit float; every +texture read is `textureLod(..., uv, 0.0)` (explicit LOD 0, normalized UV). + +``` +p = ivec2(gid.xy) // output texel +if (any(greaterThanEqual(p, imageSize(outFrame)))) return; // early-out + +S = vec2(textureSize(prevFrame, 0)) // NOTE: dimensions of binding 32, not of the output +pc = vec2(gid.xy) + vec2(0.5, 0.5) // texel-center in prevFrame texel units +uv = pc / S +``` + +Flow fetch (at the *unwarped* position) and time weights: + +``` +fA = textureLod(flowA, uv, 0.0) * flowScale // vec4 +fB = textureLod(flowB, uv, 0.0) * flowScale // vec4 +t = alpha +a = 2.0 * t +b = 2.0 * (1.0 - t) +``` + +Four warped sample positions. Displacements are in **texels of `S`** +(the prevFrame size), added to `pc` before renormalizing by `S`: + +``` +uv1 = (pc + a * fA.xy) / S +uv2 = (pc + b * fA.zw) / S +uv3 = (pc + a * fB.xy) / S +uv4 = (pc + b * fB.zw) / S +``` + +Confidence gather — one component per warped position (4 separate samples of +binding 36; component k of sample k): + +``` +c = vec4( textureLod(confidence, uv1, 0.0).x, + textureLod(confidence, uv2, 0.0).y, + textureLod(confidence, uv3, 0.0).z, + textureLod(confidence, uv4, 0.0).w ) +``` + +Softmax over the 4 confidences (`exp` = GLSL.std.450 `Exp`): + +``` +e = exp(c) // component-wise +w = e / (((e.x + e.y) + e.z) + e.w) // vec4, sums to 1 +``` + +Weighted blend. Note the pairing: positions from `.xy` flow components sample +**prevFrame** with time weight `(1 - t)`; positions from `.zw` components +sample **currFrame** with time weight `t`: + +``` +num = ((textureLod(prevFrame, uv1, 0.0) * (1.0 - t)) * w.x) + + ((textureLod(currFrame, uv2, 0.0) * t) * w.y) + + ((textureLod(prevFrame, uv3, 0.0) * (1.0 - t)) * w.z) + + ((textureLod(currFrame, uv4, 0.0) * t) * w.w) // vec4, summed left-to-right + +den = (1.0 - t)*w.x + t*w.y + (1.0 - t)*w.z + t*w.w + EPS // scalar, summed left-to-right + +imageStore(outFrame, p, num / vec4(den)) +``` + +`(1.0 - t)` is computed once and reused for both `b` and the blend weights. + +## 3. Literal constants + +| Value | Decimal | Bits (fp32) | +|---|---|---| +| 0.5 | 0.5 | 0x3F000000 | +| 2.0 | 2.0 | 0x40000000 | +| 1.0 | 1.0 | 0x3F800000 | +| EPS | 9.99999994e-09 (float(1e-8)) | 0x322BCC77 | + +## 4. Control flow / boundary behavior + +- Single early-out: `any(p >= imageSize(outFrame))` (component-wise signed >= + against the **output** storage image's size). No loops. No other branches. +- The shader does **not** clamp any sampling coordinate. `uv1..uv4` can leave + [0,1] whenever the (scaled) flow displacement pushes past an edge; behavior + there is decided by the externally supplied sampler state (address mode, + filter), which is not part of this module. +- Every invocation that passes the guard performs exactly one image write, at + `p`, of the vec4 above. + +## 5. Interpretation (hint, not normative) + +This is a softmax-gated bidirectional warp blend for frame interpolation at +phase `t`: flowA/flowB each pack a forward half-flow in `.xy` (stretched by +`2t` to reach the previous frame) and a backward half-flow in `.zw` +(stretched by `2(1-t)` to reach the current frame). Each of the 4 candidate +warps carries a confidence logit in its own channel of binding 36; the +softmax of those logits, multiplied by the time weights `(1-t)/t`, forms a +partition-of-unity-ish blend whose weight sum (`den`, plus 1e-8 to avoid +division by zero) renormalizes the result. diff --git a/cleanroom/specs/05-feat-a.md b/cleanroom/specs/05-feat-a.md new file mode 100644 index 0000000..43510d9 --- /dev/null +++ b/cleanroom/specs/05-feat-a.md @@ -0,0 +1,98 @@ +# shader_05 — half-res 3x3 conv, 1 input channel -> 4 feature channels + +Source of truth: `asm/shader_05.spvasm`. One output texel per invocation. +Reads a single-channel input (only `.r` of the sampled texture is used) at 2x +the output resolution, applies a 3x3 convolution producing 4 channels, then an +output affine remap, and stores to an `rgba8` image. + +(Interpretation, after the exact math below: this is a small CNN layer — input +normalization `(x - mean) * invStd + bias`, a 1-in/4-out 3x3 convolution, and +an output requantization affine so the result survives unorm8 storage.) + +## 1. Interface + +- Workgroup size: **16 x 16 x 1**. Uses `gl_GlobalInvocationID`. +- Descriptors, all set 0: + +| binding | kind | format | access | role | +|---|---|---|---|---| +| 32 | combined image sampler, 2D float | (sampled) | read | input feature/luma image; only channel r is read | +| 48 | storage image 2D | `rgba8` | write-only (`NonReadable`) | output 4-channel feature map | + +- No UBO, no push constants, no spec constants, no shared memory. +- FP16: all convolution arithmetic is IEEE half precision + (`GL_EXT_shader_explicit_arithmetic_types_float16`). + +## 2. Behavior + +``` +gid = ivec2(gl_GlobalInvocationID.xy) +if (any(greaterThanEqual(gid, imageSize(dst)))) return; // early-out + +srcSize = vec2(textureSize(src, 0)) +uv = (vec2(gid * 2) + 0.5) / srcSize // note the *2: output is half-res +``` + +Nine taps are taken with `textureLodOffset(src, uv, 0.0, off)` — constant +integer offsets applied in texel units by the sampling hardware at LOD 0. +For each tap, channel r is converted to fp16 and remapped: + +``` +t(off) = (float16_t(textureLodOffset(src, uv, 0.0, off).r) - C0) * C1 + C2 +C0 = 0x1.aap-3 = 0.2080078125 +C1 = 0x1.7fp+0 = 1.49609375 +C2 = 0x1.8ap-1 = 0.76953125 // all fp16-exact +``` + +Accumulate (fp16, `f16vec4`), in exactly this tap order, `acc = Σ w(off) * t(off)`: + +| # | off | weight vector w(off) = (r, g, b, a) | hex (fp16-exact) | +|---|---|---|---| +| 1 | (-1,-1) | (0.2138671875, -0.061798095703125, -0.2091064453125, -1.0029296875) | (0x1.b6p-3, -0x1.fa4p-5, -0x1.ac4p-3, -0x1.00cp+0) | +| 2 | (-1, 0) | (0.343994140625, -0.04486083984375, -0.327880859375, -0.62060546875) | (0x1.604p-2, -0x1.6f8p-5, -0x1.4fcp-2, -0x1.3dcp-1) | +| 3 | (-1, 1) | (0.1617431640625, -0.023727416992188, -0.16748046875, -0.256103515625) | (0x1.4b4p-3, -0x1.84cp-6, -0x1.57p-3, -0x1.064p-2) | +| 4 | ( 0,-1) | (0.34033203125, -0.0031566619873047, -0.315673828125, 0.0011692047119141) | (0x1.5c8p-2, -0x1.9dcp-9, -0x1.434p-2, 0x1.328p-10) | +| 5 | ( 0, 0) | (0.70654296875, 0.04998779296875, -0.666015625, 0.1534423828125) | (0x1.69cp-1, 0x1.998p-5, -0x1.55p-1, 0x1.3a4p-3) | +| 6 | ( 0, 1) | (0.441650390625, 0.060455322265625, -0.435546875, 0.2081298828125) | (0x1.c44p-2, 0x1.ef4p-5, -0x1.bep-2, 0x1.aa4p-3) | +| 7 | ( 1,-1) | (0.14453125, 0.0061836242675781, -0.154296875, -0.07080078125) | (0x1.28p-3, 0x1.954p-8, -0x1.3cp-3, -0x1.22p-4) | +| 8 | ( 1, 0) | (0.44677734375, 0.05987548828125, -0.418701171875, 0.0965576171875) | (0x1.c98p-2, 0x1.ea8p-5, -0x1.accp-2, 0x1.8b8p-4) | +| 9 | ( 1, 1) | (0.352783203125, 0.047119140625, -0.324951171875, 0.1416015625) | (0x1.694p-2, 0x1.82p-5, -0x1.4ccp-2, 0x1.22p-3) | + +(The accumulation is sequential: `acc = w1*t1; acc += w2*t2; ... acc += w9*t9`. +Keep this association order for bit-exactness in fp16.) + +Output affine (componentwise, fp16, exactly this operation order — +subtract, then multiply, then add): + +``` +out = (acc - B1) * G + B2 + +B1 = ( 2.408203125, 0.069763183593750, -2.306640625, -1.0205078125) + = ( 0x1.344p+1, 0x1.1dcp-4, -0x1.274p+1, -0x1.054p+0) +G = ( 0.19494628906, 0.29223632812, 0.43359375, 0.6943359375) + = ( 0x1.8f4p-3, 0x1.2b4p-2, 0x1.bcp-2, 0x1.638p-1) +B2 = ( 0.08825683594, -0.25756835938, -0.18615722656, -0.52392578125) + = ( 0x1.698p-4, -0x1.07cp-2, -0x1.7d4p-3, -0x1.0c4p-1) +``` + +Store: `imageStore(dst, gid, vec4(out))` (fp16 -> float32 conversion, then +unorm8 quantization by the `rgba8` format; values outside [0,1] clamp at +storage time per normal unorm rules). + +Note the offset convention: the first offset component is x, the second y +(offset (-1,0) is the texel to the left). + +## 3. Control flow + +Straight-line except the single early-out at the top. No loops (the 9 taps +are fully unrolled). + +## 4. Boundary behavior + +- Out-of-range **writes** are prevented by the early return against + `imageSize(dst)` only; no per-write guard. +- Sample coordinates are not clamped in shader math. With + `imageSize(dst) == textureSize(src,0)/2` the +/-1 texel offsets still step + outside the source at the borders; edge behavior is whatever the bound + sampler's addressing mode provides. `uv` itself is in (0,1) for all in-range + `gid` only if `dst` is at most half the source size in each dimension. diff --git a/cleanroom/specs/06-feat-b.md b/cleanroom/specs/06-feat-b.md new file mode 100644 index 0000000..5e981f5 --- /dev/null +++ b/cleanroom/specs/06-feat-b.md @@ -0,0 +1,131 @@ +# shader_06 — same-res 3x3 conv, 4 input channels -> 4 output channels + +Source of truth: `asm/shader_06.spvasm`. One output texel per invocation. +Reads a 4-channel input at the SAME resolution as the output (no coordinate +scaling — contrast with shader_05's x2), applies a 3x3 convolution with full +4x4 channel mixing per tap, then an output affine remap, and stores to an +`rgba8` image. + +(Interpretation, after the exact math: a 4-in/4-out 3x3 CNN convolution layer +with an output requantization affine for unorm8 storage. Unlike shader_05 +there is no per-tap input affine — the input is consumed as sampled.) + +## 1. Interface + +- Workgroup size: **16 x 16 x 1**. Uses `gl_GlobalInvocationID`. +- Descriptors, all set 0: + +| binding | kind | format | access | role | +|---|---|---|---|---| +| 32 | combined image sampler, 2D float | (sampled) | read | 4-channel input feature map | +| 48 | storage image 2D | `rgba8` | write-only (`NonReadable`) | 4-channel output feature map | + +- No UBO, no push constants, no spec constants, no shared memory. +- FP16 arithmetic throughout (`GL_EXT_shader_explicit_arithmetic_types_float16`). + +## 2. Behavior + +``` +gid = ivec2(gl_GlobalInvocationID.xy) +if (any(greaterThanEqual(gid, imageSize(dst)))) return; + +srcSize = vec2(textureSize(src, 0)) +uv = (vec2(gid) + 0.5) / srcSize // 1:1 mapping, no *2 +``` + +Nine taps `v(off) = f16vec4(textureLodOffset(src, uv, 0.0, off))` (LOD 0, +constant texel offsets, full rgba). Accumulate in fp16, sequentially in the +tap order below: + +``` +acc = M1 * v(-1,-1); acc += M2 * v(-1,0); ... ; acc += M9 * v(1,1) +``` + +Each `Mk` is an `f16mat4` and `M * v` is the standard column-major +matrix-vector product: `result = Σ_j column_j * v[j]` (v.r multiplies +column 1, v.g column 2, v.b column 3, v.a column 4). Columns below are +written as GLSL constructor order `f16mat4(col1, col2, col3, col4)`, each +column being an (out.r, out.g, out.b, out.a) 4-vector. All values fp16-exact. + +M1, off (-1,-1): +- col1 (0.28100585938, 0.396484375, 0.20422363281, 0.18115234375) = (0x1.1fcp-2, 0x1.96p-2, 0x1.a24p-3, 0x1.73p-3) +- col2 (0.0022754669189, 0.0083007812500, -0.0066604614258, 0.017120361328) = (0x1.2a4p-9, 0x1.1p-7, -0x1.b48p-8, 0x1.188p-6) +- col3 (-0.28930664062, -0.19592285156, -0.28198242188, -0.0029315948486) = (-0x1.284p-2, -0x1.914p-3, -0x1.20cp-2, -0x1.804p-9) +- col4 (0.017227172852, 0.076110839844, -0.38549804688, 0.042022705078) = (0x1.1a4p-6, 0x1.37cp-4, -0x1.8acp-2, 0x1.584p-5) + +M2, off (-1,0): +- col1 (-0.042236328125, 0.57373046875, 0.32958984375, 0.18994140625) = (-0x1.5ap-5, 0x1.25cp-1, 0x1.518p-2, 0x1.85p-3) +- col2 (0.014884948730, 0.051116943359, -0.031829833984, 0.0067481994629) = (0x1.e7cp-7, 0x1.a2cp-5, -0x1.04cp-5, 0x1.ba4p-8) +- col3 (0.0032176971436, -0.3828125, -0.37084960938, 0.028533935547) = (0x1.a5cp-9, -0x1.88p-2, -0x1.7bcp-2, 0x1.d38p-6) +- col4 (-0.0380859375, 0.072448730469, 0.016708374023, 0.061370849609) = (-0x1.38p-5, 0x1.28cp-4, 0x1.11cp-6, 0x1.f6cp-5) + +M3, off (-1,1): +- col1 (-0.33666992188, 0.34155273438, 0.17761230469, 0.029235839844) = (-0x1.58cp-2, 0x1.5dcp-2, 0x1.6bcp-3, 0x1.dfp-6) +- col2 (-0.022705078125, -0.055694580078, -0.032562255859, 0.0034389495850) = (-0x1.74p-6, -0x1.c84p-5, -0x1.0acp-5, 0x1.c2cp-9) +- col3 (0.27124023438, -0.20324707031, -0.33984375, 0.0049285888672) = (0x1.15cp-2, -0x1.a04p-3, -0x1.5cp-2, 0x1.43p-8) +- col4 (-0.0074043273926, 0.16552734375, -0.18872070312, 0.037658691406) = (-0x1.e54p-8, 0x1.53p-3, -0x1.828p-3, 0x1.348p-5) + +M4, off (0,-1): +- col1 (0.52294921875, 0.071228027344, -0.044586181641, 0.058410644531) = (0x1.0bcp-1, 0x1.23cp-4, -0x1.6d4p-5, 0x1.de8p-5) +- col2 (-0.012573242188, 0.027557373047, 0.1142578125, 0.021209716797) = (-0x1.9cp-7, 0x1.c38p-6, 0x1.d4p-4, 0x1.5b8p-6) +- col3 (-0.42456054688, -0.03857421875, 0.096130371094, -0.019409179688) = (-0x1.b2cp-2, -0x1.3cp-5, 0x1.89cp-4, -0x1.3ep-6) +- col4 (0.015853881836, -0.31396484375, 0.085205078125, 0.088500976562) = (0x1.03cp-6, -0x1.418p-2, 0x1.5dp-4, 0x1.6a8p-4) + +M5, off (0,0) (center tap, sampled with no offset): +- col1 (0.067443847656, 0.068237304688, -0.036346435547, 0.20202636719) = (0x1.144p-4, 0x1.178p-4, -0x1.29cp-5, 0x1.9dcp-3) +- col2 (-0.023071289062, 0.028823852539, 0.10894775391, 0.011940002441) = (-0x1.7ap-6, 0x1.d84p-6, 0x1.be4p-4, 0x1.874p-7) +- col3 (0.021423339844, -0.036193847656, 0.16223144531, 0.036865234375) = (0x1.5fp-6, -0x1.288p-5, 0x1.4c4p-3, 0x1.2ep-5) +- col4 (-0.037322998047, -0.26611328125, 0.4873046875, 0.12780761719) = (-0x1.31cp-5, -0x1.108p-2, 0x1.f3p-2, 0x1.05cp-3) + +M6, off (0,1): +- col1 (-0.48461914062, -0.0050849914551, -0.0051536560059, 0.18518066406) = (-0x1.f04p-2, -0x1.4d4p-8, -0x1.51cp-8, 0x1.7b4p-3) +- col2 (-0.022323608398, 0.012138366699, 0.12139892578, -0.00022995471954) = (-0x1.6dcp-6, 0x1.8dcp-7, 0x1.f14p-4, -0x1.e24p-13) +- col3 (0.42041015625, -0.031524658203, 0.053558349609, 0.026870727539) = (0x1.ae8p-2, -0x1.024p-5, 0x1.b6cp-5, 0x1.b84p-6) +- col4 (0.050903320312, -0.44946289062, 0.30541992188, 0.095520019531) = (0x1.a1p-5, -0x1.cc4p-2, 0x1.38cp-2, 0x1.874p-4) + +M7, off (1,-1): +- col1 (0.31689453125, -0.37719726562, -0.013618469238, -0.22326660156) = (0x1.448p-2, -0x1.824p-2, -0x1.be4p-7, -0x1.c94p-3) +- col2 (-0.028625488281, -0.018066406250, -0.084777832031, 0.040496826172) = (-0x1.d5p-6, -0x1.28p-6, -0x1.5b4p-4, 0x1.4bcp-5) +- col3 (-0.2666015625, 0.16943359375, 0.085571289062, -0.024078369141) = (-0x1.11p-2, 0x1.5bp-3, 0x1.5e8p-4, -0x1.8a8p-6) +- col4 (-0.032562255859, 0.15759277344, -0.34887695312, -0.058319091797) = (-0x1.0acp-5, 0x1.42cp-3, -0x1.654p-2, -0x1.ddcp-5) + +M8, off (1,0): +- col1 (0.058258056641, -0.580078125, -0.34692382812, -0.0083084106445) = (0x1.dd4p-5, -0x1.29p-1, -0x1.634p-2, -0x1.104p-7) +- col2 (0.025192260742, 0.011932373047, -0.086120605469, 0.013916015625) = (0x1.9ccp-6, 0x1.87p-7, -0x1.60cp-4, 0x1.c8p-7) +- col3 (0.0084915161133, 0.3330078125, 0.5546875, 0.040649414062) = (0x1.164p-7, 0x1.55p-2, 0x1.1cp-1, 0x1.4dp-5) +- col4 (-0.017013549805, 0.29858398438, 0.32690429688, -0.061126708984) = (-0x1.16cp-6, 0x1.31cp-2, 0x1.4ecp-2, -0x1.f4cp-5) + +M9, off (1,1): +- col1 (-0.38623046875, -0.49340820312, -0.28295898438, 0.17102050781) = (-0x1.8b8p-2, -0x1.f94p-2, -0x1.21cp-2, 0x1.5e4p-3) +- col2 (0.035369873047, 0.023452758789, -0.081604003906, -0.016952514648) = (0x1.21cp-5, 0x1.804p-6, -0x1.4e4p-4, -0x1.15cp-6) +- col3 (0.26416015625, 0.32910156250, 0.47753906250, 0.018386840820) = (0x1.0e8p-2, 0x1.51p-2, 0x1.e9p-2, 0x1.2d4p-6) +- col4 (0.13903808594, 0.023025512695, -0.084228515625, -0.021194458008) = (0x1.1ccp-3, 0x1.794p-6, -0x1.59p-4, -0x1.5b4p-6) + +Output affine (componentwise fp16; subtract, then multiply, then add): + +``` +out = (acc - B1) * G + B2 + +B1 = (0.0021209716797, -0.0070228576660, 0.026550292969, 0.10119628906) + = (0x1.16p-9, -0x1.cc4p-8, 0x1.b3p-6, 0x1.9e8p-4) +G = (4.10546875, 8.515625, 5.17578125, 2.251953125) + = (0x1.06cp+2, 0x1.108p+3, 0x1.4b4p+2, 0x1.204p+1) +B2 = (0.10455322266, 0.27416992188, -0.13793945312, -0.16271972656) + = (0x1.ac4p-4, 0x1.18cp-2, -0x1.1a8p-3, -0x1.4d4p-3) +``` + +Store: `imageStore(dst, gid, vec4(out))` — fp16 -> float32, then the `rgba8` +format quantizes/clamps to unorm8. + +Offset convention: first component is x, second y. + +## 3. Control flow + +Straight-line except the early-out; the 9 taps are fully unrolled. + +## 4. Boundary behavior + +- Writes guarded only by the top early return against `imageSize(dst)`. +- No shader-side clamping of sample coordinates; the +/-1 offsets read outside + the source at borders, handled by the bound sampler's addressing mode. If + `dst` and `src` are the same size, `uv` stays in (0,1) for all in-range gid. diff --git a/cleanroom/specs/07-conv-down-4to8.md b/cleanroom/specs/07-conv-down-4to8.md new file mode 100644 index 0000000..d3520e9 --- /dev/null +++ b/cleanroom/specs/07-conv-down-4to8.md @@ -0,0 +1,321 @@ +# shader_07 — 3x3 stride-2 convolution, 4 -> 8 channels (encoder downsample) + +Source of truth: the traced shader_07 disassembly (kept outside this +repository). One compute pass. It reads a 3x3 neighborhood from one sampled +RGBA image (which is at twice the output resolution), applies a fixed +(compiled-in) fp16 linear layer — a 3x3 convolution with stride 2, 4 input +channels (1 image x RGBA), 8 output channels — followed by a per-channel +affine remap, and stores the 8 output channels as two RGBA8 storage images at +the output resolution. It is the narrow (model-0) counterpart of shader_32: +same structure, half the input and output channels. + +There is no UBO, no push constants, no spec constants, no shared memory, no +loops. The entire network layer's weights are literal constants in the shader. + +## 1. Interface + +- Workgroup size: **16 x 16 x 1**. +- Built-ins used: `gl_GlobalInvocationID` (only `.xy`; `.z` is ignored). +- All descriptors are in **set 0**: + +| binding | kind | format | access | role | +|---|---|---|---|---| +| 32 | combined image sampler, 2D float | (sampled; format external) | read | input feature image (source of all 9 taps and of the size used for UV normalization) | +| 48 | storage image 2D | `rgba8` | write-only (`NonReadable`) | output channels 0-3; its size is also the bounds-check extent | +| 49 | storage image 2D | `rgba8` | write-only (`NonReadable`) | output channels 4-7 | + +## 2. Behavior + +Notation: + +``` +p = ivec2(gl_GlobalInvocationID.xy) // output texel +outSize = imageSize(out48) // binding 48 only +inSize = vec2(textureSize(in32, 0)) // binding 32, level 0 +uv = (vec2(p * 2) + 0.5) / inSize +``` + +Early-out: if `p.x >= outSize.x || p.y >= outSize.y` (signed compare against +binding 48's size) the invocation returns without writing anything. Note the +UNSIGNED gid is bitcast to signed before the compare; no lower-bound check +exists (coordinates are non-negative by construction). + +Note the sample coordinate: `p*2 + 0.5`, i.e. the center of input texel +`(2p.x, 2p.y)` — the *top-left* texel of the 2x2 block, not the block center. +Combined with the +-1 tap offsets below, the 3x3 window covers input texels +`2p + d, d in [-1..1]^2`, so with a nearest or linear sampler the taps are +exactly the texel values (the coordinate lands exactly on texel centers). + +### 2.1 Taps + +9 taps, each a `vec4` sampled with explicit LOD 0 and then converted to +fp16 (`f16vec4`): + +``` +t[k] for k = 0..8 : textureLodOffset(in32, uv, 0.0, D[k]) // binding 32 +D = [(-1,-1), (-1,0), (-1,1), (0,-1), (0,0), (0,1), (1,-1), (1,0), (1,1)] +``` + +(the (0,0) tap uses no offset at all; the others use compile-time constant +offsets, i.e. `textureLodOffset`). + +### 2.2 Per output image + +For each output image `o` in {48, 49} there are 9 constant `f16mat4` +matrices `W[o][k]` (one per tap) and three constant `f16vec4`s `a[o]`, `b[o]`, +`c[o]`. The value written at `p` is: + +``` +sum = W[o][0]*t[0] + W[o][1]*t[1] + ... + W[o][8]*t[8] // f16vec4 +v = (sum - a[o]) * b[o] + c[o] // componentwise, fp16 +store = vec4(v) // widen to fp32 +imageStore(out_o, p, store) // rgba8 unorm store +``` + +- `W*t` is the standard matrix-vector product: `(W*t)[i] = sum_j W[i][j]*t[j]` + with `W[i][j]` given row-major in the appendix (section 6). +- All arithmetic (matrix products, the 8 additions, the affine) is IEEE fp16. + The additions associate strictly left-to-right in tap order: + `((W0*t0 + W1*t1) + W2*t2) + ...` — reproduce this order for bit-exactness. +- The `rgba8` store clamps each component to [0,1] and quantizes to unorm8; + this clamp is the only nonlinearity in the pass. + +Both outputs are written at the same coordinate `p` from the same 9 taps; +they differ only in their weight matrices and affine constants. + +Interpretation (hint, not normative): this is one layer of a small +convolutional network — a stride-2 3x3 conv taking one RGBA feature map +(4 channels) to 8 channels packed as 2 RGBA8 images; `(x-a)*b+c` is a +per-channel affine that maps the fp16 activations into [0,1] for quantized +storage (a following layer presumably inverts it). + +## 3. Control flow + +- Single early-out bounds check (section 2), guarding everything. +- No loops, no other conditionals. The 9 taps and 2 output computations are + straight-line code. + +## 4. Boundary behavior + +- Writes are guarded only by the check against binding 48's `imageSize`; the + other output is assumed to be at least as large. +- Nothing clamps the sample UVs. For `p` on the image border the offset taps + address input texels at -1 or `2*outSize` etc.; behavior comes from the + externally supplied sampler's address mode. The shader itself does no + clamping or edge handling. +- The shader relies on the dispatch to cover `outSize` (grid of + ceil(outSize/16) workgroups); overhanging invocations self-terminate. + +## 5. Precision requirements + +Bit-exact reproduction requires: + +- Sample results converted from fp32 to fp16 (round-to-nearest-even) before + any arithmetic. +- All matrix/add/affine math in IEEE fp16 + (`GL_EXT_shader_explicit_arithmetic_types_float16`; `f16mat4`/`f16vec4`). +- The accumulation association order of section 2.2. +- Widen to fp32 only for the final `imageStore`. + +In GLSL, build each `f16mat4` from the row-major tables in the appendix as +`f16mat4(col0, col1, col2, col3)` where `col_j = f16vec4(W[0][j], W[1][j], +W[2][j], W[3][j])` (GLSL matrix constructors take columns), then use plain +`M * t`. + +## 6. Weights appendix + +Layout: for each output binding, first the affine constants `a`, `b`, `c` +(as used in `v = (sum - a)*b + c`), then the 9 matrices keyed by +(input binding, tap offset). Each matrix is printed as 4 rows of 4 values, +row-major; each value is exact decimal followed by the exact fp16 hex-float +in parentheses. All values are exactly representable in fp16; both forms are +bit-exact. + +All constants below were machine-extracted from the disassembly by script +(no manual transcription): every value was cross-checked against the shader's +constant declarations and verified to round-trip IEEE fp16 exactly — 312 +values total (2 outputs x (9 matrices x 16 weights + 3 affine vectors x 4)). + +### Output binding 48 + +Post-sum affine constants (see section 2): + +- `a` = (0.80810546875, 0.72705078125, 0.82861328125, -0.250732421875) + - hex: (0x1.9dcp-1, 0x1.744p-1, 0x1.a84p-1, -0x1.00cp-2) +- `b` = (0.34326171875, 0.457763671875, 0.292236328125, 0.3623046875) + - hex: (0x1.5f8p-2, 0x1.d4cp-2, 0x1.2b4p-2, 0x1.73p-2) +- `c` = (0.256103515625, -0.1566162109375, 0.10400390625, 0.07696533203125) + - hex: (0x1.064p-2, -0x1.40cp-3, 0x1.aap-4, 0x1.3b4p-4) + +Tap: input binding 32, offset (-1,-1) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + 0.34619140625 (0x1.628p-2) -0.32373046875 (-0x1.4b8p-2) -0.07513427734375 (-0x1.33cp-4) 0.0306396484375 (0x1.f6p-6) + -0.2236328125 (-0x1.cap-3) 0.08392333984375 (0x1.57cp-4) -0.24169921875 (-0x1.efp-3) 0.1756591796875 (0x1.67cp-3) + -0.1871337890625 (-0x1.7f4p-3) 0.214599609375 (0x1.b78p-3) 0.08349609375 (0x1.56p-4) 0.31640625 (0x1.44p-2) + 0.362548828125 (0x1.734p-2) -0.412841796875 (-0x1.a6cp-2) -0.1900634765625 (-0x1.854p-3) 0.23095703125 (0x1.d9p-3) +``` + +Tap: input binding 32, offset (-1,0) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + 0.0340576171875 (0x1.17p-5) -0.10888671875 (-0x1.bep-4) -0.2281494140625 (-0x1.d34p-3) 0.0771484375 (0x1.3cp-4) + -0.35498046875 (-0x1.6b8p-2) 0.09136962890625 (0x1.764p-4) 0.221923828125 (0x1.c68p-3) 0.04718017578125 (0x1.828p-5) + 0.2861328125 (0x1.25p-2) 0.07708740234375 (0x1.3bcp-4) -0.2313232421875 (-0x1.d9cp-3) 0.18896484375 (0x1.83p-3) + 0.41552734375 (0x1.a98p-2) -0.31591796875 (-0x1.438p-2) -0.26220703125 (-0x1.0c8p-2) -0.07513427734375 (-0x1.33cp-4) +``` + +Tap: input binding 32, offset (-1,1) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + -0.2374267578125 (-0x1.e64p-3) 0.24560546875 (0x1.f7p-3) 0.2301025390625 (0x1.d74p-3) -0.0036563873291015625 (-0x1.df4p-9) + -0.11175537109375 (-0x1.c9cp-4) 0.2109375 (0x1.bp-3) 0.54345703125 (0x1.164p-1) -0.11090087890625 (-0x1.c64p-4) + 0.32861328125 (0x1.508p-2) -0.123046875 (-0x1.f8p-4) 0.0740966796875 (0x1.2f8p-4) 0.068115234375 (0x1.17p-4) + -0.018798828125 (-0x1.34p-6) 0.1529541015625 (0x1.394p-3) 0.2232666015625 (0x1.c94p-3) -0.267822265625 (-0x1.124p-2) +``` + +Tap: input binding 32, offset (0,-1) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + -0.046478271484375 (-0x1.7ccp-5) -0.150634765625 (-0x1.348p-3) -0.25537109375 (-0x1.058p-2) 0.3662109375 (0x1.77p-2) + -0.10601806640625 (-0x1.b24p-4) 0.27734375 (0x1.1cp-2) -0.04437255859375 (-0x1.6b8p-5) 0.032073974609375 (0x1.06cp-5) + 0.343017578125 (0x1.5f4p-2) 0.1624755859375 (0x1.4ccp-3) 0.10723876953125 (0x1.b74p-4) 0.2039794921875 (0x1.a1cp-3) + 0.464599609375 (0x1.dbcp-2) -0.1763916015625 (-0x1.694p-3) -0.15185546875 (-0x1.37p-3) 0.2252197265625 (0x1.cd4p-3) +``` + +Tap: input binding 32, offset (0,0) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + 0.0572509765625 (0x1.d5p-5) 0.3330078125 (0x1.55p-2) -0.08526611328125 (-0x1.5d4p-4) 0.37890625 (0x1.84p-2) + -0.03546142578125 (-0x1.228p-5) 0.2364501953125 (0x1.e44p-3) 0.275146484375 (0x1.19cp-2) 0.053558349609375 (0x1.b6cp-5) + 0.89208984375 (0x1.c8cp-1) 0.1944580078125 (0x1.8e4p-3) -0.238037109375 (-0x1.e78p-3) 0.015625 (0x1p-6) + 0.63330078125 (0x1.444p-1) -0.5634765625 (-0x1.208p-1) -0.364013671875 (-0x1.74cp-2) -0.017242431640625 (-0x1.1a8p-6) +``` + +Tap: input binding 32, offset (0,1) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + -0.1185302734375 (-0x1.e58p-4) 0.71484375 (0x1.6ep-1) 0.48291015625 (0x1.ee8p-2) 0.181884765625 (0x1.748p-3) + -0.054107666015625 (-0x1.bb4p-5) 0.395263671875 (0x1.94cp-2) 0.426513671875 (0x1.b4cp-2) -0.10498046875 (-0x1.aep-4) + 0.457763671875 (0x1.d4cp-2) 0.035675048828125 (0x1.244p-5) 0.160888671875 (0x1.498p-3) -0.1444091796875 (-0x1.27cp-3) + 0.450927734375 (0x1.cdcp-2) -0.237060546875 (-0x1.e58p-3) 0.070556640625 (0x1.21p-4) -0.23876953125 (-0x1.e9p-3) +``` + +Tap: input binding 32, offset (1,-1) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + -0.213623046875 (-0x1.b58p-3) 0.10675048828125 (0x1.b54p-4) -0.11419677734375 (-0x1.d3cp-4) 0.1695556640625 (0x1.5b4p-3) + 0.471923828125 (0x1.e34p-2) 0.191162109375 (0x1.878p-3) -0.01025390625 (-0x1.5p-7) -0.1617431640625 (-0x1.4b4p-3) + 0.51220703125 (0x1.064p-1) 0.007213592529296875 (0x1.d8cp-8) 0.032745361328125 (0x1.0c4p-5) 0.07147216796875 (0x1.24cp-4) + 0.019989013671875 (0x1.478p-6) 0.1661376953125 (0x1.544p-3) 0.13916015625 (0x1.1dp-3) 0.1263427734375 (0x1.02cp-3) +``` + +Tap: input binding 32, offset (1,0) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + 0.146728515625 (0x1.2c8p-3) 0.46142578125 (0x1.d88p-2) 0.0233612060546875 (0x1.7ecp-6) 0.128173828125 (0x1.068p-3) + 0.43115234375 (0x1.b98p-2) 0.26171875 (0x1.0cp-2) 0.332763671875 (0x1.54cp-2) -0.1422119140625 (-0x1.234p-3) + 0.89892578125 (0x1.cc4p-1) 0.035125732421875 (0x1.1fcp-5) -0.3349609375 (-0x1.57p-2) -0.2086181640625 (-0x1.ab4p-3) + 0.2255859375 (0x1.cep-3) -0.299072265625 (-0x1.324p-2) -0.30615234375 (-0x1.398p-2) 0.03857421875 (0x1.3cp-5) +``` + +Tap: input binding 32, offset (1,1) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + 0.137451171875 (0x1.198p-3) 0.759765625 (0x1.85p-1) 0.54052734375 (0x1.14cp-1) -0.0675048828125 (-0x1.148p-4) + 0.2939453125 (0x1.2dp-2) 0.056671142578125 (0x1.d04p-5) 0.247802734375 (0x1.fb8p-3) -0.1826171875 (-0x1.76p-3) + 0.250732421875 (0x1.00cp-2) 0.035003662109375 (0x1.1ecp-5) 0.10357666015625 (0x1.a84p-4) -0.34423828125 (-0x1.608p-2) + 0.270751953125 (0x1.154p-2) -0.323486328125 (-0x1.4b4p-2) -0.0823974609375 (-0x1.518p-4) -0.115234375 (-0x1.d8p-4) +``` + +### Output binding 49 + +Post-sum affine constants (see section 2): + +- `a` = (0.3017578125, 0.01161956787109375, -0.78759765625, 1.0009765625) + - hex: (0x1.35p-2, 0x1.7ccp-7, -0x1.934p-1, 0x1.004p+0) +- `b` = (0.4638671875, 0.5078125, 0.44775390625, 0.30126953125) + - hex: (0x1.dbp-2, 0x1.04p-1, 0x1.ca8p-2, 0x1.348p-2) +- `c` = (0.0196685791015625, -0.02593994140625, -0.006587982177734375, 0.1923828125) + - hex: (0x1.424p-6, -0x1.a9p-6, -0x1.afcp-8, 0x1.8ap-3) + +Tap: input binding 32, offset (-1,-1) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + -0.450927734375 (-0x1.cdcp-2) 0.47802734375 (0x1.e98p-2) 0.23779296875 (0x1.e7p-3) 0.04095458984375 (0x1.4f8p-5) + 0.1409912109375 (0x1.20cp-3) 0.0416259765625 (0x1.55p-5) -0.01399993896484375 (-0x1.cacp-7) -0.0168609619140625 (-0x1.144p-6) + -0.310302734375 (-0x1.3dcp-2) -0.187255859375 (-0x1.7f8p-3) -0.10882568359375 (-0x1.bdcp-4) -0.06378173828125 (-0x1.054p-4) + 0.3994140625 (0x1.99p-2) 0.1317138671875 (0x1.0dcp-3) -0.1307373046875 (-0x1.0bcp-3) 0.34765625 (0x1.64p-2) +``` + +Tap: input binding 32, offset (-1,0) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + -0.2900390625 (-0x1.29p-2) 0.2386474609375 (0x1.e8cp-3) 0.1495361328125 (0x1.324p-3) 0.28515625 (0x1.24p-2) + 0.472412109375 (0x1.e3cp-2) -0.272216796875 (-0x1.16cp-2) -0.09075927734375 (-0x1.73cp-4) -0.038909912109375 (-0x1.3ecp-5) + -0.5703125 (-0x1.24p-1) 0.06304931640625 (0x1.024p-4) -0.1265869140625 (-0x1.034p-3) -0.131103515625 (-0x1.0c8p-3) + 0.134033203125 (0x1.128p-3) 0.5947265625 (0x1.308p-1) 0.4423828125 (0x1.c5p-2) 0.140625 (0x1.2p-3) +``` + +Tap: input binding 32, offset (-1,1) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + 0.1939697265625 (0x1.8d4p-3) -0.240966796875 (-0x1.ed8p-3) -0.17333984375 (-0x1.63p-3) 0.456787109375 (0x1.d3cp-2) + 0.436767578125 (0x1.bf4p-2) -0.321533203125 (-0x1.494p-2) -0.09564208984375 (-0x1.87cp-4) -0.21337890625 (-0x1.b5p-3) + -0.6943359375 (-0x1.638p-1) 0.1651611328125 (0x1.524p-3) 0.250732421875 (0x1.00cp-2) -0.0001180171966552734375 (-0x1.efp-14) + -0.0165863037109375 (-0x1.0fcp-6) 0.1092529296875 (0x1.bf8p-4) 0.338623046875 (0x1.5acp-2) 0.085205078125 (0x1.5dp-4) +``` + +Tap: input binding 32, offset (0,-1) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + -0.354736328125 (-0x1.6b4p-2) 0.12384033203125 (0x1.fb4p-4) 0.10650634765625 (0x1.b44p-4) -0.246826171875 (-0x1.f98p-3) + -0.53759765625 (-0x1.134p-1) 0.450927734375 (0x1.cdcp-2) 0.2237548828125 (0x1.ca4p-3) 0.018096923828125 (0x1.288p-6) + -0.603515625 (-0x1.35p-1) 0.08929443359375 (0x1.6dcp-4) -0.1639404296875 (-0x1.4fcp-3) -0.0167388916015625 (-0x1.124p-6) + 0.6923828125 (0x1.628p-1) 0.343017578125 (0x1.5f4p-2) 0.12890625 (0x1.08p-3) 0.10601806640625 (0x1.b24p-4) +``` + +Tap: input binding 32, offset (0,0) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + -0.6826171875 (-0x1.5d8p-1) 0.6103515625 (0x1.388p-1) 0.373779296875 (0x1.7ecp-2) -0.051361083984375 (-0x1.a4cp-5) + -0.17041015625 (-0x1.5dp-3) 0.08642578125 (0x1.62p-4) 0.14599609375 (0x1.2bp-3) 0.1082763671875 (0x1.bb8p-4) + -1 (-0x1p+0) 0.07745361328125 (0x1.3d4p-4) 0.0030536651611328125 (0x1.904p-9) -0.0721435546875 (-0x1.278p-4) + 0.445556640625 (0x1.c84p-2) 0.4375 (0x1.cp-2) 0.5068359375 (0x1.038p-1) -0.149169921875 (-0x1.318p-3) +``` + +Tap: input binding 32, offset (0,1) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + -0.482666015625 (-0x1.ee4p-2) 0.26513671875 (0x1.0f8p-2) 0.01073455810546875 (0x1.5fcp-7) 0.201416015625 (0x1.9c8p-3) + 0.252197265625 (0x1.024p-2) -0.3486328125 (-0x1.65p-2) -0.1729736328125 (-0x1.624p-3) 0.0531005859375 (0x1.b3p-5) + -0.6640625 (-0x1.54p-1) -0.061737060546875 (-0x1.f9cp-5) 0.273193359375 (0x1.17cp-2) 0.01151275634765625 (0x1.794p-7) + 0.04486083984375 (0x1.6f8p-5) -0.052520751953125 (-0x1.ae4p-5) 0.34619140625 (0x1.628p-2) -0.0821533203125 (-0x1.508p-4) +``` + +Tap: input binding 32, offset (1,-1) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + 0.427001953125 (0x1.b54p-2) -0.27099609375 (-0x1.158p-2) -0.2119140625 (-0x1.b2p-3) -0.34130859375 (-0x1.5d8p-2) + -0.433349609375 (-0x1.bbcp-2) 0.191650390625 (0x1.888p-3) 0.10235595703125 (0x1.a34p-4) -0.10516357421875 (-0x1.aecp-4) + -0.51171875 (-0x1.06p-1) 0.280029296875 (0x1.1ecp-2) -0.01012420654296875 (-0x1.4bcp-7) -0.0034084320068359375 (-0x1.becp-9) + -0.05755615234375 (-0x1.d78p-5) 0.11322021484375 (0x1.cfcp-4) 0.1451416015625 (0x1.294p-3) 0.003177642822265625 (0x1.a08p-9) +``` + +Tap: input binding 32, offset (1,0) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + 0.09271240234375 (0x1.7bcp-4) 0.1824951171875 (0x1.75cp-3) 0.0770263671875 (0x1.3b8p-4) -0.2298583984375 (-0x1.d6cp-3) + -0.7099609375 (-0x1.6b8p-1) 0.4560546875 (0x1.d3p-2) 0.29248046875 (0x1.2b8p-2) 0.0947265625 (0x1.84p-4) + -0.5634765625 (-0x1.208p-1) 0.147216796875 (0x1.2d8p-3) -0.0145111083984375 (-0x1.db8p-7) -0.028839111328125 (-0x1.d88p-6) + -0.11505126953125 (-0x1.d74p-4) 0.154541015625 (0x1.3c8p-3) 0.2216796875 (0x1.c6p-3) -0.229736328125 (-0x1.d68p-3) +``` + +Tap: input binding 32, offset (1,1) — W rows (row-major, `contrib[i] = sum_j W[i][j]*tap[j]`): + +``` + -0.151611328125 (-0x1.368p-3) 0.273681640625 (0x1.184p-2) 0.00514984130859375 (0x1.518p-8) 0.00307464599609375 (0x1.93p-9) + -0.4248046875 (-0x1.b3p-2) 0.165283203125 (0x1.528p-3) -0.10418701171875 (-0x1.aacp-4) 0.1697998046875 (0x1.5bcp-3) + -0.548828125 (-0x1.19p-1) -0.21728515625 (-0x1.bdp-3) 0.1673583984375 (0x1.56cp-3) 0.10076904296875 (0x1.9ccp-4) + -0.059906005859375 (-0x1.eacp-5) -0.0153045654296875 (-0x1.f58p-7) 0.191162109375 (0x1.878p-3) -0.00913238525390625 (-0x1.2b4p-7) +``` diff --git a/cleanroom/specs/08-31-refine.md b/cleanroom/specs/08-31-refine.md new file mode 100644 index 0000000..f33a0dc --- /dev/null +++ b/cleanroom/specs/08-31-refine.md @@ -0,0 +1,581 @@ +# shader_08 / shader_31 — 3x3 linear flow refinement (family of 2) + +Source of truth: `asm/shader_08.spvasm`, `asm/shader_31.spvasm`. The two +modules are structurally identical — same interface, same sampling pattern, +same instruction structure — and differ **only** in the numeric values of +their weight/rescale constants (verified by diffing the disassemblies with +constant values normalized out: no other difference). One spec, two constant +sets (sections 3.1 and 3.2). + +Each is a straight-line compute pass producing one texel of each of two +outputs per invocation: a fully linear 3x3 neighborhood filter over two +4-channel input textures (72 inputs -> 4 outputs, twice). + +## 1. Interface (identical for both shaders) + +- Workgroup size: **16 x 16 x 1**. +- Built-ins used: `gl_GlobalInvocationID` only. +- All descriptors are in **set 0**: + +| binding | kind | format | access | role | +|---|---|---|---|---| +| 32 | combined image sampler, 2D float | unknown to shader | read | input A (4 channels, 3x3 neighborhood read) | +| 33 | combined image sampler, 2D float | unknown to shader | read | input B (4 channels, 3x3 neighborhood read) | +| 48 | storage image 2D | `rgba8` | write-only (`NonReadable`) | output F | +| 49 | storage image 2D | `rgba8` | write-only (`NonReadable`) | output B | + +- **No UBO. No push constants. No spec constants.** (In particular, despite + what pipeline-level notes may suggest, neither module declares a uniform + block or reads any `flowScale`-like parameter — the ASM contains no + Uniform-storage variable at all.) +- Requires FP16 arithmetic + (`GL_EXT_shader_explicit_arithmetic_types_float16`): all arithmetic between + sampling and the final stores is IEEE binary16. + +## 2. Behavior (identical for both shaders; constants differ) + +``` +p = ivec2(gl_GlobalInvocationID.xy) +if (p.x >= imageSize(outF).x || p.y >= imageSize(outF).y) return; // signed compare, see section 4 +sz = textureSize(texA, 0) // binding 32, LOD 0 +uv = (vec2(p) + 0.5) / vec2(sz) +``` + +Both inputs are sampled at explicit LOD 0 at this single `uv` with the nine +compile-time texel offsets, in this order (column-major over the 3x3 +neighborhood): + +``` +O = [(-1,-1), (-1,0), (-1,1), (0,-1), (0,0), (0,1), (1,-1), (1,0), (1,1)] +tA[o] = f16vec4(textureLodOffset(texA, uv, 0.0, o)) // binding 32; o = (0,0) uses plain textureLod +tB[o] = f16vec4(textureLodOffset(texB, uv, 0.0, o)) // binding 33 +``` + +Offsets are in texel units of the sampled texture's own LOD-0 grid. Each +sampled vec4 (float32) is converted to `f16vec4` before use. + +Each output texel is an affinely rescaled sum of 18 matrix-vector products +(a fully linear 72->4 map; there is no nonlinearity anywhere). Matrices are +GLSL `mat4` built from the four **columns** listed in section 3 +(`M * v = v.x*col0 + v.y*col1 + v.z*col2 + v.w*col3`). All products and sums +fp16, accumulated left-to-right in exactly the order of `O`, A taps first: + +``` +sF = WF_A[-1-1]*tA[-1,-1] + WF_A[-1+0]*tA[-1,0] + ... + WF_A[+1+1]*tA[1,1] + + WF_B[-1-1]*tB[-1,-1] + ... + WF_B[+1+1]*tB[1,1] // 18 terms, this order +outF_val = (sF - subF) * mulF + addF +imageStore(outF, p, vec4(outF_val)) // widen to float32; rgba8 quantizes + +sB = WB_A[-1-1]*tA[-1,-1] + ... + WB_B[+1+1]*tB[1,1] // same 18 samples, second weight set +outB_val = (sB - subB) * mulB + addB +imageStore(outB, p, vec4(outB_val)) // binding 49, same coordinate p +``` + +Association order (bit-exactness): the accumulation is +`((...((M1*v1 + M2*v2) + M3*v3) + ...) + M18*v18)` in the listed order; the +final rescale is `(sum - sub) * mul + add` with separate fp16 sub, mul, add +steps. + +## 3. Constants — family parameter table + +The two shaders differ **only** here: every one of the 36 matrices (16 +values each) and the 6 rescale vectors is independently different between +shader_08 and shader_31; nothing else differs. All values are exact IEEE +binary16 constants: decimal expansions are exact (round-trip to the same +fp16 bit pattern); the trailing comments give the same values as C99 +hex-float literals. + +Naming: `WF_A[dxdy]` = weight matrix applied to input-A tap at offset +`(dx,dy)` for output F; `WB_*` likewise for output B; `subF/mulF/addF` and +`subB/mulB/addB` are the final rescales. + +### 3.1 shader_08 constant set + +``` +WF_A[-1-1] = mat4( + vec4(-0.1815185546875, 0.1619873046875, -0.1451416015625, -0.08929443359375), // -0x1.73cp-3 0x1.4bcp-3 -0x1.294p-3 -0x1.6dcp-4 + vec4(-0.0853271484375, 0.50244140625, 0.2388916015625, 0.07208251953125), // -0x1.5d8p-4 0x1.014p-1 0x1.e94p-3 0x1.274p-4 + vec4(0.276611328125, -0.189453125, -0.2437744140625, -0.20361328125), // 0x1.1b4p-2 -0x1.84p-3 -0x1.f34p-3 -0x1.a1p-3 + vec4(-0.017059326171875, 0.150634765625, -0.1834716796875, -0.2401123046875)); // -0x1.178p-6 0x1.348p-3 -0x1.77cp-3 -0x1.ebcp-3 + +WF_A[-1+0] = mat4( + vec4(0.27685546875, -0.160400390625, 0.2489013671875, -0.11248779296875), // 0x1.1b8p-2 -0x1.488p-3 0x1.fdcp-3 -0x1.cccp-4 + vec4(-0.2000732421875, 0.33642578125, 0.0083465576171875, -0.08074951171875), // -0x1.99cp-3 0x1.588p-2 0x1.118p-7 -0x1.4acp-4 + vec4(0.69482421875, -0.37548828125, -0.25927734375, 0.156494140625), // 0x1.63cp-1 -0x1.808p-2 -0x1.098p-2 0x1.408p-3 + vec4(0.1788330078125, -0.1248779296875, -0.401123046875, 0.4033203125)); // 0x1.6e4p-3 -0x1.ff8p-4 -0x1.9acp-2 0x1.9dp-2 + +WF_A[-1+1] = mat4( + vec4(0.2366943359375, 0.1202392578125, 0.08221435546875, 0.10308837890625), // 0x1.e4cp-3 0x1.ec8p-4 0x1.50cp-4 0x1.a64p-4 + vec4(0.0714111328125, -0.043853759765625, -0.39013671875, 0.1854248046875), // 0x1.248p-4 -0x1.674p-5 -0x1.8f8p-2 0x1.7bcp-3 + vec4(0.390869140625, -0.0111846923828125, -0.08697509765625, 0.10955810546875), // 0x1.904p-2 -0x1.6e8p-7 -0x1.644p-4 0x1.c0cp-4 + vec4(-0.09307861328125, -0.07501220703125, 0.0438232421875, 0.341796875)); // -0x1.7d4p-4 -0x1.334p-4 0x1.67p-5 0x1.5ep-2 + +WF_A[+0-1] = mat4( + vec4(-0.481689453125, 0.2110595703125, -0.292724609375, -0.036376953125), // -0x1.ed4p-2 0x1.b04p-3 -0x1.2bcp-2 -0x1.2ap-5 + vec4(-0.11456298828125, 0.11669921875, 0.350341796875, 0.0635986328125), // -0x1.d54p-4 0x1.dep-4 0x1.66cp-2 0x1.048p-4 + vec4(-0.129150390625, 0.251708984375, 0.05194091796875, -0.2490234375), // -0x1.088p-3 0x1.01cp-2 0x1.a98p-5 -0x1.fep-3 + vec4(0.152587890625, 0.7998046875, 0.435546875, -0.11614990234375)); // 0x1.388p-3 0x1.998p-1 0x1.bep-2 -0x1.dbcp-4 + +WF_A[+0+0] = mat4( + vec4(-0.03826904296875, 0.01971435546875, -0.306396484375, -0.087890625), // -0x1.398p-5 0x1.43p-6 -0x1.39cp-2 -0x1.68p-4 + vec4(0.05743408203125, 0.298583984375, 0.1842041015625, -0.02392578125), // 0x1.d68p-5 0x1.31cp-2 0x1.794p-3 -0x1.88p-6 + vec4(0.14892578125, 0.062347412109375, 0.039794921875, -0.092041015625), // 0x1.31p-3 0x1.fecp-5 0x1.46p-5 -0x1.79p-4 + vec4(0.194091796875, 0.1463623046875, 0.404541015625, -0.10260009765625)); // 0x1.8d8p-3 0x1.2bcp-3 0x1.9e4p-2 -0x1.a44p-4 + +WF_A[+0+1] = mat4( + vec4(0.416748046875, -0.2147216796875, 0.011566162109375, -0.03155517578125), // 0x1.aacp-2 -0x1.b7cp-3 0x1.7bp-7 -0x1.028p-5 + vec4(-0.015625, -0.129638671875, 0.20361328125, 0.09930419921875), // -0x1p-6 -0x1.098p-3 0x1.a1p-3 0x1.96cp-4 + vec4(-0.01146697998046875, -0.27099609375, -0.146728515625, -0.0113677978515625), // -0x1.77cp-7 -0x1.158p-2 -0x1.2c8p-3 -0x1.748p-7 + vec4(-0.07940673828125, -0.244140625, -0.25146484375, 0.423828125)); // -0x1.454p-4 -0x1.f4p-3 -0x1.018p-2 0x1.b2p-2 + +WF_A[+1-1] = mat4( + vec4(-0.177001953125, -0.1612548828125, 0.10443115234375, 0.163330078125), // -0x1.6a8p-3 -0x1.4a4p-3 0x1.abcp-4 0x1.4e8p-3 + vec4(0.1329345703125, -0.15966796875, -0.0259552001953125, -0.0709228515625), // 0x1.104p-3 -0x1.47p-3 -0x1.a94p-6 -0x1.228p-4 + vec4(-0.254150390625, 0.07513427734375, 0.04327392578125, 0.0689697265625), // -0x1.044p-2 0x1.33cp-4 0x1.628p-5 0x1.1a8p-4 + vec4(0.1871337890625, 0.62744140625, 0.4462890625, 0.236328125)); // 0x1.7f4p-3 0x1.414p-1 0x1.c9p-2 0x1.e4p-3 + +WF_A[+1+0] = mat4( + vec4(-0.11181640625, 0.019866943359375, -0.314697265625, 0.0657958984375), // -0x1.cap-4 0x1.458p-6 -0x1.424p-2 0x1.0d8p-4 + vec4(0.1705322265625, -0.2022705078125, -0.14892578125, 0.0941162109375), // 0x1.5d4p-3 -0x1.9e4p-3 -0x1.31p-3 0x1.818p-4 + vec4(-0.8046875, 0.3369140625, 0.227783203125, -0.186279296875), // -0x1.9cp-1 0x1.59p-2 0x1.d28p-3 -0x1.7d8p-3 + vec4(-0.269287109375, 0.58056640625, 0.75341796875, -0.09893798828125)); // -0x1.13cp-2 0x1.294p-1 0x1.81cp-1 -0x1.954p-4 + +WF_A[+1+1] = mat4( + vec4(0.06982421875, -0.0002639293670654297, -0.24658203125, -0.1170654296875), // 0x1.1ep-4 -0x1.14cp-12 -0x1.f9p-3 -0x1.df8p-4 + vec4(0.1064453125, -0.1864013671875, 0.048065185546875, 0.277099609375), // 0x1.b4p-4 -0x1.7dcp-3 0x1.89cp-5 0x1.1bcp-2 + vec4(-0.35693359375, 0.0740966796875, 0.3388671875, -0.2509765625), // -0x1.6d8p-2 0x1.2f8p-4 0x1.5bp-2 -0x1.01p-2 + vec4(-0.2498779296875, -0.282470703125, 0.78369140625, -0.233154296875)); // -0x1.ffcp-3 -0x1.214p-2 0x1.914p-1 -0x1.dd8p-3 + +WF_B[-1-1] = mat4( + vec4(-0.2344970703125, -0.174072265625, 0.010528564453125, 0.47314453125), // -0x1.e04p-3 -0x1.648p-3 0x1.59p-7 0x1.e48p-2 + vec4(-0.13037109375, 0.018310546875, -0.1910400390625, 0.346923828125), // -0x1.0bp-3 0x1.2cp-6 -0x1.874p-3 0x1.634p-2 + vec4(-0.07373046875, -0.046722412109375, 0.2288818359375, 0.1312255859375), // -0x1.2ep-4 -0x1.7ecp-5 0x1.d4cp-3 0x1.0ccp-3 + vec4(-0.1181640625, 0.07855224609375, -0.101806640625, -0.0309906005859375)); // -0x1.e4p-4 0x1.41cp-4 -0x1.a1p-4 -0x1.fbcp-6 + +WF_B[-1+0] = mat4( + vec4(-0.231201171875, -0.33642578125, 0.343994140625, -0.11376953125), // -0x1.d98p-3 -0x1.588p-2 0x1.604p-2 -0x1.d2p-4 + vec4(-0.11761474609375, -0.1968994140625, 0.1864013671875, 0.302001953125), // -0x1.e1cp-4 -0x1.934p-3 0x1.7dcp-3 0x1.354p-2 + vec4(-0.42626953125, 0.4677734375, 0.143798828125, -0.08880615234375), // -0x1.b48p-2 0x1.dfp-2 0x1.268p-3 -0x1.6bcp-4 + vec4(0.252197265625, -0.2225341796875, 0.1414794921875, -0.119384765625)); // 0x1.024p-2 -0x1.c7cp-3 0x1.21cp-3 -0x1.e9p-4 + +WF_B[-1+1] = mat4( + vec4(-0.033905029296875, -0.3056640625, 0.263671875, -0.2093505859375), // -0x1.15cp-5 -0x1.39p-2 0x1.0ep-2 -0x1.accp-3 + vec4(0.0267791748046875, -0.279541015625, 0.174560546875, -0.202880859375), // 0x1.b6cp-6 -0x1.1e4p-2 0x1.658p-3 -0x1.9f8p-3 + vec4(-0.2489013671875, 0.208984375, 0.1175537109375, 0.130126953125), // -0x1.fdcp-3 0x1.acp-3 0x1.e18p-4 0x1.0a8p-3 + vec4(0.2252197265625, 0.0246429443359375, -0.0223541259765625, -0.0268707275390625)); // 0x1.cd4p-3 0x1.93cp-6 -0x1.6e4p-6 -0x1.b84p-6 + +WF_B[+0-1] = mat4( + vec4(-0.327392578125, 0.003009796142578125, -0.162353515625, 0.81396484375), // -0x1.4f4p-2 0x1.8a8p-9 -0x1.4c8p-3 0x1.a0cp-1 + vec4(-0.1287841796875, 0.376708984375, 0.319091796875, 0.79541015625), // -0x1.07cp-3 0x1.81cp-2 0x1.46cp-2 0x1.974p-1 + vec4(-0.1156005859375, -0.2626953125, -0.2257080078125, 0.2337646484375), // -0x1.d98p-4 -0x1.0dp-2 -0x1.ce4p-3 0x1.decp-3 + vec4(-0.440673828125, 0.00302886962890625, -0.21435546875, 0.164306640625)); // -0x1.c34p-2 0x1.8dp-9 -0x1.b7p-3 0x1.508p-3 + +WF_B[+0+0] = mat4( + vec4(-0.091064453125, 0.0762939453125, 0.11041259765625, 0.552734375), // -0x1.75p-4 0x1.388p-4 0x1.c44p-4 0x1.1bp-1 + vec4(0.039031982421875, 0.142822265625, 0.031585693359375, 0.58544921875), // 0x1.3fcp-5 0x1.248p-3 0x1.02cp-5 0x1.2bcp-1 + vec4(0.033050537109375, 0.2279052734375, 0.1651611328125, 0.25146484375), // 0x1.0ecp-5 0x1.d2cp-3 0x1.524p-3 0x1.018p-2 + vec4(-0.08709716796875, 0.068115234375, -0.2548828125, -0.0750732421875)); // -0x1.64cp-4 0x1.17p-4 -0x1.05p-2 -0x1.338p-4 + +WF_B[+0+1] = mat4( + vec4(0.39013671875, -0.09796142578125, 0.194091796875, -0.359375), // 0x1.8f8p-2 -0x1.914p-4 0x1.8d8p-3 -0x1.7p-2 + vec4(0.434326171875, -0.10577392578125, 0.06475830078125, -0.1605224609375), // 0x1.bccp-2 -0x1.b14p-4 0x1.094p-4 -0x1.48cp-3 + vec4(-0.1114501953125, 0.50341796875, -0.062408447265625, -0.1165771484375), // -0x1.c88p-4 0x1.01cp-1 -0x1.ff4p-5 -0x1.dd8p-4 + vec4(0.67138671875, -0.318115234375, 0.13330078125, -0.2015380859375)); // 0x1.57cp-1 -0x1.45cp-2 0x1.11p-3 -0x1.9ccp-3 + +WF_B[+1-1] = mat4( + vec4(-0.1727294921875, 0.07891845703125, 0.299072265625, 0.5068359375), // -0x1.61cp-3 0x1.434p-4 0x1.324p-2 0x1.038p-1 + vec4(-0.00830841064453125, 0.315673828125, 0.242431640625, 0.035614013671875), // -0x1.104p-7 0x1.434p-2 0x1.f08p-3 0x1.23cp-5 + vec4(0.11822509765625, -0.01058197021484375, -0.1221923828125, -0.09295654296875), // 0x1.e44p-4 -0x1.5acp-7 -0x1.f48p-4 -0x1.7ccp-4 + vec4(-0.06353759765625, -0.1861572265625, 0.10577392578125, 0.114990234375)); // -0x1.044p-4 -0x1.7d4p-3 0x1.b14p-4 0x1.d7p-4 + +WF_B[+1+0] = mat4( + vec4(0.05517578125, 0.11224365234375, 0.0159912109375, 0.5498046875), // 0x1.c4p-5 0x1.cbcp-4 0x1.06p-6 0x1.198p-1 + vec4(-0.045196533203125, 0.311767578125, 0.348388671875, 0.1893310546875), // -0x1.724p-5 0x1.3f4p-2 0x1.64cp-2 0x1.83cp-3 + vec4(0.54833984375, -0.58349609375, -0.053955078125, 0.385009765625), // 0x1.18cp-1 -0x1.2acp-1 -0x1.bap-5 0x1.8a4p-2 + vec4(-0.415283203125, 0.29931640625, -0.33544921875, -0.0237274169921875)); // -0x1.a94p-2 0x1.328p-2 -0x1.578p-2 -0x1.84cp-6 + +WF_B[+1+1] = mat4( + vec4(0.515625, 0.219970703125, -0.32958984375, -0.2998046875), // 0x1.08p-1 0x1.c28p-3 -0x1.518p-2 -0x1.33p-2 + vec4(0.251708984375, 0.1605224609375, -0.10772705078125, -0.23681640625), // 0x1.01cp-2 0x1.48cp-3 -0x1.b94p-4 -0x1.e5p-3 + vec4(0.10894775390625, 0.40234375, -0.381103515625, -0.03118896484375), // 0x1.be4p-4 0x1.9cp-2 -0x1.864p-2 -0x1.ffp-6 + vec4(-0.17236328125, 0.1700439453125, -0.348876953125, -0.235595703125)); // -0x1.61p-3 0x1.5c4p-3 -0x1.654p-2 -0x1.e28p-3 + +WB_A[-1-1] = mat4( + vec4(-0.05133056640625, 0.49951171875, 0.0780029296875, -0.53173828125), // -0x1.a48p-5 0x1.ff8p-2 0x1.3f8p-4 -0x1.104p-1 + vec4(-0.172607421875, -0.03656005859375, -0.0059661865234375, 0.388916015625), // -0x1.618p-3 -0x1.2b8p-5 -0x1.87p-8 0x1.8e4p-2 + vec4(0.223388671875, 0.28662109375, -0.0478515625, -0.042877197265625), // 0x1.c98p-3 0x1.258p-2 -0x1.88p-5 -0x1.5f4p-5 + vec4(0.211181640625, -0.31103515625, -0.1719970703125, 0.424560546875)); // 0x1.b08p-3 -0x1.3e8p-2 -0x1.604p-3 0x1.b2cp-2 + +WB_A[-1+0] = mat4( + vec4(-0.10101318359375, 0.142333984375, 0.03143310546875, -0.1978759765625), // -0x1.9dcp-4 0x1.238p-3 0x1.018p-5 -0x1.954p-3 + vec4(-0.06146240234375, -0.0943603515625, 0.0228729248046875, -0.041351318359375), // -0x1.f78p-5 -0x1.828p-4 0x1.76cp-6 -0x1.52cp-5 + vec4(0.045867919921875, 0.055328369140625, -0.3779296875, -0.1051025390625), // 0x1.77cp-5 0x1.c54p-5 -0x1.83p-2 -0x1.ae8p-4 + vec4(0.0232391357421875, -0.1435546875, -0.353759765625, 0.314453125)); // 0x1.7ccp-6 -0x1.26p-3 -0x1.6a4p-2 0x1.42p-2 + +WB_A[-1+1] = mat4( + vec4(-0.205078125, -0.41162109375, -0.2049560546875, 0.333984375), // -0x1.a4p-3 -0x1.a58p-2 -0x1.a3cp-3 0x1.56p-2 + vec4(0.1048583984375, -0.2459716796875, 0.040313720703125, 0.323974609375), // 0x1.ad8p-4 -0x1.f7cp-3 0x1.4a4p-5 0x1.4bcp-2 + vec4(-0.1580810546875, 0.05865478515625, 0.007663726806640625, -0.263671875), // -0x1.43cp-3 0x1.e08p-5 0x1.f64p-8 -0x1.0ep-2 + vec4(-0.0199737548828125, -0.0458984375, 0.0697021484375, -0.08544921875)); // -0x1.474p-6 -0x1.78p-5 0x1.1d8p-4 -0x1.5ep-4 + +WB_A[+0-1] = mat4( + vec4(0.453125, 0.1148681640625, 0.12249755859375, -0.046783447265625), // 0x1.dp-2 0x1.d68p-4 0x1.f5cp-4 -0x1.7f4p-5 + vec4(0.10089111328125, -0.09912109375, 0.2174072265625, -0.142578125), // 0x1.9d4p-4 -0x1.96p-4 0x1.bd4p-3 -0x1.24p-3 + vec4(0.1397705078125, 0.09588623046875, -0.44091796875, -0.11505126953125), // 0x1.1e4p-3 0x1.88cp-4 -0x1.c38p-2 -0x1.d74p-4 + vec4(-0.7177734375, -0.2193603515625, -0.3369140625, 0.30126953125)); // -0x1.6f8p-1 -0x1.c14p-3 -0x1.59p-2 0x1.348p-2 + +WB_A[+0+0] = mat4( + vec4(0.12890625, -0.564453125, -0.096435546875, 0.5654296875), // 0x1.08p-3 -0x1.21p-1 -0x1.8bp-4 0x1.218p-1 + vec4(-0.0709228515625, -0.053863525390625, -0.2568359375, -0.0021724700927734375), // -0x1.228p-4 -0x1.b94p-5 -0x1.07p-2 -0x1.1ccp-9 + vec4(-0.0631103515625, -0.00591278076171875, 0.419921875, -0.2939453125), // -0x1.028p-4 -0x1.838p-8 0x1.aep-2 -0x1.2dp-2 + vec4(-0.49609375, 0.06988525390625, -0.11151123046875, -0.04388427734375)); // -0x1.fcp-2 0x1.1e4p-4 -0x1.c8cp-4 -0x1.678p-5 + +WB_A[+0+1] = mat4( + vec4(-0.1490478515625, -0.239990234375, -0.0202484130859375, 0.27099609375), // -0x1.314p-3 -0x1.eb8p-3 -0x1.4bcp-6 0x1.158p-2 + vec4(-0.06048583984375, -0.388671875, -0.10260009765625, 0.321533203125), // -0x1.ef8p-5 -0x1.8ep-2 -0x1.a44p-4 0x1.494p-2 + vec4(-0.332763671875, -0.1954345703125, 0.74951171875, -0.237548828125), // -0x1.54cp-2 -0x1.904p-3 0x1.7fcp-1 -0x1.e68p-3 + vec4(0.27197265625, 0.0186004638671875, 0.1572265625, -0.482421875)); // 0x1.168p-2 0x1.30cp-6 0x1.42p-3 -0x1.eep-2 + +WB_A[+1-1] = mat4( + vec4(0.251953125, -0.461669921875, -0.143310546875, 0.52734375), // 0x1.02p-2 -0x1.d8cp-2 -0x1.258p-3 0x1.0ep-1 + vec4(0.04669189453125, 0.133056640625, 0.2415771484375, -0.28125), // 0x1.7e8p-5 0x1.108p-3 0x1.eecp-3 -0x1.2p-2 + vec4(0.07891845703125, 0.0712890625, -0.021636962890625, 0.004550933837890625), // 0x1.434p-4 0x1.24p-4 -0x1.628p-6 0x1.2a4p-8 + vec4(-0.759765625, 0.038238525390625, 0.12353515625, -0.1396484375)); // -0x1.85p-1 0x1.394p-5 0x1.fap-4 -0x1.1ep-3 + +WB_A[+1+0] = mat4( + vec4(-0.010711669921875, -0.50439453125, 0.2237548828125, 0.46435546875), // -0x1.5fp-7 -0x1.024p-1 0x1.ca4p-3 0x1.db8p-2 + vec4(-0.141845703125, -0.1966552734375, -0.163818359375, 0.1705322265625), // -0x1.228p-3 -0x1.92cp-3 -0x1.4f8p-3 0x1.5d4p-3 + vec4(0.181640625, -0.157470703125, 0.70068359375, 0.00829315185546875), // 0x1.74p-3 -0x1.428p-3 0x1.66cp-1 0x1.0fcp-7 + vec4(-0.476318359375, 0.106689453125, 0.1954345703125, -0.587890625)); // -0x1.e7cp-2 0x1.b5p-4 0x1.904p-3 -0x1.2dp-1 + +WB_A[+1+1] = mat4( + vec4(-0.00438690185546875, 0.41259765625, -0.0211944580078125, -0.29248046875), // -0x1.1f8p-8 0x1.a68p-2 -0x1.5b4p-6 -0x1.2b8p-2 + vec4(0.069580078125, 0.16748046875, -0.07904052734375, 0.2705078125), // 0x1.1dp-4 0x1.57p-3 -0x1.43cp-4 0x1.15p-2 + vec4(0.11102294921875, -0.071044921875, 0.18310546875, 0.263916015625), // 0x1.c6cp-4 -0x1.23p-4 0x1.77p-3 0x1.0e4p-2 + vec4(0.464111328125, -0.0479736328125, -0.251220703125, -0.306884765625)); // 0x1.db4p-2 -0x1.89p-5 -0x1.014p-2 -0x1.3a4p-2 + +WB_B[-1-1] = mat4( + vec4(0.0828857421875, -0.006198883056640625, -0.00475311279296875, 0.060272216796875), // 0x1.538p-4 -0x1.964p-8 -0x1.378p-8 0x1.edcp-5 + vec4(0.0802001953125, -0.1138916015625, -0.058074951171875, 0.2135009765625), // 0x1.488p-4 -0x1.d28p-4 -0x1.dbcp-5 0x1.b54p-3 + vec4(-0.007572174072265625, -0.134033203125, 0.0416259765625, 0.01103973388671875), // -0x1.f04p-8 -0x1.128p-3 0x1.55p-5 0x1.69cp-7 + vec4(0.002758026123046875, 0.07952880859375, 0.19091796875, -0.2476806640625)); // 0x1.698p-9 0x1.45cp-4 0x1.87p-3 -0x1.fb4p-3 + +WB_B[-1+0] = mat4( + vec4(0.148193359375, 0.1947021484375, 0.0175628662109375, -0.10174560546875), // 0x1.2f8p-3 0x1.8ecp-3 0x1.1fcp-6 -0x1.a0cp-4 + vec4(0.05706787109375, 0.11956787109375, 0.01264190673828125, 0.134521484375), // 0x1.d38p-5 0x1.e9cp-4 0x1.9e4p-7 0x1.138p-3 + vec4(-0.11163330078125, -0.1910400390625, 0.6142578125, -0.183349609375), // -0x1.c94p-4 -0x1.874p-3 0x1.3a8p-1 -0x1.778p-3 + vec4(-0.052032470703125, 0.697265625, -0.2403564453125, -0.450439453125)); // -0x1.aa4p-5 0x1.65p-1 -0x1.ec4p-3 -0x1.cd4p-2 + +WB_B[-1+1] = mat4( + vec4(0.1773681640625, -0.034393310546875, 0.1358642578125, -0.1328125), // 0x1.6b4p-3 -0x1.19cp-5 0x1.164p-3 -0x1.1p-3 + vec4(0.10302734375, -0.05865478515625, 0.08099365234375, 0.01238250732421875), // 0x1.a6p-4 -0x1.e08p-5 0x1.4bcp-4 0x1.95cp-7 + vec4(0.056488037109375, -0.09393310546875, 0.06964111328125, 0.024627685546875), // 0x1.cecp-5 -0x1.80cp-4 0x1.1d4p-4 0x1.938p-6 + vec4(-0.050201416015625, 0.310791015625, -0.217041015625, -0.34423828125)); // -0x1.9b4p-5 0x1.3e4p-2 -0x1.bc8p-3 -0x1.608p-2 + +WB_B[+0-1] = mat4( + vec4(-0.2724609375, 0.2093505859375, 0.0887451171875, -0.0125579833984375), // -0x1.17p-2 0x1.accp-3 0x1.6b8p-4 -0x1.9b8p-7 + vec4(-0.64404296875, 0.270263671875, -8.302927017211914e-05, 0.0390625), // -0x1.49cp-1 0x1.14cp-2 -0x1.5c4p-14 0x1.4p-5 + vec4(-0.29736328125, 0.07049560546875, 0.331787109375, -0.024383544921875), // -0x1.308p-2 0x1.20cp-4 0x1.53cp-2 -0x1.8f8p-6 + vec4(0.1949462890625, 0.6689453125, -0.09124755859375, -0.443359375)); // 0x1.8f4p-3 0x1.568p-1 -0x1.75cp-4 -0x1.c6p-2 + +WB_B[+0+0] = mat4( + vec4(-0.408935546875, 0.1290283203125, 0.060516357421875, 0.172607421875), // -0x1.a2cp-2 0x1.084p-3 0x1.efcp-5 0x1.618p-3 + vec4(-0.86328125, 0.2442626953125, 0.221923828125, -0.0927734375), // -0x1.bap-1 0x1.f44p-3 0x1.c68p-3 -0x1.7cp-4 + vec4(-0.07757568359375, -0.09625244140625, -0.2081298828125, 0.2088623046875), // -0x1.3dcp-4 -0x1.8a4p-4 -0x1.aa4p-3 0x1.abcp-3 + vec4(0.0156402587890625, 0.25537109375, -0.303466796875, -0.1588134765625)); // 0x1.004p-6 0x1.058p-2 -0x1.36cp-2 -0x1.454p-3 + +WB_B[+0+1] = mat4( + vec4(-0.03271484375, -0.3212890625, -0.1365966796875, 0.282470703125), // -0x1.0cp-5 -0x1.49p-2 -0x1.17cp-3 0x1.214p-2 + vec4(0.0511474609375, -0.1568603515625, -0.1414794921875, -0.02447509765625), // 0x1.a3p-5 -0x1.414p-3 -0x1.21cp-3 -0x1.91p-6 + vec4(0.0938720703125, -0.0723876953125, -0.68798828125, -0.11004638671875), // 0x1.808p-4 -0x1.288p-4 -0x1.604p-1 -0x1.c2cp-4 + vec4(-0.10186767578125, -0.42236328125, 0.26123046875, 0.156005859375)); // -0x1.a14p-4 -0x1.b08p-2 0x1.0b8p-2 0x1.3f8p-3 + +WB_B[+1-1] = mat4( + vec4(-0.39013671875, 0.1387939453125, 0.03436279296875, -0.04815673828125), // -0x1.8f8p-2 0x1.1c4p-3 0x1.198p-5 -0x1.8a8p-5 + vec4(-0.470947265625, 0.2249755859375, 0.09991455078125, -0.0193328857421875), // -0x1.e24p-2 0x1.cccp-3 0x1.994p-4 -0x1.3ccp-6 + vec4(0.09844970703125, 0.13671875, -0.031280517578125, -0.004955291748046875), // 0x1.934p-4 0x1.18p-3 -0x1.004p-5 -0x1.44cp-8 + vec4(0.12890625, 0.166259765625, -0.345947265625, 0.086669921875)); // 0x1.08p-3 0x1.548p-3 -0x1.624p-2 0x1.63p-4 + +WB_B[+1+0] = mat4( + vec4(-0.51416015625, -0.1756591796875, -0.1044921875, 0.11444091796875), // -0x1.074p-1 -0x1.67cp-3 -0x1.acp-4 0x1.d4cp-4 + vec4(-0.473388671875, 0.05987548828125, 0.11370849609375, -0.1942138671875), // -0x1.e4cp-2 0x1.ea8p-5 0x1.d1cp-4 -0x1.8dcp-3 + vec4(0.003795623779296875, 0.085693359375, -0.90234375, -0.187255859375), // 0x1.f18p-9 0x1.5fp-4 -0x1.cep-1 -0x1.7f8p-3 + vec4(0.22021484375, -0.431884765625, 0.037384033203125, 0.43798828125)); // 0x1.c3p-3 -0x1.ba4p-2 0x1.324p-5 0x1.c08p-2 + +WB_B[+1+1] = mat4( + vec4(0.06097412109375, -0.304443359375, -0.226806640625, 0.1220703125), // 0x1.f38p-5 -0x1.37cp-2 -0x1.d08p-3 0x1.f4p-4 + vec4(0.2919921875, -0.0633544921875, -0.12200927734375, 0.0005459785461425781), // 0x1.2bp-2 -0x1.038p-4 -0x1.f3cp-4 0x1.1e4p-11 + vec4(0.030242919921875, 0.41845703125, 0.1304931640625, -0.5400390625), // 0x1.ef8p-6 0x1.ac8p-2 0x1.0b4p-3 -0x1.148p-1 + vec4(0.06622314453125, -0.1771240234375, 0.54052734375, 0.25244140625)); // 0x1.0f4p-4 -0x1.6acp-3 0x1.14cp-1 0x1.028p-2 + +subF = vec4(-0.035614013671875, 0.29736328125, -0.0168304443359375, 0.2900390625); // -0x1.23cp-5 0x1.308p-2 -0x1.13cp-6 0x1.29p-2 +mulF = vec4(1.8330078125, 1.189453125, 1.0966796875, 1.2373046875); // 0x1.d54p+0 0x1.308p+0 0x1.18cp+0 0x1.3ccp+0 +addF = vec4(0.415771484375, 0.5341796875, 0.5341796875, 0.5478515625); // 0x1.a9cp-2 0x1.118p-1 0x1.118p-1 0x1.188p-1 +subB = vec4(-0.25927734375, -0.09466552734375, -0.05706787109375, -0.02874755859375); // -0x1.098p-2 -0x1.83cp-4 -0x1.d38p-5 -0x1.d7p-6 +mulB = vec4(1.6591796875, 1.1123046875, 1.3701171875, 0.92724609375); // 0x1.a8cp+0 0x1.1ccp+0 0x1.5ecp+0 0x1.dacp-1 +addB = vec4(0.66748046875, 0.62451171875, 0.498779296875, 0.74658203125); // 0x1.55cp-1 0x1.3fcp-1 0x1.fecp-2 0x1.7e4p-1 +``` + +### 3.2 shader_31 constant set + +``` +WF_A[-1-1] = mat4( + vec4(0.0199432373046875, 0.08966064453125, 0.017547607421875, 0.1976318359375), // 0x1.46cp-6 0x1.6f4p-4 0x1.1f8p-6 0x1.94cp-3 + vec4(-0.0447998046875, -0.0675048828125, -0.01873779296875, 0.11846923828125), // -0x1.6fp-5 -0x1.148p-4 -0x1.33p-6 0x1.e54p-4 + vec4(0.0196685791015625, -0.01708984375, -0.0295257568359375, -0.1881103515625), // 0x1.424p-6 -0x1.18p-6 -0x1.e3cp-6 -0x1.814p-3 + vec4(-0.039337158203125, 0.049163818359375, 0.022125244140625, -0.12890625)); // -0x1.424p-5 0x1.92cp-5 0x1.6a8p-6 -0x1.08p-3 + +WF_A[-1+0] = mat4( + vec4(-0.07073974609375, -0.092041015625, -0.0207672119140625, 0.201416015625), // -0x1.21cp-4 -0x1.79p-4 -0x1.544p-6 0x1.9c8p-3 + vec4(-0.27392578125, -0.0968017578125, -0.0797119140625, 0.345458984375), // -0x1.188p-2 -0x1.8c8p-4 -0x1.468p-4 0x1.61cp-2 + vec4(0.04315185546875, 0.0660400390625, 0.0947265625, -0.1376953125), // 0x1.618p-5 0x1.0e8p-4 0x1.84p-4 -0x1.1ap-3 + vec4(-0.10601806640625, 0.00759124755859375, 0.11334228515625, -0.153564453125)); // -0x1.b24p-4 0x1.f18p-8 0x1.d04p-4 -0x1.3a8p-3 + +WF_A[-1+1] = mat4( + vec4(0.12469482421875, -0.2021484375, 0.0013027191162109375, 0.11737060546875), // 0x1.fecp-4 -0x1.9ep-3 0x1.558p-10 0x1.e0cp-4 + vec4(-0.10858154296875, 0.0621337890625, -0.025726318359375, 0.240966796875), // -0x1.bccp-4 0x1.fdp-5 -0x1.a58p-6 0x1.ed8p-3 + vec4(-0.12432861328125, 0.074462890625, 0.1854248046875, -0.042694091796875), // -0x1.fd4p-4 0x1.31p-4 0x1.7bcp-3 -0x1.5dcp-5 + vec4(-0.2161865234375, -0.0216522216796875, 0.054229736328125, -0.073486328125)); // -0x1.bacp-3 -0x1.62cp-6 0x1.bc4p-5 -0x1.2dp-4 + +WF_A[+0-1] = mat4( + vec4(0.037872314453125, 0.2027587890625, 0.0673828125, -0.049407958984375), // 0x1.364p-5 0x1.9f4p-3 0x1.14p-4 -0x1.94cp-5 + vec4(-0.11480712890625, 0.09210205078125, 0.00310516357421875, 0.09429931640625), // -0x1.d64p-4 0x1.794p-4 0x1.97p-9 0x1.824p-4 + vec4(0.10809326171875, -0.1717529296875, -0.047637939453125, -0.0272674560546875), // 0x1.bacp-4 -0x1.5fcp-3 -0x1.864p-5 -0x1.becp-6 + vec4(0.150390625, 0.00959014892578125, -0.0007958412170410156, -0.0188446044921875)); // 0x1.34p-3 0x1.3a4p-7 -0x1.a14p-11 -0x1.34cp-6 + +WF_A[+0+0] = mat4( + vec4(-0.05755615234375, 0.002307891845703125, -0.00510406494140625, -0.095703125), // -0x1.d78p-5 0x1.2e8p-9 -0x1.4e8p-8 -0x1.88p-4 + vec4(-0.3076171875, -0.0005688667297363281, -0.01012420654296875, 0.1502685546875), // -0x1.3bp-2 -0x1.2a4p-11 -0x1.4bcp-7 0x1.33cp-3 + vec4(0.075439453125, -0.0291900634765625, 0.0489501953125, 0.0281982421875), // 0x1.35p-4 -0x1.de4p-6 0x1.91p-5 0x1.cep-6 + vec4(-0.057373046875, 0.0212249755859375, 0.0985107421875, -0.01342010498046875)); // -0x1.d6p-5 0x1.5bcp-6 0x1.938p-4 -0x1.b7cp-7 + +WF_A[+0+1] = mat4( + vec4(0.202880859375, -0.255615234375, -0.00716400146484375, -0.1798095703125), // 0x1.9f8p-3 -0x1.05cp-2 -0x1.d58p-8 -0x1.704p-3 + vec4(0.1182861328125, -0.03656005859375, 0.0063323974609375, 0.07403564453125), // 0x1.e48p-4 -0x1.2b8p-5 0x1.9fp-8 0x1.2f4p-4 + vec4(-0.0909423828125, 0.1881103515625, 0.21337890625, 0.0877685546875), // -0x1.748p-4 0x1.814p-3 0x1.b5p-3 0x1.678p-4 + vec4(-0.216796875, 0.06884765625, 0.11407470703125, 0.0175018310546875)); // -0x1.bcp-3 0x1.1ap-4 0x1.d34p-4 0x1.1ecp-6 + +WF_A[+1-1] = mat4( + vec4(0.0806884765625, 0.2381591796875, 0.00794219970703125, -0.197509765625), // 0x1.4a8p-4 0x1.e7cp-3 0x1.044p-7 -0x1.948p-3 + vec4(-0.1392822265625, 0.216552734375, 0.0428466796875, -0.0352783203125), // -0x1.1d4p-3 0x1.bb8p-3 0x1.5fp-5 -0x1.21p-5 + vec4(0.007030487060546875, -0.18701171875, -0.10076904296875, 0.10113525390625), // 0x1.cccp-8 -0x1.7fp-3 -0x1.9ccp-4 0x1.9e4p-4 + vec4(0.0302886962890625, -0.0806884765625, -0.07476806640625, 0.058746337890625)); // 0x1.f04p-6 -0x1.4a8p-4 -0x1.324p-4 0x1.e14p-5 + +WF_A[+1+0] = mat4( + vec4(-0.11016845703125, 0.15185546875, -0.0005979537963867188, -0.283203125), // -0x1.c34p-4 0x1.37p-3 -0x1.398p-11 -0x1.22p-2 + vec4(-0.293701171875, 0.1365966796875, -0.0091705322265625, -0.0215911865234375), // -0x1.2ccp-2 0x1.17cp-3 -0x1.2c8p-7 -0x1.61cp-6 + vec4(0.06903076171875, -0.11163330078125, -0.0250244140625, 0.2271728515625), // 0x1.1acp-4 -0x1.c94p-4 -0x1.9ap-6 0x1.d14p-3 + vec4(-0.1568603515625, 0.0231781005859375, 0.0262451171875, 0.0948486328125)); // -0x1.414p-3 0x1.7bcp-6 0x1.aep-6 0x1.848p-4 + +WF_A[+1+1] = mat4( + vec4(-0.048492431640625, -0.10064697265625, -0.00811767578125, -0.2137451171875), // -0x1.8d4p-5 -0x1.9c4p-4 -0x1.0ap-7 -0x1.b5cp-3 + vec4(0.0249786376953125, 0.00836944580078125, -0.04608154296875, -0.10308837890625), // 0x1.994p-6 0x1.124p-7 -0x1.798p-5 -0x1.a64p-4 + vec4(0.07427978515625, 0.12548828125, 0.0738525390625, 0.2081298828125), // 0x1.304p-4 0x1.01p-3 0x1.2e8p-4 0x1.aa4p-3 + vec4(-0.250732421875, 0.122802734375, 0.08087158203125, 0.07244873046875)); // -0x1.00cp-2 0x1.f7p-4 0x1.4b4p-4 0x1.28cp-4 + +WF_B[-1-1] = mat4( + vec4(0.037109375, -0.07415771484375, -0.0013933181762695312, 0.0029163360595703125), // 0x1.3p-5 -0x1.2fcp-4 -0x1.6d4p-10 0x1.7e4p-9 + vec4(-0.0516357421875, -0.11761474609375, -0.032379150390625, 0.2080078125), // -0x1.a7p-5 -0x1.e1cp-4 -0x1.094p-5 0x1.aap-3 + vec4(-0.14453125, -0.01983642578125, -0.0039825439453125, 0.2122802734375), // -0x1.28p-3 -0x1.45p-6 -0x1.05p-8 0x1.b2cp-3 + vec4(-0.09771728515625, 0.0516357421875, -0.08984375, -0.007785797119140625)); // -0x1.904p-4 0x1.a7p-5 -0x1.7p-4 -0x1.fe4p-8 + +WF_B[-1+0] = mat4( + vec4(-0.226318359375, -0.09869384765625, -0.00608062744140625, 0.12298583984375), // -0x1.cf8p-3 -0x1.944p-4 -0x1.8e8p-8 0x1.f7cp-4 + vec4(0.0662841796875, -0.151123046875, 0.00917816162109375, 0.34423828125), // 0x1.0f8p-4 -0x1.358p-3 0x1.2ccp-7 0x1.608p-2 + vec4(-0.039886474609375, -0.085205078125, -0.03375244140625, 0.2105712890625), // -0x1.46cp-5 -0x1.5dp-4 -0x1.148p-5 0x1.af4p-3 + vec4(0.120849609375, -0.0173797607421875, 0.0247802734375, -0.0699462890625)); // 0x1.efp-4 -0x1.1ccp-6 0x1.96p-6 -0x1.1e8p-4 + +WF_B[-1+1] = mat4( + vec4(-0.25244140625, -0.0192718505859375, -0.0335693359375, 0.15234375), // -0x1.028p-2 -0x1.3bcp-6 -0x1.13p-5 0x1.38p-3 + vec4(0.07733154296875, 0.035064697265625, 0.059356689453125, 0.10113525390625), // 0x1.3ccp-4 0x1.1f4p-5 0x1.e64p-5 0x1.9e4p-4 + vec4(0.14013671875, -0.07073974609375, -0.004497528076171875, 0.1239013671875), // 0x1.1fp-3 -0x1.21cp-4 -0x1.26cp-8 0x1.fb8p-4 + vec4(-0.00928497314453125, -0.016143798828125, 0.10400390625, -0.1358642578125)); // -0x1.304p-7 -0x1.088p-6 0x1.aap-4 -0x1.164p-3 + +WF_B[+0-1] = mat4( + vec4(0.06695556640625, 0.11212158203125, 0.03662109375, -0.06219482421875), // 0x1.124p-4 0x1.cb4p-4 0x1.2cp-5 -0x1.fd8p-5 + vec4(-0.1119384765625, -0.02459716796875, 0.0123748779296875, 0.0177764892578125), // -0x1.ca8p-4 -0x1.93p-6 0x1.958p-7 0x1.234p-6 + vec4(-0.00812530517578125, 0.07427978515625, 0.007720947265625, -0.005306243896484375), // -0x1.0a4p-7 0x1.304p-4 0x1.fap-8 -0x1.5bcp-8 + vec4(0.01079559326171875, -0.00146484375, -0.1339111328125, -0.0242919921875)); // 0x1.61cp-7 -0x1.8p-10 -0x1.124p-3 -0x1.8ep-6 + +WF_B[+0+0] = mat4( + vec4(-0.1658935546875, 0.056854248046875, 0.04473876953125, 0.00032901763916015625), // -0x1.53cp-3 0x1.d1cp-5 0x1.6e8p-5 0x1.59p-12 + vec4(0.08831787109375, -0.1868896484375, 0.03472900390625, 0.0704345703125), // 0x1.69cp-4 -0x1.7ecp-3 0x1.1c8p-5 0x1.208p-4 + vec4(0.1419677734375, -0.1182861328125, -0.0255279541015625, -0.04644775390625), // 0x1.22cp-3 -0x1.e48p-4 -0x1.a24p-6 -0x1.7c8p-5 + vec4(0.1944580078125, -0.060943603515625, 0.012725830078125, 0.02056884765625)); // 0x1.8e4p-3 -0x1.f34p-5 0x1.a1p-7 0x1.51p-6 + +WF_B[+0+1] = mat4( + vec4(-0.03363037109375, 0.0070953369140625, -0.0091705322265625, -0.0250701904296875), // -0x1.138p-5 0x1.d1p-8 -0x1.2c8p-7 -0x1.9acp-6 + vec4(0.17041015625, -0.1058349609375, 0.020843505859375, -0.0208282470703125), // 0x1.5dp-3 -0x1.b18p-4 0x1.558p-6 -0x1.554p-6 + vec4(0.291748046875, -0.197509765625, -0.0198516845703125, -0.10150146484375), // 0x1.2acp-2 -0x1.948p-3 -0x1.454p-6 -0x1.9fcp-4 + vec4(0.020263671875, 0.016326904296875, 0.06951904296875, -0.0109100341796875)); // 0x1.4cp-6 0x1.0b8p-6 0x1.1ccp-4 -0x1.658p-7 + +WF_B[+1-1] = mat4( + vec4(-0.0045013427734375, 0.09185791015625, -0.01445770263671875, -0.103759765625), // -0x1.27p-8 0x1.784p-4 -0x1.d9cp-7 -0x1.a9p-4 + vec4(-0.0711669921875, 0.1785888671875, 0.0396728515625, -0.14697265625), // -0x1.238p-4 0x1.6dcp-3 0x1.45p-5 -0x1.2dp-3 + vec4(0.01473236083984375, 0.2105712890625, 0.030120849609375, -0.1463623046875), // 0x1.e2cp-7 0x1.af4p-3 0x1.ed8p-6 -0x1.2bcp-3 + vec4(-0.051666259765625, 0.018798828125, -0.1546630859375, -0.0006651878356933594)); // -0x1.a74p-5 0x1.34p-6 -0x1.3ccp-3 -0x1.5ccp-11 + +WF_B[+1+0] = mat4( + vec4(-0.1468505859375, 0.2083740234375, -0.006103515625, -0.12005615234375), // -0x1.2ccp-3 0x1.aacp-3 -0x1.9p-8 -0x1.ebcp-4 + vec4(0.02734375, -0.11700439453125, 0.036773681640625, -0.11962890625), // 0x1.cp-6 -0x1.df4p-4 0x1.2d4p-5 -0x1.eap-4 + vec4(0.058929443359375, 0.06292724609375, -0.0265960693359375, -0.2230224609375), // 0x1.e2cp-5 0x1.01cp-4 -0x1.b3cp-6 -0x1.c8cp-3 + vec4(0.14111328125, -0.11688232421875, -0.04937744140625, 0.113037109375)); // 0x1.21p-3 -0x1.decp-4 -0x1.948p-5 0x1.cfp-4 + +WF_B[+1+1] = mat4( + vec4(-0.11956787109375, 0.18603515625, -0.03460693359375, -0.171630859375), // -0x1.e9cp-4 0x1.7dp-3 -0x1.1b8p-5 -0x1.5f8p-3 + vec4(0.0210113525390625, -0.1663818359375, -0.01593017578125, -0.158935546875), // 0x1.584p-6 -0x1.54cp-3 -0x1.05p-6 -0x1.458p-3 + vec4(0.0506591796875, -0.0836181640625, -0.056427001953125, -0.171875), // 0x1.9fp-5 -0x1.568p-4 -0x1.ce4p-5 -0x1.6p-3 + vec4(-0.14697265625, -5.4001808166503906e-05, 0.01300048828125, 0.11138916015625)); // -0x1.2dp-3 -0x1.c5p-15 0x1.aap-7 0x1.c84p-4 + +WB_A[-1-1] = mat4( + vec4(-0.03271484375, -0.2052001953125, 0.320068359375, -0.1123046875), // -0x1.0cp-5 -0x1.a44p-3 0x1.47cp-2 -0x1.ccp-4 + vec4(0.210693359375, -0.005035400390625, 0.1253662109375, 0.09271240234375), // 0x1.af8p-3 -0x1.4ap-8 0x1.00cp-3 0x1.7bcp-4 + vec4(0.0885009765625, 0.1627197265625, -0.288818359375, -0.128173828125), // 0x1.6a8p-4 0x1.4d4p-3 -0x1.27cp-2 -0x1.068p-3 + vec4(-0.13134765625, -0.03204345703125, 0.032867431640625, -0.2113037109375)); // -0x1.0dp-3 -0x1.068p-5 0x1.0d4p-5 -0x1.b0cp-3 + +WB_A[-1+0] = mat4( + vec4(0.0364990234375, 0.127685546875, -0.004650115966796875, -0.0809326171875), // 0x1.2bp-5 0x1.058p-3 -0x1.30cp-8 -0x1.4b8p-4 + vec4(0.289306640625, 0.1964111328125, 0.0726318359375, 0.051910400390625), // 0x1.284p-2 0x1.924p-3 0x1.298p-4 0x1.a94p-5 + vec4(0.064208984375, -0.01116180419921875, -0.0304412841796875, -0.10015869140625), // 0x1.07p-4 -0x1.6dcp-7 -0x1.f2cp-6 -0x1.9a4p-4 + vec4(-0.10107421875, -0.0657958984375, 0.02996826171875, -0.2059326171875)); // -0x1.9ep-4 -0x1.0d8p-4 0x1.ebp-6 -0x1.a5cp-3 + +WB_A[-1+1] = mat4( + vec4(0.1090087890625, 0.23779296875, -0.26708984375, 0.047332763671875), // 0x1.be8p-4 0x1.e7p-3 -0x1.118p-2 0x1.83cp-5 + vec4(0.2509765625, 0.206298828125, -0.045379638671875, -0.12213134765625), // 0x1.01p-2 0x1.a68p-3 -0x1.73cp-5 -0x1.f44p-4 + vec4(-0.022125244140625, -0.1405029296875, 0.12841796875, -0.00213623046875), // -0x1.6a8p-6 -0x1.1fcp-3 0x1.07p-3 -0x1.18p-9 + vec4(0.014068603515625, 0.05096435546875, 0.09027099609375, 0.045562744140625)); // 0x1.cdp-7 0x1.a18p-5 0x1.71cp-4 0x1.754p-5 + +WB_A[+0-1] = mat4( + vec4(-0.18408203125, -0.313720703125, 0.286376953125, -0.0841064453125), // -0x1.79p-3 -0x1.414p-2 0x1.254p-2 -0x1.588p-4 + vec4(-0.0169219970703125, -0.139404296875, 0.440673828125, 0.0170135498046875), // -0x1.154p-6 -0x1.1d8p-3 0x1.c34p-2 0x1.16cp-6 + vec4(0.197998046875, 0.1766357421875, -0.07037353515625, 0.010162353515625), // 0x1.958p-3 0x1.69cp-3 -0x1.204p-4 0x1.4dp-7 + vec4(0.004680633544921875, 0.031280517578125, -0.0226593017578125, -0.145751953125)); // 0x1.32cp-8 0x1.004p-5 -0x1.734p-6 -0x1.2a8p-3 + +WB_A[+0+0] = mat4( + vec4(-0.2218017578125, -0.129638671875, -0.1439208984375, 0.051727294921875), // -0x1.c64p-3 -0x1.098p-3 -0x1.26cp-3 0x1.a7cp-5 + vec4(0.037811279296875, 0.048553466796875, 0.148681640625, -0.05426025390625), // 0x1.35cp-5 0x1.8dcp-5 0x1.308p-3 -0x1.bc8p-5 + vec4(0.226318359375, 0.0311126708984375, 0.069091796875, 0.08343505859375), // 0x1.cf8p-3 0x1.fdcp-6 0x1.1bp-4 0x1.55cp-4 + vec4(-0.039306640625, -0.060516357421875, 0.0657958984375, -0.05303955078125)); // -0x1.42p-5 -0x1.efcp-5 0x1.0d8p-4 -0x1.b28p-5 + +WB_A[+0+1] = mat4( + vec4(-0.11181640625, 0.161865234375, -0.36572265625, 0.489013671875), // -0x1.cap-4 0x1.4b8p-3 -0x1.768p-2 0x1.f4cp-2 + vec4(0.07818603515625, 0.238037109375, -0.1185302734375, -0.0579833984375), // 0x1.404p-4 0x1.e78p-3 -0x1.e58p-4 -0x1.dbp-5 + vec4(0.11553955078125, -0.12005615234375, 0.156982421875, -0.140380859375), // 0x1.d94p-4 -0x1.ebcp-4 0x1.418p-3 -0x1.1f8p-3 + vec4(-0.06640625, -0.045654296875, 0.11083984375, 0.0197906494140625)); // -0x1.1p-4 -0x1.76p-5 0x1.c6p-4 0x1.444p-6 + +WB_A[+1-1] = mat4( + vec4(-0.09490966796875, -0.160888671875, 0.0535888671875, -0.3330078125), // -0x1.84cp-4 -0x1.498p-3 0x1.b7p-5 -0x1.55p-2 + vec4(-0.02496337890625, -0.0374755859375, 0.3896484375, -0.1376953125), // -0x1.99p-6 -0x1.33p-5 0x1.8fp-2 -0x1.1ap-3 + vec4(0.19873046875, 0.1533203125, 0.00789642333984375, 0.1209716796875), // 0x1.97p-3 0x1.3ap-3 0x1.02cp-7 0x1.ef8p-4 + vec4(0.0386962890625, 0.019134521484375, 0.06365966796875, -0.07135009765625)); // 0x1.3dp-5 0x1.398p-6 0x1.04cp-4 -0x1.244p-4 + +WB_A[+1+0] = mat4( + vec4(-0.06988525390625, -0.2415771484375, -0.234619140625, -0.09881591796875), // -0x1.1e4p-4 -0x1.eecp-3 -0x1.e08p-3 -0x1.94cp-4 + vec4(-0.08673095703125, -0.0638427734375, 0.061767578125, -0.287353515625), // -0x1.634p-4 -0x1.058p-4 0x1.fap-5 -0x1.264p-2 + vec4(0.200927734375, 0.135009765625, 0.1337890625, 0.1058349609375), // 0x1.9b8p-3 0x1.148p-3 0x1.12p-3 0x1.b18p-4 + vec4(0.0096282958984375, 0.050567626953125, -0.0113983154296875, -0.01038360595703125)); // 0x1.3b8p-7 0x1.9e4p-5 -0x1.758p-7 -0x1.544p-7 + +WB_A[+1+1] = mat4( + vec4(-0.069580078125, -0.09600830078125, -0.287109375, 0.44580078125), // -0x1.1dp-4 -0x1.894p-4 -0x1.26p-2 0x1.c88p-2 + vec4(-0.00904083251953125, 0.1907958984375, -0.1832275390625, -0.0408935546875), // -0x1.284p-7 0x1.86cp-3 -0x1.774p-3 -0x1.4fp-5 + vec4(0.10516357421875, 0.004695892333984375, 0.093017578125, -0.10272216796875), // 0x1.aecp-4 0x1.33cp-8 0x1.7dp-4 -0x1.a4cp-4 + vec4(-0.1029052734375, -0.02655029296875, -0.10662841796875, -0.05657958984375)); // -0x1.a58p-4 -0x1.b3p-6 -0x1.b4cp-4 -0x1.cf8p-5 + +WB_B[-1-1] = mat4( + vec4(0.0169677734375, -0.1627197265625, 0.10546875, 0.041259765625), // 0x1.16p-6 -0x1.4d4p-3 0x1.bp-4 0x1.52p-5 + vec4(0.1953125, 0.096923828125, -0.0389404296875, 0.0645751953125), // 0x1.9p-3 0x1.8dp-4 -0x1.3fp-5 0x1.088p-4 + vec4(0.1588134765625, 0.0106201171875, 0.192138671875, 0.0112457275390625), // 0x1.454p-3 0x1.5cp-7 0x1.898p-3 0x1.708p-7 + vec4(-0.08184814453125, -0.024200439453125, -0.150390625, -0.15185546875)); // -0x1.4f4p-4 -0x1.8c8p-6 -0x1.34p-3 -0x1.37p-3 + +WB_B[-1+0] = mat4( + vec4(0.1837158203125, -0.033447265625, 0.11041259765625, -0.0200958251953125), // 0x1.784p-3 -0x1.12p-5 0x1.c44p-4 -0x1.494p-6 + vec4(0.1416015625, 0.12103271484375, -0.10906982421875, -0.058135986328125), // 0x1.22p-3 0x1.efcp-4 -0x1.becp-4 -0x1.dc4p-5 + vec4(0.1524658203125, 0.11700439453125, -0.0193939208984375, -0.03106689453125), // 0x1.384p-3 0x1.df4p-4 -0x1.3dcp-6 -0x1.fdp-6 + vec4(-0.055023193359375, -0.203857421875, -0.018768310546875, -0.340576171875)); // -0x1.c2cp-5 -0x1.a18p-3 -0x1.338p-6 -0x1.5ccp-2 + +WB_B[-1+1] = mat4( + vec4(0.3046875, 0.258544921875, 0.0296478271484375, -0.006378173828125), // 0x1.38p-2 0x1.08cp-2 0x1.e5cp-6 -0x1.a2p-8 + vec4(-0.066162109375, 0.034088134765625, -0.10888671875, -0.140380859375), // -0x1.0fp-4 0x1.174p-5 -0x1.bep-4 -0x1.1f8p-3 + vec4(0.09783935546875, 0.25537109375, -0.17236328125, 0.0254669189453125), // 0x1.90cp-4 0x1.058p-2 -0x1.61p-3 0x1.a14p-6 + vec4(-0.0299530029296875, 0.0679931640625, 0.004871368408203125, -0.0281982421875)); // -0x1.eacp-6 0x1.168p-4 0x1.3f4p-8 -0x1.cep-6 + +WB_B[+0-1] = mat4( + vec4(-0.10406494140625, -0.29052734375, 0.388916015625, -0.01250457763671875), // -0x1.aa4p-4 -0x1.298p-2 0x1.8e4p-2 -0x1.99cp-7 + vec4(-0.043731689453125, 0.01457977294921875, 0.057769775390625, 0.036865234375), // -0x1.664p-5 0x1.ddcp-7 0x1.d94p-5 0x1.2ep-5 + vec4(-0.0941162109375, -0.1827392578125, 0.2406005859375, -0.0701904296875), // -0x1.818p-4 -0x1.764p-3 0x1.eccp-3 -0x1.1f8p-4 + vec4(0.029937744140625, -0.0196685791015625, -0.1673583984375, 0.0176849365234375)); // 0x1.ea8p-6 -0x1.424p-6 -0x1.56cp-3 0x1.21cp-6 + +WB_B[+0+0] = mat4( + vec4(-0.06494140625, -0.1820068359375, 0.2396240234375, -0.059600830078125), // -0x1.0ap-4 -0x1.74cp-3 0x1.eacp-3 -0x1.e84p-5 + vec4(0.0293121337890625, 0.1331787109375, -0.099365234375, 0.00513458251953125), // 0x1.e04p-6 0x1.10cp-3 -0x1.97p-4 0x1.508p-8 + vec4(-0.11285400390625, -0.00634765625, -0.046234130859375, 0.00847625732421875), // -0x1.ce4p-4 -0x1.ap-8 -0x1.7acp-5 0x1.15cp-7 + vec4(0.08331298828125, -0.0958251953125, -0.07769775390625, -0.132080078125)); // 0x1.554p-4 -0x1.888p-4 -0x1.3e4p-4 -0x1.0e8p-3 + +WB_B[+0+1] = mat4( + vec4(-0.04486083984375, 0.1397705078125, 0.041351318359375, 0.0426025390625), // -0x1.6f8p-5 0x1.1e4p-3 0x1.52cp-5 0x1.5dp-5 + vec4(0.008697509765625, 0.28076171875, -0.1693115234375, 0.2259521484375), // 0x1.1dp-7 0x1.1f8p-2 -0x1.5acp-3 0x1.cecp-3 + vec4(-0.1044921875, 0.281494140625, -0.200439453125, 0.2705078125), // -0x1.acp-4 0x1.204p-2 -0x1.9a8p-3 0x1.15p-2 + vec4(0.09991455078125, 0.09588623046875, 0.0305328369140625, 0.287353515625)); // 0x1.994p-4 0x1.88cp-4 0x1.f44p-6 0x1.264p-2 + +WB_B[+1-1] = mat4( + vec4(0.029388427734375, 0.01433563232421875, 0.223388671875, -0.290771484375), // 0x1.e18p-6 0x1.d5cp-7 0x1.c98p-3 -0x1.29cp-2 + vec4(-0.0183258056640625, -0.1571044921875, 0.0304718017578125, -0.06549072265625), // -0x1.2c4p-6 -0x1.41cp-3 0x1.f34p-6 -0x1.0c4p-4 + vec4(-0.101806640625, -0.14501953125, 0.0278167724609375, -0.10089111328125), // -0x1.a1p-4 -0x1.29p-3 0x1.c7cp-6 -0x1.9d4p-4 + vec4(0.0821533203125, -0.189697265625, -0.1212158203125, 0.042327880859375)); // 0x1.508p-4 -0x1.848p-3 -0x1.f08p-4 0x1.5acp-5 + +WB_B[+1+0] = mat4( + vec4(-0.000762939453125, -0.09295654296875, 0.07720947265625, -0.32861328125), // -0x1.9p-11 -0x1.7ccp-4 0x1.3c4p-4 -0x1.508p-2 + vec4(0.007701873779296875, -0.090576171875, -0.127685546875, 0.04290771484375), // 0x1.f8cp-8 -0x1.73p-4 -0x1.058p-3 0x1.5f8p-5 + vec4(-0.06512451171875, -0.1427001953125, -0.151611328125, 0.07977294921875), // -0x1.0acp-4 -0x1.244p-3 -0x1.368p-3 0x1.46cp-4 + vec4(0.135986328125, -0.211181640625, 0.03753662109375, 0.0804443359375)); // 0x1.168p-3 -0x1.b08p-3 0x1.338p-5 0x1.498p-4 + +WB_B[+1+1] = mat4( + vec4(-0.0234832763671875, 0.05914306640625, -0.1162109375, 0.04315185546875), // -0x1.80cp-6 0x1.e48p-5 -0x1.dcp-4 0x1.618p-5 + vec4(0.0263824462890625, 0.2327880859375, -0.0679931640625, 0.1822509765625), // 0x1.b04p-6 0x1.dccp-3 -0x1.168p-4 0x1.754p-3 + vec4(-0.05914306640625, -0.0011539459228515625, -0.110107421875, 0.2939453125), // -0x1.e48p-5 -0x1.2e8p-10 -0x1.c3p-4 0x1.2dp-2 + vec4(0.181884765625, 0.0723876953125, -0.006908416748046875, 0.32470703125)); // 0x1.748p-3 0x1.288p-4 -0x1.c4cp-8 0x1.4c8p-2 + +subF = vec4(-0.481689453125, 0.07958984375, 0.063720703125, 0.193359375); // -0x1.ed4p-2 0x1.46p-4 0x1.05p-4 0x1.8cp-3 +mulF = vec4(1.6923828125, 1.6337890625, 3.208984375, 2.80859375); // 0x1.b14p+0 0x1.a24p+0 0x1.9acp+1 0x1.678p+1 +addF = vec4(-0.210205078125, 0.0880126953125, -0.45263671875, 0.16064453125); // -0x1.ae8p-3 0x1.688p-4 -0x1.cf8p-2 0x1.49p-3 +subB = vec4(0.4033203125, 0.2088623046875, 0.369140625, -0.2333984375); // 0x1.9dp-2 0x1.abcp-3 0x1.7ap-2 -0x1.dep-3 +mulB = vec4(1.5693359375, 1.6083984375, 1.19140625, 1.8642578125); // 0x1.91cp+0 0x1.9bcp+0 0x1.31p+0 0x1.dd4p+0 +addB = vec4(-0.39990234375, 0.137939453125, 0.08624267578125, -0.152099609375); // -0x1.998p-2 0x1.1a8p-3 0x1.614p-4 -0x1.378p-3 +``` + +## 4. Control flow + +Straight-line: a single early-out bounds check, then unconditional +computation and two stores. No loops. (The original wraps the body in a +degenerate one-iteration `switch`; the observable behavior is just +`if (out of range) return;`.) + +## 5. Boundary behavior + +- The only guard is `any(greaterThanEqual(p, imageSize(outF)))` — a *signed* + comparison of `ivec2(gl_GlobalInvocationID.xy)` against **binding 48's** + size. The store to binding 49 relies on the same guard; the shader assumes + 49 is at least as large as 48. +- `uv` is normalized by binding 32's LOD-0 size; binding 33 is sampled at the + same normalized position (offsets stay in its own texel units if its + resolution differs). +- Nothing clamps the sample coordinates; at border texels the +-1 offsets + address outside the image and edge behavior comes from the externally + supplied samplers. + +## 6. Precision requirements + +Bit-exact reproduction requires: convert each sampled vec4 to `f16vec4` +before any arithmetic; perform all 36 matrix products, the 17+17 +accumulating adds and the two 3-step rescales in fp16 in the association +order of section 2; widen to float32 only immediately before each +`imageStore` (where `rgba8` clamps to [0,1] and quantizes to unorm8). + +## 7. Interpretation (non-normative) + +A learned, purely linear 3x3 refinement/merge filter over two 4-channel +fields (in the surrounding pipeline: flow refinement over a forward and a +backward flow texture), producing refined forward (48) and backward (49) +fields. The two family members carry independently trained weights — +presumably for two different pyramid levels or pipeline positions; which is +which is not determinable from the modules themselves. diff --git a/cleanroom/specs/09-coarse-flow.md b/cleanroom/specs/09-coarse-flow.md new file mode 100644 index 0000000..1531627 --- /dev/null +++ b/cleanroom/specs/09-coarse-flow.md @@ -0,0 +1,242 @@ +# shader_09 — coarse flow from 3x3 matching costs (two outputs) + +Source of truth: `asm/shader_09.spvasm`. One straight-line compute pass, one +texel of each of two flow outputs per invocation. It samples three 8-channel +feature maps (each stored as a pair of RGBA textures), computes 18 matching +costs (9 spatial offsets x 2 query descriptors), normalizes them, and maps +them through two small learned linear layers to produce a "forward" and a +"backward" 4-channel output. + +## 1. Interface + +- Workgroup size: **16 x 16 x 1**. +- Built-ins used: `gl_GlobalInvocationID` only. +- All descriptors are in **set 0**: + +| binding | kind | format | access | role (functional, see note) | +|---|---|---|---|---| +| 32 | combined image sampler, 2D float | unknown to shader | read | query descriptor A, channels 0..3 | +| 33 | combined image sampler, 2D float | unknown to shader | read | query descriptor A, channels 4..7 | +| 34 | combined image sampler, 2D float | unknown to shader | read | query descriptor B, channels 0..3 | +| 35 | combined image sampler, 2D float | unknown to shader | read | query descriptor B, channels 4..7 | +| 36 | combined image sampler, 2D float | unknown to shader | read | reference descriptor R, channels 0..3 (sampled at 9 offsets) | +| 37 | combined image sampler, 2D float | unknown to shader | read | reference descriptor R, channels 4..7 (sampled at 9 offsets) | +| 48 | storage image 2D | `rgba8` | write-only (`NonReadable`) | output F ("forward" result) | +| 49 | storage image 2D | `rgba8` | write-only (`NonReadable`) | output B ("backward" result) | + +- **No UBO. No push constants. No spec constants.** +- Requires FP16 arithmetic (`GL_EXT_shader_explicit_arithmetic_types_float16`): + every arithmetic step between sampling and the final store is IEEE binary16. + +Note on roles: the dataflow pairs the samplers as (32,33), (34,35), (36,37) — +each pair is dotted together as one 8-component descriptor. The pipeline-level +meaning of A, B, R (which frame/pyramid level each holds) is decided by the +host bindings, not by this shader; the pairing above is what the code does. +(This grouping does NOT match a "32-34 = pyramid levels of frame 1, 35-37 = +pyramid levels of frame 2" reading; the code pairs 33 with 32, not with a +same-frame pyramid.) + +## 2. Behavior + +Notation: + +``` +p = ivec2(gl_GlobalInvocationID.xy) +if (p.x >= imageSize(outF).x || p.y >= imageSize(outF).y) return; // signed compare, see section 4 +sz = textureSize(texA0, 0) // binding 32, LOD 0 +uv = (vec2(p) + 0.5) / vec2(sz) +``` + +All texture reads are `textureLod(..., uv, 0.0)` (explicit LOD 0) at this one +`uv`, some with a compile-time texel offset (`textureLodOffset`). Offsets are +in texel units of the *sampled* texture's own LOD-0 grid. Every sampled +result (vec4, float32) is immediately converted to `f16vec4`: + +``` +a0 = f16vec4(textureLod(texA0, uv, 0.0)) // binding 32 +a1 = f16vec4(textureLod(texA1, uv, 0.0)) // binding 33 +b0 = f16vec4(textureLod(texB0, uv, 0.0)) // binding 34 +b1 = f16vec4(textureLod(texB1, uv, 0.0)) // binding 35 +r0(o) = f16vec4(textureLodOffset(texR0, uv, 0.0, o)) // binding 36, o = ivec2 offset +r1(o) = f16vec4(textureLodOffset(texR1, uv, 0.0, o)) // binding 37 +``` + +### 2.1 Matching costs + +For each offset `o`, two 8-channel dot products (each a 4-component fp16 +`dot`, then one fp16 add): + +``` +costA(o) = dot(a0, r0(o)) + dot(a1, r1(o)) +costB(o) = dot(b0, r0(o)) + dot(b1, r1(o)) +``` + +The 9 offsets are grouped as: + +``` +group 1: (-1,-1), (0,-1), (1,-1), (-1,0) -> vec components x, y, z, w +group 2: ( 0, 0), (1, 0), (-1,1), ( 0,1) -> vec components x, y, z, w +single : ( 1, 1) +``` + +giving, for X in {A, B}: + +``` +cX1 = f16vec4(costX(-1,-1), costX(0,-1), costX(1,-1), costX(-1,0)) +cX2 = f16vec4(costX( 0, 0), costX(1, 0), costX(-1,1), costX( 0,1)) +cX9 = costX(1,1) // scalar +``` + +### 2.2 Cost normalization (all fp16, componentwise) + +``` +nX1 = clamp((cX1 - biasG1) * scaleG1 + postG1, 0.0, 1.0) +nX2 = clamp((cX2 - biasG2) * scaleG2 + postG2, 0.0, 1.0) +qX = clamp((cX9 - bias9 ) * scale9 + post9 , 0.0, 1.0) // scalar +``` + +The three (bias, scale, post) sets are shared between A and B; constants in +section 3. + +### 2.3 Linear layers and stores + +Each output is an 18-input, 4-output linear layer over +`(nA1, nA2, qA, nB1, nB2, qB)` followed by an affine rescale. Matrices are +GLSL `mat4` built from the four **columns** listed in section 3 +(`M * v = v.x*col0 + v.y*col1 + v.z*col2 + v.w*col3`). Accumulate fp16, in +exactly this association order: + +``` +sF = ((((Wf_a1*nA1 + Wf_a2*nA2) + wf_a9*qA) + Wf_b1*nB1) + Wf_b2*nB2) + wf_b9*qB +outF_val = (sF - subF) * mulF + addF +imageStore(outF, p, vec4(outF_val)) // widen to float32, rgba8 quantizes + +sB = ((((Wb_a1*nA1 + Wb_a2*nA2) + wb_a9*qA) + Wb_b1*nB1) + Wb_b2*nB2) + wb_b9*qB +outB_val = (sB - subB) * mulB + addB +imageStore(outB, p, vec4(outB_val)) // binding 49, same coordinate p +``` + +`wf_a9*qA` etc. are vector-times-scalar (fp16). The two stores use the same +coordinate `p` and both depend on all 18 normalized costs; only the weights +differ. + +## 3. Constants + +All constants below are exact IEEE binary16 values. The decimal expansions +are exact (they round-trip to the same fp16 bit pattern); the trailing +comment on each line gives the same values as C99 hex-float literals. + +``` +biasG1 = vec4(2.5, 2.521484375, 2.50390625, 2.51953125); // 0x1.4p+1 0x1.42cp+1 0x1.408p+1 0x1.428p+1 +scaleG1 = vec4(1.0341796875, 0.72412109375, 0.6572265625, 1.0205078125); // 0x1.08cp+0 0x1.72cp-1 0x1.508p-1 0x1.054p+0 +postG1 = vec4(-0.4296875, -0.042877197265625, -0.4951171875, -0.11126708984375); // -0x1.b8p-2 -0x1.5f4p-5 -0x1.fbp-2 -0x1.c7cp-4 +biasG2 = vec4(2.568359375, 2.53515625, 2.498046875, 2.521484375); // 0x1.48cp+1 0x1.448p+1 0x1.3fcp+1 0x1.42cp+1 +scaleG2 = vec4(0.53466796875, 0.427978515625, 0.6787109375, 0.8740234375); // 0x1.11cp-1 0x1.b64p-2 0x1.5b8p-1 0x1.bf8p-1 +postG2 = vec4(0.10174560546875, 0.266357421875, -0.0150909423828125, -0.380126953125); // 0x1.a0cp-4 0x1.10cp-2 -0x1.ee8p-7 -0x1.854p-2 +bias9 = 2.509765625; scale9 = 0.480712890625; post9 = 0.278076171875; // 0x1.414p+1 0x1.ec4p-2 0x1.1ccp-2 + +Wf_a1 = mat4( + vec4(-0.6171875, -0.098876953125, -0.003223419189453125, 0.05706787109375), // -0x1.3cp-1 -0x1.95p-4 -0x1.a68p-9 0x1.d38p-5 + vec4(-0.201171875, 0.275146484375, -0.053924560546875, -0.409912109375), // -0x1.9cp-3 0x1.19cp-2 -0x1.b9cp-5 -0x1.a3cp-2 + vec4(-0.076171875, -0.0161285400390625, 0.3349609375, -0.54541015625), // -0x1.38p-4 -0x1.084p-6 0x1.57p-2 -0x1.174p-1 + vec4(-0.1729736328125, 0.1617431640625, -0.0648193359375, 0.245361328125)); // -0x1.624p-3 0x1.4b4p-3 -0x1.098p-4 0x1.f68p-3 + +Wf_a2 = mat4( + vec4(0.302978515625, 0.5341796875, -0.433837890625, -0.21142578125), // 0x1.364p-2 0x1.118p-1 -0x1.bc4p-2 -0x1.b1p-3 + vec4(0.375732421875, -0.01236724853515625, 0.239990234375, -0.291748046875), // 0x1.80cp-2 -0x1.954p-7 0x1.eb8p-3 -0x1.2acp-2 + vec4(-0.25830078125, 0.14013671875, -0.054351806640625, 0.078369140625), // -0x1.088p-2 0x1.1fp-3 -0x1.bd4p-5 0x1.41p-4 + vec4(0.05908203125, 0.185546875, 0.0665283203125, -0.66748046875)); // 0x1.e4p-5 0x1.7cp-3 0x1.108p-4 -0x1.55cp-1 + +Wf_b1 = mat4( + vec4(-0.51171875, -0.256103515625, 0.06341552734375, -0.06170654296875), // -0x1.06p-1 -0x1.064p-2 0x1.03cp-4 -0x1.f98p-5 + vec4(-0.1678466796875, -0.25439453125, 0.391845703125, -0.1029052734375), // -0x1.57cp-3 -0x1.048p-2 0x1.914p-2 -0x1.a58p-4 + vec4(-0.01464080810546875, -0.238525390625, 0.1650390625, -0.321044921875), // -0x1.dfcp-7 -0x1.e88p-3 0x1.52p-3 -0x1.48cp-2 + vec4(-0.361083984375, -0.2294921875, 0.183349609375, 0.51953125)); // -0x1.71cp-2 -0x1.d6p-3 0x1.778p-3 0x1.0ap-1 + +Wf_b2 = mat4( + vec4(0.8525390625, -1.013671875, -0.8603515625, 0.3408203125), // 0x1.b48p-1 -0x1.038p+0 -0x1.b88p-1 0x1.5dp-2 + vec4(0.30224609375, -0.10955810546875, 0.39599609375, -0.2481689453125), // 0x1.358p-2 -0x1.c0cp-4 0x1.958p-2 -0x1.fc4p-3 + vec4(-0.439208984375, -0.046905517578125, 0.296142578125, 0.1353759765625), // -0x1.c1cp-2 -0x1.804p-5 0x1.2f4p-2 0x1.154p-3 + vec4(-0.00047397613525390625, 0.1292724609375, 0.318359375, -0.395263671875)); // -0x1.f1p-12 0x1.08cp-3 0x1.46p-2 -0x1.94cp-2 + +wf_a9 = vec4(-0.073486328125, 0.1968994140625, -0.061004638671875, -0.548828125); // -0x1.2dp-4 0x1.934p-3 -0x1.f3cp-5 -0x1.19p-1 +wf_b9 = vec4(-0.053466796875, 0.1724853515625, 0.1519775390625, -0.0129852294921875); // -0x1.b6p-5 0x1.614p-3 0x1.374p-3 -0x1.a98p-7 +subF = vec4(0.12493896484375, -0.004108428955078125, 0.08489990234375, -0.276611328125); // 0x1.ffcp-4 -0x1.0d4p-8 0x1.5bcp-4 -0x1.1b4p-2 +mulF = vec4(1.67578125, 5.44140625, 4.0625, 2.37109375); // 0x1.adp+0 0x1.5c4p+2 0x1.04p+2 0x1.2f8p+1 +addF = vec4(0.14404296875, -0.186767578125, 0.034576416015625, -0.2451171875); // 0x1.27p-3 -0x1.7e8p-3 0x1.1b4p-5 -0x1.f6p-3 + +Wb_a1 = mat4( + vec4(-0.06646728515625, 0.132080078125, 0.10211181640625, -0.1077880859375), // -0x1.104p-4 0x1.0e8p-3 0x1.a24p-4 -0x1.b98p-4 + vec4(0.01702880859375, -0.18701171875, -0.34912109375, -0.04522705078125), // 0x1.17p-6 -0x1.7fp-3 -0x1.658p-2 -0x1.728p-5 + vec4(0.1290283203125, -0.033416748046875, -0.2529296875, 0.034515380859375), // 0x1.084p-3 -0x1.11cp-5 -0x1.03p-2 0x1.1acp-5 + vec4(0.0321044921875, -0.1719970703125, -0.01235198974609375, -0.28125)); // 0x1.07p-5 -0x1.604p-3 -0x1.94cp-7 -0x1.2p-2 + +Wb_a2 = mat4( + vec4(1.0380859375, -0.225341796875, -0.26123046875, -0.4716796875), // 0x1.09cp+0 -0x1.cd8p-3 -0x1.0b8p-2 -0x1.e3p-2 + vec4(0.0662841796875, -0.14501953125, -0.03436279296875, 0.277587890625), // 0x1.0f8p-4 -0x1.29p-3 -0x1.198p-5 0x1.1c4p-2 + vec4(-0.10638427734375, -0.00730133056640625, -0.10723876953125, 0.1124267578125), // -0x1.b3cp-4 -0x1.de8p-8 -0x1.b74p-4 0x1.cc8p-4 + vec4(-0.06939697265625, -0.1727294921875, -0.314453125, 0.04400634765625)); // -0x1.1c4p-4 -0x1.61cp-3 -0x1.42p-2 0x1.688p-5 + +Wb_b1 = mat4( + vec4(0.02752685546875, 0.14208984375, 0.192626953125, -0.197509765625), // 0x1.c3p-6 0x1.23p-3 0x1.8a8p-3 -0x1.948p-3 + vec4(-0.1563720703125, -0.265380859375, -0.0111083984375, 0.1336669921875), // -0x1.404p-3 -0x1.0fcp-2 -0x1.6cp-7 0x1.11cp-3 + vec4(0.1590576171875, 0.01421356201171875, -0.178466796875, -0.1771240234375), // 0x1.45cp-3 0x1.d1cp-7 -0x1.6d8p-3 -0x1.6acp-3 + vec4(-0.279296875, -0.1534423828125, 0.07720947265625, -0.3857421875)); // -0x1.1ep-2 -0x1.3a4p-3 0x1.3c4p-4 -0x1.8bp-2 + +Wb_b2 = mat4( + vec4(0.8505859375, -0.60693359375, -0.297607421875, 0.1439208984375), // 0x1.b38p-1 -0x1.36cp-1 -0x1.30cp-2 0x1.26cp-3 + vec4(-0.1905517578125, -0.2235107421875, 0.019561767578125, 0.8798828125), // -0x1.864p-3 -0x1.c9cp-3 0x1.408p-6 0x1.c28p-1 + vec4(0.116943359375, 0.0157928466796875, 0.034027099609375, 0.2724609375), // 0x1.dfp-4 0x1.02cp-6 0x1.16cp-5 0x1.17p-2 + vec4(-0.1539306640625, 0.0080108642578125, -0.11529541015625, 0.131103515625)); // -0x1.3b4p-3 0x1.068p-7 -0x1.d84p-4 0x1.0c8p-3 + +wb_a9 = vec4(0.11322021484375, -0.1365966796875, -0.301513671875, 0.307861328125); // 0x1.cfcp-4 -0x1.17cp-3 -0x1.34cp-2 0x1.3b4p-2 +wb_b9 = vec4(0.1278076171875, -0.1292724609375, -0.173828125, 0.48583984375); // 0x1.05cp-3 -0x1.08cp-3 -0x1.64p-3 0x1.f18p-2 +subB = vec4(0.30712890625, -0.40625, -0.285888671875, 0.476806640625); // 0x1.3a8p-2 -0x1.ap-2 -0x1.24cp-2 0x1.e84p-2 +mulB = vec4(0.599609375, 2.76171875, 2.630859375, 3.283203125); // 0x1.33p-1 0x1.618p+1 0x1.50cp+1 0x1.a44p+1 +addB = vec4(0.141845703125, -0.390869140625, -0.041107177734375, 0.6826171875); // 0x1.228p-3 -0x1.904p-2 -0x1.50cp-5 0x1.5d8p-1 +``` + +## 4. Control flow + +Straight-line: a single early-out bounds check, then unconditional +computation and two stores. No loops. (The original wraps the body in a +degenerate one-iteration `switch`; the observable behavior is just +`if (out of range) return;`.) + +## 5. Boundary behavior + +- The only guard is `any(greaterThanEqual(p, imageSize(outF)))` — a *signed* + comparison of `ivec2(gl_GlobalInvocationID.xy)` against **binding 48's** + size. Both the store to 48 and the store to 49 rely on this one guard; the + shader assumes binding 49 is at least as large as binding 48 (a dispatch + sized for 48 can write out-of-range texels of a smaller 49 — such stores + would be discarded by the implementation, but the shader itself does not + check). +- `uv` is normalized by binding 32's LOD-0 size. If the output size exceeds + the input size, or at border texels with the +-1 texel `ConstOffset` + applied, sampling coordinates can leave the interior; addressing/edge + behavior comes from the externally supplied samplers (offsets are applied + to the unnormalized coordinate before the sampler's address mode). +- All six samplers are sampled at the same normalized `uv`; if bindings 33..37 + differ in resolution from binding 32, they are sampled at the proportional + position (and offsets remain in their own texel units). + +## 6. Precision requirements + +Bit-exact reproduction requires: + +- Sampling returns float32; convert each sampled vec4 to `f16vec4` before any + arithmetic. +- All dots, adds, multiply-adds, clamps, matrix products and the final affine + are fp16, in the association orders written in section 2. +- Widen to float32 only immediately before each `imageStore`; `rgba8` + storage then clamps to [0,1] and quantizes each channel to unorm8. + +## 7. Interpretation (non-normative) + +This is a learned coarse-flow head: 18 feature-correlation costs over a 3x3 +search neighborhood (two query descriptors against one reference), each cost +affinely squashed to [0,1], then two independent 18->4 fully-connected layers +(no nonlinearity other than the input clamps) whose 4-channel outputs are +rescaled into [0,1] for unorm8 storage. The meaning/packing of the 4 output +channels is not determinable from this shader alone. diff --git a/cleanroom/specs/10-family-refine.md b/cleanroom/specs/10-family-refine.md new file mode 100644 index 0000000..4c39465 --- /dev/null +++ b/cleanroom/specs/10-family-refine.md @@ -0,0 +1,2291 @@ +# Spec: shader_10 family — 3x3 dual-image fp16 convolution ("optical-flow refinement" passes) + +Members: shader_10, shader_11, shader_12, shader_35, shader_36, shader_37, +shader_50, shader_51, shader_52 (files `asm/shader_NN.spvasm`). + +All nine members are **structurally identical**: after masking SSA ids and +floating-point literal values, the instruction streams differ only in +whitespace and in the number of deduplicated scalar-constant declarations. +Every behavioral difference between members is confined to the values of +baked half-precision (binary16) constants: 18 + 18 weight matrices (4x4) and +2 x 3 affine vectors per member, 600 scalar halves total. Per-member values +are in Appendix A. No member needs a separate structural spec. + +## 1. Interface + +- Entry point: GLCompute `main`, workgroup size **16 x 16 x 1** + (`LocalSize 16 16 1`). +- SPIR-V capabilities: Shader, **Float16** (arithmetic is done in binary16), + ImageQuery. SPIR-V 1.0. +- Descriptors (all in set 0; identical in all nine members): + +| set | binding | kind | type / format | access | +|---|---|---|---|---| +| 0 | 32 | combined image sampler | 2D, float-sampled, format Unknown | read (texelFetch only, LOD 0) | +| 0 | 33 | combined image sampler | 2D, float-sampled, format Unknown | read (texelFetch only, LOD 0) | +| 0 | 48 | storage image | 2D, `Rgba8` (unorm) | write-only (`NonReadable`) | +| 0 | 49 | storage image | 2D, `Rgba8` (unorm) | write-only (`NonReadable`) | + +- **No UBO, no push constants, no spec constants.** (Pipeline briefing + mentioned a binding-0 UBO with a `flowScale` float; the disassembly of all + nine members contains no binding-0 descriptor and no non-constant scalar + input whatsoever. If such a UBO exists in the pipeline layout it is unused + by these shaders.) +- Sampler state of bindings 32/33 is irrelevant: every read is an + `OpImageFetch` (GLSL `texelFetch`) at explicit LOD 0 on the image extracted + from the combined sampler; no filtering, wrapping, or normalized UVs occur. + +Role naming (from the pipeline context, interpretation only): binding 32 and +33 are the two 4-channel input feature/flow images; binding 48 and 49 are the +refined forward/backward flow outputs. + +## 2. Conventions and notation + +- `p = ivec2(gl_GlobalInvocationID.xy)` — one invocation produces exactly one + texel at integer coordinate `p` in **both** output images. +- Tap offsets, in this exact order (index `t` = 0..8): + + | t | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | + |---|---|---|---|---|---|---|---|---|---| + | d_t | (-1,-1) | (-1,0) | (-1,+1) | (0,-1) | (0,0) | (0,+1) | (+1,-1) | (+1,0) | (+1,+1) | + + (x-major: dx varies slowest; `d_t = (t/3 - 1, t%3 - 1)`.) +- `f16(v)` = conversion of a float32 vec4 to binary16 (RTE rounding); + `f32(v)` = the exact widening conversion back. +- All matrices are 4x4 binary16; `M * x` is the standard matrix-vector + product (`out_i = sum_j M[i][j] * x_j`). Appendix A prints matrices in + **row-major** order, i.e. row `i` of the printed matrix is + `(M[i][0], M[i][1], M[i][2], M[i][3])`. + +## 3. Behavior + +Let `S48 = imageSize(img48)`. + +**Early out:** if `p.x >= S48.x || p.y >= S48.y`, the invocation writes +nothing and returns. This is the only guard; there is no separate check +against the size of img49 or of the sampled images (see section 5). + +**Tap gathering.** For each input image `I` in {binding 32, binding 33} and +each tap `t` = 0..8, with `q = p + d_t`: + +``` +T_I[t] = f16( inBounds_I(q) ? texelFetch(I, q, 0) : vec4(0.0) ) // f16vec4 +where inBounds_I(q) = all(greaterThanEqual(q, ivec2(0))) + && all(lessThan(q, textureSize(I, 0))) +``` + +Exception, reproduced exactly: for the **center tap (t = 4)** no bounds test +is performed at all — `texelFetch(I, p, 0)` is executed unconditionally +(`p` is known non-negative and less than `S48`, but is *not* checked against +`textureSize(I, 0)`; the original relies on the sampled images being at least +as large as img48). + +The `textureSize(I, 0)` query is re-issued per guarded tap (9 + 9 - 2 = 16 +queries) — behaviorally irrelevant, listed for completeness. + +**Convolution + affine, two independent heads.** Define the 18-element tap +vector list, in this exact accumulation order: + +``` +x[0..8] = T_img32[0..8] // binding 32, tap order t = 0..8 above +x[9..17] = T_img33[0..8] // binding 33, same tap order +``` + +Each head h (A -> img48, B -> img49) has 18 matrices `W_h[k]` (4x4 f16) and +three f16vec4 constants `mu_h`, `sigma_h`, `beta_h` (Appendix A): + +``` +acc_h = ((...((W_h[0]*x[0] + W_h[1]*x[1]) + W_h[2]*x[2]) + ... ) + W_h[17]*x[17]) + // left-to-right, all arithmetic binary16 +y_h = (acc_h - mu_h) * sigma_h + beta_h // componentwise, binary16 + // exactly: FSub, then FMul, then FAdd + // (NOT an fma; no reassociation) +out_h = f32(y_h) // widen to float32 +imageStore(img_h, p, out_h) // rgba8 unorm store: each component is + // clamped to [0,1] and quantized to + // round(c * 255) / 255 by the store itself +``` + +Head A is computed and stored to img48 first, then head B to img49; both use +the same tap values `x[0..17]` and the same coordinate `p`. There is no +nonlinearity — each output texel is an affine function of the 72 input scalars. + +**Precision requirements (observable):** input taps are fetched as float32 and +converted to binary16 once per tap; every multiply/add of the convolution and +the final affine is binary16 (RTE). The accumulation order above and the +sub-then-mul-then-add form are part of the spec for bit-exactness. + +## 4. Control flow + +No loops — the 3x3 x 2-image gather and the 18-term sums are fully unrolled +straight-line code. The only conditionals are: the single early-out bounds +check against `S48`, and the per-tap `inBounds` predicates (each implemented +as `q >= 0` first, with the `q < textureSize` half evaluated only when the +first half passes — same result as the combined predicate). The whole body +sits inside a degenerate single-case switch used as a `break`-able block; it +has no behavioral effect. + +## 5. Boundary behavior + +- The shader guards its own writes against img48's size only; dispatching + `ceil(S48/16)` workgroups per axis is expected. Out-of-range invocations + write neither image. +- The img49 write is **not** guarded by img49's size: correctness requires + `imageSize(img49) >= imageSize(img48)` componentwise (in the pipeline they + are presumably equal). +- Neighborhood reads are zero-padded outside each sampled image's own LOD-0 + extent (per-tap check), **except the center tap** which is fetched + unconditionally; if `textureSize(I,0)` could be smaller than `S48` this + out-of-range `texelFetch` would be undefined — UNRESOLVED: whether the + pipeline ever binds inputs smaller than the output (the shader assumes not). +- No coordinate clamping or wrapping anywhere; no normalized UVs are used. + +## 6. Family parameter table + +Members differ **only** in the 600 baked binary16 scalars per member +(2 heads x (18 matrices x 16 + 3 vectors x 4)). All 18 weight sets +(9 members x 2 heads) are pairwise distinct; no other constant, binding, +size, format, or instruction differs (verified by diffing all nine +disassemblies with SSA ids and float literals masked: remaining differences +were only constant-pool dedup counts and indentation). + +| member | head A weights (-> img48) | head B weights (-> img49) | +|---|---|---| +| shader_10 | `0490c8ac4892` | `43ca70f54341` | +| shader_11 | `a92b404d3798` | `13b9cb6679f9` | +| shader_12 | `25489cdebda7` | `bcba3c242ad6` | +| shader_35 | `f2b494d43e8c` | `a8978d885da7` | +| shader_36 | `9c137a15c27c` | `8f560fc074f3` | +| shader_37 | `21a5e999a280` | `ad2ba39f87a7` | +| shader_50 | `b44203cfa357` | `45a437fce293` | +| shader_51 | `0e1191b8ab87` | `621ea45c8aaf` | +| shader_52 | `4509aadde3a1` | `92af744b39b2` | + +(Digests are md5-12 of the canonical JSON of the weight set; full values in +Appendix A are the normative data.) + +## 7. Interpretation (non-normative) + +Each member is one trained 3x3 convolution layer: 8 input channels (two RGBA +images), 8 output channels (two RGBA images), no bias in the conv itself, +followed by a per-channel affine remap `(acc - mu) * sigma + beta` that maps +the activation range into [0,1] for storage in unorm8 textures — i.e. a +quantization/renormalization stage between layers of a small optical-flow +refinement network. The nine members are nine instances of this identical +layer topology with different trained weights (plausibly 3 pyramid levels x 3 +stages, matching the 10/11/12, 35/36/37, 50/51/52 grouping). + +## Appendix A — per-member weights (normative) + +Values are printed as exact decimals (shortest strings that round-trip; when +parsed and rounded to nearest binary16 they reproduce the original bits +exactly — verified programmatically) plus the raw IEEE 754 binary16 bit +patterns (hex, row-major) as the canonical form. Matrix `W[k]` multiplies tap +vector `x[k]`; printed rows are matrix rows (see section 2). + +### shader_10 + +**Head A** (output binding 48), weight-set digest `0490c8ac4892`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [-0.1488037109375, -0.02032470703125, -0.0196685791015625, -0.4228515625] + [-0.10235595703125, 0.141357421875, -0.310302734375, -0.1707763671875] + [-0.05987548828125, 0.391357421875, -0.1519775390625, -0.1632080078125] + [-0.02398681640625, -0.06365966796875, 0.036773681640625, -0.391845703125] + # bits (row-major): b0c3 a534 a509 b6c4 ae8d 3086 b4f7 b177 abaa 3643 b0dd b139 a624 ac13 28b5 b645 +W[ 1] # source img binding 32, tap offset (-1, 0) + [-0.2254638671875, -0.103759765625, -0.1463623046875, -0.57373046875] + [0.117431640625, -0.1112060546875, 0.172607421875, 0.1553955078125] + [-0.260009765625, -0.1136474609375, -0.1737060546875, -0.2388916015625] + [0.1282958984375, -0.4345703125, -0.58935546875, -0.09783935546875] + # bits (row-major): b337 aea4 b0af b897 2f84 af1e 3186 30f9 b429 af46 b18f b3a5 301b b6f4 b8b7 ae43 +W[ 2] # source img binding 32, tap offset (-1,+1) + [-0.185302734375, -0.140625, -0.1510009765625, -0.61279296875] + [0.1190185546875, 0.283203125, 0.271728515625, 0.337646484375] + [-0.48291015625, -0.2734375, 0.33056640625, 0.08154296875] + [0.40869140625, -0.492919921875, -0.7060546875, -0.0280303955078125] + # bits (row-major): b1ee b080 b0d5 b8e7 2f9e 3488 3459 3567 b7ba b460 354a 2d38 368a b7e3 b9a6 a72d +W[ 3] # source img binding 32, tap offset ( 0,-1) + [-0.205810546875, -0.055267333984375, 0.0850830078125, -0.5380859375] + [0.050201416015625, 0.0042572021484375, -0.061004638671875, 0.00920867919921875] + [-0.57373046875, 0.401611328125, 0.1392822265625, 0.2279052734375] + [-0.236328125, -0.163330078125, -0.073486328125, 0.1788330078125] + # bits (row-major): b296 ab13 2d72 b84e 2a6d 1c5c abcf 20b7 b897 366d 3075 334b b390 b13a acb4 31b9 +W[ 4] # source img binding 32, tap offset ( 0, 0) + [-0.341064453125, -0.134521484375, -0.036895751953125, -0.55517578125] + [0.037628173828125, 0.376220703125, 0.56298828125, 0.294921875] + [-0.34375, 0.1456298828125, 0.01207733154296875, -0.08734130859375] + [-0.0318603515625, -0.394287109375, -0.64501953125, 0.1864013671875] + # bits (row-major): b575 b04e a8b9 b871 28d1 3605 3881 34b8 b580 30a9 222f ad97 a814 b64f b929 31f7 +W[ 5] # source img binding 32, tap offset ( 0,+1) + [-0.240234375, -0.2003173828125, -0.035858154296875, -0.57568359375] + [0.1031494140625, 0.37744140625, 0.6279296875, 0.43798828125] + [-0.02337646484375, -0.1339111328125, 0.21435546875, 0.039581298828125] + [-0.0095672607421875, -0.6708984375, -1.1875, 0.54150390625] + # bits (row-major): b3b0 b269 a897 b89b 2e9a 360a 3906 3702 a5fc b049 32dc 2911 a0e6 b95e bcc0 3855 +W[ 6] # source img binding 32, tap offset (+1,-1) + [-0.393798828125, -0.08966064453125, -0.00107574462890625, -0.463134765625] + [-0.1929931640625, 0.227783203125, -0.4560546875, 0.0828857421875] + [-0.61572265625, 0.556640625, 0.254150390625, -0.013916015625] + [0.14111328125, -0.12261962890625, 0.2083740234375, -0.176025390625] + # bits (row-major): b64d adbd 9468 b769 b22d 334a b74c 2d4e b8ed 3874 3411 a320 3084 afd9 32ab b1a2 +W[ 7] # source img binding 32, tap offset (+1, 0) + [-0.476318359375, -0.1585693359375, -0.08160400390625, -0.54248046875] + [0.101318359375, -0.0050048828125, -0.04754638671875, -0.02178955078125] + [-0.66357421875, -0.0296630859375, 0.11187744140625, 0.17724609375] + [0.28466796875, -0.4140625, -0.1148681640625, -0.17236328125] + # bits (row-major): b79f b113 ad39 b857 2e7c 9d20 aa16 a594 b94f a798 2f29 31ac 348e b6a0 af5a b184 +W[ 8] # source img binding 32, tap offset (+1,+1) + [-0.369873046875, -0.2110595703125, -0.10748291015625, -0.6103515625] + [0.121337890625, 0.302490234375, 0.0740966796875, 0.218994140625] + [-0.09564208984375, 0.015411376953125, 0.136474609375, 0.296630859375] + [0.560546875, -0.3330078125, -0.30859375, 0.08050537109375] + # bits (row-major): b5eb b2c1 aee1 b8e2 2fc4 34d7 2cbe 3302 ae1f 23e4 305e 34bf 387c b554 b4f0 2d27 +W[ 9] # source img binding 33, tap offset (-1,-1) + [-0.11932373046875, -0.21435546875, 0.057952880859375, 0.492431640625] + [-0.1004638671875, -0.10516357421875, 0.4833984375, 0.10064697265625] + [-0.76123046875, 0.6005859375, 0.481689453125, 0.29443359375] + [-0.013397216796875, 0.163330078125, 0.2861328125, 0.407958984375] + # bits (row-major): afa3 b2dc 2b6b 37e1 ae6e aebb 37bc 2e71 ba17 38ce 37b5 34b6 a2dc 313a 3494 3687 +W[10] # source img binding 33, tap offset (-1, 0) + [-0.12255859375, -0.29736328125, -0.08551025390625, 0.46044921875] + [0.330810546875, -0.047821044921875, 0.1241455078125, -0.298583984375] + [-0.455078125, 0.221923828125, 0.250244140625, 0.3193359375] + [0.3037109375, 0.08251953125, 0.28759765625, -0.0171356201171875] + # bits (row-major): afd8 b4c2 ad79 375e 354b aa1f 2ff2 b4c7 b748 331a 3401 351c 34dc 2d48 349a a463 +W[11] # source img binding 33, tap offset (-1,+1) + [-0.2464599609375, -0.263427734375, 0.01079559326171875, 0.56396484375] + [0.73193359375, 0.0714111328125, 0.058074951171875, -0.06842041015625] + [-0.46337890625, 0.08648681640625, 0.049713134765625, 0.2763671875] + [0.8662109375, -0.381103515625, -0.470703125, 0.322998046875] + # bits (row-major): b3e3 b437 2187 3883 39db 2c92 2b6f ac61 b76a 2d89 2a5d 346c 3aee b619 b788 352b +W[12] # source img binding 33, tap offset ( 0,-1) + [-0.171875, -0.2301025390625, -0.0118560791015625, 0.630859375] + [0.3232421875, -0.1151123046875, 0.257080078125, 0.029144287109375] + [-0.99462890625, 0.96337890625, 0.453857421875, -0.25048828125] + [0.07208251953125, 0.1854248046875, 0.30859375, 0.08697509765625] + # bits (row-major): b180 b35d a212 390c 352c af5e 341d 2776 bbf5 3bb5 3743 b402 2c9d 31ef 34f0 2d91 +W[13] # source img binding 33, tap offset ( 0, 0) + [-0.1898193359375, -0.2010498046875, -0.11981201171875, 0.6220703125] + [1.2861328125, 0.181884765625, -0.09930419921875, -0.33056640625] + [-0.318359375, 0.339599609375, 0.13232421875, -0.20263671875] + [0.1663818359375, 0.342529296875, 0.5322265625, -0.035369873046875] + # bits (row-major): b213 b26f afab 38fa 3d25 31d2 ae5b b54a b518 356f 303c b27c 3153 357b 3842 a887 +W[14] # source img binding 33, tap offset ( 0,+1) + [-0.34423828125, -0.1363525390625, -0.0081939697265625, 0.59130859375] + [1.1064453125, 0.21533203125, 0.15087890625, -0.072021484375] + [-0.128173828125, -0.085693359375, -0.121826171875, -0.10076904296875] + [0.55908203125, 0.208984375, 0.08135986328125, 0.047149658203125] + # bits (row-major): b582 b05d a032 38bb 3c6d 32e4 30d4 ac9c b01a ad7c afcc ae73 3879 32b0 2d35 2a09 +W[15] # source img binding 33, tap offset (+1,-1) + [-0.433349609375, -0.1678466796875, 0.0328369140625, 0.41552734375] + [-0.05157470703125, -0.033966064453125, 0.452392578125, 0.013946533203125] + [-0.78564453125, 0.7080078125, 0.337158203125, 0.0655517578125] + [0.51171875, -0.10589599609375, 0.060760498046875, 0.2392578125] + # bits (row-major): b6ef b15f 2834 36a6 aa9a a859 373d 2324 ba49 39aa 3565 2c32 3818 aec7 2bc7 33a8 +W[16] # source img binding 33, tap offset (+1, 0) + [-0.456787109375, -0.1583251953125, -0.05145263671875, 0.29931640625] + [0.28173828125, 0.01100921630859375, 0.2568359375, -0.11383056640625] + [-0.63623046875, 0.259033203125, 0.0215606689453125, 0.01557159423828125] + [0.61376953125, 0.06634521484375, 0.13623046875, 0.03485107421875] + # bits (row-major): b74f b111 aa96 34ca 3482 21a3 341c af49 b917 3425 2585 23f9 38e9 2c3f 305c 2876 +W[17] # source img binding 33, tap offset (+1,+1) + [-0.58203125, -0.14208984375, 3.701448440551758e-05, 0.411376953125] + [0.365234375, 0.252197265625, 0.513671875, 0.057830810546875] + [-0.27734375, -0.005832672119140625, -0.28955078125, -0.01491546630859375] + [0.90380859375, -0.120849609375, -0.316650390625, 0.3115234375] + # bits (row-major): b8a8 b08c 026d 3695 35d8 3409 381c 2b67 b470 9df9 b4a2 a3a3 3b3b afbc b511 34fc +mu = [0.6435546875, 1.3896484375, -0.31591796875, 0.46044921875] # bits: 3926 3d8f b50e 375e +sigma = [0.47705078125, 0.6689453125, 1.00390625, 0.49609375] # bits: 37a2 395a 3c04 37f0 +beta = [-0.31884765625, -0.1954345703125, 0.2003173828125, -0.2205810546875] # bits: b51a b241 3269 b30f +``` + +**Head B** (output binding 49), weight-set digest `43ca70f54341`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [0.306884765625, 0.40380859375, 0.47607421875, -0.336181640625] + [-0.62548828125, 0.131591796875, 0.94189453125, -0.0064544677734375] + [0.0037441253662109375, 0.078857421875, -0.330322265625, 0.4482421875] + [-0.5146484375, -0.2017822265625, -0.04742431640625, 0.1534423828125] + # bits (row-major): 34e9 3676 379e b561 b901 3036 3b89 9e9c 1bab 2d0c b549 372c b81e b275 aa12 30e9 +W[ 1] # source img binding 32, tap offset (-1, 0) + [0.05462646484375, 0.556640625, 0.7314453125, -0.474365234375] + [0.7509765625, 0.2578125, -0.603515625, -0.240234375] + [-0.417724609375, 0.2215576171875, 0.1761474609375, 0.058990478515625] + [-0.4375, 0.1881103515625, 0.346435546875, -0.126220703125] + # bits (row-major): 2afe 3874 39da b797 3a02 3420 b8d4 b3b0 b6af 3317 31a3 2b8d b700 3205 358b b00a +W[ 2] # source img binding 32, tap offset (-1,+1) + [0.032684326171875, 0.028656005859375, 0.748046875, -0.54833984375] + [0.3994140625, 0.487548828125, -0.135009765625, -0.08868408203125] + [-0.327392578125, 0.1494140625, -0.03271484375, 0.329345703125] + [-0.1322021484375, -0.2193603515625, -0.1353759765625, 0.12371826171875] + # bits (row-major): 282f 2756 39fc b863 3664 37cd b052 adad b53d 30c8 a830 3545 b03b b305 b055 2feb +W[ 3] # source img binding 32, tap offset ( 0,-1) + [0.06854248046875, 0.31396484375, 0.40576171875, -0.29248046875] + [0.387939453125, -0.49072265625, -0.07647705078125, -0.315673828125] + [-0.445068359375, 0.335205078125, 0.29443359375, 0.1748046875] + [-0.5126953125, -0.08056640625, -0.033416748046875, 0.324951171875] + # bits (row-major): 2c63 3506 367e b4ae 3635 b7da ace5 b50d b71f 355d 34b6 3198 b81a ad28 a847 3533 +W[ 4] # source img binding 32, tap offset ( 0, 0) + [0.56982421875, 0.1778564453125, 0.10980224609375, -0.346923828125] + [-0.78759765625, 0.1339111328125, 0.021881103515625, 0.2529296875] + [-0.2705078125, 0.35400390625, 0.56884765625, -0.07525634765625] + [-0.30908203125, 0.183349609375, 0.299560546875, 0.0283203125] + # bits (row-major): 388f 31b1 2f07 b58d ba4d 3049 259a 340c b454 35aa 388d acd1 b4f2 31de 34cb 2740 +W[ 5] # source img binding 32, tap offset ( 0,+1) + [0.11004638671875, -0.0032482147216796875, 0.6123046875, -0.5244140625] + [0.005504608154296875, -0.15234375, 0.07366943359375, -0.31689453125] + [-0.62744140625, 0.477783203125, 0.7216796875, 0.004283905029296875] + [-0.33740234375, -0.0426025390625, 0.17724609375, 0.203125] + # bits (row-major): 2f0b 9aa7 38e6 b832 1da3 b0e0 2cb7 b512 b905 37a5 39c6 1c63 b566 a974 31ac 3280 +W[ 6] # source img binding 32, tap offset (+1,-1) + [-0.3203125, 0.5380859375, 0.25341796875, -0.290771484375] + [0.2685546875, -0.2412109375, -0.190185546875, -0.11810302734375] + [-0.0625, -0.06304931640625, 0.0113677978515625, 0.09747314453125] + [-0.190185546875, -0.229736328125, -0.1533203125, 0.045379638671875] + # bits (row-major): b520 384e 340e b4a7 344c b3b8 b216 af8f ac00 ac09 21d2 2e3d b216 b35a b0e8 29cf +W[ 7] # source img binding 32, tap offset (+1, 0) + [0.11602783203125, 0.35205078125, -0.250244140625, -0.1973876953125] + [-0.4287109375, -0.361083984375, 0.1646728515625, -0.119140625] + [-0.86865234375, 0.319580078125, 0.50244140625, 0.10064697265625] + [-0.60498046875, 0.197509765625, 0.275390625, 0.11773681640625] + # bits (row-major): 2f6d 35a2 b401 b251 b6dc b5c7 3145 afa0 baf3 351d 3805 2e71 b8d7 3252 3468 2f89 +W[ 8] # source img binding 32, tap offset (+1,+1) + [0.1715087890625, 0.56884765625, -0.020050048828125, -0.92626953125] + [-0.321533203125, -0.50439453125, 0.23828125, -0.107421875] + [-0.383056640625, 0.055572509765625, 0.12548828125, 0.044647216796875] + [-0.52978515625, -0.2322998046875, 0.09490966796875, 0.10009765625] + # bits (row-major): 317d 388d a522 bb69 b525 b809 33a0 aee0 b621 2b1d 3004 29b7 b83d b36f 2e13 2e68 +W[ 9] # source img binding 33, tap offset (-1,-1) + [0.195068359375, -0.40576171875, -0.42578125, 0.189453125] + [-0.474609375, 0.26953125, 0.0697021484375, 0.126708984375] + [-0.53466796875, 0.01727294921875, -0.08843994140625, -0.2890625] + [-0.8291015625, 0.172607421875, 0.1385498046875, -0.0970458984375] + # bits (row-major): 323e b67e b6d0 3210 b798 3450 2c76 300e b847 246c ada9 b4a0 baa2 3186 306f ae36 +W[10] # source img binding 33, tap offset (-1, 0) + [-0.01459503173828125, -0.2232666015625, -0.253662109375, 0.0013132095336914062] + [0.263427734375, 0.194580078125, 0.157958984375, -0.13134765625] + [-0.63720703125, 0.047637939453125, -0.05303955078125, -0.154541015625] + [-0.463134765625, 0.384033203125, 0.270751953125, 0.00115203857421875] + # bits (row-major): a379 b325 b40f 1561 3437 323a 310e b034 b919 2a19 aaca b0f2 b769 3625 3455 14b8 +W[11] # source img binding 33, tap offset (-1,+1) + [-0.58447265625, -0.286376953125, 0.16357421875, 0.10406494140625] + [0.2071533203125, 0.1002197265625, 0.07135009765625, -0.21826171875] + [-0.51318359375, 0.044830322265625, -0.0162811279296875, -0.375244140625] + [-0.46337890625, 0.2022705078125, 0.1795654296875, -0.11285400390625] + # bits (row-major): b8ad b495 313c 2ea9 32a1 2e6a 2c91 b2fc b81b 29bd a42b b601 b76a 3279 31bf af39 +W[12] # source img binding 33, tap offset ( 0,-1) + [-0.11328125, -0.6953125, -0.47802734375, 0.338134765625] + [-0.289306640625, -0.0792236328125, -0.0418701171875, 0.468505859375] + [-0.71533203125, -0.026092529296875, -0.162353515625, -0.1644287109375] + [-0.64892578125, -0.040283203125, -0.01195526123046875, -0.12939453125] + # bits (row-major): af40 b990 b7a6 3569 b4a1 ad12 a95c 377f b9b9 a6ae b132 b143 b931 a928 a21f b024 +W[13] # source img binding 33, tap offset ( 0, 0) + [-0.0029048919677734375, -0.60888671875, -0.3837890625, 0.1817626953125] + [-0.1541748046875, 0.11456298828125, 0.2191162109375, -0.431884765625] + [-0.69921875, 0.09588623046875, -0.0195770263671875, -0.087158203125] + [-0.3408203125, 0.267333984375, 0.255126953125, -0.09783935546875] + # bits (row-major): 99f3 b8df b624 31d1 b0ef 2f55 3303 b6e9 b998 2e23 a503 ad94 b574 3447 3415 ae43 +W[14] # source img binding 33, tap offset ( 0,+1) + [-0.499267578125, -0.64208984375, -0.1671142578125, 0.2193603515625] + [-0.355712890625, -0.248046875, 0.0916748046875, -0.0784912109375] + [-0.64501953125, 0.056182861328125, -0.032470703125, -0.3955078125] + [-0.5634765625, 0.09613037109375, 0.108154296875, -0.1334228515625] + # bits (row-major): b7fd b923 b159 3305 b5b1 b3f0 2dde ad06 b929 2b31 a828 b654 b882 2e27 2eec b045 +W[15] # source img binding 33, tap offset (+1,-1) + [-0.458251953125, -0.446533203125, -0.184326171875, 0.1434326171875] + [-0.04364013671875, -0.1142578125, -0.183349609375, -0.0077056884765625] + [0.033233642578125, -0.37841796875, -0.50439453125, -0.39453125] + [0.0068359375, -0.333740234375, -0.43017578125, -0.301513671875] + # bits (row-major): b755 b725 b1e6 3097 a996 af50 b1de 9fe4 2841 b60e b809 b650 1f00 b557 b6e2 b4d3 +W[16] # source img binding 33, tap offset (+1, 0) + [-0.20703125, -0.58642578125, -0.2890625, -0.0855712890625] + [-0.43798828125, -0.036041259765625, 0.09765625, 0.167724609375] + [-0.08380126953125, -0.1148681640625, -0.343994140625, -0.32666015625] + [0.00727081298828125, 0.11126708984375, -0.1329345703125, -0.2196044921875] + # bits (row-major): b2a0 b8b1 b4a0 ad7a b702 a89d 2e40 315e ad5d af5a b581 b53a 1f72 2f1f b041 b307 +W[17] # source img binding 33, tap offset (+1,+1) + [-0.3203125, -0.6875, -0.31494140625, 0.0051422119140625] + [-0.3974609375, -0.155517578125, 0.064453125, 0.02398681640625] + [-0.0269012451171875, -0.2685546875, -0.372802734375, -0.47412109375] + [-0.283203125, -0.07330322265625, -0.17138671875, -0.161376953125] + # bits (row-major): b520 b980 b50a 1d44 b65c b0fa 2c20 2624 a6e3 b44c b5f7 b796 b488 acb1 b17c b12a +mu = [0.8310546875, -0.51171875, -2.26171875, -1.8779296875] # bits: 3aa6 b818 c086 bf83 +sigma = [0.456787109375, 1.3349609375, 0.744140625, 0.79150390625] # bits: 374f 3d57 39f4 3a55 +beta = [-0.060791015625, 0.061920166015625, 0.13623046875, -0.0928955078125] # bits: abc8 2bed 305c adf2 +``` + +### shader_11 + +**Head A** (output binding 48), weight-set digest `a92b404d3798`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [0.6123046875, -0.44482421875, -0.295654296875, 0.09576416015625] + [-0.50146484375, 0.71923828125, -0.340576171875, 0.6845703125] + [0.294921875, -0.36083984375, -0.332275390625, 0.280517578125] + [0.68017578125, -0.282470703125, 0.1588134765625, -0.491943359375] + # bits (row-major): 38e6 b71e b4bb 2e21 b803 39c1 b573 397a 34b8 b5c6 b551 347d 3971 b485 3115 b7df +W[ 1] # source img binding 32, tap offset (-1, 0) + [0.376220703125, -0.10638427734375, 0.1002197265625, 0.3193359375] + [-0.2203369140625, 0.1527099609375, -0.371337890625, 0.373046875] + [0.31201171875, -0.1944580078125, -0.30615234375, 0.341796875] + [0.35107421875, -0.167724609375, 0.16015625, -0.3212890625] + # bits (row-major): 3605 aecf 2e6a 351c b30d 30e3 b5f1 35f8 34fe b239 b4e6 3578 359e b15e 3120 b524 +W[ 2] # source img binding 32, tap offset (-1,+1) + [0.2318115234375, -0.020904541015625, 0.378173828125, 0.478515625] + [0.1688232421875, -0.34326171875, -0.1263427734375, -0.09295654296875] + [0.444580078125, 0.031951904296875, -0.098876953125, 0.40966796875] + [0.439453125, -0.68994140625, 0.437255859375, -0.6298828125] + # bits (row-major): 336b a55a 360d 37a8 3167 b57e b00b adf3 371d 2817 ae54 368e 3708 b985 36ff b90a +W[ 3] # source img binding 32, tap offset ( 0,-1) + [0.36376953125, -0.4609375, -0.0771484375, -0.10748291015625] + [-0.1883544921875, 0.459228515625, -0.0809326171875, 0.51220703125] + [0.353271484375, -0.11407470703125, -0.16796875, -0.1846923828125] + [-0.0209503173828125, 0.1710205078125, -0.51513671875, -0.22021484375] + # bits (row-major): 35d2 b760 acf0 aee1 b207 3759 ad2e 3819 35a7 af4d b160 b1e9 a55d 3179 b81f b30c +W[ 4] # source img binding 32, tap offset ( 0, 0) + [-0.052947998046875, -0.251953125, 0.08770751953125, -0.046966552734375] + [0.04498291015625, 0.07958984375, -0.134033203125, 0.235595703125] + [0.35986328125, -0.1787109375, -0.039520263671875, -0.254150390625] + [-0.1727294921875, 0.06964111328125, -0.0963134765625, -0.05908203125] + # bits (row-major): aac7 b408 2d9d aa03 29c2 2d18 b04a 338a 35c2 b1b8 a90f b411 b187 2c75 ae2a ab90 +W[ 5] # source img binding 32, tap offset ( 0,+1) + [-0.1441650390625, -0.2449951171875, 0.49462890625, 0.036590576171875] + [0.43212890625, -0.38232421875, -0.0897216796875, -0.1552734375] + [0.47314453125, 0.02850341796875, 0.2025146484375, -0.252197265625] + [-0.06866455078125, -0.2447509765625, 0.2880859375, -0.438720703125] + # bits (row-major): b09d b3d7 37ea 28af 36ea b61e adbe b0f8 3792 274c 327b b409 ac65 b3d5 349c b705 +W[ 6] # source img binding 32, tap offset (+1,-1) + [0.28076171875, -0.1932373046875, -0.09112548828125, -0.07049560546875] + [-0.045318603515625, 0.0113525390625, 0.365966796875, -0.06109619140625] + [0.3896484375, -0.464599609375, -0.282470703125, 0.283935546875] + [-0.32177734375, 0.57568359375, -1.04296875, 0.479248046875] + # bits (row-major): 347e b22f add5 ac83 a9cd 21d0 35db abd2 363c b76f b485 348b b526 389b bc2c 37ab +W[ 7] # source img binding 32, tap offset (+1, 0) + [-0.047943115234375, -0.2255859375, -0.061767578125, -0.344482421875] + [0.265625, -0.4189453125, 0.14892578125, -0.44384765625] + [0.5224609375, -0.533203125, -0.05865478515625, 0.1824951171875] + [-0.28271484375, 0.321044921875, -0.46142578125, 0.260009765625] + # bits (row-major): aa23 b338 abe8 b583 3440 b6b4 30c4 b71a 382e b844 ab82 31d7 b486 3523 b762 3429 +W[ 8] # source img binding 32, tap offset (+1,+1) + [0.020538330078125, -0.5009765625, 0.440673828125, -0.355712890625] + [0.6044921875, -0.83740234375, 0.166259765625, -0.99755859375] + [0.75146484375, -0.39501953125, 0.0765380859375, 0.350341796875] + [-0.22412109375, -0.07928466796875, 0.08685302734375, -0.001018524169921875] + # bits (row-major): 2542 b802 370d b5b1 38d6 bab3 3152 bbfb 3a03 b652 2ce6 359b b32c ad13 2d8f 942c +W[ 9] # source img binding 33, tap offset (-1,-1) + [-0.052642822265625, -0.1561279296875, 0.76318359375, 0.8359375] + [-0.5166015625, -0.399658203125, -0.95751953125, -0.7958984375] + [-0.341064453125, -0.369873046875, 0.34326171875, 0.339599609375] + [0.00777435302734375, -0.2352294921875, -0.1217041015625, -0.1995849609375] + # bits (row-major): aabd b0ff 3a1b 3ab0 b822 b665 bba9 ba5e b575 b5eb 357e 356f 1ff6 b387 afca b263 +W[10] # source img binding 33, tap offset (-1, 0) + [-0.170654296875, 0.0309906005859375, 0.332275390625, 0.30419921875] + [-0.5205078125, -0.380615234375, -0.297607421875, -0.1416015625] + [-0.395263671875, -0.5703125, 0.11895751953125, 0.18212890625] + [0.25244140625, -0.26416015625, 0.262939453125, 0.424560546875] + # bits (row-major): b176 27ef 3551 34de b82a b617 b4c3 b088 b653 b890 2f9d 31d4 340a b43a 3435 36cb +W[11] # source img binding 33, tap offset (-1,+1) + [-0.2310791015625, -0.049224853515625, 0.2225341796875, 0.1953125] + [-0.25341796875, -0.2236328125, -0.07470703125, -0.08245849609375] + [-0.00942230224609375, -0.76416015625, 0.107666015625, 0.09649658203125] + [0.291015625, -0.2396240234375, 0.3466796875, 0.322021484375] + # bits (row-major): b365 aa4d 331f 3240 b40e b328 acc8 ad47 a0d3 ba1d 2ee4 2e2d 34a8 b3ab 358c 3527 +W[12] # source img binding 33, tap offset ( 0,-1) + [-0.15966796875, -0.162841796875, 0.277587890625, 0.327880859375] + [-0.193603515625, -0.0823974609375, -0.288330078125, -0.5078125] + [-0.1656494140625, 0.03546142578125, 0.2391357421875, 0.2213134765625] + [-0.1993408203125, -0.41796875, -0.42822265625, -0.36328125] + # bits (row-major): b11c b136 3471 353f b232 ad46 b49d b810 b14d 288a 33a7 3315 b261 b6b0 b6da b5d0 +W[13] # source img binding 33, tap offset ( 0, 0) + [-0.21728515625, 0.01380157470703125, 0.1400146484375, -0.061370849609375] + [-0.30322265625, -0.11163330078125, 0.093017578125, 0.02838134765625] + [-0.2376708984375, -0.11602783203125, 0.207275390625, 0.169677734375] + [0.026397705078125, -0.10833740234375, 0.1524658203125, 0.479248046875] + # bits (row-major): b2f4 2311 307b abdb b4da af25 2df4 2744 b39b af6d 32a2 316e 26c2 aeef 30e1 37ab +W[14] # source img binding 33, tap offset ( 0,+1) + [-0.2548828125, 0.2266845703125, 0.1727294921875, 0.147216796875] + [-0.16357421875, -0.0226287841796875, 0.047821044921875, 0.01165771484375] + [0.0185089111328125, -0.38525390625, 0.035614013671875, 0.02001953125] + [-0.08367919921875, -0.180908203125, 0.1121826171875, 0.306640625] + # bits (row-major): b414 3341 3187 30b6 b13c a5cb 2a1f 21f8 24bd b62a 288f 2520 ad5b b1ca 2f2e 34e8 +W[15] # source img binding 33, tap offset (+1,-1) + [-0.1427001953125, -0.242431640625, 0.09295654296875, 0.11907958984375] + [0.079833984375, 0.2078857421875, 0.043670654296875, -0.19140625] + [-0.259033203125, -0.1348876953125, 0.04132080078125, -0.035858154296875] + [-0.49755859375, -0.8779296875, -1.2275390625, -1.0634765625] + # bits (row-major): b091 b3c2 2df3 2f9f 2d1c 32a7 2997 b220 b425 b051 294a a897 b7f6 bb06 bce9 bc41 +W[16] # source img binding 33, tap offset (+1, 0) + [-0.29296875, -0.0711669921875, 0.296630859375, 0.047454833984375] + [-0.1611328125, 0.1478271484375, 0.291259765625, 0.2310791015625] + [-0.271484375, -0.1959228515625, 0.005931854248046875, -0.0523681640625] + [-0.0391845703125, -0.202880859375, -0.162841796875, 0.155517578125] + # bits (row-major): b4b0 ac8e 34bf 2a13 b128 30bb 34a9 3365 b458 b245 1e13 aab4 a904 b27e b136 30fa +W[17] # source img binding 33, tap offset (+1,+1) + [-0.291748046875, 0.373046875, 0.97998046875, 0.6689453125] + [-0.1624755859375, 0.1334228515625, 0.058197021484375, 0.1236572265625] + [-0.0341796875, -0.4638671875, -0.1046142578125, -0.11712646484375] + [-0.3623046875, -0.0650634765625, -0.176025390625, -0.0263671875] + # bits (row-major): b4ab 35f8 3bd7 395a b133 3045 2b73 2fea a860 b76c aeb2 af7f b5cc ac2a b1a2 a6c0 +mu = [2.22265625, -1.751953125, -0.337890625, -2.1328125] # bits: 4072 bf02 b568 c044 +sigma = [0.38525390625, 0.61669921875, 0.337646484375, 0.50830078125] # bits: 362a 38ef 3567 3811 +beta = [0.016143798828125, -0.1622314453125, -0.56005859375, -0.51025390625] # bits: 2422 b131 b87b b815 +``` + +**Head B** (output binding 49), weight-set digest `13b9cb6679f9`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [0.642578125, -0.2841796875, 0.47802734375, -0.176513671875] + [-0.373291015625, 0.0390625, -0.25146484375, -0.268310546875] + [0.290771484375, 0.003604888916015625, -0.4404296875, 0.4111328125] + [0.2239990234375, -0.2318115234375, 0.9970703125, 0.1968994140625] + # bits (row-major): 3924 b48c 37a6 b1a6 b5f9 2900 b406 b44b 34a7 1b62 b70c 3694 332b b36b 3bfa 324d +W[ 1] # source img binding 32, tap offset (-1, 0) + [0.93798828125, -0.28955078125, 0.21923828125, -0.005756378173828125] + [-0.75439453125, 0.32080078125, -0.2283935546875, 0.1409912109375] + [0.22216796875, 0.2900390625, -0.5087890625, 0.432373046875] + [0.0888671875, 0.0177459716796875, 0.33447265625, 0.186767578125] + # bits (row-major): 3b81 b4a2 3304 9de5 ba09 3522 b34f 3083 331c 34a4 b812 36eb 2db0 248b 355a 31fa +W[ 2] # source img binding 32, tap offset (-1,+1) + [0.638671875, -0.75, 0.1611328125, -0.3076171875] + [-0.73681640625, 0.5634765625, -0.1416015625, 0.13134765625] + [0.23828125, 0.494140625, -0.272216796875, 0.79541015625] + [-0.0172271728515625, 0.3544921875, -0.016815185546875, 0.1915283203125] + # bits (row-major): 391c ba00 3128 b4ec b9e5 3882 b088 3034 33a0 37e8 b45b 3a5d a469 35ac a44e 3221 +W[ 3] # source img binding 32, tap offset ( 0,-1) + [0.55517578125, -0.2373046875, 0.375244140625, -0.05499267578125] + [-0.5263671875, 0.2459716796875, -0.285400390625, 0.037811279296875] + [0.295654296875, 0.410888671875, -0.170166015625, 0.2010498046875] + [0.163818359375, 0.13818359375, 0.626953125, 0.382568359375] + # bits (row-major): 3871 b398 3601 ab0a b836 33df b491 28d7 34bb 3693 b172 326f 313e 306c 3904 361f +W[ 4] # source img binding 32, tap offset ( 0, 0) + [0.884765625, -0.1961669921875, 0.0997314453125, 0.13818359375] + [-0.70361328125, 0.32958984375, -0.2337646484375, 0.308349609375] + [0.267578125, 0.404296875, -0.23486328125, 0.00670623779296875] + [0.08148193359375, 0.1845703125, 0.080322265625, 0.158203125] + # bits (row-major): 3b14 b247 2e62 306c b9a1 3546 b37b 34ef 3448 3678 b384 1ede 2d37 31e8 2d24 3110 +W[ 5] # source img binding 32, tap offset ( 0,+1) + [0.62109375, -0.67724609375, 0.08251953125, -0.1724853515625] + [-0.681640625, 0.51513671875, -0.12176513671875, 0.2359619140625] + [0.297119140625, 0.5576171875, -0.06768798828125, 0.300537109375] + [0.0008587837219238281, 0.42724609375, -0.439697265625, 0.1629638671875] + # bits (row-major): 38f8 b96b 2d48 b185 b974 381f afcb 338d 34c1 3876 ac55 34cf 1309 36d6 b709 3137 +W[ 6] # source img binding 32, tap offset (+1,-1) + [0.30224609375, -0.4658203125, 0.53466796875, -0.1220703125] + [-0.27490234375, 0.396240234375, -0.271240234375, 0.2353515625] + [0.31494140625, 0.11395263671875, 0.18017578125, 0.58447265625] + [0.157470703125, 0.388427734375, 0.64501953125, 0.310302734375] + # bits (row-major): 34d6 b774 3847 afd0 b466 3657 b457 3388 350a 2f4b 31c4 38ad 310a 3637 3929 34f7 +W[ 7] # source img binding 32, tap offset (+1, 0) + [0.447021484375, -0.477783203125, 0.29443359375, -0.00440216064453125] + [-0.499267578125, 0.4677734375, -0.347412109375, 0.447021484375] + [0.2607421875, 0.11737060546875, -0.0909423828125, 0.298583984375] + [0.1197509765625, 0.4189453125, 0.051116943359375, 0.1875] + # bits (row-major): 3727 b7a5 34b6 9c82 b7fd 377c b58f 3727 342c 2f83 add2 34c7 2faa 36b4 2a8b 3200 +W[ 8] # source img binding 32, tap offset (+1,+1) + [0.21337890625, -0.9130859375, 0.259765625, -0.2958984375] + [-0.31591796875, 0.58984375, -0.284423828125, 0.392578125] + [0.369140625, 0.1995849609375, -0.0207672119140625, 0.591796875] + [0.0948486328125, 0.7041015625, -0.65185546875, 0.3759765625] + # bits (row-major): 32d4 bb4e 3428 b4bc b50e 38b8 b48d 3648 35e8 3263 a551 38bc 2e12 39a2 b937 3604 +W[ 9] # source img binding 33, tap offset (-1,-1) + [0.427734375, 0.1844482421875, -0.1822509765625, -0.198974609375] + [-0.26416015625, -0.0218963623046875, 0.326904296875, 0.09979248046875] + [-0.004123687744140625, 0.176025390625, -0.26171875, -0.264892578125] + [0.1441650390625, 0.76318359375, 0.787109375, 0.86669921875] + # bits (row-major): 36d8 31e7 b1d5 b25e b43a a59b 353b 2e63 9c39 31a2 b430 b43d 309d 3a1b 3a4c 3aef +W[10] # source img binding 33, tap offset (-1, 0) + [0.220703125, 0.006256103515625, -0.2451171875, -0.2294921875] + [-0.44189453125, -0.058502197265625, 0.278076171875, 0.1473388671875] + [-0.31103515625, -0.0115509033203125, -0.5439453125, -0.357177734375] + [-0.07843017578125, 0.419189453125, 0.1744384765625, 0.345703125] + # bits (row-major): 3310 1e68 b3d8 b358 b712 ab7d 3473 30b7 b4fa a1ea b85a b5b7 ad05 36b5 3195 3588 +W[11] # source img binding 33, tap offset (-1,+1) + [0.379638671875, 0.0941162109375, -0.2408447265625, -0.24658203125] + [-0.462890625, -0.398681640625, 0.1065673828125, 0.0196685791015625] + [-0.10693359375, -0.6220703125, -0.58203125, -0.387451171875] + [-0.09112548828125, -0.2244873046875, -0.1170654296875, 0.112548828125] + # bits (row-major): 3613 2e06 b3b5 b3e4 b768 b661 2ed2 2509 aed8 b8fa b8a8 b633 add5 b32f af7e 2f34 +W[12] # source img binding 33, tap offset ( 0,-1) + [0.208740234375, 0.0010128021240234375, -0.302978515625, -0.3623046875] + [-0.29150390625, -0.0055694580078125, 0.338134765625, 0.1270751953125] + [0.11517333984375, 0.22802734375, -0.271728515625, -0.262939453125] + [0.042999267578125, 0.407958984375, 0.09368896484375, 0.285888671875] + # bits (row-major): 32ae 1426 b4d9 b5cc b4aa 9db4 3569 3011 2f5f 334c b459 b435 2981 3687 2dff 3493 +W[13] # source img binding 33, tap offset ( 0, 0) + [0.006519317626953125, -0.1680908203125, -0.2471923828125, -0.29052734375] + [-0.52587890625, 0.05963134765625, 0.38232421875, 0.240966796875] + [-0.212890625, 0.265625, -0.414794921875, -0.17138671875] + [-0.0194244384765625, 0.0279388427734375, -0.43603515625, -0.3232421875] + # bits (row-major): 1ead b161 b3e9 b4a6 b835 2ba2 361e 33b6 b2d0 3440 b6a3 b17c a4f9 2727 b6fa b52c +W[14] # source img binding 33, tap offset ( 0,+1) + [0.1453857421875, -0.039306640625, -0.2384033203125, -0.31201171875] + [-0.73486328125, -0.2237548828125, 0.220458984375, 0.113525390625] + [-0.1937255859375, 0.00920867919921875, -0.273681640625, -0.047760009765625] + [-0.10772705078125, -0.5078125, -0.89404296875, -0.57470703125] + # bits (row-major): 30a7 a908 b3a1 b4fe b9e1 b329 330e 2f44 b233 20b7 b461 aa1d aee5 b810 bb27 b899 +W[15] # source img binding 33, tap offset (+1,-1) + [0.0899658203125, 0.1070556640625, -0.2578125, -0.350830078125] + [-0.2210693359375, -0.1312255859375, 0.277099609375, 0.061126708984375] + [0.11065673828125, 0.09808349609375, 0.07586669921875, -0.205322265625] + [-0.1180419921875, 0.0004611015319824219, 0.009918212890625, -0.11212158203125] + # bits (row-major): 2dc2 2eda b420 b59d b313 b033 346f 2bd3 2f15 2e47 2cdb b292 af8e 0f8e 2114 af2d +W[16] # source img binding 33, tap offset (+1, 0) + [-0.09197998046875, -0.04901123046875, -0.263427734375, -0.2900390625] + [-0.322021484375, -0.1468505859375, 0.2744140625, 0.1357421875] + [-0.097900390625, 0.1181640625, -0.1763916015625, -0.158935546875] + [-0.2049560546875, -0.4541015625, -0.67626953125, -0.92431640625] + # bits (row-major): ade3 aa46 b437 b4a4 b527 b0b3 3464 3058 ae44 2f90 b1a5 b116 b28f b744 b969 bb65 +W[17] # source img binding 33, tap offset (+1,+1) + [0.0546875, 0.08441162109375, -0.1246337890625, -0.22607421875] + [-0.68701171875, -0.1876220703125, 0.18505859375, 0.053924560546875] + [-0.0767822265625, 0.2386474609375, 0.022705078125, -0.01200103759765625] + [-0.429931640625, -0.87548828125, -1.2470703125, -0.966796875] + # bits (row-major): 2b00 2d67 affa b33c b97f b201 31ec 2ae7 acea 33a3 25d0 a225 b6e1 bb01 bcfd bbbc +mu = [0.223388671875, -1.1845703125, -0.83935546875, -0.1507568359375] # bits: 3326 bcbd bab7 b0d3 +sigma = [0.2327880859375, 0.257080078125, 0.165771484375, 0.210205078125] # bits: 3373 341d 314e 32ba +beta = [-0.25048828125, -0.4111328125, -0.311767578125, -0.1903076171875] # bits: b402 b694 b4fd b217 +``` + +### shader_12 + +**Head A** (output binding 48), weight-set digest `25489cdebda7`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [-0.3232421875, -0.76318359375, 0.323974609375, 0.53955078125] + [0.2379150390625, -0.35400390625, -0.31201171875, -1.3544921875] + [0.155517578125, -0.265869140625, -0.3251953125, -0.467041015625] + [0.1475830078125, 0.44775390625, -0.305908203125, -0.264892578125] + # bits (row-major): b52c ba1b 352f 3851 339d b5aa b4fe bd6b 30fa b441 b534 b779 30b9 372a b4e5 b43d +W[ 1] # source img binding 32, tap offset (-1, 0) + [-0.1502685546875, -0.25732421875, 0.43359375, 0.350830078125] + [-0.019378662109375, -0.294189453125, -0.202392578125, -0.038299560546875] + [0.12347412109375, -0.26025390625, -0.197265625, 0.1507568359375] + [0.400634765625, 0.1634521484375, -0.1329345703125, -0.434814453125] + # bits (row-major): b0cf b41e 36f0 359d a4f6 b4b5 b27a a8e7 2fe7 b42a b250 30d3 3669 313b b041 b6f5 +W[ 2] # source img binding 32, tap offset (-1,+1) + [-0.340087890625, 0.382080078125, 0.79296875, 0.328125] + [0.084228515625, -0.12841796875, -0.287841796875, 0.58349609375] + [0.322265625, 0.148193359375, -0.29248046875, 0.3095703125] + [0.16845703125, 0.08953857421875, -0.01334381103515625, -0.84130859375] + # bits (row-major): b571 361d 3a58 3540 2d64 b01c b49b 38ab 3528 30be b4ae 34f4 3164 2dbb a2d5 babb +W[ 3] # source img binding 32, tap offset ( 0,-1) + [-0.00933074951171875, -0.298828125, 0.34765625, 0.60791015625] + [0.1734619140625, -0.47216796875, -0.259033203125, -1.0576171875] + [0.1019287109375, -0.2127685546875, -0.2197265625, -0.408935546875] + [0.148681640625, -0.2432861328125, -0.487548828125, -0.1068115234375] + # bits (row-major): a0c7 b4c8 3590 38dd 318d b78e b425 bc3b 2e86 b2cf b308 b68b 30c2 b3c9 b7cd aed6 +W[ 4] # source img binding 32, tap offset ( 0, 0) + [0.3125, -0.1839599609375, 0.400390625, 0.09381103515625] + [-0.07122802734375, -0.1402587890625, -0.0887451171875, -0.446533203125] + [0.056396484375, -0.0088653564453125, -0.040557861328125, 0.1689453125] + [0.1591796875, -0.88916015625, -0.57421875, -0.02008056640625] + # bits (row-major): 3500 b1e3 3668 2e01 ac8f b07d adae b725 2b38 a08a a931 3168 3118 bb1d b898 a524 +W[ 5] # source img binding 32, tap offset ( 0,+1) + [0.07269287109375, -0.09356689453125, 0.67431640625, -0.0146331787109375] + [0.07525634765625, 0.282958984375, -0.1571044921875, 0.4541015625] + [0.2587890625, 0.3330078125, -0.095703125, 0.396728515625] + [0.043426513671875, -0.64306640625, -0.62255859375, -0.5849609375] + # bits (row-major): 2ca7 adfd 3965 a37e 2cd1 3487 b107 3744 3424 3554 ae20 3659 298f b925 b8fb b8ae +W[ 6] # source img binding 32, tap offset (+1,-1) + [-0.238525390625, 0.2144775390625, 0.6240234375, 0.0914306640625] + [0.39794921875, -0.2705078125, -0.387939453125, -1.44140625] + [0.25927734375, 0.168212890625, -0.34716796875, -0.8046875] + [0.1318359375, 0.382568359375, -0.5439453125, -0.003231048583984375] + # bits (row-major): b3a2 32dd 38fe 2dda 365e b454 b635 bdc4 3426 3162 b58e ba70 3038 361f b85a 9a9e +W[ 7] # source img binding 32, tap offset (+1, 0) + [0.041290283203125, -0.024627685546875, 0.63232421875, -0.31005859375] + [0.12469482421875, 0.2298583984375, -0.268310546875, -1.548828125] + [0.2060546875, 0.44775390625, -0.1923828125, -0.716796875] + [0.252685546875, -0.6171875, -0.55810546875, 0.040863037109375] + # bits (row-major): 2949 a64e 390f b4f6 2ffb 335b b44b be32 3298 372a b228 b9bc 340b b8f0 b877 293b +W[ 8] # source img binding 32, tap offset (+1,+1) + [-0.05731201171875, -0.21044921875, 0.9951171875, -0.318359375] + [0.2236328125, 0.6611328125, -0.37451171875, -1.5712890625] + [0.396484375, 0.64013671875, -0.235595703125, -0.4453125] + [0.0006279945373535156, 0.1298828125, -0.86083984375, -0.50830078125] + # bits (row-major): ab56 b2bc 3bf6 b518 3328 394a b5fe be49 3658 391f b38a b720 1125 3028 bae3 b811 +W[ 9] # source img binding 33, tap offset (-1,-1) + [0.144287109375, -0.329833984375, -0.40673828125, 0.150634765625] + [0.39111328125, -0.418701171875, -0.1956787109375, 0.1854248046875] + [0.43359375, -0.68408203125, -0.2890625, 0.3154296875] + [-0.355224609375, 0.340576171875, 0.67919921875, -1.2353515625] + # bits (row-major): 309e b547 b682 30d2 3642 b6b3 b243 31ef 36f0 b979 b4a0 350c b5af 3573 396f bcf1 +W[10] # source img binding 33, tap offset (-1, 0) + [0.003505706787109375, -0.01751708984375, -0.0394287109375, 0.0275726318359375] + [0.515625, -0.204345703125, -0.1075439453125, 0.3154296875] + [0.580078125, -0.01116943359375, -0.1314697265625, 0.1953125] + [-0.0731201171875, 0.043121337890625, 1.037109375, -0.724609375] + # bits (row-major): 1b2e a47c a90c 270f 3820 b28a aee2 350c 38a4 a1b8 b035 3240 acae 2985 3c26 b9cc +W[11] # source img binding 33, tap offset (-1,+1) + [-0.15966796875, 0.14453125, 0.7294921875, 0.1280517578125] + [0.5654296875, -0.54345703125, -0.273681640625, 0.0237579345703125] + [0.67724609375, -0.1881103515625, -0.306884765625, -0.15380859375] + [0.4482421875, -0.059173583984375, 0.136474609375, -0.354248046875] + # bits (row-major): b11c 30a0 39d6 3019 3886 b859 b461 2615 396b b205 b4e9 b0ec 372c ab93 305e b5ab +W[12] # source img binding 33, tap offset ( 0,-1) + [0.0404052734375, -0.0816650390625, -0.1492919921875, 0.16845703125] + [0.440673828125, -0.0256805419921875, -0.0418701171875, 0.2412109375] + [0.48193359375, -0.7421875, -0.037139892578125, 0.31103515625] + [-0.476806640625, 0.10693359375, -0.12078857421875, -0.38232421875] + # bits (row-major): 292c ad3a b0c7 3164 370d a693 a95c 33b8 37b6 b9f0 a8c1 34fa b7a1 2ed8 afbb b61e +W[13] # source img binding 33, tap offset ( 0, 0) + [-0.03118896484375, -0.006916046142578125, -0.16259765625, 0.038421630859375] + [0.485595703125, 0.197265625, 0.2236328125, 0.36669921875] + [0.6435546875, 0.0089263916015625, 0.1534423828125, 0.143310546875] + [-0.287353515625, 0.0023784637451171875, 0.314697265625, 0.07269287109375] + # bits (row-major): a7fc 9f15 b134 28eb 37c5 3250 3328 35de 3926 2092 30e9 3096 b499 18df 3509 2ca7 +W[14] # source img binding 33, tap offset ( 0,+1) + [-0.20947265625, 0.220458984375, 0.346923828125, 0.52392578125] + [0.58154296875, -0.296875, 0.032501220703125, 0.037994384765625] + [0.80712890625, -0.1038818359375, -0.05780029296875, -0.142333984375] + [0.246337890625, -0.1475830078125, 0.08624267578125, -0.0828857421875] + # bits (row-major): b2b4 330e 358d 3831 38a7 b4c0 2829 28dd 3a75 aea6 ab66 b08e 33e2 b0b9 2d85 ad4e +W[15] # source img binding 33, tap offset (+1,-1) + [-0.04437255859375, 0.0467529296875, 0.08270263671875, -0.1632080078125] + [0.4462890625, -0.244873046875, -0.0897216796875, -0.08441162109375] + [0.64013671875, -1.029296875, -0.0190277099609375, 0.014404296875] + [-0.3505859375, 0.1798095703125, 0.324951171875, -0.10626220703125] + # bits (row-major): a9ae 29fc 2d4b b139 3724 b3d6 adbe ad67 391f bc1e a4df 2360 b59c 31c1 3533 aecd +W[16] # source img binding 33, tap offset (+1, 0) + [-0.09320068359375, 0.119384765625, -0.0994873046875, 0.1353759765625] + [0.471435546875, -0.1048583984375, 0.17333984375, -0.060272216796875] + [0.73193359375, -0.37548828125, 0.2105712890625, -0.1456298828125] + [-0.1331787109375, 0.0909423828125, 0.23046875, -0.298583984375] + # bits (row-major): adf7 2fa4 ae5e 3055 378b aeb6 318c abb7 39db b602 32bd b0a9 b043 2dd2 3360 b4c7 +W[17] # source img binding 33, tap offset (+1,+1) + [-0.22802734375, 0.49951171875, 0.5908203125, 0.78955078125] + [0.413818359375, -0.71142578125, 0.06219482421875, -0.340087890625] + [0.82421875, -0.376708984375, -0.0087432861328125, -0.33349609375] + [0.376708984375, -0.1988525390625, 0.1552734375, -0.5087890625] + # bits (row-major): b34c 37fe 38ba 3a51 369f b9b1 2bf6 b571 3a98 b607 a07a b556 3607 b25d 30f8 b812 +mu = [0.12103271484375, 0.11639404296875, 1.189453125, -0.42529296875] # bits: 2fbf 2f73 3cc2 b6ce +sigma = [0.80029296875, 0.9619140625, 0.98779296875, 1.4794921875] # bits: 3a67 3bb2 3be7 3deb +beta = [-0.57275390625, 0.11492919921875, -0.0204010009765625, 0.43359375] # bits: b895 2f5b a539 36f0 +``` + +**Head B** (output binding 49), weight-set digest `bcba3c242ad6`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [0.362060546875, -0.00495147705078125, -0.97412109375, -0.6328125] + [-0.2548828125, -0.44970703125, 0.79638671875, 0.53125] + [0.06976318359375, -0.07220458984375, -0.3447265625, -0.822265625] + [-0.1904296875, -0.45458984375, 0.07098388671875, -0.1016845703125] + # bits (row-major): 35cb 9d12 bbcb b910 b414 b732 3a5f 3840 2c77 ac9f b584 ba94 b218 b746 2c8b ae82 +W[ 1] # source img binding 32, tap offset (-1, 0) + [0.26513671875, -0.35498046875, -0.921875, -0.1339111328125] + [-0.04638671875, 0.09576416015625, 0.85546875, 0.2880859375] + [0.06182861328125, -0.142333984375, -0.2144775390625, -0.121337890625] + [-0.252197265625, 0.0028057098388671875, 0.017669677734375, 0.1314697265625] + # bits (row-major): 343e b5ae bb60 b049 a9f0 2e21 3ad8 349c 2bea b08e b2dd afc4 b409 19bf 2486 3035 +W[ 2] # source img binding 32, tap offset (-1,+1) + [0.29541015625, -0.3720703125, -1.3486328125, -0.2783203125] + [-0.239013671875, 0.63916015625, 0.9638671875, 0.172607421875] + [0.318115234375, 0.3876953125, -0.33544921875, 0.271484375] + [-0.404296875, 0.20751953125, 0.2225341796875, 0.221923828125] + # bits (row-major): 34ba b5f4 bd65 b474 b3a6 391d 3bb6 3186 3517 3634 b55e 3458 b678 32a4 331f 331a +W[ 3] # source img binding 32, tap offset ( 0,-1) + [0.2376708984375, -0.2142333984375, -0.8212890625, -0.51513671875] + [-0.13671875, 0.050079345703125, 0.7890625, 0.38671875] + [0.054351806640625, -0.07568359375, -0.1805419921875, 0.1875] + [-0.167724609375, -0.0291595458984375, 0.142578125, -0.1978759765625] + # bits (row-major): 339b b2db ba92 b81f b060 2a69 3a50 3630 2af5 acd8 b1c7 3200 b15e a777 3090 b255 +W[ 4] # source img binding 32, tap offset ( 0, 0) + [0.07427978515625, -0.297119140625, -0.68798828125, -0.034027099609375] + [0.09600830078125, 0.1376953125, 0.72216796875, 0.05865478515625] + [0.0703125, 0.0257568359375, -0.00045490264892578125, 0.278076171875] + [-0.2039794921875, 0.212158203125, 0.06842041015625, -0.11065673828125] + # bits (row-major): 2cc1 b4c1 b981 a85b 2e25 3068 39c7 2b82 2c80 2698 8f74 3473 b287 32ca 2c61 af15 +W[ 5] # source img binding 32, tap offset ( 0,+1) + [0.047698974609375, -0.026519775390625, -1.095703125, -0.05682373046875] + [-0.064453125, 0.2376708984375, 0.763671875, -0.06463623046875] + [0.275390625, 0.4208984375, -0.12127685546875, 0.62841796875] + [-0.312255859375, 0.3017578125, 0.2352294921875, -0.1690673828125] + # bits (row-major): 2a1b a6ca bc62 ab46 ac20 339b 3a1c ac23 3468 36bc afc3 3907 b4ff 34d4 3387 b169 +W[ 6] # source img binding 32, tap offset (+1,-1) + [0.265380859375, -0.26220703125, -0.9306640625, -0.1263427734375] + [-0.402587890625, 0.02618408203125, 0.701171875, -0.0906982421875] + [0.1907958984375, 0.351318359375, -0.346923828125, -0.1912841796875] + [-0.285888671875, -0.11029052734375, 0.2130126953125, 0.144775390625] + # bits (row-major): 343f b432 bb72 b00b b671 26b4 399c adce 321b 359f b58d b21f b493 af0f 32d1 30a2 +W[ 7] # source img binding 32, tap offset (+1, 0) + [0.104736328125, -0.094482421875, -0.5849609375, -0.1434326171875] + [-0.1494140625, -0.1820068359375, 0.5126953125, 0.1754150390625] + [0.1534423828125, 0.430419921875, -0.2249755859375, -0.4580078125] + [-0.342041015625, 0.049346923828125, 0.1630859375, 0.2137451171875] + # bits (row-major): 2eb4 ae0c b8ae b097 b0c8 b1d3 381a 319d 30e9 36e3 b333 b754 b579 2a51 3138 32d7 +W[ 8] # source img binding 32, tap offset (+1,+1) + [0.0119171142578125, 0.2066650390625, -0.970703125, -0.34912109375] + [-0.178955078125, -0.162841796875, 0.71142578125, 0.318115234375] + [0.333251953125, 0.6640625, -0.30517578125, -0.1600341796875] + [-0.396240234375, 0.0304412841796875, 0.370361328125, 0.1497802734375] + # bits (row-major): 221a 329d bbc4 b596 b1ba b136 39b1 3517 3555 3950 b4e2 b11f b657 27cb 35ed 30cb +W[ 9] # source img binding 33, tap offset (-1,-1) + [-0.305908203125, -0.000453948974609375, -0.9892578125, -0.796875] + [0.1334228515625, 0.061859130859375, 0.5224609375, 0.41162109375] + [0.7431640625, -1.0048828125, -0.2169189453125, 0.211181640625] + [0.10955810546875, 0.41845703125, -0.396484375, -0.0300445556640625] + # bits (row-major): b4e5 8f70 bbea ba60 3045 2beb 382e 3696 39f2 bc05 b2f1 32c2 2f03 36b2 b658 a7b1 +W[10] # source img binding 33, tap offset (-1, 0) + [-0.265380859375, 0.03326416015625, -0.65478515625, -0.3212890625] + [0.04083251953125, 0.10791015625, 0.658203125, 0.05853271484375] + [0.7021484375, -0.060028076171875, -0.0869140625, 0.0328369140625] + [-0.2059326171875, 0.482177734375, -0.4873046875, -0.13623046875] + # bits (row-major): b43f 2842 b93d b524 293a 2ee8 3944 2b7e 399e abaf ad90 2834 b297 37b7 b7cc b05c +W[11] # source img binding 33, tap offset (-1,+1) + [0.2479248046875, 0.041656494140625, -0.99853515625, -0.34326171875] + [-0.10943603515625, 0.00908660888671875, 0.72802734375, -0.0391845703125] + [0.66796875, -0.152587890625, -0.332275390625, -0.400146484375] + [-0.1387939453125, 0.64990234375, -0.357177734375, -0.293701171875] + # bits (row-major): 33ef 2955 bbfd b57e af01 20a7 39d3 a904 3958 b0e2 b551 b667 b071 3933 b5b7 b4b3 +W[12] # source img binding 33, tap offset ( 0,-1) + [-0.302734375, 0.132080078125, -0.74462890625, -0.302490234375] + [0.0740966796875, 0.0255279541015625, 0.52880859375, 0.275390625] + [0.64794921875, -0.47216796875, 0.0244140625, 0.21044921875] + [-0.01454925537109375, 0.453125, -0.342041015625, -0.0775146484375] + # bits (row-major): b4d8 303a b9f5 b4d7 2cbe 2689 383b 3468 392f b78e 2640 32bc a373 3740 b579 acf6 +W[13] # source img binding 33, tap offset ( 0, 0) + [-0.354736328125, 0.2237548828125, -0.37060546875, -0.05975341796875] + [0.03900146484375, -0.00785064697265625, 0.286376953125, 0.09808349609375] + [0.56396484375, 0.43798828125, 0.194091796875, 0.031494140625] + [-0.24169921875, 0.51513671875, -0.331787109375, -0.1328125] + # bits (row-major): b5ad 3329 b5ee aba6 28fe a005 3495 2e47 3883 3702 3236 2808 b3bc 381f b54f b040 +W[14] # source img binding 33, tap offset ( 0,+1) + [0.1180419921875, 0.060333251953125, -1.0712890625, -0.533203125] + [-0.14306640625, 0.011962890625, 0.380615234375, 0.343505859375] + [0.732421875, 0.350341796875, -0.11932373046875, -0.32177734375] + [-0.2022705078125, 0.70556640625, -0.267822265625, -0.1785888671875] + # bits (row-major): 2f8e 2bb9 bc49 b844 b094 2220 3617 357f 39dc 359b afa3 b526 b279 39a5 b449 b1b7 +W[15] # source img binding 33, tap offset (+1,-1) + [-0.031341552734375, -0.01406097412109375, -0.397216796875, -0.625] + [-0.0531005859375, 0.1708984375, 0.4345703125, 0.287109375] + [0.54345703125, -0.50146484375, 0.0050048828125, -0.14794921875] + [-0.0157318115234375, 0.58642578125, -0.51416015625, -0.1905517578125] + # bits (row-major): a803 a333 b65b b900 aacc 3178 36f4 3498 3859 b803 1d20 b0bc a407 38b1 b81d b219 +W[16] # source img binding 33, tap offset (+1, 0) + [-0.04046630859375, 0.0482177734375, -0.1690673828125, -0.57666015625] + [-0.1119384765625, 0.187744140625, 0.12188720703125, 0.336181640625] + [0.4501953125, 0.291015625, 0.1630859375, -0.245361328125] + [-0.194091796875, 0.71484375, -0.454345703125, -0.1329345703125] + # bits (row-major): a92e 2a2c b169 b89d af2a 3202 2fcd 3561 3734 34a8 3138 b3da b236 39b8 b745 b041 +W[17] # source img binding 33, tap offset (+1,+1) + [0.32861328125, -0.10919189453125, -1.2109375, -0.67822265625] + [-0.214111328125, 0.25439453125, 0.4892578125, 0.265380859375] + [0.5986328125, 0.2188720703125, -0.11322021484375, -0.470458984375] + [-0.1358642578125, 1.078125, -0.2264404296875, 0.053619384765625] + # bits (row-major): 3542 aefd bcd8 b96d b2da 3412 37d4 343f 38ca 3301 af3f b787 b059 3c50 b33f 2add +mu = [-1.748046875, 0.916015625, 1.552734375, -0.75439453125] # bits: befe 3b54 3e36 ba09 +sigma = [0.66455078125, 0.70654296875, 1.0380859375, 1.1337890625] # bits: 3951 39a7 3c27 3c89 +beta = [0.84521484375, -0.26953125, -0.07989501953125, -0.07757568359375] # bits: 3ac3 b450 ad1d acf7 +``` + +### shader_35 + +**Head A** (output binding 48), weight-set digest `f2b494d43e8c`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [-0.0308074951171875, -0.1644287109375, 0.1673583984375, 0.2431640625] + [0.3134765625, -0.10498046875, 0.8955078125, 0.121337890625] + [1.046875, -0.439697265625, 0.236083984375, 0.85498046875] + [-0.0265655517578125, 0.1456298828125, -0.67529296875, 0.1988525390625] + # bits (row-major): a7e3 b143 315b 33c8 3504 aeb8 3b2a 2fc4 3c30 b709 338e 3ad7 a6cd 30a9 b967 325d +W[ 1] # source img binding 32, tap offset (-1, 0) + [-0.306640625, -0.396484375, 0.0310821533203125, 0.28759765625] + [0.426513671875, -0.16796875, -0.326416015625, 0.0215301513671875] + [-0.25830078125, -0.03424072265625, 0.01284027099609375, -0.09466552734375] + [0.1859130859375, 0.31201171875, -0.395263671875, 0.31982421875] + # bits (row-major): b4e8 b658 27f5 349a 36d3 b160 b539 2583 b422 a862 2293 ae0f 31f3 34fe b653 351e +W[ 2] # source img binding 32, tap offset (-1,+1) + [-0.002254486083984375, -0.264892578125, -0.2568359375, 0.1807861328125] + [0.66015625, -0.046295166015625, 0.28515625, 0.06195068359375] + [-0.404296875, 0.09771728515625, -0.447021484375, -0.373291015625] + [0.028778076171875, 0.5126953125, -0.5078125, 0.0709228515625] + # bits (row-major): 989e b43d b41c 31c9 3948 a9ed 3490 2bee b678 2e41 b727 b5f9 275e 381a b810 2c8a +W[ 3] # source img binding 32, tap offset ( 0,-1) + [-0.2005615234375, -0.320068359375, -0.01026153564453125, 0.3076171875] + [0.5078125, 0.09527587890625, 0.853515625, 0.391845703125] + [-0.1282958984375, 0.05792236328125, -0.462890625, -0.04473876953125] + [0.1544189453125, 0.17822265625, 0.34130859375, 0.2259521484375] + # bits (row-major): b26b b51f a141 34ec 3810 2e19 3ad4 3645 b01b 2b6a b768 a9ba 30f1 31b4 3576 333b +W[ 4] # source img binding 32, tap offset ( 0, 0) + [-0.44384765625, -0.4677734375, 0.03558349609375, 0.328125] + [-0.44970703125, -0.051605224609375, -0.053863525390625, -0.306884765625] + [0.00237274169921875, 0.01041412353515625, -0.22998046875, -0.0023784637451171875] + [-0.057830810546875, 0.303466796875, 0.300048828125, 0.0670166015625] + # bits (row-major): b71a b77c 288e 3540 b732 aa9b aae5 b4e9 18dc 2155 b35c 98df ab67 34db 34cd 2c4a +W[ 5] # source img binding 32, tap offset ( 0,+1) + [-0.2939453125, -0.2734375, -0.07318115234375, 0.194580078125] + [0.271728515625, 0.12237548828125, 0.5322265625, 0.254150390625] + [0.324951171875, -0.037445068359375, 0.05401611328125, 0.2398681640625] + [0.0207672119140625, 0.5966796875, 0.01317596435546875, 0.079833984375] + # bits (row-major): b4b4 b460 acaf 323a 3459 2fd5 3842 3411 3533 a8cb 2aea 33ad 2551 38c6 22bf 2d1c +W[ 6] # source img binding 32, tap offset (+1,-1) + [-0.23193359375, -0.293212890625, 0.104736328125, 0.6083984375] + [0.2108154296875, 0.24365234375, 0.7021484375, 0.1788330078125] + [0.17529296875, 0.2183837890625, 0.470947265625, -0.305908203125] + [0.0211944580078125, 0.2010498046875, -0.18505859375, 0.1328125] + # bits (row-major): b36c b4b1 2eb4 38de 32bf 33cc 399e 31b9 319c 32fd 3789 b4e5 256d 326f b1ec 3040 +W[ 7] # source img binding 32, tap offset (+1, 0) + [-0.1904296875, -0.486328125, 0.1055908203125, 0.283447265625] + [0.322998046875, 0.18798828125, 0.6435546875, 0.37841796875] + [0.1981201171875, 0.0190277099609375, 0.094482421875, 0.1884765625] + [0.27978515625, 0.359619140625, 0.1663818359375, 0.103515625] + # bits (row-major): b218 b7c8 2ec2 3489 352b 3204 3926 360e 3257 24df 2e0c 3208 347a 35c1 3153 2ea0 +W[ 8] # source img binding 32, tap offset (+1,+1) + [-0.2022705078125, -0.1331787109375, 0.04864501953125, 0.345458984375] + [0.4716796875, 0.310546875, 0.73193359375, 0.41552734375] + [0.1829833984375, -0.1357421875, -0.380859375, 0.31591796875] + [0.333251953125, 0.5087890625, -0.1663818359375, 0.1812744140625] + # bits (row-major): b279 b043 2a3a 3587 378c 34f8 39db 36a6 31db b058 b618 350e 3555 3812 b153 31cd +W[ 9] # source img binding 33, tap offset (-1,-1) + [-0.371337890625, -0.135498046875, 0.12054443359375, 0.0323486328125] + [-0.11053466796875, -0.134765625, 0.1416015625, -0.54296875] + [-0.49951171875, 0.330322265625, -1.3232421875, -0.355712890625] + [-0.210693359375, -0.56005859375, -0.456787109375, -0.392578125] + # bits (row-major): b5f1 b056 2fb7 2824 af13 b050 3088 b858 b7fe 3549 bd4b b5b1 b2be b87b b74f b648 +W[10] # source img binding 33, tap offset (-1, 0) + [-0.3291015625, -0.1937255859375, -0.07611083984375, -0.016265869140625] + [-0.05462646484375, -0.1524658203125, 0.0947265625, -0.1600341796875] + [0.19677734375, -0.1036376953125, 0.2052001953125, -0.6298828125] + [-0.1070556640625, -0.212646484375, -0.662109375, -0.40478515625] + # bits (row-major): b544 b233 acdf a42a aafe b0e1 2e10 b11f 324c aea2 3291 b90a aeda b2ce b94c b67a +W[11] # source img binding 33, tap offset (-1,+1) + [-0.2342529296875, -0.11834716796875, -0.103271484375, 0.0175933837890625] + [-0.423583984375, 0.074462890625, -0.28955078125, -0.11627197265625] + [-0.12469482421875, -0.2362060546875, 0.2418212890625, -0.43994140625] + [0.0140838623046875, -0.051239013671875, -0.327392578125, -0.4755859375] + # bits (row-major): b37f af93 ae9c 2481 b6c7 2cc4 b4a2 af71 affb b38f 33bd b70a 2336 aa8f b53d b79c +W[12] # source img binding 33, tap offset ( 0,-1) + [-0.414306640625, -0.386962890625, -0.11639404296875, 0.1287841796875] + [0.0223541259765625, -0.27099609375, -0.041351318359375, -0.41552734375] + [-0.01139068603515625, 0.0997314453125, 0.1885986328125, -0.203857421875] + [-0.1993408203125, -0.548828125, -0.57568359375, -0.324462890625] + # bits (row-major): b6a1 b631 af73 301f 25b9 b456 a94b b6a6 a1d5 2e62 3209 b286 b261 b864 b89b b531 +W[13] # source img binding 33, tap offset ( 0, 0) + [-0.35693359375, -0.28173828125, -0.156005859375, 0.01824951171875] + [0.09820556640625, -0.73291015625, 0.450439453125, -0.09674072265625] + [-0.16748046875, -0.005207061767578125, -0.038665771484375, -0.064453125] + [0.10125732421875, -0.46875, -0.455322265625, -0.261474609375] + # bits (row-major): b5b6 b482 b0fe 24ac 2e49 b9dd 3735 ae31 b15c 9d55 a8f3 ac20 2e7b b780 b749 b42f +W[14] # source img binding 33, tap offset ( 0,+1) + [-0.236572265625, -0.302490234375, -0.10638427734375, -0.022735595703125] + [-0.312255859375, -0.7373046875, -0.32763671875, -0.0256805419921875] + [-0.63623046875, -0.355712890625, -0.556640625, -0.336181640625] + [-0.0506591796875, -0.28564453125, -0.455322265625, -0.2386474609375] + # bits (row-major): b392 b4d7 aecf a5d2 b4ff b9e6 b53e a693 b917 b5b1 b874 b561 aa7c b492 b749 b3a3 +W[15] # source img binding 33, tap offset (+1,-1) + [-0.272705078125, -0.50048828125, -0.1993408203125, 0.364501953125] + [0.20654296875, 0.0443115234375, 0.197998046875, -0.320556640625] + [0.2218017578125, 0.040252685546875, 0.5927734375, -0.257568359375] + [-0.150390625, -0.158447265625, -0.34326171875, -0.340576171875] + # bits (row-major): b45d b801 b261 35d5 329c 29ac 3256 b521 3319 2927 38be b41f b0d0 b112 b57e b573 +W[16] # source img binding 33, tap offset (+1, 0) + [-0.1253662109375, -0.334228515625, -0.10791015625, 0.1424560546875] + [0.2548828125, -0.2010498046875, -0.10833740234375, 0.0002961158752441406] + [-0.0928955078125, -0.19775390625, -0.43017578125, -0.12042236328125] + [0.008544921875, -0.1937255859375, -0.599609375, -0.2366943359375] + # bits (row-major): b003 b559 aee8 308f 3414 b26f aeef 0cda adf2 b254 b6e2 afb5 2060 b233 b8cc b393 +W[17] # source img binding 33, tap offset (+1,+1) + [0.031707763671875, -0.421630859375, 0.0123138427734375, 0.25634765625] + [-0.07183837890625, -0.159912109375, -0.4140625, -0.08355712890625] + [-0.70263671875, 0.0460205078125, -0.609375, 0.07635498046875] + [-0.351318359375, -0.2366943359375, -0.70458984375, -0.2005615234375] + # bits (row-major): 280f b6bf 224e 341a ac99 b11e b6a0 ad59 b99f 29e4 b8e0 2ce3 b59f b393 b9a3 b26b +mu = [-0.4873046875, 2.787109375, -0.5966796875, -1.41796875] # bits: b7cc 4193 b8c6 bdac +sigma = [0.53515625, 0.61474609375, 0.7158203125, 0.70166015625] # bits: 3848 38eb 39ba 399d +beta = [0.006866455078125, 0.01308441162109375, -0.00901031494140625, 0.14208984375] # bits: 1f08 22b3 a09d 308c +``` + +**Head B** (output binding 49), weight-set digest `a8978d885da7`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [-0.220703125, -0.81005859375, -0.26171875, -0.056427001953125] + [0.57177734375, -0.1534423828125, -0.094482421875, 0.66015625] + [-0.3681640625, 0.499755859375, -0.416015625, 0.179931640625] + [0.0709228515625, 0.36181640625, 0.42236328125, 0.003551483154296875] + # bits (row-major): b310 ba7b b430 ab39 3893 b0e9 ae0c 3948 b5e4 37ff b6a8 31c2 2c8a 35ca 36c2 1b46 +W[ 1] # source img binding 32, tap offset (-1, 0) + [-0.08636474609375, -0.55615234375, 0.020599365234375, 0.1441650390625] + [0.1453857421875, 0.005832672119140625, 0.1787109375, 0.28466796875] + [0.204345703125, 0.235595703125, -0.5732421875, 0.52294921875] + [0.2626953125, -0.2379150390625, 0.440185546875, 0.2159423828125] + # bits (row-major): ad87 b873 2546 309d 30a7 1df9 31b8 348e 328a 338a b896 382f 3434 b39d 370b 32e9 +W[ 2] # source img binding 32, tap offset (-1,+1) + [-0.006656646728515625, 0.006305694580078125, -0.492431640625, 0.044647216796875] + [0.43505859375, 0.1949462890625, -0.1473388671875, 0.376953125] + [0.313720703125, 0.0980224609375, -0.440673828125, 0.603515625] + [0.23291015625, -0.61767578125, 0.381103515625, 0.2054443359375] + # bits (row-major): 9ed1 1e75 b7e1 29b7 36f6 323d b0b7 3608 3505 2e46 b70d 38d4 3374 b8f1 3619 3293 +W[ 3] # source img binding 32, tap offset ( 0,-1) + [-0.047088623046875, -0.5224609375, 0.039947509765625, -0.01274871826171875] + [0.1754150390625, 0.14501953125, 0.07135009765625, 0.236083984375] + [0.1353759765625, 0.11407470703125, -0.427978515625, -0.482666015625] + [0.22705078125, -0.09442138671875, 0.19677734375, 0.368408203125] + # bits (row-major): aa07 b82e 291d a287 319d 30a4 2c91 338e 3055 2f4d b6d9 b7b9 3344 ae0b 324c 35e5 +W[ 4] # source img binding 32, tap offset ( 0, 0) + [0.1209716796875, -0.296142578125, 0.339599609375, 0.2283935546875] + [-0.155029296875, 0.043365478515625, 0.03692626953125, -0.47998046875] + [0.74365234375, 0.1336669921875, -0.7978515625, -0.54248046875] + [0.2144775390625, -0.430419921875, 0.140869140625, 0.2578125] + # bits (row-major): 2fbe b4bd 356f 334f b0f6 298d 28ba b7ae 39f3 3047 ba62 b857 32dd b6e3 3082 3420 +W[ 5] # source img binding 32, tap offset ( 0,+1) + [0.10205078125, 0.254150390625, -0.1319580078125, 0.139892578125] + [0.048980712890625, 0.1087646484375, 0.00722503662109375, -0.258056640625] + [0.066650390625, 0.20947265625, -0.444580078125, 0.419189453125] + [0.188720703125, -0.419677734375, 0.06549072265625, 0.16650390625] + # bits (row-major): 2e88 3411 b039 307a 2a45 2ef6 1f66 b421 2c44 32b4 b71d 36b5 320a b6b7 2c31 3154 +W[ 6] # source img binding 32, tap offset (+1,-1) + [-0.172607421875, -0.70654296875, 0.1053466796875, -0.09130859375] + [0.5234375, 0.0897216796875, 0.04266357421875, 0.38525390625] + [0.2276611328125, 0.055084228515625, -0.0628662109375, 0.1300048828125] + [0.048858642578125, -0.2919921875, 0.2861328125, 0.5068359375] + # bits (row-major): b186 b9a7 2ebe add8 3830 2dbe 2976 362a 3349 2b0d ac06 3029 2a41 b4ac 3494 380e +W[ 7] # source img binding 32, tap offset (+1, 0) + [-0.044189453125, -0.330322265625, 0.2294921875, 0.1163330078125] + [0.05706787109375, 0.122802734375, -0.03961181640625, -0.0295562744140625] + [-0.0172271728515625, -0.060699462890625, -0.0080718994140625, 0.318359375] + [0.10589599609375, -0.53271484375, 0.456787109375, 0.4140625] + # bits (row-major): a9a8 b549 3358 2f72 2b4e 2fdc a912 a791 a469 abc5 a022 3518 2ec7 b843 374f 36a0 +W[ 8] # source img binding 32, tap offset (+1,+1) + [-0.0194854736328125, 0.1683349609375, -0.2783203125, 0.0005078315734863281] + [0.2000732421875, 0.53955078125, -0.060302734375, 0.0682373046875] + [0.06854248046875, 0.168212890625, -0.2274169921875, 0.154052734375] + [0.681640625, -0.290771484375, 0.08673095703125, -0.5595703125] + # bits (row-major): a4fd 3163 b474 1029 3267 3851 abb8 2c5e 2c63 3162 b347 30ee 3974 b4a7 2d8d b87a +W[ 9] # source img binding 33, tap offset (-1,-1) + [-0.6181640625, -0.07366943359375, -0.255126953125, -0.031341552734375] + [-0.2177734375, -0.006687164306640625, -0.369873046875, 0.296630859375] + [-0.1622314453125, 0.2529296875, 0.345947265625, -0.1527099609375] + [0.52099609375, 0.367431640625, 0.401611328125, -0.1981201171875] + # bits (row-major): b8f2 acb7 b415 a803 b2f8 9ed9 b5eb 34bf b131 340c 3589 b0e3 382b 35e1 366d b257 +W[10] # source img binding 33, tap offset (-1, 0) + [-0.439208984375, 0.038848876953125, -0.4287109375, -0.29345703125] + [-0.10040283203125, 0.1751708984375, -0.0200042724609375, -0.2340087890625] + [-0.187744140625, 0.4228515625, -0.410888671875, -0.03662109375] + [0.2467041015625, 0.2763671875, -0.0172576904296875, 0.037353515625] + # bits (row-major): b707 28f9 b6dc b4b2 ae6d 319b a51f b37d b202 36c4 b693 a8b0 33e5 346c a46b 28c8 +W[11] # source img binding 33, tap offset (-1,+1) + [-0.564453125, -0.6181640625, -0.2587890625, -0.18408203125] + [0.13525390625, -0.288818359375, -0.037017822265625, 0.41162109375] + [0.039398193359375, 0.50634765625, -0.38671875, 0.188232421875] + [-0.06146240234375, 0.2095947265625, -0.155029296875, -0.02313232421875] + # bits (row-major): b884 b8f2 b424 b1e4 3054 b49f a8bd 3696 290b 380d b630 3206 abde 32b5 b0f6 a5ec +W[12] # source img binding 33, tap offset ( 0,-1) + [-0.6162109375, -0.1129150390625, -0.42431640625, -0.2049560546875] + [0.1739501953125, -0.0904541015625, -0.1514892578125, -0.1324462890625] + [-0.285400390625, -0.0135498046875, 0.267822265625, -0.1844482421875] + [0.452392578125, 0.251220703125, -0.0237884521484375, 0.2362060546875] + # bits (row-major): b8ee af3a b6ca b28f 3191 adca b0d9 b03d b491 a2f0 3449 b1e7 373d 3405 a617 338f +W[13] # source img binding 33, tap offset ( 0, 0) + [-0.55517578125, 0.07855224609375, -0.68505859375, -0.423828125] + [0.10235595703125, 0.1737060546875, 0.299560546875, -1.0546875] + [-0.146728515625, 0.03424072265625, -0.42822265625, 0.00934600830078125] + [0.1051025390625, 0.299072265625, -0.233642578125, 0.2384033203125] + # bits (row-major): b871 2d07 b97b b6c8 2e8d 318f 34cb bc38 b0b2 2862 b6da 20c9 2eba 34c9 b37a 33a1 +W[14] # source img binding 33, tap offset ( 0,+1) + [-0.82080078125, -0.50732421875, -0.455810546875, -0.289794921875] + [0.599609375, 0.0517578125, 0.37255859375, -0.59619140625] + [0.0482177734375, 0.07415771484375, -0.425048828125, 0.37109375] + [-0.114501953125, 0.2249755859375, -0.130859375, 0.10516357421875] + # bits (row-major): ba91 b80f b74b b4a3 38cc 2aa0 35f6 b8c5 2a2c 2cbf b6cd 35f0 af54 3333 b030 2ebb +W[15] # source img binding 33, tap offset (+1,-1) + [-0.4091796875, -0.416015625, -0.21044921875, -0.210205078125] + [0.697265625, -0.492431640625, -0.1427001953125, 0.33447265625] + [-0.4931640625, 0.0660400390625, -0.2117919921875, -0.11773681640625] + [0.404541015625, 0.279541015625, 0.058746337890625, 0.083740234375] + # bits (row-major): b68c b6a8 b2bc b2ba 3994 b7e1 b091 355a b7e4 2c3a b2c7 af89 3679 3479 2b85 2d5c +W[16] # source img binding 33, tap offset (+1, 0) + [-0.455078125, -0.181640625, -0.434326171875, -0.41259765625] + [0.492431640625, 0.169921875, 0.278564453125, -0.7939453125] + [-0.268310546875, -0.0380859375, -0.340087890625, 0.12396240234375] + [0.208740234375, 0.271728515625, 0.0003509521484375, 0.1641845703125] + # bits (row-major): b748 b1d0 b6f3 b69a 37e1 3170 3475 ba5a b44b a8e0 b571 2fef 32ae 3459 0dc0 3141 +W[17] # source img binding 33, tap offset (+1,+1) + [-0.9658203125, -0.73974609375, -0.35400390625, -0.302001953125] + [1.0869140625, 0.0595703125, 0.62841796875, -0.7021484375] + [0.055572509765625, 0.125, -0.144287109375, 0.2198486328125] + [0.134033203125, 0.26416015625, 0.1451416015625, -0.1793212890625] + # bits (row-major): bbba b9eb b5aa b4d5 3c59 2ba0 3907 b99e 2b1d 3000 b09e 3309 304a 343a 30a5 b1bd +mu = [-2.615234375, 1.2119140625, -0.13720703125, 2.935546875] # bits: c13b 3cd9 b064 41df +sigma = [0.68212890625, 0.5263671875, 0.5625, 0.755859375] # bits: 3975 3836 3880 3a0c +beta = [0.1959228515625, -0.496826171875, 0.28515625, 0.1214599609375] # bits: 3245 b7f3 3490 2fc6 +``` + +### shader_36 + +**Head A** (output binding 48), weight-set digest `9c137a15c27c`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [-0.36181640625, -0.4423828125, 0.314697265625, -0.253662109375] + [0.227783203125, -0.26806640625, 0.3857421875, 0.29150390625] + [0.096435546875, -0.073974609375, 0.15185546875, -0.1888427734375] + [-0.2381591796875, -0.102294921875, -0.04046630859375, -0.0096893310546875] + # bits (row-major): b5ca b714 3509 b40f 334a b44a 362c 34aa 2e2c acbc 30dc b20b b39f ae8c a92e a0f6 +W[ 1] # source img binding 32, tap offset (-1, 0) + [-0.053680419921875, -0.2587890625, -0.302490234375, -0.3720703125] + [0.2054443359375, -0.32666015625, -0.30859375, -0.12451171875] + [0.01476287841796875, -0.0631103515625, 0.10931396484375, -0.1748046875] + [-0.4443359375, -0.00974273681640625, -0.0980224609375, 0.14111328125] + # bits (row-major): aadf b424 b4d7 b5f4 3293 b53a b4f0 aff8 238f ac0a 2eff b198 b71c a0fd ae46 3084 +W[ 2] # source img binding 32, tap offset (-1,+1) + [0.525390625, 0.2393798828125, -0.355712890625, -0.2646484375] + [0.289794921875, -0.452880859375, -0.892578125, -0.56005859375] + [4.202127456665039e-05, -0.005626678466796875, 0.071044921875, -0.0197296142578125] + [-0.04736328125, 0.1015625, 0.1744384765625, 0.169921875] + # bits (row-major): 3834 33a9 b5b1 b43c 34a3 b73f bb24 b87b 02c1 9dc3 2c8c a50d aa10 2e80 3195 3170 +W[ 3] # source img binding 32, tap offset ( 0,-1) + [-0.495361328125, -0.260498046875, 0.39990234375, -0.1649169921875] + [0.138916015625, -0.445556640625, -0.0811767578125, -0.0697021484375] + [0.10260009765625, -0.1431884765625, 0.147216796875, -0.36328125] + [-0.4775390625, 0.077392578125, -0.09442138671875, 0.07720947265625] + # bits (row-major): b7ed b42b 3666 b147 3072 b721 ad32 ac76 2e91 b095 30b6 b5d0 b7a4 2cf4 ae0b 2cf1 +W[ 4] # source img binding 32, tap offset ( 0, 0) + [-0.2001953125, -0.1444091796875, -0.2392578125, -0.095458984375] + [0.166748046875, -0.420654296875, -0.49169921875, -0.29345703125] + [0.062225341796875, -0.13330078125, 0.09051513671875, -0.233154296875] + [-0.548828125, 0.265869140625, 0.218505859375, 0.42822265625] + # bits (row-major): b268 b09f b3a8 ae1c 3156 b6bb b7de b4b2 2bf7 b044 2dcb b376 b864 3441 32fe 36da +W[ 5] # source img binding 32, tap offset ( 0,+1) + [0.350830078125, 0.422119140625, -0.2091064453125, -0.1461181640625] + [0.208984375, -0.298583984375, -0.5810546875, -0.340576171875] + [0.05389404296875, 0.021820068359375, 0.019775390625, 0.0012655258178710938] + [-0.199951171875, 0.26708984375, 0.39013671875, 0.401123046875] + # bits (row-major): 359d 36c1 b2b1 b0ad 32b0 b4c7 b8a6 b573 2ae6 2596 2510 152f b266 3446 363e 366b +W[ 6] # source img binding 32, tap offset (+1,-1) + [-0.3232421875, -0.035858154296875, 0.0080108642578125, -0.286865234375] + [0.2568359375, -0.60400390625, -0.77099609375, -0.283203125] + [0.1295166015625, -0.03924560546875, 0.1728515625, -0.268310546875] + [-0.167236328125, 0.0718994140625, -0.0289764404296875, 0.0509033203125] + # bits (row-major): b52c a897 201a b497 341c b8d5 ba2b b488 3025 a906 3188 b44b b15a 2c9a a76b 2a84 +W[ 7] # source img binding 32, tap offset (+1, 0) + [-0.2315673828125, -0.01306915283203125, -0.1962890625, -0.10357666015625] + [0.179931640625, -0.57861328125, -0.67041015625, -0.49560546875] + [0.09320068359375, 0.06329345703125, 0.11993408203125, -0.062408447265625] + [-0.253662109375, 0.131103515625, 0.07281494140625, 0.34765625] + # bits (row-major): b369 a2b1 b248 aea1 31c2 b8a1 b95d b7ee 2df7 2c0d 2fad abfd b40f 3032 2ca9 3590 +W[ 8] # source img binding 32, tap offset (+1,+1) + [0.225830078125, 0.26806640625, 0.1688232421875, -0.1368408203125] + [0.247314453125, -0.432861328125, -0.172119140625, -0.33837890625] + [0.0863037109375, 0.145263671875, 0.09942626953125, 0.168212890625] + [-0.1395263671875, 0.15478515625, 0.0498046875, 0.343017578125] + # bits (row-major): 333a 344a 3167 b061 33ea b6ed b182 b56a 2d86 30a6 2e5d 3162 b077 30f4 2a60 357d +W[ 9] # source img binding 33, tap offset (-1,-1) + [0.1539306640625, 0.5830078125, -0.361083984375, -0.26025390625] + [0.13037109375, 0.80224609375, -0.308837890625, 0.10931396484375] + [0.05926513671875, -0.0411376953125, 0.1441650390625, 0.1431884765625] + [-0.2354736328125, 0.74853515625, -0.378662109375, -0.217529296875] + # bits (row-major): 30ed 38aa b5c7 b42a 302c 3a6b b4f1 2eff 2b96 a944 309d 3095 b389 39fd b60f b2f6 +W[10] # source img binding 33, tap offset (-1, 0) + [0.405029296875, 0.438232421875, 0.035552978515625, -0.1494140625] + [0.0872802734375, 0.364501953125, -0.316162109375, 0.251708984375] + [-0.1220703125, -0.01526641845703125, -0.044708251953125, 0.213623046875] + [-0.29931640625, 0.2374267578125, -0.37744140625, -0.60205078125] + # bits (row-major): 367b 3703 288d b0c8 2d96 35d5 b50f 3407 afd0 a3d1 a9b9 32d6 b4ca 3399 b60a b8d1 +W[11] # source img binding 33, tap offset (-1,+1) + [0.64306640625, 0.28662109375, 0.798828125, 0.10577392578125] + [0.1890869140625, 0.3984375, -0.448486328125, 0.07696533203125] + [-0.153076171875, -0.2044677734375, 0.06494140625, 0.220947265625] + [-0.1856689453125, 0.094482421875, -0.1343994140625, 0.08843994140625] + # bits (row-major): 3925 3496 3a64 2ec5 320d 3660 b72d 2ced b0e6 b28b 2c28 3312 b1f1 2e0c b04d 2da9 +W[12] # source img binding 33, tap offset ( 0,-1) + [-0.326904296875, 0.21484375, -0.2457275390625, -0.0004429817199707031] + [0.078369140625, 0.53564453125, -0.31689453125, 0.34765625] + [-0.01039886474609375, 0.0005259513854980469, 0.03497314453125, 0.1566162109375] + [-0.427978515625, 0.379150390625, -0.2359619140625, -0.544921875] + # bits (row-major): b53b 32e0 b3dd 8f42 2d04 3849 b512 3590 a153 104f 287a 3103 b6d9 3611 b38d b85c +W[13] # source img binding 33, tap offset ( 0, 0) + [-0.211669921875, 0.2244873046875, -0.0247039794921875, 0.0301361083984375] + [0.0189971923828125, 0.232421875, -0.219970703125, 0.45751953125] + [-0.08978271484375, -0.033966064453125, 0.005390167236328125, 0.271484375] + [-0.4755859375, 0.04473876953125, -0.0863037109375, -1.0078125] + # bits (row-major): b2c6 332f a653 27b7 24dd 3370 b30a 3752 adbf a859 1d85 3458 b79c 29ba ad86 bc08 +W[14] # source img binding 33, tap offset ( 0,+1) + [0.0290985107421875, 0.478515625, 0.34765625, 0.01065826416015625] + [0.07470703125, 0.26123046875, -0.386474609375, 0.1575927734375] + [-0.1424560546875, -0.240966796875, 0.1248779296875, 0.294677734375] + [-0.380859375, -0.059112548828125, 0.1202392578125, -0.03173828125] + # bits (row-major): 2773 37a8 3590 2175 2cc8 342e b62f 310b b08f b3b6 2ffe 34b7 b618 ab91 2fb2 a810 +W[15] # source img binding 33, tap offset (+1,-1) + [-0.4306640625, 0.339599609375, -0.218994140625, 0.11749267578125] + [0.12744140625, 0.67041015625, -0.320556640625, 0.32275390625] + [0.0258636474609375, -0.00478363037109375, 0.00719451904296875, 0.141357421875] + [-0.260009765625, 0.1326904296875, -0.14697265625, -0.167236328125] + # bits (row-major): b6e4 356f b302 2f85 3014 395d b521 352a 269f 9ce6 1f5e 3086 b429 303f b0b4 b15a +W[16] # source img binding 33, tap offset (+1, 0) + [-0.486083984375, 0.303466796875, -0.00411224365234375, 0.0987548828125] + [0.028839111328125, 0.580078125, -0.25341796875, 0.2578125] + [-0.01183319091796875, -0.039398193359375, 0.00568389892578125, 0.26171875] + [-0.374755859375, 0.00957489013671875, 0.0372314453125, -0.461669921875] + # bits (row-major): b7c7 34db 9c36 2e52 2762 38a4 b40e 3420 a20f a90b 1dd2 3430 b5ff 20e7 28c4 b763 +W[17] # source img binding 33, tap offset (+1,+1) + [-0.35302734375, 0.6806640625, 0.213134765625, 0.0178375244140625] + [0.0771484375, 0.391845703125, -0.337158203125, -0.056640625] + [-0.087158203125, -0.27734375, 0.0888671875, 0.297119140625] + [-0.250244140625, -0.227783203125, 0.1632080078125, 0.268310546875] + # bits (row-major): b5a6 3972 32d2 2491 2cf0 3645 b565 ab40 ad94 b470 2db0 34c1 b401 b34a 3139 344b +mu = [-0.7626953125, -1.9921875, 0.66162109375, -2.158203125] # bits: ba1a bff8 394b c051 +sigma = [0.46875, 0.3095703125, 0.1951904296875, 0.340087890625] # bits: 3780 34f4 323f 3571 +beta = [-0.40234375, -0.32275390625, -0.595703125, -0.1331787109375] # bits: b670 b52a b8c4 b043 +``` + +**Head B** (output binding 49), weight-set digest `8f560fc074f3`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [0.400146484375, -0.16015625, 0.053955078125, 0.09661865234375] + [-0.029510498046875, -0.09033203125, 0.08917236328125, 0.3212890625] + [-0.16064453125, 0.60205078125, 0.51953125, 0.56787109375] + [0.32958984375, -0.5625, -0.02374267578125, -0.15966796875] + # bits (row-major): 3667 b120 2ae8 2e2f a78e adc8 2db5 3524 b124 38d1 3828 388b 3546 b880 a614 b11c +W[ 1] # source img binding 32, tap offset (-1, 0) + [0.281982421875, -0.09661865234375, -0.15478515625, -0.0267333984375] + [0.005039215087890625, -0.1605224609375, -0.019378662109375, -0.1373291015625] + [-0.1024169921875, 0.1500244140625, 0.318603515625, 0.53173828125] + [0.1473388671875, -0.400634765625, -0.0665283203125, -0.1656494140625] + # bits (row-major): 3483 ae2f b0f4 a6d8 1d29 b123 a4f6 b065 ae8e 30cd 3519 3841 30b7 b669 ac42 b14d +W[ 2] # source img binding 32, tap offset (-1,+1) + [0.41845703125, 0.08880615234375, 0.001953125, 0.12890625] + [0.05706787109375, -0.1298828125, -0.379150390625, -0.494140625] + [-0.264892578125, -0.023590087890625, -0.2386474609375, 0.1087646484375] + [0.1363525390625, -0.1904296875, -0.04730224609375, -0.2138671875] + # bits (row-major): 36b2 2daf 1800 3020 2b4e b028 b611 b7e8 b43d a60a b3a3 2ef6 305d b218 aa0e b2d8 +W[ 3] # source img binding 32, tap offset ( 0,-1) + [0.37451171875, -0.117431640625, -0.1278076171875, 0.1094970703125] + [0.0360107421875, -0.16796875, -0.0096435546875, 0.1409912109375] + [-0.1739501953125, 0.3671875, 0.29345703125, 0.333740234375] + [0.1947021484375, -0.445556640625, -0.07415771484375, -0.183837890625] + # bits (row-major): 35fe af84 b017 2f02 289c b160 a0f0 3083 b191 35e0 34b2 3557 323b b721 acbf b1e2 +W[ 4] # source img binding 32, tap offset ( 0, 0) + [0.2044677734375, -0.07415771484375, -0.3212890625, -0.0736083984375] + [0.1318359375, -0.09307861328125, -0.197998046875, -0.04010009765625] + [-0.2462158203125, 0.10784912109375, -0.08416748046875, 0.347412109375] + [0.0313720703125, -0.1925048828125, -0.2066650390625, -0.060546875] + # bits (row-major): 328b acbf b524 acb6 3038 adf5 b256 a922 b3e1 2ee7 ad63 358f 2804 b229 b29d abc0 +W[ 5] # source img binding 32, tap offset ( 0,+1) + [0.34033203125, 0.10321044921875, -0.123046875, 0.06915283203125] + [0.10247802734375, -0.06829833984375, -0.12890625, -0.2349853515625] + [-0.537109375, 0.03692626953125, -0.050567626953125, -0.01806640625] + [0.016082763671875, -0.140625, -0.1846923828125, -0.17919921875] + # bits (row-major): 3572 2e9b afe0 2c6d 2e8f ac5f b020 b385 b84c 28ba aa79 a4a0 241e b080 b1e9 b1bc +W[ 6] # source img binding 32, tap offset (+1,-1) + [0.5537109375, 0.170654296875, -0.01422882080078125, 0.123291015625] + [0.1575927734375, -0.25390625, -0.53759765625, -0.043853759765625] + [-0.1715087890625, 0.006580352783203125, 0.049560546875, -0.02679443359375] + [0.30029296875, -0.423828125, -0.45068359375, -0.153564453125] + # bits (row-major): 386e 3176 a349 2fe4 310b b410 b84d a99d b17d 1ebd 2a58 a6dc 34ce b6c8 b736 b0ea +W[ 7] # source img binding 32, tap offset (+1, 0) + [0.3984375, 0.176025390625, -0.2156982421875, 0.04315185546875] + [0.11041259765625, -0.1829833984375, -0.36376953125, -0.298095703125] + [-0.453125, -0.150390625, -0.175537109375, 0.03131103515625] + [0.0771484375, -0.2412109375, -0.1802978515625, -0.1348876953125] + # bits (row-major): 3660 31a2 b2e7 2986 2f11 b1db b5d2 b4c5 b740 b0d0 b19e 2802 2cf0 b3b8 b1c5 b051 +W[ 8] # source img binding 32, tap offset (+1,+1) + [0.43798828125, 0.321044921875, -0.051849365234375, 0.1468505859375] + [0.1243896484375, -0.08966064453125, -0.01056671142578125, -0.373779296875] + [-0.85693359375, -0.3662109375, -0.267822265625, -0.2486572265625] + [0.0831298828125, -0.34765625, -0.21435546875, -0.2578125] + # bits (row-major): 3702 3523 aaa3 30b3 2ff6 adbd a169 b5fb badb b5dc b449 b3f5 2d52 b590 b2dc b420 +W[ 9] # source img binding 33, tap offset (-1,-1) + [0.5703125, 0.425048828125, 0.1324462890625, 0.11700439453125] + [0.39794921875, 0.8544921875, -0.267822265625, -0.5849609375] + [0.1878662109375, -0.384521484375, 0.433837890625, -0.2025146484375] + [0.490966796875, 0.869140625, -0.046112060546875, 0.0382080078125] + # bits (row-major): 3890 36cd 303d 2f7d 365e 3ad6 b449 b8ae 3203 b627 36f1 b27b 37db 3af4 a9e7 28e4 +W[10] # source img binding 33, tap offset (-1, 0) + [0.64794921875, 0.12322998046875, 0.10882568359375, -0.09625244140625] + [0.1832275390625, 0.427490234375, -0.415283203125, -0.2349853515625] + [0.1552734375, 0.195068359375, 0.181396484375, 0.03167724609375] + [0.401123046875, 0.4150390625, -0.077880859375, -0.349609375] + # bits (row-major): 392f 2fe3 2ef7 ae29 31dd 36d7 b6a5 b385 30f8 323e 31ce 280e 366b 36a4 acfc b598 +W[11] # source img binding 33, tap offset (-1,+1) + [0.6279296875, -0.1898193359375, 0.454345703125, 0.07647705078125] + [0.401611328125, 0.4990234375, -0.368896484375, -0.1019287109375] + [-0.07696533203125, 0.11572265625, -0.36572265625, -0.04754638671875] + [0.348876953125, 0.0748291015625, -0.00978851318359375, -0.2266845703125] + # bits (row-major): 3906 b213 3745 2ce5 366d 37fc b5e7 ae86 aced 2f68 b5da aa16 3595 2cca a103 b341 +W[12] # source img binding 33, tap offset ( 0,-1) + [0.63720703125, 0.283203125, -0.048614501953125, 0.06719970703125] + [0.3671875, 0.68798828125, -0.087890625, -0.295654296875] + [0.0260009765625, 0.004474639892578125, 0.347900390625, -0.169677734375] + [0.376708984375, 0.54541015625, -0.274658203125, -0.283203125] + # bits (row-major): 3919 3488 aa39 2c4d 35e0 3981 ada0 b4bb 26a8 1c95 3591 b16e 3607 385d b465 b488 +W[13] # source img binding 33, tap offset ( 0, 0) + [0.6396484375, 0.11199951171875, -0.088134765625, -0.1302490234375] + [0.2022705078125, 0.33642578125, -0.0141143798828125, 0.060302734375] + [0.01284027099609375, 0.4765625, 0.2139892578125, 0.05889892578125] + [0.33349609375, 0.09967041015625, -0.353271484375, -0.56201171875] + # bits (row-major): 391e 2f2b ada4 b02b 3279 3562 a33a 2bb8 2293 37a0 32d9 2b8a 3556 2e61 b5a7 b87f +W[14] # source img binding 33, tap offset ( 0,+1) + [0.56298828125, 0.0269012451171875, 0.2430419921875, -0.0225830078125] + [0.3974609375, 0.460205078125, -0.1517333984375, 0.06402587890625] + [-0.369140625, 0.69140625, -0.33740234375, -0.06268310546875] + [0.258056640625, -0.0582275390625, -0.26513671875, -0.40673828125] + # bits (row-major): 3881 26e3 33c7 a5c8 365c 375d b0db 2c19 b5e8 3988 b566 ac03 3421 ab74 b43e b682 +W[15] # source img binding 33, tap offset (+1,-1) + [0.57470703125, 0.1512451171875, -0.009552001953125, 0.25732421875] + [0.56103515625, 0.54833984375, -0.052093505859375, -0.0347900390625] + [-0.07098388671875, 0.332275390625, 0.08929443359375, -0.213134765625] + [0.46240234375, 0.313720703125, -0.053009033203125, -0.08404541015625] + # bits (row-major): 3899 30d7 a0e4 341e 387d 3863 aaab a874 ac8b 3551 2db7 b2d2 3766 3505 aac9 ad61 +W[16] # source img binding 33, tap offset (+1, 0) + [0.52880859375, 0.03717041015625, -0.06365966796875, 0.04913330078125] + [0.35498046875, 0.436279296875, -0.13671875, 0.00927734375] + [-0.2337646484375, 1.16015625, -0.0908203125, -0.20068359375] + [0.320556640625, -0.041259765625, -0.3828125, -0.4697265625] + # bits (row-major): 383b 28c2 ac13 2a4a 35ae 36fb b060 20c0 b37b 3ca4 add0 b26c 3521 a948 b620 b784 +W[17] # source img binding 33, tap offset (+1,+1) + [0.38525390625, 0.056243896484375, 0.265380859375, 0.1634521484375] + [0.59521484375, 0.73681640625, -0.27001953125, -0.017242431640625] + [-0.7490234375, 1.390625, -0.57177734375, -0.3837890625] + [0.257568359375, -0.095703125, -0.27099609375, -0.343994140625] + # bits (row-major): 362a 2b33 343f 313b 38c3 39e5 b452 a46a b9fe 3d90 b893 b624 341f ae20 b456 b581 +mu = [3.62109375, -0.384033203125, -0.74072265625, -1.4716796875] # bits: 433e b625 b9ed bde3 +sigma = [0.390625, 0.347900390625, 0.59716796875, 0.640625] # bits: 3640 3591 38c7 3920 +beta = [-0.016998291015625, -0.5546875, -0.058746337890625, 0.2216796875] # bits: a45a b870 ab85 3318 +``` + +### shader_37 + +**Head A** (output binding 48), weight-set digest `21a5e999a280`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [0.031768798828125, 0.218994140625, -0.04351806640625, 0.3349609375] + [0.29931640625, 0.2227783203125, -0.0765380859375, 0.378173828125] + [0.370361328125, 0.1922607421875, -0.10198974609375, 0.09588623046875] + [0.34521484375, 0.225830078125, -0.039337158203125, 0.227294921875] + # bits (row-major): 2811 3302 a992 355c 34ca 3321 ace6 360d 35ed 3227 ae87 2e23 3586 333a a909 3346 +W[ 1] # source img binding 32, tap offset (-1, 0) + [-0.09423828125, 0.120361328125, 0.034912109375, 0.26953125] + [0.132568359375, 0.343505859375, 0.0152587890625, 0.322265625] + [0.362548828125, 0.338134765625, 0.00994873046875, 0.263671875] + [0.314697265625, 0.0340576171875, 0.053009033203125, 0.205322265625] + # bits (row-major): ae08 2fb4 2878 3450 303e 357f 23d0 3528 35cd 3569 2118 3438 3509 285c 2ac9 3292 +W[ 2] # source img binding 32, tap offset (-1,+1) + [0.361572265625, -0.01293182373046875, 0.025726318359375, -0.009674072265625] + [0.52001953125, 0.034027099609375, -0.01100921630859375, -0.053863525390625] + [0.71435546875, -0.184814453125, 0.00807952880859375, -0.0758056640625] + [0.7900390625, -0.21044921875, 0.0645751953125, 0.08001708984375] + # bits (row-major): 35c9 a29f 2696 a0f4 3829 285b a1a3 aae5 39b7 b1ea 2023 acda 3a52 b2bc 2c22 2d1f +W[ 3] # source img binding 32, tap offset ( 0,-1) + [-0.1490478515625, 0.332275390625, -0.025909423828125, 0.259765625] + [0.2294921875, 0.34619140625, -0.0240325927734375, 0.4267578125] + [0.432373046875, 0.352294921875, -0.0296478271484375, 0.343017578125] + [0.21435546875, 0.361572265625, 0.0428466796875, 0.06201171875] + # bits (row-major): b0c5 3551 a6a2 3428 3358 358a a627 36d4 36eb 35a3 a797 357d 32dc 35c9 297c 2bf0 +W[ 4] # source img binding 32, tap offset ( 0, 0) + [-0.38427734375, 0.2274169921875, -0.0102081298828125, 0.2442626953125] + [-0.1480712890625, 0.366455078125, -0.0116729736328125, 0.266845703125] + [0.1036376953125, 0.417236328125, -0.01715087890625, 0.232177734375] + [0.07696533203125, 0.12457275390625, 0.10040283203125, 0.099609375] + # bits (row-major): b626 3347 a13a 33d1 b0bd 35dd a1fa 3445 2ea2 36ad a464 336e 2ced 2ff9 2e6d 2e60 +W[ 5] # source img binding 32, tap offset ( 0,+1) + [0.073974609375, 0.186767578125, -0.0249786376953125, 0.045257568359375] + [0.1383056640625, 0.125, -0.0611572265625, -0.01461029052734375] + [0.35400390625, -0.0299224853515625, -0.052001953125, -0.036285400390625] + [0.47705078125, -0.00571441650390625, 0.0494384765625, 0.1112060546875] + # bits (row-major): 2cbc 31fa a665 29cb 306d 3000 abd4 a37b 35aa a7a9 aaa8 a8a5 37a2 9dda 2a54 2f1e +W[ 6] # source img binding 32, tap offset (+1,-1) + [-0.1953125, 0.32177734375, -0.04852294921875, -0.05328369140625] + [0.04547119140625, 0.09027099609375, -0.03399658203125, -0.042877197265625] + [0.352294921875, 0.039794921875, -0.046661376953125, 0.077880859375] + [0.250244140625, 0.41845703125, 0.0277252197265625, -0.087646484375] + # bits (row-major): b240 3526 aa36 aad2 29d2 2dc7 a85a a97d 35a3 2918 a9f9 2cfc 3401 36b2 2719 ad9c +W[ 7] # source img binding 32, tap offset (+1, 0) + [-0.338134765625, 0.162109375, -0.045135498046875, 0.0916748046875] + [-0.30517578125, 0.169921875, -0.05096435546875, 0.0248565673828125] + [-0.0009732246398925781, 0.1842041015625, -0.048828125, 0.102783203125] + [0.1922607421875, 0.2349853515625, 0.093994140625, 0.185546875] + # bits (row-major): b569 3130 a9c7 2dde b4e2 3170 aa86 265d 93f9 31e5 aa40 2e94 3227 3385 2e04 31f0 +W[ 8] # source img binding 32, tap offset (+1,+1) + [0.1734619140625, 0.162841796875, -0.07763671875, -0.02850341796875] + [0.0013303756713867188, 0.051361083984375, -0.1112060546875, -0.060882568359375] + [0.1810302734375, -0.11297607421875, -0.08380126953125, 0.0758056640625] + [0.71435546875, 0.1190185546875, -0.01201629638671875, 0.289306640625] + # bits (row-major): 318d 3136 acf8 a74c 1573 2a93 af1e abcb 31cb af3b ad5d 2cda 39b7 2f9e a227 34a1 +W[ 9] # source img binding 33, tap offset (-1,-1) + [-0.11419677734375, 0.8046875, 0.0144805908203125, 0.430908203125] + [-0.224609375, 0.83154296875, 0.1024169921875, 0.30517578125] + [-0.294921875, 0.84716796875, 0.1510009765625, 0.1243896484375] + [-0.01526641845703125, 0.2861328125, -0.10986328125, 0.1986083984375] + # bits (row-major): af4f 3a70 236a 36e5 b330 3aa7 2e8e 34e2 b4b8 3ac7 30d5 2ff6 a3d1 3494 af08 325b +W[10] # source img binding 33, tap offset (-1, 0) + [-0.0099334716796875, 0.67822265625, 0.12078857421875, 0.19580078125] + [-0.0230560302734375, 0.9794921875, 0.28076171875, 0.052947998046875] + [-0.0565185546875, 1.0869140625, 0.1845703125, -0.12030029296875] + [-0.039398193359375, 0.1787109375, -0.217529296875, -0.0180511474609375] + # bits (row-major): a116 396d 2fbb 3244 a5e7 3bd6 347e 2ac7 ab3c 3c59 31e8 afb3 a90b 31b8 b2f6 a49f +W[11] # source img binding 33, tap offset (-1,+1) + [-0.07183837890625, 0.74267578125, -0.268310546875, 0.24560546875] + [0.036346435546875, 0.9326171875, 0.003948211669921875, 0.2763671875] + [0.0256805419921875, 0.8779296875, -0.195556640625, -0.114013671875] + [-0.0303497314453125, 0.1610107421875, -0.556640625, -0.139404296875] + # bits (row-major): ac99 39f1 b44b 33dc 28a7 3b76 1c0b 346c 2693 3b06 b242 af4c a7c5 3127 b874 b076 +W[12] # source img binding 33, tap offset ( 0,-1) + [-0.06207275390625, 0.92578125, 0.0247955322265625, 0.2440185546875] + [-0.09320068359375, 1.0302734375, -0.0198516845703125, 0.235595703125] + [-0.178955078125, 1.125, 0.0677490234375, 0.216552734375] + [-0.08746337890625, 0.30126953125, 0.05218505859375, 0.0084686279296875] + # bits (row-major): abf2 3b68 2659 33cf adf7 3c1f a515 338a b1ba 3c80 2c56 32ee ad99 34d2 2aae 2056 +W[13] # source img binding 33, tap offset ( 0, 0) + [0.042327880859375, 0.6201171875, 0.219482421875, -0.004039764404296875] + [0.08392333984375, 0.8115234375, 0.329833984375, -0.06817626953125] + [0.04931640625, 0.9267578125, 0.30078125, -0.0762939453125] + [-0.1767578125, 0.1475830078125, 0.17236328125, -0.1517333984375] + # bits (row-major): 296b 38f6 3306 9c23 2d5f 3a7e 3547 ac5d 2a50 3b6a 34d0 ace2 b1a8 30b9 3184 b0db +W[14] # source img binding 33, tap offset ( 0,+1) + [-0.067138671875, 0.6171875, -0.07269287109375, -0.0189361572265625] + [0.085205078125, 0.7236328125, 0.25732421875, 0.1820068359375] + [0.0948486328125, 0.71044921875, 0.13623046875, 0.016693115234375] + [-0.203369140625, 0.1373291015625, 0.0232086181640625, -0.13134765625] + # bits (row-major): ac4c 38f0 aca7 a4d9 2d74 39ca 341e 31d3 2e12 39af 305c 2446 b282 3065 25f1 b034 +W[15] # source img binding 33, tap offset (+1,-1) + [-0.05133056640625, 0.95068359375, -0.171630859375, 0.32568359375] + [-0.08135986328125, 1.041015625, -0.398681640625, 0.0275726318359375] + [-0.115234375, 1.083984375, -0.186279296875, 0.09033203125] + [-0.09033203125, 0.42626953125, 0.10479736328125, 0.09423828125] + # bits (row-major): aa92 3b9b b17e 3536 ad35 3c2a b661 270f af60 3c56 b1f6 2dc8 adc8 36d2 2eb5 2e08 +W[16] # source img binding 33, tap offset (+1, 0) + [-0.037261962890625, 0.61328125, 0.0198211669921875, 0.1507568359375] + [0.05035400390625, 0.85546875, 0.09063720703125, -0.09539794921875] + [0.07122802734375, 0.9580078125, 0.2193603515625, -0.091064453125] + [-0.22900390625, 0.250732421875, 0.384521484375, -0.021392822265625] + # bits (row-major): a8c5 38e8 2513 30d3 2a72 3ad8 2dcd ae1b 2c8f 3baa 3305 add4 b354 3403 3627 a57a +W[17] # source img binding 33, tap offset (+1,+1) + [-0.1368408203125, 0.771484375, -0.75, -0.302001953125] + [-0.002864837646484375, 0.91455078125, -0.365966796875, -0.0012912750244140625] + [0.111328125, 0.876953125, -0.16650390625, -0.0136260986328125] + [-0.2437744140625, 0.26611328125, -0.0270233154296875, -0.0863037109375] + # bits (row-major): b061 3a2c ba00 b4d5 99de 3b51 b5db 954a 2f20 3b04 b154 a2fa b3cd 3442 a6eb ad86 +mu = [0.95849609375, 1.4169921875, 1.1357421875, 0.2216796875] # bits: 3bab 3dab 3c8b 3318 +sigma = [0.88916015625, 0.677734375, 0.5751953125, 0.6015625] # bits: 3b1d 396c 389a 38d0 +beta = [-0.279541015625, -0.52197265625, -0.76904296875, -0.970703125] # bits: b479 b82d ba27 bbc4 +``` + +**Head B** (output binding 49), weight-set digest `ad2ba39f87a7`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [0.04193115234375, 0.34130859375, -0.055450439453125, -0.0087738037109375] + [0.1402587890625, 0.360107421875, -0.07586669921875, 0.1669921875] + [0.0174713134765625, 0.1395263671875, 0.060760498046875, -0.40625] + [-0.41162109375, -0.0091094970703125, 0.06451416015625, -1.0654296875] + # bits (row-major): 295e 3576 ab19 a07e 307d 35c3 acdb 3158 2479 3077 2bc7 b680 b696 a0aa 2c21 bc43 +W[ 1] # source img binding 32, tap offset (-1, 0) + [-0.029998779296875, 0.332275390625, -0.00501251220703125, 0.036651611328125] + [0.09259033203125, 0.40625, 0.007373809814453125, 0.2247314453125] + [-0.1392822265625, -0.0958251953125, 0.042938232421875, -1.0556640625] + [-0.363525390625, -0.214599609375, 0.09661865234375, -0.92431640625] + # bits (row-major): a7ae 3551 9d22 28b1 2ded 3680 1f8d 3331 b075 ae22 297f bc39 b5d1 b2de 2e2f bb65 +W[ 2] # source img binding 32, tap offset (-1,+1) + [0.310546875, -0.04107666015625, 0.00872039794921875, -0.2432861328125] + [0.509765625, -0.0202178955078125, -0.005756378173828125, -0.165283203125] + [-0.39599609375, -0.036773681640625, 0.077392578125, -1.02734375] + [-0.397705078125, -0.314697265625, 0.1029052734375, -0.0006108283996582031] + # bits (row-major): 34f8 a942 2077 b3c9 3814 a52d 9de5 b14a b656 a8b5 2cf4 bc1c b65d b509 2e96 9101 +W[ 3] # source img binding 32, tap offset ( 0,-1) + [0.007160186767578125, 0.4306640625, -0.029571533203125, 0.1727294921875] + [0.1524658203125, 0.443115234375, -0.025543212890625, 0.29833984375] + [0.044647216796875, 0.109375, 0.05938720703125, -1.1396484375] + [-0.480224609375, -0.032867431640625, 0.03216552734375, -0.4072265625] + # bits (row-major): 1f55 36e4 a792 3187 30e1 3717 a68a 34c6 29b7 2f00 2b9a bc8f b7af a835 281e b684 +W[ 4] # source img binding 32, tap offset ( 0, 0) + [-0.281982421875, 0.38916015625, -0.034332275390625, 0.09576416015625] + [-0.1590576171875, 0.440673828125, -0.0297393798828125, 0.1790771484375] + [-0.034393310546875, 0.0726318359375, 0.1162109375, -1.1708984375] + [-0.331787109375, -0.1407470703125, 0.1085205078125, 0.17919921875] + # bits (row-major): b483 363a a865 2e21 b117 370d a79d 31bb a867 2ca6 2f70 bcaf b54f b081 2ef2 31bc +W[ 5] # source img binding 32, tap offset ( 0,+1) + [-0.03509521484375, 0.1414794921875, -0.03973388671875, -0.0791015625] + [0.1397705078125, 0.1229248046875, -0.06195068359375, -0.07928466796875] + [-0.1458740234375, 0.20751953125, 0.1824951171875, -0.215576171875] + [-0.15234375, -0.2021484375, 0.1580810546875, 0.5322265625] + # bits (row-major): a87e 3087 a916 ad10 3079 2fde abee ad13 b0ab 32a4 31d7 b2e6 b0e0 b278 310f 3842 +W[ 6] # source img binding 32, tap offset (+1,-1) + [-0.087890625, 0.36767578125, -0.04156494140625, -0.088623046875] + [0.057769775390625, 0.281494140625, -0.052734375, -0.024627685546875] + [0.0731201171875, 0.031951904296875, 0.045440673828125, -1.291015625] + [-0.60595703125, -0.1611328125, 0.0020751953125, 0.0281524658203125] + # bits (row-major): ada0 35e2 a952 adac 2b65 3481 aac0 a64e 2cae 2817 29d1 bd2a b8d9 b128 1840 2735 +W[ 7] # source img binding 32, tap offset (+1, 0) + [-0.36669921875, 0.28515625, -0.054962158203125, 0.0295257568359375] + [-0.288330078125, 0.322021484375, -0.05633544921875, 0.0748291015625] + [0.09674072265625, 0.1260986328125, 0.1546630859375, -0.23046875] + [-0.474853515625, -0.19482421875, 0.0743408203125, 0.375244140625] + # bits (row-major): b5de 3490 ab09 278f b49d 3527 ab36 2cca 2e31 3009 30f3 b360 b799 b23c 2cc2 3601 +W[ 8] # source img binding 32, tap offset (+1,+1) + [-0.11676025390625, 0.1624755859375, -0.093505859375, 0.0239410400390625] + [0.03973388671875, 0.11187744140625, -0.10302734375, 0.024169921875] + [0.06597900390625, 0.2218017578125, 0.2481689453125, 0.55908203125] + [-0.282470703125, -0.15380859375, 0.11212158203125, 0.44873046875] + # bits (row-major): af79 3133 adfc 2621 2916 2f29 ae98 2630 2c39 3319 33f1 3879 b485 b0ec 2f2d 372e +W[ 9] # source img binding 33, tap offset (-1,-1) + [-0.12164306640625, 0.76708984375, -0.060089111328125, 0.357421875] + [-0.209716796875, 0.88720703125, 0.0157928466796875, 0.3896484375] + [0.2459716796875, -0.278564453125, 0.00835418701171875, -0.258056640625] + [0.414306640625, -0.365966796875, 0.2734375, 0.1126708984375] + # bits (row-major): afc9 3a23 abb1 35b8 b2b6 3b19 240b 363c 33df b475 2047 b421 36a1 b5db 3460 2f36 +W[10] # source img binding 33, tap offset (-1, 0) + [-0.01229095458984375, 0.828125, 0.05938720703125, 0.1693115234375] + [-0.0010957717895507812, 1.037109375, 0.1290283203125, 0.1776123046875] + [0.1802978515625, -0.18408203125, 0.1507568359375, -0.14599609375] + [0.29052734375, -0.1788330078125, 0.30126953125, 0.267822265625] + # bits (row-major): a24b 3aa0 2b9a 316b 947d 3c26 3021 31af 31c5 b1e4 30d3 b0ac 34a6 b1b9 34d2 3449 +W[11] # source img binding 33, tap offset (-1,+1) + [0.025238037109375, 0.78076171875, -0.271484375, 0.314208984375] + [0.042938232421875, 0.99267578125, -0.288330078125, 0.2464599609375] + [0.21337890625, -0.477783203125, 0.12255859375, -0.10479736328125] + [0.384521484375, -0.2398681640625, -0.9306640625, 0.175048828125] + # bits (row-major): 2676 3a3f b458 3507 297f 3bf1 b49d 33e3 32d4 b7a5 2fd8 aeb5 3627 b3ad bb72 319a +W[12] # source img binding 33, tap offset ( 0,-1) + [-0.1275634765625, 0.90234375, 0.011962890625, 0.35791015625] + [-0.1414794921875, 1.1357421875, 0.01294708251953125, 0.318359375] + [0.361572265625, -0.1595458984375, 0.304931640625, -0.195556640625] + [0.55029296875, -0.1907958984375, 0.32568359375, 0.11248779296875] + # bits (row-major): b015 3b38 2220 35ba b087 3c8b 22a1 3518 35c9 b11b 34e1 b242 3867 b21b 3536 2f33 +W[13] # source img binding 33, tap offset ( 0, 0) + [-0.02239990234375, 0.8193359375, 0.256103515625, 0.13232421875] + [0.04046630859375, 0.94921875, 0.323486328125, 0.01277923583984375] + [0.318115234375, 0.05450439453125, 0.2724609375, 0.07354736328125] + [0.411376953125, 0.048431396484375, 0.50439453125, 0.2337646484375] + # bits (row-major): a5bc 3a8e 3419 303c 292e 3b98 352d 228b 3517 2afa 345c 2cb5 3695 2a33 3809 337b +W[14] # source img binding 33, tap offset ( 0,+1) + [-0.0355224609375, 0.67138671875, 0.151123046875, 0.2626953125] + [0.05548095703125, 0.81787109375, 0.13720703125, 0.1773681640625] + [0.392578125, -0.195068359375, -0.311279296875, 0.1226806640625] + [0.61328125, -0.0033779144287109375, -0.67236328125, 0.18701171875] + # bits (row-major): a88c 395f 30d6 3434 2b1a 3a8b 3064 31ad 3648 b23e b4fb 2fda 38e8 9aeb b961 31fc +W[15] # source img binding 33, tap offset (+1,-1) + [-0.1544189453125, 0.86865234375, -0.173828125, 0.401123046875] + [-0.1220703125, 1.126953125, -0.1708984375, 0.37744140625] + [0.2474365234375, -0.364013671875, 0.301513671875, -0.09027099609375] + [0.43994140625, -0.38720703125, -0.63037109375, 0.08966064453125] + # bits (row-major): b0f1 3af3 b190 366b afd0 3c82 b178 360a 33eb b5d3 34d3 adc7 370a b632 b90b 2dbd +W[16] # source img binding 33, tap offset (+1, 0) + [-0.10211181640625, 0.72265625, 0.1861572265625, 0.352294921875] + [-0.03289794921875, 0.89404296875, 0.28466796875, 0.296630859375] + [0.307861328125, -0.0777587890625, -0.356689453125, 0.161865234375] + [0.348876953125, -0.10015869140625, -0.279541015625, 0.156982421875] + # bits (row-major): ae89 39c8 31f5 35a3 a836 3b27 348e 34bf 34ed acfa b5b5 312e 3595 ae69 b479 3106 +W[17] # source img binding 33, tap offset (+1,+1) + [-0.149169921875, 0.751953125, -0.1436767578125, 0.263916015625] + [-0.07647705078125, 0.95556640625, -0.204345703125, 0.243896484375] + [0.47998046875, -0.2078857421875, -1.205078125, 0.2388916015625] + [0.6611328125, -0.0828857421875, -0.93603515625, 0.222412109375] + # bits (row-major): b0c6 3a04 b099 3439 ace5 3ba5 b28a 33ce 37ae b2a7 bcd2 33a5 394a ad4e bb7d 331e +mu = [1.5166015625, 1.8359375, -0.67041015625, 0.5947265625] # bits: 3e11 3f58 b95d 38c2 +sigma = [0.7255859375, 0.59521484375, 0.4306640625, 0.677734375] # bits: 39ce 38c3 36e4 396c +beta = [-0.2607421875, -0.416259765625, 0.4873046875, 0.1953125] # bits: b42c b6a9 37cc 3240 +``` + +### shader_50 + +**Head A** (output binding 48), weight-set digest `b44203cfa357`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [0.0445556640625, -0.039581298828125, -0.0237579345703125, -0.1734619140625] + [0.10589599609375, 0.25, 0.0838623046875, 0.35986328125] + [-0.03924560546875, -0.01126861572265625, -0.125244140625, 0.16943359375] + [-0.00684356689453125, 0.1856689453125, -0.173828125, -0.0361328125] + # bits (row-major): 29b4 a911 a615 b18d 2ec7 3400 2d5e 35c2 a906 a1c5 b002 316c 9f02 31f1 b190 a8a0 +W[ 1] # source img binding 32, tap offset (-1, 0) + [0.01448822021484375, -0.0728759765625, -0.006305694580078125, -0.1282958984375] + [0.1649169921875, 0.113037109375, 0.1517333984375, 0.2242431640625] + [-0.028839111328125, -0.0237884521484375, -0.1456298828125, 0.103515625] + [0.0295867919921875, 0.20361328125, -0.1544189453125, 0.06329345703125] + # bits (row-major): 236b acaa 9e75 b01b 3147 2f3c 30db 332d a762 a617 b0a9 2ea0 2793 3284 b0f1 2c0d +W[ 2] # source img binding 32, tap offset (-1,+1) + [0.048004150390625, -0.124267578125, 0.04058837890625, -0.18359375] + [0.2371826171875, 0.240478515625, 0.12371826171875, 0.21533203125] + [-0.01445770263671875, 0.003936767578125, -0.294677734375, 0.27685546875] + [-0.01377105712890625, 0.1319580078125, -0.177490234375, -0.08819580078125] + # bits (row-major): 2a25 aff4 2932 b1e0 3397 33b2 2feb 32e4 a367 1c08 b4b7 346e a30d 3039 b1ae ada5 +W[ 3] # source img binding 32, tap offset ( 0,-1) + [0.0518798828125, -0.08648681640625, -0.0166168212890625, -0.2044677734375] + [0.0672607421875, 0.2001953125, 0.0826416015625, 0.208740234375] + [0.034942626953125, -0.06268310546875, -0.135009765625, 0.120361328125] + [0.08856201171875, 0.04705810546875, 0.07086181640625, -0.1300048828125] + # bits (row-major): 2aa4 ad89 a441 b28b 2c4e 3268 2d4a 32ae 2879 ac03 b052 2fb4 2dab 2a06 2c89 b029 +W[ 4] # source img binding 32, tap offset ( 0, 0) + [0.02960205078125, -0.05206298828125, 0.00505828857421875, -0.0936279296875] + [0.025421142578125, 0.122314453125, -0.03155517578125, 0.218017578125] + [0.07391357421875, -0.0088348388671875, -0.175048828125, 0.030975341796875] + [0.2125244140625, -0.1220703125, 0.219482421875, -0.2366943359375] + # bits (row-major): 2794 aaaa 1d2e adfe 2682 2fd4 a80a 32fa 2cbb a086 b19a 27ee 32cd afd0 3306 b393 +W[ 5] # source img binding 32, tap offset ( 0,+1) + [0.0474853515625, -0.1502685546875, 0.04718017578125, -0.1500244140625] + [0.155517578125, 0.08734130859375, 0.06695556640625, 0.0889892578125] + [0.01934814453125, 0.03326416015625, -0.244140625, 0.1483154296875] + [0.1048583984375, -0.02191162109375, 0.0215301513671875, -0.193359375] + # bits (row-major): 2a14 b0cf 2a0a b0cd 30fa 2d97 2c49 2db2 24f4 2842 b3d0 30bf 2eb6 a59c 2583 b230 +W[ 6] # source img binding 32, tap offset (+1,-1) + [0.0306243896484375, -0.05902099609375, -0.077392578125, -0.1861572265625] + [0.08843994140625, 0.339111328125, 0.051666259765625, 0.19140625] + [0.10638427734375, -0.141845703125, -0.283447265625, 0.186279296875] + [0.019561767578125, -0.09210205078125, 0.134765625, -0.355224609375] + # bits (row-major): 27d7 ab8e acf4 b1f5 2da9 356d 2a9d 3220 2ecf b08a b489 31f6 2502 ade5 3050 b5af +W[ 7] # source img binding 32, tap offset (+1, 0) + [0.018402099609375, -0.1123046875, -0.012969970703125, -0.151123046875] + [0.034912109375, 0.06927490234375, 0.168212890625, -0.070556640625] + [0.1435546875, -0.1339111328125, -0.2139892578125, 0.09039306640625] + [0.1287841796875, -0.31982421875, 0.336181640625, -0.61767578125] + # bits (row-major): 24b6 af30 a2a4 b0d6 2878 2c6f 3162 ac84 3098 b049 b2d9 2dc9 301f b51e 3561 b8f1 +W[ 8] # source img binding 32, tap offset (+1,+1) + [0.0272216796875, -0.11505126953125, 0.015350341796875, -0.172607421875] + [0.106689453125, 0.1982421875, 0.009613037109375, 0.126708984375] + [0.07763671875, -0.0160064697265625, -0.26708984375, 0.2178955078125] + [0.056243896484375, -0.2174072265625, 0.10650634765625, -0.46533203125] + # bits (row-major): 26f8 af5d 23dc b186 2ed4 3258 20ec 300e 2cf8 a419 b446 32f9 2b33 b2f5 2ed1 b772 +W[ 9] # source img binding 33, tap offset (-1,-1) + [-0.42724609375, 0.283203125, 0.056488037109375, -0.254150390625] + [0.1741943359375, 0.1275634765625, 0.1082763671875, 0.183349609375] + [-0.1195068359375, -0.135009765625, 0.01486968994140625, -0.2447509765625] + [-0.0211944580078125, 0.25244140625, -0.098876953125, -0.1292724609375] + # bits (row-major): b6d6 3488 2b3b b411 3193 3015 2eee 31de afa6 b052 239d b3d5 a56d 340a ae54 b023 +W[10] # source img binding 33, tap offset (-1, 0) + [-0.325927734375, 0.1856689453125, 0.06927490234375, -0.1234130859375] + [-0.0022296905517578125, 0.1778564453125, 0.08392333984375, 0.20068359375] + [-0.312255859375, -0.1593017578125, 0.04132080078125, -0.28759765625] + [0.03399658203125, 0.174072265625, -0.06158447265625, -0.07501220703125] + # bits (row-major): b537 31f1 2c6f afe6 9891 31b1 2d5f 326c b4ff b119 294a b49a 285a 3192 abe2 accd +W[11] # source img binding 33, tap offset (-1,+1) + [-0.25927734375, 0.258544921875, 0.032470703125, -0.12481689453125] + [0.023040771484375, 0.64892578125, 0.05126953125, 0.1683349609375] + [-0.445556640625, -0.037384033203125, 0.07012939453125, -0.55419921875] + [-0.055633544921875, 0.2435302734375, -0.12200927734375, -0.1385498046875] + # bits (row-major): b426 3423 2828 affd 25e6 3931 2a90 3163 b721 a8c9 2c7d b86f ab1f 33cb afcf b06f +W[12] # source img binding 33, tap offset ( 0,-1) + [-0.3447265625, 0.276123046875, 0.03656005859375, -0.2073974609375] + [0.12890625, 0.30859375, 0.07513427734375, 0.1536865234375] + [-0.034393310546875, -0.071044921875, -0.0278778076171875, -0.270751953125] + [-0.0267333984375, 0.06756591796875, 0.054901123046875, 0.009002685546875] + # bits (row-major): b584 346b 28ae b2a3 3020 34f0 2ccf 30eb a867 ac8c a723 b455 a6d8 2c53 2b07 209c +W[13] # source img binding 33, tap offset ( 0, 0) + [-0.2159423828125, 0.15478515625, 0.056732177734375, -0.10699462890625] + [0.006282806396484375, 0.398681640625, 0.080322265625, -0.0020847320556640625] + [-0.2203369140625, -0.06280517578125, -0.001598358154296875, -0.357421875] + [-0.1063232421875, -0.1773681640625, 0.1488037109375, 0.08355712890625] + # bits (row-major): b2e9 30f4 2b43 aed9 1e6f 3661 2d24 9845 b30d ac05 968c b5b8 aece b1ad 30c3 2d59 +W[14] # source img binding 33, tap offset ( 0,+1) + [-0.177734375, 0.14501953125, 0.08026123046875, -0.03521728515625] + [-0.1170654296875, 0.5400390625, 0.03570556640625, 0.1392822265625] + [-0.402587890625, -0.01053619384765625, 0.0499267578125, -0.54248046875] + [-0.04705810546875, 0.0258331298828125, -0.01219940185546875, -0.01383209228515625] + # bits (row-major): b1b0 30a4 2d23 a882 af7e 3852 2892 3075 b671 a165 2a64 b857 aa06 269d a23f a315 +W[15] # source img binding 33, tap offset (+1,-1) + [-0.40966796875, 0.380126953125, 0.045257568359375, -0.280029296875] + [0.1739501953125, 0.6962890625, 0.042938232421875, 0.0836181640625] + [-0.264892578125, 0.01126861572265625, -0.042510986328125, -0.6015625] + [-0.127685546875, -0.03924560546875, -0.01090240478515625, 0.0625] + # bits (row-major): b68e 3615 29cb b47b 3191 3992 297f 2d5a b43d 21c5 a971 b8d0 b016 a906 a195 2c00 +W[16] # source img binding 33, tap offset (+1, 0) + [-0.2310791015625, 0.1630859375, 0.052276611328125, -0.103271484375] + [-0.11279296875, 0.533203125, 0.11676025390625, 0.029266357421875] + [-0.39794921875, -0.01529693603515625, -0.03570556640625, -0.5390625] + [-0.1624755859375, -0.291015625, 0.10546875, 0.1588134765625] + # bits (row-major): b365 3138 2ab1 ae9c af38 3844 2f79 277e b65e a3d5 a892 b850 b133 b4a8 2ec0 3115 +W[17] # source img binding 33, tap offset (+1,+1) + [-0.1351318359375, 0.170166015625, 0.0838623046875, -0.0863037109375] + [-0.094970703125, 0.5703125, 0.10162353515625, -0.01078033447265625] + [-0.4833984375, 0.07891845703125, 0.024200439453125, -0.63916015625] + [-0.16162109375, -0.097412109375, -0.03497314453125, 0.007030487060546875] + # bits (row-major): b053 3172 2d5e ad86 ae14 3890 2e81 a185 b7bc 2d0d 2632 b91d b12c ae3c a87a 1f33 +mu = [-0.89013671875, 4.3671875, -2.875, -0.66015625] # bits: bb1f 445e c1c0 b948 +sigma = [0.54248046875, 0.45654296875, 0.368408203125, 0.82421875] # bits: 3857 374e 35e5 3a98 +beta = [-0.410888671875, -0.12939453125, -0.297607421875, 0.08770751953125] # bits: b693 b024 b4c3 2d9d +``` + +**Head B** (output binding 49), weight-set digest `45a437fce293`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [0.260498046875, 0.044464111328125, 0.06884765625, -0.0335693359375] + [0.0439453125, 0.00856781005859375, 0.032318115234375, 0.262939453125] + [-0.483154296875, 0.293212890625, -0.359375, -0.0665283203125] + [-0.1368408203125, -0.3212890625, 0.2183837890625, -0.50537109375] + # bits (row-major): 342b 29b1 2c68 a84c 29a0 2063 2823 3435 b7bb 34b1 b5c0 ac42 b061 b524 32fd b80b +W[ 1] # source img binding 32, tap offset (-1, 0) + [0.145751953125, 0.205322265625, 0.223876953125, -0.08837890625] + [-0.00016796588897705078, -0.00821685791015625, 0.1575927734375, 0.0022220611572265625] + [-0.260009765625, 0.140869140625, -0.02374267578125, -0.147216796875] + [0.0703125, 0.07635498046875, 0.09466552734375, -0.1937255859375] + # bits (row-major): 30aa 3292 332a ada8 8981 a035 310b 188d b429 3082 a614 b0b6 2c80 2ce3 2e0f b233 +W[ 2] # source img binding 32, tap offset (-1,+1) + [0.0513916015625, 0.10546875, 0.273681640625, -0.28515625] + [0.2005615234375, 0.0777587890625, 0.06689453125, 0.19580078125] + [-0.6220703125, 0.34814453125, -0.2437744140625, -0.14404296875] + [0.0308837890625, -0.1400146484375, 0.186767578125, -0.292236328125] + # bits (row-major): 2a94 2ec0 3461 b490 326b 2cfa 2c48 3244 b8fa 3592 b3cd b09c 27e8 b07b 31fa b4ad +W[ 3] # source img binding 32, tap offset ( 0,-1) + [-0.08843994140625, -0.1654052734375, -0.18505859375, 0.41845703125] + [-0.1302490234375, 0.047454833984375, 0.11053466796875, 0.040496826171875] + [-0.314697265625, 0.1156005859375, -0.0855712890625, -0.0196533203125] + [0.043853759765625, -0.0070343017578125, 0.136962890625, -0.1470947265625] + # bits (row-major): ada9 b14b b1ec 36b2 b02b 2a13 2f13 292f b509 2f66 ad7a a508 299d 9f34 3062 b0b5 +W[ 4] # source img binding 32, tap offset ( 0, 0) + [0.1351318359375, -0.12939453125, -0.08740234375, 0.279052734375] + [-0.2646484375, 0.1348876953125, -0.03472900390625, 0.10443115234375] + [-0.064208984375, 0.018463134765625, -0.047882080078125, 0.0321044921875] + [0.09112548828125, 0.311767578125, 0.0555419921875, 0.003570556640625] + # bits (row-major): 3053 b024 ad98 3477 b43c 3051 a872 2eaf ac1c 24ba aa21 281c 2dd5 34fd 2b1c 1b50 +W[ 5] # source img binding 32, tap offset ( 0,+1) + [0.11798095703125, -0.0036449432373046875, 0.255126953125, -0.231201171875] + [-0.031585693359375, 0.02557373046875, 0.0889892578125, 0.09027099609375] + [-0.352783203125, 0.10089111328125, -0.037689208984375, -0.09173583984375] + [0.1182861328125, 0.1632080078125, 0.049041748046875, -0.076416015625] + # bits (row-major): 2f8d 9b77 3415 b366 a80b 268c 2db2 2dc7 b5a5 2e75 a8d3 addf 2f92 3139 2a47 ace4 +W[ 6] # source img binding 32, tap offset (+1,-1) + [-0.022857666015625, 0.2225341796875, 0.21435546875, -0.02874755859375] + [0.05010986328125, 0.0262451171875, 0.0888671875, 0.2159423828125] + [-0.61669921875, 0.357177734375, -0.452880859375, -0.031585693359375] + [0.007503509521484375, -0.141845703125, -0.0245361328125, -0.1490478515625] + # bits (row-major): a5da 331f 32dc a75c 2a6a 26b8 2db0 32e9 b8ef 35b7 b73f a80b 1faf b08a a648 b0c5 +W[ 7] # source img binding 32, tap offset (+1, 0) + [-0.0103607177734375, 0.10919189453125, 0.08819580078125, 0.07305908203125] + [-0.04632568359375, -0.04608154296875, 0.1837158203125, -0.034149169921875] + [-0.40185546875, 0.0733642578125, -0.12298583984375, -0.09063720703125] + [-0.008270263671875, 0.355224609375, -0.1177978515625, 0.09228515625] + # bits (row-major): a14e 2efd 2da5 2cad a9ee a9e6 31e1 a85f b66e 2cb2 afdf adcd a03c 35af af8a 2de8 +W[ 8] # source img binding 32, tap offset (+1,+1) + [0.1553955078125, 0.005428314208984375, 0.224609375, -0.1815185546875] + [0.0728759765625, -0.00855255126953125, 0.07958984375, 0.1875] + [-0.5380859375, 0.230712890625, -0.30126953125, -0.074462890625] + [-0.057220458984375, 0.2230224609375, -0.1328125, 0.003757476806640625] + # bits (row-major): 30f9 1d8f 3330 b1cf 2caa a061 2d18 3200 b84e 3362 b4d2 acc4 ab53 3323 b040 1bb2 +W[ 9] # source img binding 33, tap offset (-1,-1) + [-0.09857177734375, -0.045928955078125, -0.0343017578125, 0.1358642578125] + [0.0092010498046875, 0.03729248046875, -0.78759765625, -0.171875] + [0.02874755859375, 0.01049041748046875, 0.1075439453125, -0.1583251953125] + [-0.10516357421875, -0.40380859375, -0.0213165283203125, 0.24609375] + # bits (row-major): ae4f a9e1 a864 3059 20b6 28c6 ba4d b180 275c 215f 2ee2 b111 aebb b676 a575 33e0 +W[10] # source img binding 33, tap offset (-1, 0) + [-0.002887725830078125, -0.046875, -0.027191162109375, 0.01222991943359375] + [0.007717132568359375, 0.0103912353515625, -0.37255859375, -0.08135986328125] + [0.04534912109375, -0.047210693359375, 0.0274505615234375, 0.0031223297119140625] + [-0.2152099609375, -0.08203125, -0.05450439453125, 0.1578369140625] + # bits (row-major): 99ea aa00 a6f6 2243 1fe7 2152 b5f6 ad35 29ce aa0b 2707 1a65 b2e3 ad40 aafa 310d +W[11] # source img binding 33, tap offset (-1,+1) + [-0.10791015625, -0.15625, 0.1715087890625, 0.0499267578125] + [-0.0145416259765625, 0.14453125, -0.82470703125, -0.25634765625] + [-0.03155517578125, 0.0806884765625, 0.1497802734375, -0.1148681640625] + [-0.48779296875, -0.1502685546875, 0.0182647705078125, 0.04266357421875] + # bits (row-major): aee8 b100 317d 2a64 a372 30a0 ba99 b41a a80a 2d2a 30cb af5a b7ce b0cf 24ad 2976 +W[12] # source img binding 33, tap offset ( 0,-1) + [-0.47119140625, -0.049560546875, 0.22021484375, -0.033416748046875] + [0.173583984375, -0.025909423828125, -0.49609375, -0.031463623046875] + [0.0947265625, -0.02093505859375, -0.01337432861328125, 0.0209808349609375] + [0.0484619140625, -0.0714111328125, 0.014801025390625, 0.09722900390625] + # bits (row-major): b78a aa58 330c a847 318e a6a2 b7f0 a807 2e10 a55c a2d9 255f 2a34 ac92 2394 2e39 +W[13] # source img binding 33, tap offset ( 0, 0) + [-0.4287109375, -0.0228729248046875, -0.118896484375, -0.062042236328125] + [0.2186279296875, 0.00720977783203125, -0.025299072265625, -0.06890869140625] + [0.1734619140625, 0.032684326171875, -0.12646484375, -0.012115478515625] + [-0.0179901123046875, 0.187255859375, 0.03643798828125, 0.040618896484375] + # bits (row-major): b6dc a5db af9c abf1 32ff 1f62 a67a ac69 318d 282f b00c a234 a49b 31fe 28aa 2933 +W[14] # source img binding 33, tap offset ( 0,+1) + [-0.111328125, -0.11602783203125, 0.0152587890625, 0.0115814208984375] + [0.031951904296875, 0.02215576171875, -0.4384765625, -0.022216796875] + [0.056182861328125, 0.0203857421875, -0.000518798828125, -0.08416748046875] + [-0.27001953125, 0.1322021484375, 0.042572021484375, 0.0289459228515625] + # bits (row-major): af20 af6d 23d0 21ee 2817 25ac b704 a5b0 2b31 2538 9040 ad63 b452 303b 2973 2769 +W[15] # source img binding 33, tap offset (+1,-1) + [-0.170166015625, -0.1033935546875, 0.10772705078125, -0.07379150390625] + [0.08636474609375, 0.243408203125, -1.0498046875, -0.0888671875] + [-0.04095458984375, 0.0482177734375, 0.1453857421875, -0.289794921875] + [-0.09552001953125, -0.09442138671875, -0.14453125, -0.0791015625] + # bits (row-major): b172 ae9e 2ee5 acb9 2d87 33ca bc33 adb0 a93e 2a2c 30a7 b4a3 ae1d ae0b b0a0 ad10 +W[16] # source img binding 33, tap offset (+1, 0) + [-0.2069091796875, -0.044097900390625, 0.06903076171875, 0.0182037353515625] + [0.136962890625, 0.01430511474609375, -0.5068359375, -0.02777099609375] + [-0.0154266357421875, 0.0299072265625, 0.018798828125, -0.07000732421875] + [-0.0022449493408203125, 0.324951171875, -0.1400146484375, -0.107177734375] + # bits (row-major): b29f a9a5 2c6b 24a9 3062 2353 b80e a71c a3e6 27a8 24d0 ac7b 9899 3533 b07b aedc +W[17] # source img binding 33, tap offset (+1,+1) + [-0.14013671875, -0.15380859375, 0.09539794921875, 0.138916015625] + [0.017822265625, 0.17333984375, -0.8642578125, -0.11248779296875] + [-0.10052490234375, 0.0362548828125, 0.1279296875, -0.172607421875] + [-0.3115234375, 0.295654296875, -0.1396484375, -0.21142578125] + # bits (row-major): b07c b0ec 2e1b 3072 2490 318c baea af33 ae6f 28a4 3018 b186 b4fc 34bb b078 b2c4 +mu = [0.1737060546875, -1.3681640625, -1.31640625, -0.40283203125] # bits: 318f bd79 bd44 b672 +sigma = [0.92138671875, 0.479248046875, 0.51025390625, 0.463134765625] # bits: 3b5f 37ab 3815 3769 +beta = [0.284423828125, -0.377685546875, -0.340576171875, 0.375732421875] # bits: 348d b60b b573 3603 +``` + +### shader_51 + +**Head A** (output binding 48), weight-set digest `0e1191b8ab87`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [0.552734375, 0.0667724609375, 0.2232666015625, 0.108642578125] + [0.2076416015625, 0.248291015625, 0.275146484375, 0.1475830078125] + [-0.2183837890625, -0.2529296875, -0.16845703125, -0.06005859375] + [0.07293701171875, -0.06024169921875, -0.004184722900390625, 0.08770751953125] + # bits (row-major): 386c 2c46 3325 2ef4 32a5 33f2 3467 30b9 b2fd b40c b164 abb0 2cab abb6 9c49 2d9d +W[ 1] # source img binding 32, tap offset (-1, 0) + [0.081787109375, -0.0312347412109375, 0.0255584716796875, 0.09014892578125] + [0.00266265869140625, 0.20751953125, 0.164794921875, 0.261962890625] + [0.0260772705078125, -0.1669921875, 0.0677490234375, -0.0103912353515625] + [-0.07666015625, 0.0160064697265625, -0.0972900390625, 0.19189453125] + # bits (row-major): 2d3c a7ff 268b 2dc5 1974 32a4 3146 3431 26ad b158 2c56 a152 ace8 2419 ae3a 3224 +W[ 2] # source img binding 32, tap offset (-1,+1) + [0.291748046875, 0.171142578125, 0.330322265625, 0.0887451171875] + [-0.07562255859375, 0.292724609375, 0.303955078125, -0.10504150390625] + [-0.054718017578125, -0.2841796875, -0.052001953125, 0.0021877288818359375] + [-0.0994873046875, 0.09027099609375, -0.036834716796875, 0.1695556640625] + # bits (row-major): 34ab 317a 3549 2dae acd7 34af 34dd aeb9 ab01 b48c aaa8 187b ae5e 2dc7 a8b7 316d +W[ 3] # source img binding 32, tap offset ( 0,-1) + [0.2069091796875, -0.0309295654296875, -0.040008544921875, 0.08648681640625] + [0.09228515625, 0.2432861328125, 0.23828125, -0.051727294921875] + [-0.092529296875, -0.10284423828125, -0.11346435546875, -0.068359375] + [0.057220458984375, -0.1761474609375, -0.0589599609375, -0.241943359375] + # bits (row-major): 329f a7eb a91f 2d89 2de8 33c9 33a0 aa9f adec ae95 af43 ac60 2b53 b1a3 ab8c b3be +W[ 4] # source img binding 32, tap offset ( 0, 0) + [-0.240478515625, -0.12158203125, -0.2120361328125, 0.0770263671875] + [-0.08636474609375, 0.159423828125, 0.1595458984375, 0.2132568359375] + [0.1285400390625, 0.05303955078125, 0.124755859375, -0.167724609375] + [-0.0386962890625, 0.2142333984375, -0.09063720703125, -0.07977294921875] + # bits (row-major): b3b2 afc8 b2c9 2cee ad87 311a 311b 32d3 301d 2aca 2ffc b15e a8f4 32db adcd ad1b +W[ 5] # source img binding 32, tap offset ( 0,+1) + [-0.016387939453125, 0.065673828125, 0.135986328125, 0.10601806640625] + [-0.14404296875, 0.237060546875, 0.340087890625, -0.059326171875] + [0.0294647216796875, -0.08563232421875, -0.08294677734375, -0.1986083984375] + [-0.1072998046875, -0.07659912109375, -0.040771484375, -0.0880126953125] + # bits (row-major): a432 2c34 305a 2ec9 b09c 3396 3571 ab98 278b ad7b ad4f b25b aede ace7 a938 ada2 +W[ 6] # source img binding 32, tap offset (+1,-1) + [0.52783203125, 0.1976318359375, 0.33642578125, 0.0077972412109375] + [0.0258026123046875, 0.31201171875, 0.273193359375, -0.6142578125] + [-0.6416015625, -0.352783203125, -0.54248046875, 0.13525390625] + [0.145751953125, 0.1015625, 0.045196533203125, -0.03924560546875] + # bits (row-major): 3839 3253 3562 1ffc 269b 34fe 345f b8ea b922 b5a5 b857 3054 30aa 2e80 29c9 a906 +W[ 7] # source img binding 32, tap offset (+1, 0) + [0.0279693603515625, 0.0699462890625, 0.1259765625, 0.0953369140625] + [-0.1478271484375, 0.2254638671875, 0.1771240234375, -0.0687255859375] + [-0.41943359375, -0.15966796875, -0.2371826171875, -0.0221710205078125] + [-0.01611328125, 0.129638671875, -0.0675048828125, -0.0714111328125] + # bits (row-major): 2729 2c7a 3008 2e1a b0bb 3337 31ab ac66 b6b6 b11c b397 a5ad a420 3026 ac52 ac92 +W[ 8] # source img binding 32, tap offset (+1,+1) + [0.253662109375, 0.248046875, 0.50390625, 0.0865478515625] + [-0.16552734375, 0.330810546875, 0.404296875, -0.343994140625] + [-0.483154296875, -0.405029296875, -0.51953125, -0.00646209716796875] + [-0.0867919921875, 0.0897216796875, 0.04107666015625, 0.044342041015625] + # bits (row-major): 340f 33f0 3808 2d8a b14c 354b 3678 b581 b7bb b67b b828 9e9e ad8e 2dbe 2942 29ad +W[ 9] # source img binding 33, tap offset (-1,-1) + [0.3076171875, 0.2646484375, 0.310546875, -0.1890869140625] + [0.284912109375, 0.1923828125, 0.31591796875, -0.546875] + [0.06121826171875, -0.1695556640625, -0.1568603515625, 0.1937255859375] + [-0.4736328125, 0.13037109375, 0.052642822265625, -0.040252685546875] + # bits (row-major): 34ec 343c 34f8 b20d 348f 3228 350e b860 2bd6 b16d b105 3233 b794 302c 2abd a927 +W[10] # source img binding 33, tap offset (-1, 0) + [0.09771728515625, 0.18359375, 0.1781005859375, -0.058258056640625] + [0.044464111328125, 0.11767578125, 0.1739501953125, -0.396728515625] + [0.1492919921875, -0.205078125, -0.1041259765625, 0.10174560546875] + [-0.353271484375, 0.0987548828125, -0.03662109375, -0.1304931640625] + # bits (row-major): 2e41 31e0 31b3 ab75 29b1 2f88 3191 b659 30c7 b290 aeaa 2e83 b5a7 2e52 a8b0 b02d +W[11] # source img binding 33, tap offset (-1,+1) + [0.009490966796875, 0.32958984375, 0.2244873046875, 0.10882568359375] + [0.035186767578125, 0.124267578125, 0.1392822265625, -0.1876220703125] + [0.07757568359375, -0.0203857421875, 0.029266357421875, -0.0012788772583007812] + [-0.5322265625, 0.062103271484375, 0.2159423828125, 0.244384765625] + # bits (row-major): 20dc 3546 332f 2ef7 2881 2ff4 3075 b201 2cf7 a538 277e 953d b842 2bf3 32e9 33d2 +W[12] # source img binding 33, tap offset ( 0,-1) + [0.2327880859375, 0.1505126953125, 0.1822509765625, -0.0277099609375] + [0.228271484375, 0.251708984375, 0.285888671875, -0.279296875] + [0.1173095703125, -0.2054443359375, -0.325439453125, 0.1658935546875] + [-0.2452392578125, -0.017669677734375, 0.170654296875, -0.2222900390625] + # bits (row-major): 3373 30d1 31d5 a718 334e 3407 3493 b478 2f82 b293 b535 314f b3d9 a486 3176 b31d +W[13] # source img binding 33, tap offset ( 0, 0) + [-0.01806640625, 0.051788330078125, 0.0865478515625, 0.011444091796875] + [-0.03070068359375, 0.1865234375, 0.2423095703125, -0.1912841796875] + [0.1319580078125, -0.276123046875, -0.306640625, 0.183349609375] + [-0.1500244140625, 0.369140625, 0.1746826171875, -0.7470703125] + # bits (row-major): a4a0 2aa1 2d8a 21dc a7dc 31f8 33c1 b21f 3039 b46b b4e8 31de b0cd 35e8 3197 b9fa +W[14] # source img binding 33, tap offset ( 0,+1) + [0.00836944580078125, 0.168701171875, 0.1329345703125, 0.2220458984375] + [-0.040435791015625, 0.1982421875, 0.279541015625, 0.06781005859375] + [0.111328125, -0.1302490234375, -0.2078857421875, 0.01270294189453125] + [-0.2386474609375, 0.1334228515625, 0.12298583984375, 0.194580078125] + # bits (row-major): 2049 3166 3041 331b a92d 3258 3479 2c57 2f20 b02b b2a7 2281 b3a3 3045 2fdf 323a +W[15] # source img binding 33, tap offset (+1,-1) + [0.400390625, 0.326171875, 0.280029296875, 0.0858154296875] + [0.253173828125, 0.276123046875, 0.279296875, -0.1063232421875] + [0.058135986328125, -0.205322265625, -0.3642578125, 0.08349609375] + [-0.55224609375, 0.058563232421875, 0.421142578125, -0.3759765625] + # bits (row-major): 3668 3538 347b 2d7e 340d 346b 3478 aece 2b71 b292 b5d4 2d58 b86b 2b7f 36bd b604 +W[16] # source img binding 33, tap offset (+1, 0) + [0.149169921875, 0.1787109375, 0.17041015625, 0.1517333984375] + [-0.0269317626953125, 0.179931640625, 0.2269287109375, 0.009918212890625] + [0.07794189453125, -0.26708984375, -0.3583984375, -0.0073394775390625] + [-0.3291015625, 0.0955810546875, 0.166259765625, -0.0307464599609375] + # bits (row-major): 30c6 31b8 3174 30db a6e5 31c2 3343 2114 2cfd b446 b5bc 9f84 b544 2e1e 3152 a7df +W[17] # source img binding 33, tap offset (+1,+1) + [0.10467529296875, 0.2734375, 0.256103515625, 0.3837890625] + [0.059814453125, 0.313232421875, 0.3740234375, 0.390625] + [0.10986328125, -0.160888671875, -0.32958984375, -0.275634765625] + [-0.38623046875, 0.06658935546875, 0.225341796875, 0.12347412109375] + # bits (row-major): 2eb3 3460 3419 3624 2ba8 3503 35fc 3640 2f08 b126 b546 b469 b62e 2c43 3336 2fe7 +mu = [2.005859375, 0.85107421875, -0.8251953125, -1.2265625] # bits: 4003 3acf ba9a bce8 +sigma = [0.50390625, 0.1522216796875, 0.4150390625, 0.5546875] # bits: 3808 30df 36a4 3870 +beta = [-0.69873046875, 0.7841796875, -0.0305023193359375, -0.517578125] # bits: b997 3a46 a7cf b824 +``` + +**Head B** (output binding 49), weight-set digest `621ea45c8aaf`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [-0.7607421875, -0.4208984375, -0.59912109375, -0.283447265625] + [-0.20703125, -0.09619140625, -0.038299560546875, 0.0919189453125] + [0.0168304443359375, 0.06805419921875, 0.103759765625, 0.02081298828125] + [0.251953125, -0.1514892578125, 0.09918212890625, 0.11505126953125] + # bits (row-major): ba16 b6bc b8cb b489 b2a0 ae28 a8e7 2de2 244f 2c5b 2ea4 2554 3408 b0d9 2e59 2f5d +W[ 1] # source img binding 32, tap offset (-1, 0) + [-0.12841796875, -0.1165771484375, -0.2440185546875, -0.0162506103515625] + [-0.1844482421875, -0.13671875, -0.08489990234375, -0.0660400390625] + [0.006122589111328125, -0.044158935546875, -0.02984619140625, 0.203125] + [0.26025390625, -0.146728515625, 0.120849609375, 0.08660888671875] + # bits (row-major): b01c af76 b3cf a429 b1e7 b060 ad6f ac3a 1e45 a9a7 a7a4 3280 342a b0b2 2fbc 2d8b +W[ 2] # source img binding 32, tap offset (-1,+1) + [-0.1058349609375, -0.0850830078125, -0.2205810546875, -0.07147216796875] + [-0.5791015625, -0.29736328125, -0.5068359375, -0.1641845703125] + [0.07867431640625, 0.238525390625, 0.2137451171875, 0.047698974609375] + [0.06646728515625, -0.308349609375, -0.09368896484375, 0.2188720703125] + # bits (row-major): aec6 ad72 b30f ac93 b8a2 b4c2 b80e b141 2d09 33a2 32d7 2a1b 2c41 b4ef adff 3301 +W[ 3] # source img binding 32, tap offset ( 0,-1) + [-0.400146484375, -0.1109619140625, -0.2169189453125, -0.07159423828125] + [0.1463623046875, 0.050048828125, 0.1392822265625, 0.2396240234375] + [-0.02276611328125, -0.07427978515625, -0.041046142578125, -0.069580078125] + [0.283203125, 0.0169219970703125, 0.156005859375, 0.0860595703125] + # bits (row-major): b667 af1a b2f1 ac95 30af 2a68 3075 33ab a5d4 acc1 a941 ac74 3488 2455 30fe 2d82 +W[ 4] # source img binding 32, tap offset ( 0, 0) + [0.07000732421875, 0.028472900390625, 0.053314208984375, 0.10736083984375] + [0.11346435546875, 0.01265716552734375, 0.08154296875, 0.054962158203125] + [-0.0799560546875, -0.0936279296875, -0.156005859375, 0.07049560546875] + [0.2978515625, 0.0794677734375, 0.1514892578125, -0.11395263671875] + # bits (row-major): 2c7b 274a 2ad3 2edf 2f43 227b 2d38 2b09 ad1e adfe b0fe 2c83 34c4 2d16 30d9 af4b +W[ 5] # source img binding 32, tap offset ( 0,+1) + [-0.0037860870361328125, -0.0191802978515625, -0.00762939453125, -0.005035400390625] + [-0.1505126953125, -0.1312255859375, -0.155517578125, 0.085693359375] + [-0.0517578125, -0.03289794921875, 0.0770263671875, -0.08642578125] + [0.111083984375, -0.03155517578125, -0.0305633544921875, 0.005329132080078125] + # bits (row-major): 9bc1 a4e9 9fd0 9d28 b0d1 b033 b0fa 2d7c aaa0 a836 2cee ad88 2f1c a80a a7d3 1d75 +W[ 6] # source img binding 32, tap offset (+1,-1) + [-0.480712890625, -0.2125244140625, -0.39892578125, -0.102783203125] + [0.27880859375, 0.197509765625, 0.2333984375, 0.0760498046875] + [0.034027099609375, 0.1939697265625, 0.1448974609375, -0.1988525390625] + [0.1273193359375, -0.20458984375, 0.00907135009765625, 0.300537109375] + # bits (row-major): b7b1 b2cd b662 ae94 3476 3252 3378 2cde 285b 3235 30a3 b25d 3013 b28c 20a5 34cf +W[ 7] # source img binding 32, tap offset (+1, 0) + [0.047393798828125, -0.10595703125, -0.025360107421875, 0.06365966796875] + [0.1429443359375, 0.05157470703125, 0.0540771484375, -0.12939453125] + [-0.049560546875, 0.0113677978515625, 0.01003265380859375, -0.093994140625] + [0.1749267578125, -0.1119384765625, 0.039520263671875, 0.156494140625] + # bits (row-major): 2a11 aec8 a67e 2c13 3093 2a9a 2aec b024 aa58 21d2 2123 ae04 3199 af2a 290f 3102 +W[ 8] # source img binding 32, tap offset (+1,+1) + [0.10491943359375, -0.0203399658203125, 0.00762176513671875, -0.039276123046875] + [-0.11822509765625, -0.0670166015625, -0.21728515625, 0.015167236328125] + [-0.050445556640625, 0.2342529296875, 0.2347412109375, -0.218994140625] + [-0.0172271728515625, -0.15673828125, -0.18408203125, 0.2440185546875] + # bits (row-major): 2eb7 a535 1fce a907 af91 ac4a b2f4 23c4 aa75 337f 3383 b302 a469 b104 b1e4 33cf +W[ 9] # source img binding 33, tap offset (-1,-1) + [-0.07177734375, -0.365234375, -0.412109375, 0.01195526123046875] + [0.037384033203125, -0.054443359375, -0.1119384765625, 0.09759521484375] + [-0.341796875, 0.11907958984375, 0.1585693359375, -0.175537109375] + [-0.0369873046875, -0.265380859375, -0.29296875, 0.26904296875] + # bits (row-major): ac98 b5d8 b698 221f 28c9 aaf8 af2a 2e3f b578 2f9f 3113 b19e a8bc b43f b4b0 344e +W[10] # source img binding 33, tap offset (-1, 0) + [0.09686279296875, -0.0875244140625, -0.12396240234375, -0.005748748779296875] + [-0.04693603515625, -0.181884765625, -0.1419677734375, 0.123046875] + [-0.1317138671875, 0.1131591796875, 0.163818359375, -0.1475830078125] + [0.0947265625, 0.0014810562133789062, -0.01219940185546875, 0.336669921875] + # bits (row-major): 2e33 ad9a afef 9de3 aa02 b1d2 b08b 2fe0 b037 2f3e 313e b0b9 2e10 1611 a23f 3563 +W[11] # source img binding 33, tap offset (-1,+1) + [-0.06866455078125, -0.084716796875, -0.06439208984375, -0.257080078125] + [0.1298828125, -0.374755859375, -0.50048828125, 0.11767578125] + [-0.435302734375, 0.170654296875, 0.274658203125, -0.223876953125] + [0.15234375, -0.281982421875, -0.320556640625, 0.0640869140625] + # bits (row-major): ac65 ad6c ac1f b41d 3028 b5ff b801 2f88 b6f7 3176 3465 b32a 30e0 b483 b521 2c1a +W[12] # source img binding 33, tap offset ( 0,-1) + [-0.05224609375, -0.242431640625, -0.26611328125, -0.11138916015625] + [0.055419921875, 0.054931640625, 0.0095367431640625, -0.0225677490234375] + [-0.246826171875, 0.11798095703125, 0.1483154296875, -0.146728515625] + [0.0007681846618652344, -0.12103271484375, -0.054962158203125, 0.17822265625] + # bits (row-major): aab0 b3c2 b442 af21 2b18 2b08 20e2 a5c7 b3e6 2f8d 30bf b0b2 124b afbf ab09 31b4 +W[13] # source img binding 33, tap offset ( 0, 0) + [0.07635498046875, -0.04644775390625, -0.07501220703125, -0.0416259765625] + [-0.11669921875, -0.06292724609375, 0.01421356201171875, -0.0885009765625] + [-0.06011962890625, 0.1865234375, 0.156005859375, -0.0982666015625] + [0.09405517578125, 0.1702880859375, 0.264404296875, 0.2440185546875] + # bits (row-major): 2ce3 a9f2 accd a954 af78 ac07 2347 adaa abb2 31f8 30fe ae4a 2e05 3173 343b 33cf +W[14] # source img binding 33, tap offset ( 0,+1) + [0.0178985595703125, -0.0011796951293945312, 0.01175689697265625, -0.14794921875] + [0.00305938720703125, -0.19091796875, -0.2364501953125, -0.046844482421875] + [-0.28955078125, 0.140625, 0.1700439453125, -0.11309814453125] + [0.07208251953125, -0.145751953125, -0.1170654296875, 0.120849609375] + # bits (row-major): 2495 94d5 2205 b0bc 1a44 b21c b391 a9ff b4a2 3080 3171 af3d 2c9d b0aa af7e 2fbc +W[15] # source img binding 33, tap offset (+1,-1) + [-0.10186767578125, -0.293701171875, -0.374755859375, -0.240966796875] + [0.239501953125, 0.21826171875, 0.181640625, 0.058319091796875] + [-0.3564453125, 0.192626953125, 0.267822265625, -0.1822509765625] + [-0.06500244140625, -0.351806640625, -0.33447265625, 0.0692138671875] + # bits (row-major): ae85 b4b3 b5ff b3b6 33aa 32fc 31d0 2b77 b5b4 322a 3449 b1d5 ac29 b5a1 b55a 2c6e +W[16] # source img binding 33, tap offset (+1, 0) + [0.1259765625, -0.1187744140625, -0.1337890625, -0.045654296875] + [-0.07965087890625, 0.0026264190673828125, 0.05694580078125, -0.081298828125] + [-0.09515380859375, 0.1392822265625, 0.2105712890625, 0.117431640625] + [0.038970947265625, -0.11602783203125, -0.1094970703125, 0.152587890625] + # bits (row-major): 3008 af9a b048 a9d8 ad19 1961 2b4a ad34 ae17 3075 32bd 2f84 28fd af6d af02 30e2 +W[17] # source img binding 33, tap offset (+1,+1) + [-0.01922607421875, -0.10736083984375, -0.05950927734375, -0.12744140625] + [0.034088134765625, -0.10430908203125, -0.2109375, -0.12017822265625] + [-0.336669921875, 0.189208984375, 0.2369384765625, -0.03900146484375] + [-0.01039886474609375, -0.430908203125, -0.462158203125, -0.105224609375] + # bits (row-major): a4ec aedf ab9e b014 285d aead b2c0 afb1 b563 320e 3395 a8fe a153 b6e5 b765 aebc +mu = [-1.482421875, -0.26806640625, -0.7265625, 0.5732421875] # bits: bdee b44a b9d0 3896 +sigma = [0.2392578125, 0.57177734375, 0.50927734375, 0.64111328125] # bits: 33a8 3893 3813 3921 +beta = [0.82470703125, 0.11224365234375, -0.6650390625, 0.169189453125] # bits: 3a99 2f2f b952 316a +``` + +### shader_52 + +**Head A** (output binding 48), weight-set digest `4509aadde3a1`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [0.162841796875, -0.258544921875, -0.316650390625, -0.1319580078125] + [0.4599609375, 0.3447265625, -0.04644775390625, 0.2381591796875] + [0.52978515625, 0.0176849365234375, 0.122802734375, -0.09503173828125] + [0.18212890625, 0.1331787109375, -0.155517578125, 0.047821044921875] + # bits (row-major): 3136 b423 b511 b039 375c 3584 a9f2 339f 383d 2487 2fdc ae15 31d4 3043 b0fa 2a1f +W[ 1] # source img binding 32, tap offset (-1, 0) + [-0.09552001953125, -0.098388671875, -0.1112060546875, 0.0968017578125] + [0.2047119140625, 0.100341796875, 0.049163818359375, 0.1312255859375] + [0.220458984375, 0.042755126953125, 0.09716796875, -0.03472900390625] + [-0.06707763671875, 0.272705078125, -0.0167388916015625, 0.06475830078125] + # bits (row-major): ae1d ae4c af1e 2e32 328d 2e6c 2a4b 3033 330e 2979 2e38 a872 ac4b 345d a449 2c25 +W[ 2] # source img binding 32, tap offset (-1,+1) + [0.1602783203125, -0.3310546875, -0.25634765625, -0.014434814453125] + [0.428955078125, 0.048583984375, 0.1134033203125, 0.1845703125] + [0.59619140625, -0.005550384521484375, 0.210205078125, -0.1724853515625] + [0.133544921875, 0.0142669677734375, 0.02935791015625, 0.10760498046875] + # bits (row-major): 3121 b54c b41a a364 36dd 2a38 2f42 31e8 38c5 9daf 32ba b185 3046 234e 2784 2ee3 +W[ 3] # source img binding 32, tap offset ( 0,-1) + [-0.04248046875, -0.0628662109375, -0.046112060546875, 0.007236480712890625] + [0.25732421875, 0.2344970703125, 0.050048828125, 0.19091796875] + [0.1923828125, -0.021453857421875, 0.1776123046875, 0.010040283203125] + [0.043304443359375, 0.17626953125, -0.054168701171875, -0.041259765625] + # bits (row-major): a970 ac06 a9e7 1f69 341e 3381 2a68 321c 3228 a57e 31af 2124 298b 31a4 aaef a948 +W[ 4] # source img binding 32, tap offset ( 0, 0) + [-0.311279296875, 0.1817626953125, 0.0338134765625, 0.240234375] + [-0.005401611328125, 0.0858154296875, 0.144287109375, 0.0125579833984375] + [-0.2086181640625, 0.10272216796875, 0.07659912109375, 0.0401611328125] + [-0.2381591796875, 0.323486328125, 0.033843994140625, -0.06671142578125] + # bits (row-major): b4fb 31d1 2854 33b0 9d88 2d7e 309e 226e b2ad 2e93 2ce7 2924 b39f 352d 2855 ac45 +W[ 5] # source img binding 32, tap offset ( 0,+1) + [-0.0689697265625, -0.058868408203125, -0.1507568359375, 0.085693359375] + [0.1846923828125, -0.001575469970703125, 0.06640625, 0.146728515625] + [0.156005859375, 0.005260467529296875, 0.11322021484375, -0.051361083984375] + [-0.038665771484375, 0.02886962890625, -0.0165557861328125, -0.0186767578125] + # bits (row-major): ac6a ab89 b0d3 2d7c 31e9 9674 2c40 30b2 30fe 1d63 2f3f aa93 a8f3 2764 a43d a4c8 +W[ 6] # source img binding 32, tap offset (+1,-1) + [0.254638671875, -0.438720703125, -0.19189453125, -0.13427734375] + [0.5263671875, 0.31640625, -0.017425537109375, 0.29736328125] + [0.44091796875, -0.110595703125, 0.40478515625, 0.005893707275390625] + [0.3916015625, 0.1470947265625, -0.483154296875, -0.0546875] + # bits (row-major): 3413 b705 b224 b04c 3836 3510 a476 34c2 370e af14 367a 1e09 3644 30b5 b7bb ab00 +W[ 7] # source img binding 32, tap offset (+1, 0) + [-0.003452301025390625, -0.1982421875, -0.05364990234375, 0.0195159912109375] + [0.27734375, 0.10638427734375, 0.1485595703125, 0.1788330078125] + [0.056488037109375, -0.03656005859375, 0.35888671875, 0.057952880859375] + [0.1793212890625, 0.24755859375, -0.1788330078125, -0.058624267578125] + # bits (row-major): 9b12 b258 aade 24ff 3470 2ecf 30c1 31b9 2b3b a8ae 35be 2b6b 31bd 33ec b1b9 ab81 +W[ 8] # source img binding 32, tap offset (+1,+1) + [0.309326171875, -0.31787109375, -0.5654296875, -0.09765625] + [0.5439453125, 0.2159423828125, -0.0682373046875, 0.26953125] + [0.42529296875, 0.035797119140625, 0.2015380859375, -0.02911376953125] + [0.375244140625, 0.1749267578125, -0.463134765625, -0.0177154541015625] + # bits (row-major): 34f3 b516 b886 ae40 385a 32e9 ac5e 3450 36ce 2895 3273 a774 3601 3199 b769 a489 +W[ 9] # source img binding 33, tap offset (-1,-1) + [-0.476806640625, -0.06219482421875, -0.0391845703125, 0.0158233642578125] + [-0.416748046875, -0.1966552734375, 0.07672119140625, -0.2371826171875] + [-0.400390625, -0.0341796875, 0.250244140625, -0.401611328125] + [-0.64990234375, 0.0755615234375, 0.1319580078125, 0.12005615234375] + # bits (row-major): b7a1 abf6 a904 240d b6ab b24b 2ce9 b397 b668 a860 3401 b66d b933 2cd6 3039 2faf +W[10] # source img binding 33, tap offset (-1, 0) + [0.09307861328125, 0.1907958984375, 0.0714111328125, 0.1468505859375] + [0.05218505859375, -0.0968017578125, 0.0185699462890625, 0.046600341796875] + [-0.03460693359375, 0.06488037109375, 0.14990234375, 0.12091064453125] + [0.00870513916015625, -0.021087646484375, 0.088623046875, 0.033050537109375] + # bits (row-major): 2df5 321b 2c92 30b3 2aae ae32 24c1 29f7 a86e 2c27 30cc 2fbd 2075 a566 2dac 283b +W[11] # source img binding 33, tap offset (-1,+1) + [-0.50390625, -0.470458984375, 0.1610107421875, -0.0193634033203125] + [0.0155029296875, -0.320068359375, 0.25634765625, -0.287841796875] + [-0.418701171875, -0.251220703125, 0.3388671875, -0.466796875] + [-0.19580078125, -0.2646484375, 0.276611328125, 0.06976318359375] + # bits (row-major): b808 b787 3127 a4f5 23f0 b51f 341a b49b b6b3 b405 356c b778 b244 b43c 346d 2c77 +W[12] # source img binding 33, tap offset ( 0,-1) + [0.4443359375, 0.00719451904296875, -0.0345458984375, 0.05657958984375] + [-0.005336761474609375, -0.0096435546875, -0.0928955078125, -0.0921630859375] + [0.15869140625, 0.0181427001953125, 0.1541748046875, -0.1917724609375] + [0.09796142578125, -0.01491546630859375, -0.0131683349609375, 0.047393798828125] + # bits (row-major): 371c 1f5e a86c 2b3e 9d77 a0f0 adf2 ade6 3114 24a5 30ef b223 2e45 a3a3 a2be 2a11 +W[13] # source img binding 33, tap offset ( 0, 0) + [0.72607421875, 0.27490234375, 0.08599853515625, 0.209716796875] + [0.3505859375, -0.000621795654296875, -0.2401123046875, 0.039215087890625] + [0.340087890625, 0.180419921875, -0.044097900390625, 0.09283447265625] + [0.5107421875, -0.226318359375, -0.10772705078125, -0.0633544921875] + # bits (row-major): 39cf 3466 2d81 32b6 359c 9118 b3af 2905 3571 31c6 a9a5 2df1 3816 b33e aee5 ac0e +W[14] # source img binding 33, tap offset ( 0,+1) + [0.2061767578125, 0.0139007568359375, 0.11846923828125, 0.0267791748046875] + [0.254638671875, 0.07720947265625, 0.04864501953125, -0.11328125] + [-0.02154541015625, 0.271728515625, 0.150634765625, -0.250244140625] + [0.185302734375, -0.263916015625, 0.1070556640625, 0.0953369140625] + # bits (row-major): 3299 231e 2f95 26db 3413 2cf1 2a3a af40 a584 3459 30d2 b401 31ee b439 2eda 2e1a +W[15] # source img binding 33, tap offset (+1,-1) + [-0.1595458984375, 0.183837890625, -0.08453369140625, 0.0657958984375] + [-0.314208984375, 0.193115234375, 0.04193115234375, -0.350830078125] + [-0.13671875, 0.1156005859375, 0.36767578125, -0.458251953125] + [-0.70703125, 0.451171875, 0.11431884765625, 0.04412841796875] + # bits (row-major): b11b 31e2 ad69 2c36 b507 322e 295e b59d b060 2f66 35e2 b755 b9a8 3738 2f51 29a6 +W[16] # source img binding 33, tap offset (+1, 0) + [0.268798828125, 0.185302734375, -0.04888916015625, 0.1690673828125] + [0.09881591796875, 0.038482666015625, -0.059051513671875, -0.027923583984375] + [0.07989501953125, 0.08428955078125, 0.182861328125, 0.0679931640625] + [-0.0242156982421875, 0.09234619140625, 0.09368896484375, 0.03131103515625] + # bits (row-major): 344d 31ee aa42 3169 2e53 28ed ab8f a726 2d1d 2d65 31da 2c5a a633 2de9 2dff 2802 +W[17] # source img binding 33, tap offset (+1,+1) + [-0.468505859375, -0.1339111328125, 0.0146331787109375, 0.00018894672393798828] + [-0.0908203125, -0.0665283203125, 0.21630859375, -0.296875] + [-0.324462890625, 0.067138671875, 0.3984375, -0.439208984375] + [-0.57568359375, -0.21533203125, 0.281494140625, 0.0711669921875] + # bits (row-major): b77f b049 237e 0a31 add0 ac42 32ec b4c0 b531 2c4c 3660 b707 b89b b2e4 3481 2c8e +mu = [-1.1064453125, 0.90673828125, -0.67333984375, -0.006450653076171875] # bits: bc6d 3b41 b963 9e9b +sigma = [1.150390625, 1.1953125, 0.974609375, 0.7099609375] # bits: 3c9a 3cc8 3bcc 39ae +beta = [0.00890350341796875, 0.9267578125, 0.1617431640625, 0.4150390625] # bits: 208f 3b6a 312d 36a4 +``` + +**Head B** (output binding 49), weight-set digest `92af744b39b2`: + +``` +W[ 0] # source img binding 32, tap offset (-1,-1) + [-0.2430419921875, -0.446533203125, 0.26025390625, -0.464111328125] + [0.41748046875, -0.205078125, 0.07806396484375, 0.181396484375] + [-6.598234176635742e-05, 0.1142578125, -0.271484375, -0.36669921875] + [-0.5419921875, -0.45947265625, 0.041259765625, 0.08447265625] + # bits (row-major): b3c7 b725 342a b76d 36ae b290 2cff 31ce 8453 2f50 b458 b5de b856 b75a 2948 2d68 +W[ 1] # source img binding 32, tap offset (-1, 0) + [0.09356689453125, -0.08465576171875, 0.04632568359375, -0.43212890625] + [0.269775390625, -0.314208984375, -0.06378173828125, 0.33056640625] + [-0.2222900390625, 0.1807861328125, 0.001369476318359375, -0.353759765625] + [-0.2802734375, -0.1519775390625, -0.048736572265625, -0.054107666015625] + # bits (row-major): 2dfd ad6b 29ee b6ea 3451 b507 ac15 354a b31d 31c9 159c b5a9 b47c b0dd aa3d aaed +W[ 2] # source img binding 32, tap offset (-1,+1) + [-0.09930419921875, -0.298583984375, 0.05029296875, -0.42333984375] + [0.40185546875, -0.1549072265625, 0.028961181640625, 0.22705078125] + [-0.169921875, 0.0112152099609375, -0.07806396484375, -0.421142578125] + [-0.475341796875, -0.28271484375, -0.1260986328125, 0.006977081298828125] + # bits (row-major): ae5b b4c7 2a70 b6c6 366e b0f5 276a 3344 b170 21be acff b6bd b79b b486 b009 1f25 +W[ 3] # source img binding 32, tap offset ( 0,-1) + [0.0758056640625, 0.041229248046875, 0.11639404296875, -0.357666015625] + [0.30322265625, -0.2469482421875, 0.089599609375, 0.219970703125] + [-0.10943603515625, 0.00849151611328125, -0.11767578125, -0.26806640625] + [-0.398193359375, -0.134765625, -0.053863525390625, -0.0232696533203125] + # bits (row-major): 2cda 2947 2f73 b5b9 34da b3e7 2dbc 330a af01 2059 af88 b44a b65f b050 aae5 a5f5 +W[ 4] # source img binding 32, tap offset ( 0, 0) + [0.371337890625, 0.301513671875, -0.00891876220703125, -0.294921875] + [0.10394287109375, -0.2529296875, 0.0299835205078125, 0.422607421875] + [-0.3857421875, 0.117431640625, 0.08648681640625, -0.31298828125] + [-0.141357421875, 0.033660888671875, -0.0721435546875, -0.1834716796875] + # bits (row-major): 35f1 34d3 a091 b4b8 2ea7 b40c 27ad 36c3 b62c 2f84 2d89 b502 b086 284f ac9e b1df +W[ 5] # source img binding 32, tap offset ( 0,+1) + [0.1173095703125, 0.08612060546875, 0.0889892578125, -0.352783203125] + [0.253662109375, -0.1767578125, -0.004749298095703125, 0.265869140625] + [-0.2734375, -0.0179595947265625, -0.08392333984375, -0.33837890625] + [-0.349365234375, -0.130859375, -0.06805419921875, -0.109130859375] + # bits (row-major): 2f82 2d83 2db2 b5a5 340f b1a8 9cdd 3441 b460 a499 ad5f b56a b597 b030 ac5b aefc +W[ 6] # source img binding 32, tap offset (+1,-1) + [-0.223876953125, -0.200927734375, 0.34619140625, -0.415771484375] + [0.43994140625, -0.07183837890625, 0.0455322265625, 0.1759033203125] + [0.036376953125, 0.0225067138671875, -0.5029296875, -0.35986328125] + [-0.67919921875, -0.362548828125, -0.04150390625, 0.038909912109375] + # bits (row-major): b32a b26e 358a b6a7 370a ac99 29d4 31a1 28a8 25c3 b806 b5c2 b96f b5cd a950 28fb +W[ 7] # source img binding 32, tap offset (+1, 0) + [0.03173828125, 0.071044921875, 0.249755859375, -0.339599609375] + [0.25390625, -0.361328125, 0.088623046875, 0.298095703125] + [-0.1934814453125, 0.09539794921875, -0.174072265625, -0.345703125] + [-0.4599609375, -0.1455078125, -0.08984375, -0.1300048828125] + # bits (row-major): 2810 2c8c 33fe b56f 3410 b5c8 2dac 34c5 b231 2e1b b192 b588 b75c b0a8 adc0 b029 +W[ 8] # source img binding 32, tap offset (+1,+1) + [-0.225341796875, -0.328125, 0.471435546875, -0.368408203125] + [0.3623046875, -0.1185302734375, 0.047760009765625, 0.1519775390625] + [-0.08062744140625, 0.050262451171875, -0.429443359375, -0.365234375] + [-0.65185546875, -0.4052734375, -0.01904296875, -0.038360595703125] + # bits (row-major): b336 b540 378b b5e5 35cc af96 2a1d 30dd ad29 2a6f b6df b5d8 b937 b67c a4e0 a8e9 +W[ 9] # source img binding 33, tap offset (-1,-1) + [0.29150390625, 0.05096435546875, -0.192626953125, -0.146240234375] + [0.0985107421875, 0.009857177734375, 0.29638671875, -0.186767578125] + [-0.421142578125, -0.1708984375, -0.3095703125, -0.07177734375] + [0.0950927734375, 0.042205810546875, -0.14013671875, 0.05377197265625] + # bits (row-major): 34aa 2a86 b22a b0ae 2e4e 210c 34be b1fa b6bd b178 b4f4 ac98 2e16 2967 b07c 2ae2 +W[10] # source img binding 33, tap offset (-1, 0) + [0.151123046875, 0.140869140625, -0.207275390625, 0.00385284423828125] + [0.178466796875, 0.1417236328125, 0.27490234375, -0.1258544921875] + [-0.11212158203125, -0.19091796875, -0.291748046875, -0.005039215087890625] + [0.033966064453125, 0.10626220703125, -0.26708984375, 0.018096923828125] + # bits (row-major): 30d6 3082 b2a2 1be4 31b6 3089 3466 b007 af2d b21c b4ab 9d29 2859 2ecd b446 24a2 +W[11] # source img binding 33, tap offset (-1,+1) + [-0.131591796875, 0.39404296875, -0.294677734375, -0.10113525390625] + [0.06707763671875, 0.2269287109375, 0.3037109375, -0.188232421875] + [-0.026275634765625, -0.40625, -0.2529296875, -0.1143798828125] + [-0.209228515625, 0.217529296875, -0.22216796875, 0.07989501953125] + # bits (row-major): b036 364e b4b7 ae79 2c4b 3343 34dc b206 a6ba b680 b40c af52 b2b2 32f6 b31c 2d1d +W[12] # source img binding 33, tap offset ( 0,-1) + [0.1636962890625, -0.1455078125, -0.126953125, 0.032073974609375] + [0.2734375, -0.311767578125, 0.326904296875, -0.1707763671875] + [-0.2095947265625, 0.1888427734375, -0.334228515625, -0.041656494140625] + [0.0625, -0.034271240234375, -0.2470703125, 0.12188720703125] + # bits (row-major): 313d b0a8 b010 281b 3460 b4fd 353b b177 b2b5 320b b559 a955 2c00 a863 b3e8 2fcd +W[13] # source img binding 33, tap offset ( 0, 0) + [0.07977294921875, -0.032806396484375, -0.1270751953125, 0.1717529296875] + [0.296630859375, -0.08343505859375, 0.330322265625, 0.0211181640625] + [0.040924072265625, 0.07830810546875, -0.41064453125, 0.029266357421875] + [-0.00844573974609375, 0.05352783203125, -0.41796875, 0.048492431640625] + # bits (row-major): 2d1b a833 b011 317f 34bf ad57 3549 2568 293d 2d03 b692 277e a053 2ada b6b0 2a35 +W[14] # source img binding 33, tap offset ( 0,+1) + [-0.0748291015625, 0.1551513671875, -0.24609375, 0.04913330078125] + [0.1260986328125, 0.1962890625, 0.290283203125, -0.044830322265625] + [0.07720947265625, -0.02056884765625, -0.39208984375, -0.08319091796875] + [-0.1549072265625, 0.01302337646484375, -0.3310546875, 0.135986328125] + # bits (row-major): acca 30f7 b3e0 2a4a 3009 3248 34a5 a9bd 2cf1 a544 b646 ad53 b0f5 22ab b54c 305a +W[15] # source img binding 33, tap offset (+1,-1) + [-0.04425048828125, -0.3759765625, -0.196533203125, -0.045867919921875] + [0.1966552734375, -0.1427001953125, 0.4052734375, -0.31103515625] + [-0.247802734375, 0.259033203125, -0.2802734375, -0.230224609375] + [-0.044036865234375, -0.25146484375, -0.25390625, 0.2041015625] + # bits (row-major): a9aa b604 b24a a9df 324b b091 367c b4fa b3ee 3425 b47c b35e a9a3 b406 b410 3288 +W[16] # source img binding 33, tap offset (+1, 0) + [0.06231689453125, -0.101806640625, -0.1937255859375, 0.09356689453125] + [0.1480712890625, -0.1788330078125, 0.369873046875, -0.07196044921875] + [0.04302978515625, 0.04998779296875, -0.33447265625, -0.115966796875] + [-0.0692138671875, -0.0606689453125, -0.447021484375, 0.08795166015625] + # bits (row-major): 2bfa ae84 b233 2dfd 30bd b1b9 35eb ac9b 2982 2a66 b55a af6c ac6e abc4 b727 2da1 +W[17] # source img binding 33, tap offset (+1,+1) + [-0.1256103515625, 0.1104736328125, -0.309814453125, -0.0214080810546875] + [0.13427734375, 0.016387939453125, 0.36474609375, -0.2012939453125] + [1.5020370483398438e-05, -0.1475830078125, -0.29345703125, -0.2049560546875] + [-0.247314453125, -0.0325927734375, -0.355224609375, 0.193115234375] + # bits (row-major): b005 2f12 b4f5 a57b 304c 2432 35d6 b271 00fc b0b9 b4b2 b28f b3ea a82c b5af 322e +mu = [-0.418212890625, -0.2056884765625, -1.3056640625, -2.015625] # bits: b6b1 b295 bd39 c008 +sigma = [0.69921875, 1.0205078125, 0.64794921875, 0.7783203125] # bits: 3998 3c15 392f 3a3a +beta = [0.00441741943359375, -0.2744140625, 0.7880859375, 0.51123046875] # bits: 1c86 b464 3a4e 3817 +``` + diff --git a/cleanroom/specs/13-38-flow-pyramid.md b/cleanroom/specs/13-38-flow-pyramid.md new file mode 100644 index 0000000..4cb06dc --- /dev/null +++ b/cleanroom/specs/13-38-flow-pyramid.md @@ -0,0 +1,213 @@ +# shader_13 / shader_38 — masked sigmoid map + 5-level box pyramid ("flow pyramid" family) + +One spec covers both shaders. The two binaries are structurally identical +(verified by diffing the disassembly with SSA ids normalized): they differ +ONLY in the 18 four-component convolution weight vectors and the scalar bias +listed in the Family parameters section. Everything else below applies to +both verbatim. + +## 1. Interface + +- **Workgroup size**: 16 × 16 × 1 (`LocalSize 16 16 1`). +- Uses `gl_WorkGroupID` and `gl_LocalInvocationID` (NOT `gl_GlobalInvocationID`). +- Requires fp16 arithmetic (`Float16` capability); all convolution/reduction + arithmetic is IEEE fp16 (GLSL: `float16_t` via + `GL_EXT_shader_explicit_arithmetic_types_float16`). + +Descriptors (all descriptor set 0): + +| binding | kind | format | access | role | +|---|---|---|---|---| +| 0 | UBO | struct { float @0; float @4; float @8 } | read | only member 2 (offset 8) is read; used as a threshold ("maskThreshold"). Members 0 and 1 are declared but never read by this shader. | +| 32 | combined image sampler, 2D float | — | read (texelFetch only) | input A ("merged flow"); its size defines the level-0 grid and the fetch clamp | +| 33 | combined image sampler, 2D float | — | read (texelFetch only) | input B ("feature map"); fetched at coordinates clamped against input A's size — assumed same dimensions as A | +| 48 | storage image 2D | `R8` | write-only (`NonReadable`) | output level 0 (full resolution) | +| 49 | storage image 2D | `R8` | write-only | output level 1 (½ res) | +| 50 | storage image 2D | `R8` | write-only | output level 2 (¼ res) | +| 51 | storage image 2D | `R8` | write-only | output level 3 (⅛ res) | +| 52 | storage image 2D | `R8` | write-only | output level 4 (1/16 res) | +| 53 | storage image 2D | `R8` | write-only | output level 5 (1/32 res) | + +No push constants. No spec constants. + +Shared memory: one `32 × 32` array of fp16, referred to below as `S[x][y]` +(first index = x). GLSL: `shared float16_t S[32][32];` indexed `S[x][y]`. + +## 2. Dispatch geometry + +Each workgroup produces one 32×32 tile of level 0: each of the 16×16 threads +computes a 2×2 block. Dispatch must be `ceil(W0/32) × ceil(H0/32) × 1` +workgroups, where `W0 × H0 = imageSize(level0 output)`. All out-of-range +writes are guarded inside the shader (see §5), so partial edge tiles are fine. + +Let `wg = gl_WorkGroupID.xy`, `lid = gl_LocalInvocationID.xy` (both uvec2). + +## 3. Phase 1 — per-texel value (level 0) + +Executed by every thread for its 2×2 block, as two nested loops: + +``` +for (uint dy = 0; dy < 2; ++dy) // outer loop + for (uint dx = 0; dx < 2; ++dx) { // inner loop + ivec2 p = ivec2(wg*32u + lid*2u + uvec2(dx, dy)); + ... compute v(p) ... (below) + } +``` + +Let `texA` = binding 32, `texB` = binding 33, and + +``` +ivec2 hiA = ivec2(vec2(textureSize(texA, 0))) - ivec2(1); // size-1, via a + // float round-trip + // (exact for any + // realistic size) +q(o) = clamp(p + o, ivec2(0), hiA) // componentwise, o = tap offset +``` + +The nine tap offsets, in the exact accumulation order used: + +``` +o1..o9 = (-1,-1), (-1,0), (-1,+1), (0,-1), (0,0), (0,+1), (+1,-1), (+1,0), (+1,+1) +``` + +(offsets are `(ox, oy)`; +x = right, +y = down in texel space). + +Per-texel score (all in fp16; each `texelFetch` result — a `vec4` — is +converted to `f16vec4` before the dot product; additions are performed +strictly left-to-right in the order written): + +``` +s = dot(f16(texelFetch(texA, q(o1), 0)), WA[1]) + ... + dot(f16(texelFetch(texA, q(o9), 0)), WA[9]) + + dot(f16(texelFetch(texB, q(o1), 0)), WB[1]) + ... + dot(f16(texelFetch(texB, q(o9), 0)), WB[9]) + + bias +``` + +Note: the `texB` fetches reuse the SAME clamped coordinates `q(o)` (clamped +against `texA`'s size). `WA[i]`, `WB[i]`, `bias` are the per-shader constants +in §7. + +Sigmoid, then threshold gate (fp16): + +``` +m = 1.0h / (1.0h + exp(-s)) +thr = float16_t(ubo.member2) // UBO offset 8, converted f32 -> f16 +v = step(thr, m) * m // i.e. (m >= thr) ? m : 0.0h +``` + +Writes: + +- If `p.x < imageSize(level0).x && p.y < imageSize(level0).y` (signed + compare; p is always ≥ 0): `imageStore(level0, p, vec4(float(v)))`. + Level-0 image is `R8` (unorm) — only the red channel lands; `v ∈ (0,1)` or 0 + so the unorm clamp never alters it. +- Unconditionally: `S[lid.x*2 + dx][lid.y*2 + dy] = v`. (Out-of-image texels + of a partial edge tile still get computed — from clamped fetches — and DO + contribute to the coarser-level averages below. Reproduce this.) + +## 4. Phases 2–6 — box-filter reduction pyramid + +Five identical reduction rounds with `n = 16, 8, 4, 2, 1` writing to bindings +49, 50, 51, 52, 53 respectively. Each round: + +``` +barrier(); // workgroup control barrier + + // shared-memory acquire/release +if (lid.x < n && lid.y < n) { + float16_t v = 0.25h * (((S[2*lid.x ][2*lid.y ] + + S[2*lid.x+1][2*lid.y ]) + + S[2*lid.x ][2*lid.y+1]) + + S[2*lid.x+1][2*lid.y+1]); + ivec2 c = ivec2(wg * n + lid); + if (c.x < imageSize(out_n).x && c.y < imageSize(out_n).y) + imageStore(out_n, c, vec4(float(v))); + S[lid.x][lid.y] = v; +} +``` + +Notes: +- For `n = 16` the `lid < n` test is trivially true (every thread runs it); + it is still present in the original. +- The additions inside the average are performed in exactly the parenthesized + order shown; the 0.25 multiply is exact. +- The in-place update `S[lid.x][lid.y] = v` is safe because for every active + thread `lid < n`, the cells it reads (`indices ≥ 2*lid`) are only written by + threads that read from even coarser cells; each round is separated by a + barrier. +- There is NO barrier after the final (n = 1) round; the shader simply ends. + +## 5. Boundary behavior summary + +- Reads: fetch coordinates are always clamped to `[0, sizeA-1]` + componentwise; nothing is ever fetched out of range. (No sampler math — + `texelFetch` only, LOD 0.) +- Writes: every `imageStore` is guarded by a signed `<` test against the + *destination* image's own `imageSize()` (upper bound only; coordinates are + non-negative by construction). +- Level sizes are queried independently per level; the shader does not assume + exact halving, but the coordinate scheme (`wg*n + lid`) is only meaningful + when level k has size `ceil`-halved from level k-1. + +## 6. Algorithmic intent (interpretation, not normative) + +This is a 3×3 convolution over 8 input channels (two RGBA textures) → 1 +channel, plus bias, followed by a logistic sigmoid and a hard threshold gate +(values below `ubo.member2` are zeroed) — i.e. a learned single-channel mask +(plausibly occlusion/confidence for flow merging) — then a standard 2× +box-filter mip pyramid of that mask, 6 levels total, produced in one dispatch +via shared memory. + +## 7. Family parameters (the ONLY differences between shader_13 and shader_38) + +All values are IEEE fp16 constants; both the hex-float literal (bit-exact) +and its exact decimal are given. `WA[i]`/`WB[i]` component order = (r,g,b,a) +of the fetched texel. + +### shader_13 + +bias = `0x1.b9p-3` (0.21533203125) + +| set | tap (ox,oy) | w.r | w.g | w.b | w.a | +|---|---|---|---|---|---| +| A | (-1,-1) | 0x1.6b4p-1 (0.70947265625) | -0x1.a54p-2 (-0.411376953125) | -0x1.bdcp-2 (-0.435302734375) | -0x1.2ap-1 (-0.58203125) | +| A | (-1, 0) | 0x1.594p-1 (0.67431640625) | -0x1.308p-2 (-0.29736328125) | -0x1.f14p-2 (-0.485595703125) | -0x1.154p+0 (-1.0830078125) | +| A | (-1,+1) | 0x1.1c4p+0 (1.1103515625) | -0x1.2cp-1 (-0.5859375) | -0x1.46p-1 (-0.63671875) | -0x1.2bp+0 (-1.16796875) | +| A | ( 0,-1) | 0x1.438p-2 (0.31591796875) | -0x1.d2p-2 (-0.455078125) | -0x1.264p-1 (-0.57470703125) | -0x1.c44p-1 (-0.88330078125) | +| A | ( 0, 0) | 0x1.db8p-3 (0.232177734375) | -0x1.be8p-3 (-0.218017578125) | -0x1.07cp-1 (-0.51513671875) | -0x1.9ccp+0 (-1.6123046875) | +| A | ( 0,+1) | 0x1.6acp-1 (0.70849609375) | -0x1.018p-1 (-0.5029296875) | -0x1.44p-1 (-0.6328125) | -0x1.a1p+0 (-1.62890625) | +| A | (+1,-1) | 0x1.b38p-1 (0.8505859375) | -0x1.61p-1 (-0.689453125) | -0x1.c1cp-1 (-0.87841796875) | -0x1.704p-1 (-0.71923828125) | +| A | (+1, 0) | 0x1.6dp-1 (0.712890625) | -0x1.10cp-1 (-0.53271484375) | -0x1.87cp-1 (-0.76513671875) | -0x1.cc4p-1 (-0.89892578125) | +| A | (+1,+1) | 0x1.1dp+0 (1.11328125) | -0x1.87p-1 (-0.763671875) | -0x1.c0cp-1 (-0.87646484375) | -0x1.2a8p+0 (-1.166015625) | +| B | (-1,-1) | -0x1.888p-1 (-0.7666015625) | 0x1.ba8p-1 (0.8642578125) | -0x1.14cp-1 (-0.54052734375) | 0x1.0ap-1 (0.51953125) | +| B | (-1, 0) | -0x1.ec4p-1 (-0.96142578125) | 0x1.77cp-1 (0.73388671875) | -0x1.3d8p-1 (-0.6201171875) | 0x1.3p-1 (0.59375) | +| B | (-1,+1) | -0x1.614p+0 (-1.3798828125) | 0x1.da4p-1 (0.92626953125) | -0x1.8dcp-1 (-0.77685546875) | 0x1.754p-1 (0.72900390625) | +| B | ( 0,-1) | -0x1.39cp-1 (-0.61279296875) | 0x1.548p-1 (0.6650390625) | -0x1.378p-1 (-0.6083984375) | 0x1.44cp-1 (0.63427734375) | +| B | ( 0, 0) | -0x1.eap-2 (-0.478515625) | 0x1.bacp-2 (0.432373046875) | -0x1.464p-1 (-0.63720703125) | 0x1.3a8p-1 (0.6142578125) | +| B | ( 0,+1) | -0x1.9fp-1 (-0.810546875) | 0x1.2ep-1 (0.58984375) | -0x1.67cp-1 (-0.70263671875) | 0x1.7ep-1 (0.74609375) | +| B | (+1,-1) | -0x1.28p+0 (-1.15625) | 0x1.a8cp-1 (0.82958984375) | -0x1.a38p-1 (-0.8193359375) | 0x1.ad8p-1 (0.8388671875) | +| B | (+1, 0) | -0x1.f3cp-1 (-0.97607421875) | 0x1.58cp-1 (0.67333984375) | -0x1.99p-1 (-0.798828125) | 0x1.a78p-1 (0.8271484375) | +| B | (+1,+1) | -0x1.4cp+0 (-1.296875) | 0x1.ad8p-1 (0.8388671875) | -0x1.968p-1 (-0.7939453125) | 0x1.eep-1 (0.96484375) | + +### shader_38 + +bias = `-0x1.5d4p+0` (-1.3642578125) + +| set | tap (ox,oy) | w.r | w.g | w.b | w.a | +|---|---|---|---|---|---| +| A | (-1,-1) | 0x1.f3cp-4 (0.12200927734375) | 0x1.29p-1 (0.580078125) | 0x1.d04p-1 (0.90673828125) | 0x1.06cp-1 (0.51318359375) | +| A | (-1, 0) | 0x1.b8p-2 (0.4296875) | 0x1.6d8p-2 (0.35693359375) | 0x1.1ccp-1 (0.55615234375) | 0x1.0e8p-1 (0.5283203125) | +| A | (-1,+1) | 0x1.d6cp-2 (0.459716796875) | 0x1.f64p-2 (0.490478515625) | 0x1.55p-1 (0.666015625) | 0x1.814p-1 (0.75244140625) | +| A | ( 0,-1) | 0x1.088p-3 (0.129150390625) | 0x1.fep-2 (0.498046875) | 0x1.26cp-1 (0.57568359375) | 0x1.164p-3 (0.1358642578125) | +| A | ( 0, 0) | 0x1.adp-2 (0.4189453125) | 0x1.8bp-3 (0.19287109375) | 0x1.50cp-3 (0.1644287109375) | 0x1.cd4p-3 (0.2252197265625) | +| A | ( 0,+1) | 0x1.e1p-2 (0.4697265625) | 0x1.c8p-2 (0.4453125) | 0x1.dcp-2 (0.46484375) | 0x1.0b8p-1 (0.5224609375) | +| A | (+1,-1) | 0x1.014p-2 (0.251220703125) | 0x1.1dcp-1 (0.55810546875) | 0x1.668p-1 (0.7001953125) | 0x1.678p-2 (0.35107421875) | +| A | (+1, 0) | 0x1.2ccp-1 (0.58740234375) | 0x1.d44p-2 (0.457275390625) | 0x1.eecp-2 (0.483154296875) | 0x1.504p-1 (0.65673828125) | +| A | (+1,+1) | 0x1.ddp-2 (0.4658203125) | 0x1.fecp-2 (0.498779296875) | 0x1.208p-1 (0.5634765625) | 0x1.64p-1 (0.6953125) | +| B | (-1,-1) | 0x1.194p-1 (0.54931640625) | 0x1.52cp-1 (0.66162109375) | -0x1.c9p-1 (-0.892578125) | -0x1.314p+0 (-1.1923828125) | +| B | (-1, 0) | 0x1.e44p-2 (0.472900390625) | 0x1.d44p-2 (0.457275390625) | -0x1.c7cp-1 (-0.89013671875) | -0x1.1f8p+0 (-1.123046875) | +| B | (-1,+1) | 0x1.e48p-2 (0.47314453125) | 0x1.154p-1 (0.54150390625) | -0x1.2b4p+0 (-1.1689453125) | -0x1.39p+0 (-1.22265625) | +| B | ( 0,-1) | 0x1.bd8p-2 (0.43505859375) | 0x1.bdcp-2 (0.435302734375) | -0x1.bp-1 (-0.84375) | -0x1.034p+0 (-1.0126953125) | +| B | ( 0, 0) | 0x1.02p-2 (0.251953125) | 0x1.58cp-3 (0.1683349609375) | -0x1.c08p-1 (-0.8759765625) | -0x1.e4cp-1 (-0.94677734375) | +| B | ( 0,+1) | 0x1.82cp-2 (0.377685546875) | 0x1.a04p-2 (0.406494140625) | -0x1.188p+0 (-1.095703125) | -0x1.208p+0 (-1.126953125) | +| B | (+1,-1) | 0x1.76p-2 (0.365234375) | 0x1.cap-2 (0.447265625) | -0x1.384p+0 (-1.2197265625) | -0x1.204p+0 (-1.1259765625) | +| B | (+1, 0) | 0x1.604p-2 (0.343994140625) | 0x1.adp-2 (0.4189453125) | -0x1.2a4p+0 (-1.1650390625) | -0x1.228p+0 (-1.134765625) | +| B | (+1,+1) | 0x1.6ccp-2 (0.356201171875) | 0x1.d3cp-2 (0.456787109375) | -0x1.4d4p+0 (-1.3017578125) | -0x1.4e4p+0 (-1.3056640625) | diff --git a/cleanroom/specs/14-20-warp.md b/cleanroom/specs/14-20-warp.md new file mode 100644 index 0000000..f030f7a --- /dev/null +++ b/cleanroom/specs/14-20-warp.md @@ -0,0 +1,161 @@ +# Spec: shader_14 / shader_20 — warped 3x3 feature correlation (one spec, family of 2) + +Functional specification derived solely from `asm/shader_14.spvasm` and +`asm/shader_20.spvasm`. Role names are functional labels chosen by the spec +author; the binaries contain no names. + +## 0. Family parameter table + +`shader_14.spvasm` and `shader_20.spvasm` are **byte-identical** (verified by +`diff` and matching MD5 `9e38d35c18fe3e6ed57590a804d682f9`). There are no +per-member constants or binding differences; one shader source covers both. +Any behavioral difference between the two pipeline slots can only come from +the resources bound at dispatch time, which are outside this module. + +| Shader | Differences | +|---|---| +| 14 | (reference) | +| 20 | none — identical module | + +Pipeline context called these "warp + confidence" passes; the ASM shows the +actual computation is a warped local correlation (see section 5). Binding 36, +role-named "confidence" in the pipeline notes, is consumed here as a +4-channel flow field. The ASM is authoritative. + +## 1. Interface + +- Entry point: GLCompute `main`, workgroup size **16 x 16 x 1**. +- Capabilities: `Float16` — the shader computes in 16-bit floats + (GLSL: `float16_t`/`f16vec4`, e.g. via `GL_EXT_shader_explicit_arithmetic_types_float16`). +- No push constants. No specialization constants. +- All descriptors in **set 0**: + +| Binding | Kind | Role name | Notes | +|---|---|---|---| +| 0 | UBO (`Block`) | params | 3 x float at offsets 0/4/8; **only the member at offset 4 is read** (role: interpolation phase `t` / alpha). Offsets 0 and 8 exist in the layout but are never read. | +| 32 | combined image sampler, 2D float | featPrev | sampled once, explicit LOD 0; also queried with `textureSize(.,0)` | +| 33 | combined image sampler, 2D float | featCurr | sampled once, explicit LOD 0 | +| 34 | combined image sampler, 2D float | refPrev | sampled 9x with const offsets, explicit LOD 0 | +| 35 | combined image sampler, 2D float | refCurr | sampled 9x with const offsets, explicit LOD 0 | +| 36 | combined image sampler, 2D float | flow (4-ch) | sampled once, explicit LOD 0 | +| 48 | storage image 2D, **format Rgba8** | outCost03 | write-only (`NonReadable`); written once; also `imageSize`-queried for the bounds guard | +| 49 | storage image 2D, **format Rgba8** | outCost47 | write-only; written once | +| 50 | storage image 2D, **format Rgba8** | outCost8 | write-only; written once | + +Because the storage images are `rgba8` (unorm), every stored component is +clamped to [0,1] and quantized to 8 bits by the image-store format conversion +— this is observable behavior. + +## 2. Per-invocation behavior + +Precision convention used below: `h(x)` = convert fp32 to fp16; +`H4(sample)` = the vec4 texture result converted to `f16vec4`. Everything +marked half stays in fp16 through the arithmetic. Texture sampling itself +returns fp32 (`textureLod`), immediately narrowed. + +``` +p = ivec2(gl_GlobalInvocationID.xy) +if (any(greaterThanEqual(p, imageSize(outCost03)))) return; + +S = vec2(textureSize(featPrev, 0)) // dimensions of binding 32 +pc = vec2(gl_GlobalInvocationID.xy) + vec2(0.5, 0.5) +uv = pc / S +``` + +Flow fetch and two warped positions (displacements in texels of `S`): + +``` +f = H4(textureLod(flow, uv, 0.0)) // f16vec4 +tH = h(t) // t = UBO member at offset 4 +uH = h(1.0 - t) // 1-t computed in fp32, then narrowed +dA = f.xy * tH // f16vec2 +dB = f.zw * uH // f16vec2 +uvA = (pc + vec2(dA)) / S // fp32 again (widen dA) +uvB = (pc + vec2(dB)) / S +``` + +Feature fetch at `uvA` (both source features are read at the **same** point): + +``` +F0 = H4(textureLod(featPrev, uvA, 0.0)) // f16vec4 +F1 = H4(textureLod(featCurr, uvA, 0.0)) // f16vec4 +``` + +Correlation tap, for an integer offset `o` (applied as a constant texel +offset, GLSL `textureLodOffset(tex, uvB, 0.0, o)`): + +``` +corr(o) = dot(F0, H4(textureLodOffset(refPrev, uvB, 0.0, o))) + + dot(F1, H4(textureLodOffset(refCurr, uvB, 0.0, o))) // fp16 dot4s, fp16 add +``` + +The 9 taps of the 3x3 neighborhood are packed 4 + 4 + 1 into the three +outputs, each through a per-component affine map (all fp16), then widened to +fp32 for the store: + +``` +v1 = f16vec4( corr(-1,-1), corr( 0,-1), corr( 1,-1), corr(-1, 0) ) +imageStore(outCost03, p, vec4((v1 - C1) * S1 + B1)) + +v2 = f16vec4( corr( 0, 0), corr( 1, 0), corr(-1, 1), corr( 0, 1) ) +imageStore(outCost47, p, vec4((v2 - C2) * S2 + B2)) + +s = corr( 1, 1) +imageStore(outCost8, p, vec4((s - C3) * S3 + B3, 0.0, 0.0, 0.0)) +``` + +Notes: +- The center tap `corr(0,0)` samples with **no** offset (plain `textureLod`); + all others use `ConstOffset`. Same math either way. +- The three stores happen in the order 48, 49, 50; each output texel is + written exactly once. +- `-`, `*`, `+` in the affine maps are component-wise fp16 ops in exactly + that order: subtract, multiply, add. + +## 3. Literal constants (fp16) + +All constants below are IEEE-754 binary16 values; the hex-float literal is +the bit-exact source form and the decimal is its exact value. + +Output 48 (`C1`, `S1`, `B1`), components x,y,z,w: + +| | x | y | z | w | +|---|---|---|---|---| +| C1 | 2.646484375 (0x1.52cp+1) | 2.720703125 (0x1.5c4p+1) | 2.650390625 (0x1.534p+1) | 2.740234375 (0x1.5ecp+1) | +| S1 | 0.810546875 (0x1.9fp-1) | 0.947265625 (0x1.e5p-1) | 0.80419921875 (0x1.9bcp-1) | 0.89697265625 (0x1.cb4p-1) | +| B1 | 0.19873046875 (0x1.97p-3) | 0.341064453125 (0x1.5d4p-2) | 0.1671142578125 (0x1.564p-3) | 0.30908203125 (0x1.3c8p-2) | + +Output 49 (`C2`, `S2`, `B2`): + +| | x | y | z | w | +|---|---|---|---|---| +| C2 | 2.91796875 (0x1.758p+1) | 2.751953125 (0x1.604p+1) | 2.642578125 (0x1.524p+1) | 2.71484375 (0x1.5b8p+1) | +| S2 | 0.8369140625 (0x1.ac8p-1) | 0.86474609375 (0x1.bacp-1) | 0.93603515625 (0x1.df4p-1) | 0.89501953125 (0x1.ca4p-1) | +| B2 | 0.313720703125 (0x1.414p-2) | 0.31103515625 (0x1.3e8p-2) | 0.1827392578125 (0x1.764p-3) | 0.30517578125 (0x1.388p-2) | + +Output 50 (scalars): `C3` = 2.650390625 (0x1.534p+1, same constant as C1.z), +`S3` = 0.89794921875 (0x1.cbcp-1), `B3` = 0.2105712890625 (0x1.af4p-3). + +Other literals: 0.5 (texel center), 1.0, and fp16 0.0 for the three zero +components of the last store. + +## 4. Control flow / boundary behavior + +- Single early-out: `any(p >= imageSize(outCost03))` — the guard uses **only + binding 48's** size; bindings 49/50 are assumed by the dispatch to be at + least as large. +- No loops (the 3x3 neighborhood is fully unrolled). No other branches. +- No coordinate clamping in the math; `uvA`/`uvB` can leave [0,1] under large + flow, and the const offsets can step past edges — resolution is left to the + external sampler state. + +## 5. Interpretation (hint, not normative) + +This is a 3x3 local cost volume between two 8-channel feature stacks warped +toward intermediate time `t`: the concatenation (featPrev, featCurr) sampled +at the forward-displaced point `uvA` (flow.xy scaled by t) is correlated, +via per-4-channel dot products, against (refPrev, refCurr) sampled at the +backward-displaced point `uvB` (flow.zw scaled by 1-t) over the 9 integer +offsets. The per-tap affine (C,S,B) looks like a learned normalization that +maps each correlation score into [0,1] for storage in the unorm rgba8 +outputs. diff --git a/cleanroom/specs/15-conv3x3-9to8.md b/cleanroom/specs/15-conv3x3-9to8.md new file mode 100644 index 0000000..aa3bf99 --- /dev/null +++ b/cleanroom/specs/15-conv3x3-9to8.md @@ -0,0 +1,225 @@ +# shader_15 — 3x3 stride-1 convolution, 9 -> 8 channels (texelFetch, zero-padded) + +Source of truth: `shader_15.dis` (spirv-dis output, kept outside this +repository). One compute pass. It reads a 3x3 integer-texel neighborhood +from three sampled input images — all four channels of the first two, only +the **red channel** of the third (9 input channels total) — applies a fixed +(compiled-in) fp16 linear layer (3x3 convolution, stride 1, 9 in-channels, +8 out-channels) followed by a per-channel affine remap, and stores the 8 +output channels as two RGBA8 storage images. + +This is the **8-channel counterpart of the shader_40/45 family** +(`40-45-conv3x3-9to16.md`): identical computation pattern — `texelFetch` at +LOD 0 with explicit zero padding, sampler state irrelevant — but with two +output images (8 channels) instead of four (16), and its own constants. +Everything in that spec's behavioral description applies with the output +count halved; the description below is self-contained anyway. + +There is no UBO, no push constants, no spec constants, no shared memory, no +loops. + +## 1. Interface + +- Workgroup size: **16 x 16 x 1**. +- Built-ins: `gl_GlobalInvocationID` (only `.xy`; `.z` ignored). +- All descriptors in **set 0**. The table lists what the shader itself + declares; a host descriptor-set layout may legally declare additional + bindings (e.g. sampled 35 or storage 50/51) that the shader never touches. + +| binding | kind | format | access | role | +|---|---|---|---|---| +| 32 | combined image sampler, 2D float | (sampled; format external) | read (texelFetch only) | input feature image 0 — RGBA, taps 0-8 | +| 33 | combined image sampler, 2D float | (sampled; format external) | read (texelFetch only) | input feature image 1 — RGBA, taps 9-17 | +| 34 | combined image sampler, 2D float | (sampled; format external) | read (texelFetch only) | input image 2 — **.r only**, scalar taps 18-26 | +| 48 | storage image 2D | `rgba8` | write-only (`NonReadable`) | output channels 0-3; its size is the bounds-check extent | +| 49 | storage image 2D | `rgba8` | write-only (`NonReadable`) | output channels 4-7 | + +## 2. Behavior + +Notation: + +``` +p = ivec2(gl_GlobalInvocationID.xy) // output texel (unsigned bitcast to signed) +outSize = imageSize(out48) // binding 48 only +D[k], k = 0..8 : (-1,-1), (-1,0), (-1,1), (0,-1), (0,0), (0,1), (1,-1), (1,0), (1,1) + // (dx, dy); c = p + D[k] in integer texel space of the inputs (stride 1) +``` + +Early-out: if `p.x >= outSize.x || p.y >= outSize.y` (signed compare against +binding 48's size only) the invocation returns without writing. There is no +lower-bound check on `p` itself. + +### 2.1 Taps (zero-padded texelFetch) + +For each input image `I` and each offset `D[k]`, with `c = p + D[k]`: + +- **k != 4 (non-center):** the tap is guarded: + `inb = all(c >= ivec2(0)) && all(c < textureSize(I, 0))` + (the `>= 0` half is evaluated once per offset and shared across the three + images; the `< size` half queries **that image's** level-0 size, and is + short-circuited — not evaluated when the `>= 0` half already failed). + `tap = inb ? texelFetch(I, c, 0) : vec4(0)`. +- **k == 4 (center):** `tap = texelFetch(I, p, 0)` — **unguarded** (see §4). + +The 27 tap values used by the math, in canonical order: + +``` +t[0 + k] (f16vec4) = f16vec4(tap(in32, D[k])) k = 0..8 +t[9 + k] (f16vec4) = f16vec4(tap(in33, D[k])) k = 0..8 +s[k] (float16_t)= float16_t(tap(in34, D[k]).r) k = 0..8 // red channel only +``` + +fp32 -> fp16 conversion happens immediately after each fetch, before any +arithmetic. + +### 2.2 Per output image + +For each output `o` in {48, 49} the shader bakes in: + +- 18 `f16mat4` matrices `W[o][j]`, j = 0..17 (one per f16vec4 tap `t[j]`), +- 9 `f16vec4` vectors `u[o][k]`, k = 0..8 (one per scalar tap `s[k]`), +- 3 `f16vec4` affine constants `a[o]`, `m[o]`, `b[o]`. + +Value written at `p`: + +``` +sum = W[o][0]*t[0] + W[o][1]*t[1] + ... + W[o][17]*t[17] + + u[o][0]*s[0] + u[o][1]*s[1] + ... + u[o][8]*s[8] // f16vec4 +v = (sum - a[o]) * m[o] + b[o] // componentwise fp16 +imageStore(out_o, p, vec4(v)) // rgba8 unorm store +``` + +- Matrices are given **by column** in the appendix: + `W*t = col0*t.x + col1*t.y + col2*t.z + col3*t.w` — i.e. a GLSL + `f16mat4(col0, col1, col2, col3) * t`. +- `u[o][k]*s[k]` is vector-times-scalar. +- All arithmetic is IEEE fp16. The 27 terms of each output's sum associate + **strictly left-to-right in exactly the order listed above** + (t[0]..t[17] then s[0]..s[8]; within each image, offset order D[0]..D[8]). + Verified mechanically for both (shader, output) chains: each add chain is + left-deep and in ascending canonical order. (In the original binary some + terms are merely scheduled interleaved with fetching; the association + order is exactly as stated.) Reproduce this order for bit-exactness. +- The `rgba8` store clamps each component to [0,1] and quantizes to unorm8; + this clamp is the only nonlinearity in the pass. + +Both outputs are written at the same `p` from the same 27 taps; they differ +only in their constants. + +Interpretation (hint, not normative): the model-0 (narrow, 8-channel) +counterpart of model-1 shader_40 — first fusion layer of a refinement-round +conv stack; its two outputs feed shader_16. `(x-a)*m+b` maps activations +into [0,1] for quantized storage; zero padding is standard conv boundary +handling. + +## 3. Control flow + +- One early-out (§2) guarding everything. +- Per non-center tap: the two nested guard conditionals of §2.1 (8 offsets x + 3 images = 24 guard pairs). No loops; the 3x3/per-image structure is fully + unrolled and uniform across taps (verified: all 24 guarded taps follow the + identical pattern; the 3 center taps are the only unguarded fetches). +- No other conditionals. + +## 4. Boundary behavior + +- Out-of-range **reads** are handled by the shader itself: zero padding, as + in §2.1. Coordinates are never clamped and UV normalization is never used. +- The **center** tap is not guarded: the shader assumes each input is at + least as large as `outSize` (binding 48). If an input were smaller, + `texelFetch` out of range would be undefined/robustness-dependent. +- Writes are guarded only against binding 48's size; output 49 is assumed + at least as large. +- Dispatch is expected to cover `outSize` (ceil(outSize/16) workgroups per + axis); overhanging invocations self-terminate. + +## 5. Precision requirements + +- fp32 fetch results convert to fp16 (round-to-nearest-even) before any math. +- All weight/add/affine math in IEEE fp16 + (`GL_EXT_shader_explicit_arithmetic_types_float16`); no contraction + decorations present — use the association order of §2.2. +- Final result converts fp16 -> fp32, then unorm8 store. + +## 6. Constants + +All fp16 constants below were **machine-extracted** from the disassembly by +a parser that follows the dataflow from each store back through the affine +remap and the add chain (mapping every constant to its role by use, not by +position in the file), and cross-checked: all **650** fp16 constants +declared in the module are referenced by exactly the tables below (650/650; +none unreferenced, none missing), for **672** table entries total +(2 outputs x (18 matrices x 16 + 9 vectors x 4 + 3 affine x 4); the module +deduplicates repeated values). Every value round-trips IEEE binary16 +exactly. Values are written `decimal(hexfloat)` — both forms denote the +identical binary16 value. `affine_sub/mul/add` = `a/m/b` of §2.2. `inNN +tap(dx,dy)` keys give `W[o][j]` (as 4 columns) for vector taps and +`u[o][k]` (`vec [...]`) for the `ch0` scalar taps of binding 34. + +--- + +# Appendix — shader_15 constants + +#### output binding 48 +- affine_sub: [-0.36328125(-0x1.74p-2), 0.0218963623046875(0x1.66cp-6), -0.330810546875(-0x1.52cp-2), -0.273193359375(-0x1.17cp-2)] +- affine_mul: [0.865234375(0x1.bbp-1), 0.8349609375(0x1.ab8p-1), 1.1708984375(0x1.2bcp+0), 0.52978515625(0x1.0f4p-1)] +- affine_add: [0.1678466796875(0x1.57cp-3), 0.55908203125(0x1.1e4p-1), -0.104248046875(-0x1.abp-4), 0.274658203125(0x1.194p-2)] +- in32 tap(-1,-1): cols [0.079345703125(0x1.45p-4), -0.10565185546875(-0x1.b0cp-4), -0.2470703125(-0x1.fap-3), 0.194580078125(0x1.8e8p-3)] ; [-0.005550384521484375(-0x1.6bcp-8), -0.2298583984375(-0x1.d6cp-3), 0.33349609375(0x1.558p-2), -0.0643310546875(-0x1.078p-4)] ; [-0.1748046875(-0x1.66p-3), 0.097900390625(0x1.91p-4), 0.2064208984375(0x1.a6cp-3), 0.299072265625(0x1.324p-2)] ; [0.01415252685546875(0x1.cfcp-7), 0.09185791015625(0x1.784p-4), 0.1787109375(0x1.6ep-3), -0.07843017578125(-0x1.414p-4)] +- in32 tap(-1,+0): cols [-0.466552734375(-0x1.ddcp-2), 0.05902099609375(0x1.e38p-5), 0.0269775390625(0x1.bap-6), -0.1090087890625(-0x1.be8p-4)] ; [-0.5078125(-0x1.04p-1), -0.398193359375(-0x1.97cp-2), -0.01007843017578125(-0x1.4a4p-7), 0.41796875(0x1.acp-2)] ; [-0.43017578125(-0x1.b88p-2), 0.005138397216796875(0x1.50cp-8), -0.049560546875(-0x1.96p-5), 0.7861328125(0x1.928p-1)] ; [-0.1214599609375(-0x1.f18p-4), 0.11431884765625(0x1.d44p-4), 0.2021484375(0x1.9ep-3), 0.04351806640625(0x1.648p-5)] +- in32 tap(-1,+1): cols [0.00856781005859375(0x1.18cp-7), -0.03741455078125(-0x1.328p-5), 0.275634765625(0x1.1a4p-2), -0.286865234375(-0x1.25cp-2)] ; [-0.351806640625(-0x1.684p-2), -0.61376953125(-0x1.3a4p-1), -0.12353515625(-0x1.fap-4), 0.278564453125(0x1.1d4p-2)] ; [-0.4189453125(-0x1.adp-2), -0.00655364990234375(-0x1.ad8p-8), -0.27099609375(-0x1.158p-2), 0.35595703125(0x1.6c8p-2)] ; [0.1124267578125(0x1.cc8p-4), 0.2088623046875(0x1.abcp-3), 0.1138916015625(0x1.d28p-4), -0.01251220703125(-0x1.9ap-7)] +- in32 tap(+0,-1): cols [-0.005626678466796875(-0x1.70cp-8), 0.28125(0x1.2p-2), 0.00926971435546875(0x1.2fcp-7), -0.310791015625(-0x1.3e4p-2)] ; [0.054351806640625(0x1.bd4p-5), 0.0535888671875(0x1.b7p-5), -0.1044921875(-0x1.acp-4), 0.022705078125(0x1.74p-6)] ; [-0.07366943359375(-0x1.2dcp-4), 0.301513671875(0x1.34cp-2), -0.53076171875(-0x1.0fcp-1), 0.1669921875(0x1.56p-3)] ; [-0.12548828125(-0x1.01p-3), 0.355712890625(0x1.6c4p-2), 0.2103271484375(0x1.aecp-3), 0.01708984375(0x1.18p-6)] +- in32 tap(+0,+0): cols [-0.374755859375(-0x1.7fcp-2), 0.2763671875(0x1.1bp-2), -0.1407470703125(-0x1.204p-3), -0.333984375(-0x1.56p-2)] ; [-0.3193359375(-0x1.47p-2), 0.01393890380859375(0x1.c8cp-7), -0.203125(-0x1.ap-3), 0.1292724609375(0x1.08cp-3)] ; [-0.408203125(-0x1.a2p-2), 0.315673828125(0x1.434p-2), -0.4365234375(-0x1.bfp-2), 0.10406494140625(0x1.aa4p-4)] ; [-0.10333251953125(-0x1.a74p-4), 0.291748046875(0x1.2acp-2), -0.039154052734375(-0x1.40cp-5), -0.26513671875(-0x1.0f8p-2)] +- in32 tap(+0,+1): cols [-0.07159423828125(-0x1.254p-4), 0.292236328125(0x1.2b4p-2), -0.0782470703125(-0x1.408p-4), -0.67236328125(-0x1.584p-1)] ; [-0.141357421875(-0x1.218p-3), 0.042236328125(0x1.5ap-5), 0.1002197265625(0x1.9a8p-4), -0.1798095703125(-0x1.704p-3)] ; [-0.0243682861328125(-0x1.8f4p-6), 0.27294921875(0x1.178p-2), -0.5712890625(-0x1.248p-1), 0.42919921875(0x1.b78p-2)] ; [-0.1517333984375(-0x1.36cp-3), 0.337890625(0x1.5ap-2), 0.147216796875(0x1.2d8p-3), 0.10626220703125(0x1.b34p-4)] +- in32 tap(+1,-1): cols [-0.032257080078125(-0x1.084p-5), 0.1910400390625(0x1.874p-3), 0.412353515625(0x1.a64p-2), -0.2159423828125(-0x1.ba4p-3)] ; [0.042510986328125(0x1.5c4p-5), -0.3427734375(-0x1.5fp-2), 0.07861328125(0x1.42p-4), 0.0307464599609375(0x1.f7cp-6)] ; [0.114501953125(0x1.d5p-4), -0.0192413330078125(-0x1.3b4p-6), 0.02166748046875(0x1.63p-6), 0.064697265625(0x1.09p-4)] ; [-0.2587890625(-0x1.09p-2), 0.245361328125(0x1.f68p-3), 0.76708984375(0x1.88cp-1), 0.2318115234375(0x1.dacp-3)] +- in32 tap(+1,+0): cols [-0.44580078125(-0x1.c88p-2), 0.2205810546875(0x1.c3cp-3), 0.28564453125(0x1.248p-2), -0.60888671875(-0x1.37cp-1)] ; [-0.580078125(-0x1.29p-1), -0.439697265625(-0x1.c24p-2), 0.0021610260009765625(0x1.1b4p-9), -0.10595703125(-0x1.b2p-4)] ; [-0.439453125(-0x1.c2p-2), 0.297119140625(0x1.304p-2), -0.1348876953125(-0x1.144p-3), -0.1226806640625(-0x1.f68p-4)] ; [0.30322265625(0x1.368p-2), 0.35302734375(0x1.698p-2), 0.8056640625(0x1.9c8p-1), -0.280029296875(-0x1.1ecp-2)] +- in32 tap(+1,+1): cols [-0.3291015625(-0x1.51p-2), 0.452880859375(0x1.cfcp-2), 0.73876953125(0x1.7a4p-1), -0.95263671875(-0x1.e7cp-1)] ; [-0.36572265625(-0x1.768p-2), -0.70068359375(-0x1.66cp-1), 0.0106353759765625(0x1.5c8p-7), 0.35400390625(0x1.6a8p-2)] ; [0.0131072998046875(0x1.ad8p-7), 0.1820068359375(0x1.74cp-3), -0.11395263671875(-0x1.d2cp-4), 0.57666015625(0x1.274p-1)] ; [-0.420654296875(-0x1.aecp-2), 0.3427734375(0x1.5fp-2), 0.75146484375(0x1.80cp-1), 0.36083984375(0x1.718p-2)] +- in33 tap(-1,-1): cols [-0.082763671875(-0x1.53p-4), -0.01313018798828125(-0x1.ae4p-7), -0.1158447265625(-0x1.da8p-4), -0.1724853515625(-0x1.614p-3)] ; [-0.1824951171875(-0x1.75cp-3), -0.67236328125(-0x1.584p-1), -0.2119140625(-0x1.b2p-3), 0.043792724609375(0x1.66cp-5)] ; [0.47314453125(0x1.e48p-2), -0.07110595703125(-0x1.234p-4), 0.1324462890625(0x1.0f4p-3), 0.41748046875(0x1.ab8p-2)] ; [0.66650390625(0x1.554p-1), -0.04510498046875(-0x1.718p-5), -0.20166015625(-0x1.9dp-3), 0.2479248046875(0x1.fbcp-3)] +- in33 tap(-1,+0): cols [0.06561279296875(0x1.0ccp-4), -0.1776123046875(-0x1.6bcp-3), -0.1806640625(-0x1.72p-3), -0.1466064453125(-0x1.2c4p-3)] ; [0.10272216796875(0x1.a4cp-4), -0.5068359375(-0x1.038p-1), -0.1297607421875(-0x1.09cp-3), 0.00243377685546875(0x1.3fp-9)] ; [0.2086181640625(0x1.ab4p-3), 0.04443359375(0x1.6cp-5), -0.1436767578125(-0x1.264p-3), 0.1502685546875(0x1.33cp-3)] ; [0.206298828125(0x1.a68p-3), 0.08355712890625(0x1.564p-4), -0.0278167724609375(-0x1.c7cp-6), -0.00853729248046875(-0x1.17cp-7)] +- in33 tap(-1,+1): cols [0.00821685791015625(0x1.0d4p-7), -0.2149658203125(-0x1.b84p-3), 0.060516357421875(0x1.efcp-5), -0.0162811279296875(-0x1.0acp-6)] ; [-0.297119140625(-0x1.304p-2), -0.73095703125(-0x1.764p-1), -0.26513671875(-0x1.0f8p-2), 0.245849609375(0x1.f78p-3)] ; [-0.1495361328125(-0x1.324p-3), -0.1632080078125(-0x1.4e4p-3), -0.144775390625(-0x1.288p-3), 0.029815673828125(0x1.e88p-6)] ; [0.239501953125(0x1.ea8p-3), -0.031646728515625(-0x1.034p-5), 0.2349853515625(0x1.e14p-3), -0.1585693359375(-0x1.44cp-3)] +- in33 tap(+0,-1): cols [-0.1513671875(-0x1.36p-3), 0.40625(0x1.ap-2), -0.2008056640625(-0x1.9b4p-3), -0.1602783203125(-0x1.484p-3)] ; [-0.18310546875(-0x1.77p-3), -0.39306640625(-0x1.928p-2), -0.54638671875(-0x1.17cp-1), -0.1212158203125(-0x1.f08p-4)] ; [0.378173828125(0x1.834p-2), 0.1424560546875(0x1.23cp-3), -0.1043701171875(-0x1.ab8p-4), 0.58447265625(0x1.2b4p-1)] ; [0.703125(0x1.68p-1), 0.6298828125(0x1.428p-1), -0.312744140625(-0x1.404p-2), 0.137451171875(0x1.198p-3)] +- in33 tap(+0,+0): cols [0.1756591796875(0x1.67cp-3), 0.5849609375(0x1.2b8p-1), -0.025543212890625(-0x1.a28p-6), -0.7607421875(-0x1.858p-1)] ; [0.055267333984375(0x1.c4cp-5), -0.339599609375(-0x1.5bcp-2), -0.25244140625(-0x1.028p-2), -0.298583984375(-0x1.31cp-2)] ; [-0.0260009765625(-0x1.aap-6), 0.142333984375(0x1.238p-3), -0.2208251953125(-0x1.c44p-3), 0.050048828125(0x1.9ap-5)] ; [-0.0516357421875(-0x1.a7p-5), 0.68603515625(0x1.5f4p-1), -0.344482421875(-0x1.60cp-2), -0.2509765625(-0x1.01p-2)] +- in33 tap(+0,+1): cols [-0.27587890625(-0x1.1a8p-2), 0.44921875(0x1.ccp-2), -0.07232666015625(-0x1.284p-4), -0.1617431640625(-0x1.4b4p-3)] ; [-0.044158935546875(-0x1.69cp-5), -0.341552734375(-0x1.5dcp-2), -0.44287109375(-0x1.c58p-2), 0.12188720703125(0x1.f34p-4)] ; [0.0439453125(0x1.68p-5), 0.11737060546875(0x1.e0cp-4), 0.148193359375(0x1.2f8p-3), 0.141845703125(0x1.228p-3)] ; [0.15625(0x1.4p-3), 0.4140625(0x1.a8p-2), -0.390625(-0x1.9p-2), 0.039215087890625(0x1.414p-5)] +- in33 tap(+1,-1): cols [-0.2166748046875(-0x1.bbcp-3), -0.05706787109375(-0x1.d38p-5), -0.10809326171875(-0x1.bacp-4), -0.2041015625(-0x1.a2p-3)] ; [0.049163818359375(0x1.92cp-5), -0.1566162109375(-0x1.40cp-3), -0.06939697265625(-0x1.1c4p-4), -0.165771484375(-0x1.538p-3)] ; [0.7080078125(0x1.6a8p-1), 0.31689453125(0x1.448p-2), 0.7216796875(0x1.718p-1), 0.7216796875(0x1.718p-1)] ; [0.57080078125(0x1.244p-1), -0.144287109375(-0x1.278p-3), -0.458251953125(-0x1.d54p-2), 0.1934814453125(0x1.8c4p-3)] +- in33 tap(+1,+0): cols [0.160888671875(0x1.498p-3), -0.2509765625(-0x1.01p-2), -0.2303466796875(-0x1.d7cp-3), -0.21630859375(-0x1.bbp-3)] ; [-0.01212310791015625(-0x1.8d4p-7), -0.08880615234375(-0x1.6bcp-4), -0.126708984375(-0x1.038p-3), 0.21826171875(0x1.bfp-3)] ; [0.1805419921875(0x1.71cp-3), 0.132080078125(0x1.0e8p-3), 0.394775390625(0x1.944p-2), 0.5361328125(0x1.128p-1)] ; [0.4248046875(0x1.b3p-2), -0.0863037109375(-0x1.618p-4), -0.378173828125(-0x1.834p-2), 0.2034912109375(0x1.a0cp-3)] +- in33 tap(+1,+1): cols [-0.0836181640625(-0x1.568p-4), -0.2020263671875(-0x1.9dcp-3), -0.124755859375(-0x1.ffp-4), -0.020111083984375(-0x1.498p-6)] ; [-0.005718231201171875(-0x1.76cp-8), -0.188720703125(-0x1.828p-3), -0.0269927978515625(-0x1.ba4p-6), 0.1318359375(0x1.0ep-3)] ; [0.05157470703125(0x1.a68p-5), 0.134765625(0x1.14p-3), 0.49560546875(0x1.fb8p-2), 0.53515625(0x1.12p-1)] ; [0.08367919921875(0x1.56cp-4), -0.07720947265625(-0x1.3c4p-4), -0.126953125(-0x1.04p-3), -0.0213470458984375(-0x1.5dcp-6)] +- in34 tap(-1,-1) ch0: vec [0.74169921875(0x1.7bcp-1), -0.384521484375(-0x1.89cp-2), 0.309814453125(0x1.3d4p-2), -0.422607421875(-0x1.b0cp-2)] +- in34 tap(-1,+0) ch0: vec [-0.053192138671875(-0x1.b3cp-5), -0.2008056640625(-0x1.9b4p-3), 0.322509765625(0x1.4a4p-2), -0.48291015625(-0x1.ee8p-2)] +- in34 tap(-1,+1) ch0: vec [0.1064453125(0x1.b4p-4), -0.277099609375(-0x1.1bcp-2), 0.26708984375(0x1.118p-2), -0.21044921875(-0x1.afp-3)] +- in34 tap(+0,-1) ch0: vec [0.348388671875(0x1.64cp-2), -0.2274169921875(-0x1.d1cp-3), -0.2296142578125(-0x1.d64p-3), -0.489501953125(-0x1.f54p-2)] +- in34 tap(+0,+0) ch0: vec [0.039154052734375(0x1.40cp-5), 0.1243896484375(0x1.fd8p-4), -0.061920166015625(-0x1.fb4p-5), -0.5498046875(-0x1.198p-1)] +- in34 tap(+0,+1) ch0: vec [-0.0762939453125(-0x1.388p-4), -0.02117919921875(-0x1.5bp-6), -0.348388671875(-0x1.64cp-2), -0.1885986328125(-0x1.824p-3)] +- in34 tap(+1,-1) ch0: vec [0.310791015625(0x1.3e4p-2), -0.075927734375(-0x1.37p-4), 0.2236328125(0x1.cap-3), -0.103271484375(-0x1.a7p-4)] +- in34 tap(+1,+0) ch0: vec [0.2244873046875(0x1.cbcp-3), 0.05340576171875(0x1.b58p-5), 0.015350341796875(0x1.f7p-7), -0.07891845703125(-0x1.434p-4)] +- in34 tap(+1,+1) ch0: vec [-0.1776123046875(-0x1.6bcp-3), -0.165283203125(-0x1.528p-3), 0.08721923828125(0x1.654p-4), -0.069091796875(-0x1.1bp-4)] + +#### output binding 49 +- affine_sub: [-0.7783203125(-0x1.8e8p-1), -0.285400390625(-0x1.244p-2), -0.50341796875(-0x1.01cp-1), -0.54150390625(-0x1.154p-1)] +- affine_mul: [0.88037109375(0x1.c2cp-1), 1.3310546875(0x1.54cp+0), 0.83740234375(0x1.accp-1), 0.91845703125(0x1.d64p-1)] +- affine_add: [-0.340576171875(-0x1.5ccp-2), 0.07049560546875(0x1.20cp-4), 0.0181732177734375(0x1.29cp-6), -0.1435546875(-0x1.26p-3)] +- in32 tap(-1,-1): cols [-0.05474853515625(-0x1.c08p-5), 0.1591796875(0x1.46p-3), -0.1016845703125(-0x1.a08p-4), 0.0330810546875(0x1.0fp-5)] ; [0.0809326171875(0x1.4b8p-4), -0.2236328125(-0x1.cap-3), -0.0239410400390625(-0x1.884p-6), -0.1519775390625(-0x1.374p-3)] ; [0.45849609375(0x1.d58p-2), 0.4248046875(0x1.b3p-2), 0.2344970703125(0x1.e04p-3), -0.29052734375(-0x1.298p-2)] ; [-0.0595703125(-0x1.e8p-5), -0.04608154296875(-0x1.798p-5), 0.27685546875(0x1.1b8p-2), -0.278076171875(-0x1.1ccp-2)] +- in32 tap(-1,+0): cols [-0.13232421875(-0x1.0fp-3), 0.1292724609375(0x1.08cp-3), 0.11993408203125(0x1.eb4p-4), 0.106201171875(0x1.b3p-4)] ; [-0.208984375(-0x1.acp-3), -0.222412109375(-0x1.c78p-3), 0.237548828125(0x1.e68p-3), 0.365478515625(0x1.764p-2)] ; [0.419921875(0x1.aep-2), 0.7373046875(0x1.798p-1), 0.0099029541015625(0x1.448p-7), 0.246337890625(0x1.f88p-3)] ; [0.171142578125(0x1.5e8p-3), -0.1075439453125(-0x1.b88p-4), -0.349609375(-0x1.66p-2), -0.310791015625(-0x1.3e4p-2)] +- in32 tap(-1,+1): cols [0.039306640625(0x1.42p-5), -0.035400390625(-0x1.22p-5), 0.23681640625(0x1.e5p-3), 0.333740234375(0x1.55cp-2)] ; [-0.283447265625(-0x1.224p-2), -0.51953125(-0x1.0ap-1), 0.6611328125(0x1.528p-1), 0.200927734375(0x1.9b8p-3)] ; [0.7255859375(0x1.738p-1), 0.98291015625(0x1.f74p-1), 0.9169921875(0x1.d58p-1), -0.310302734375(-0x1.3dcp-2)] ; [-0.00272369384765625(-0x1.65p-9), -0.035430908203125(-0x1.224p-5), -0.11688232421875(-0x1.decp-4), 0.156982421875(0x1.418p-3)] +- in32 tap(+0,-1): cols [0.2314453125(0x1.dap-3), -0.34033203125(-0x1.5c8p-2), -0.08599853515625(-0x1.604p-4), 0.267333984375(0x1.11cp-2)] ; [-0.2587890625(-0x1.09p-2), -0.277099609375(-0x1.1bcp-2), 0.24853515625(0x1.fdp-3), -0.2371826171875(-0x1.e5cp-3)] ; [-0.0165252685546875(-0x1.0ecp-6), 0.292236328125(0x1.2b4p-2), 0.1219482421875(0x1.f38p-4), 0.11163330078125(0x1.c94p-4)] ; [0.5673828125(0x1.228p-1), -0.478759765625(-0x1.ea4p-2), 0.00132083892822265625(0x1.5a4p-10), -0.22802734375(-0x1.d3p-3)] +- in32 tap(+0,+0): cols [-0.045684814453125(-0x1.764p-5), -0.1357421875(-0x1.16p-3), -0.16943359375(-0x1.5bp-3), 0.537109375(0x1.13p-1)] ; [-0.806640625(-0x1.9dp-1), -0.399658203125(-0x1.994p-2), -0.30419921875(-0x1.378p-2), 0.52197265625(0x1.0b4p-1)] ; [-0.1572265625(-0x1.42p-3), 0.042449951171875(0x1.5bcp-5), 0.008087158203125(0x1.09p-7), 0.36328125(0x1.74p-2)] ; [0.33642578125(0x1.588p-2), -0.326171875(-0x1.4ep-2), -0.427734375(-0x1.b6p-2), -0.42138671875(-0x1.af8p-2)] +- in32 tap(+0,+1): cols [0.1796875(0x1.7p-3), -0.28076171875(-0x1.1f8p-2), 0.56884765625(0x1.234p-1), 0.35791015625(0x1.6e8p-2)] ; [-0.435302734375(-0x1.bdcp-2), -0.234375(-0x1.ep-3), 0.806640625(0x1.9dp-1), 0.046905517578125(0x1.804p-5)] ; [0.312744140625(0x1.404p-2), 0.07562255859375(0x1.35cp-4), 0.50830078125(0x1.044p-1), -0.031280517578125(-0x1.004p-5)] ; [0.2841796875(0x1.23p-2), -0.491943359375(-0x1.f7cp-2), -0.01116180419921875(-0x1.6dcp-7), -0.0061187744140625(-0x1.91p-8)] +- in32 tap(+1,-1): cols [-0.06201171875(-0x1.fcp-5), 0.1649169921875(0x1.51cp-3), 0.14892578125(0x1.31p-3), 0.2218017578125(0x1.c64p-3)] ; [0.2032470703125(0x1.a04p-3), -0.045166015625(-0x1.72p-5), 0.06890869140625(0x1.1a4p-4), -0.06744384765625(-0x1.144p-4)] ; [0.2178955078125(0x1.be4p-3), -0.297119140625(-0x1.304p-2), -0.223876953125(-0x1.ca8p-3), 0.05047607421875(0x1.9d8p-5)] ; [0.27392578125(0x1.188p-2), -0.163818359375(-0x1.4f8p-3), -0.33447265625(-0x1.568p-2), -0.454345703125(-0x1.d14p-2)] +- in32 tap(+1,+0): cols [-0.2286376953125(-0x1.d44p-3), 0.3203125(0x1.48p-2), -0.062744140625(-0x1.01p-4), 0.6728515625(0x1.588p-1)] ; [-0.250244140625(-0x1.004p-2), -0.0377197265625(-0x1.35p-5), 0.32958984375(0x1.518p-2), 0.3798828125(0x1.85p-2)] ; [0.17822265625(0x1.6dp-3), 0.041534423828125(0x1.544p-5), 0.1689453125(0x1.5ap-3), 0.138916015625(0x1.1c8p-3)] ; [0.405517578125(0x1.9f4p-2), -0.1505126953125(-0x1.344p-3), -0.292236328125(-0x1.2b4p-2), -0.6318359375(-0x1.438p-1)] +- in32 tap(+1,+1): cols [0.07904052734375(0x1.43cp-4), 0.10772705078125(0x1.b94p-4), 0.64501953125(0x1.4a4p-1), 0.322998046875(0x1.4acp-2)] ; [-0.1339111328125(-0x1.124p-3), -0.38037109375(-0x1.858p-2), 0.6181640625(0x1.3c8p-1), 0.10491943359375(0x1.adcp-4)] ; [0.25439453125(0x1.048p-2), 0.12164306640625(0x1.f24p-4), 0.53125(0x1.1p-1), 0.027618408203125(0x1.c48p-6)] ; [0.2398681640625(0x1.eb4p-3), -0.26025390625(-0x1.0a8p-2), -0.33154296875(-0x1.538p-2), -0.388427734375(-0x1.8dcp-2)] +- in33 tap(-1,-1): cols [-0.40966796875(-0x1.a38p-2), 0.01070404052734375(0x1.5ecp-7), 0.1680908203125(0x1.584p-3), -0.470703125(-0x1.e2p-2)] ; [0.42822265625(0x1.b68p-2), 0.47265625(0x1.e4p-2), -0.357666015625(-0x1.6e4p-2), -0.53857421875(-0x1.13cp-1)] ; [0.2548828125(0x1.05p-2), -0.00714874267578125(-0x1.d48p-8), 0.2169189453125(0x1.bc4p-3), -0.135009765625(-0x1.148p-3)] ; [-0.486328125(-0x1.f2p-2), -0.261474609375(-0x1.0bcp-2), -0.141845703125(-0x1.228p-3), 0.3916015625(0x1.91p-2)] +- in33 tap(-1,+0): cols [-0.7880859375(-0x1.938p-1), 0.0670166015625(0x1.128p-4), -0.125244140625(-0x1.008p-3), -0.50439453125(-0x1.024p-1)] ; [0.72216796875(0x1.71cp-1), 0.74169921875(0x1.7bcp-1), -0.12841796875(-0x1.07p-3), -0.5205078125(-0x1.0a8p-1)] ; [0.260009765625(0x1.0a4p-2), 0.25048828125(0x1.008p-2), -0.34765625(-0x1.64p-2), -0.052093505859375(-0x1.aacp-5)] ; [-0.188720703125(-0x1.828p-3), 0.09100341796875(0x1.74cp-4), -0.408203125(-0x1.a2p-2), 0.250244140625(0x1.004p-2)] +- in33 tap(-1,+1): cols [-0.432373046875(-0x1.bacp-2), -0.002803802490234375(-0x1.6f8p-9), -0.046722412109375(-0x1.7ecp-5), -0.0902099609375(-0x1.718p-4)] ; [0.293212890625(0x1.2c4p-2), 0.44580078125(0x1.c88p-2), -0.207763671875(-0x1.a98p-3), -0.416748046875(-0x1.aacp-2)] ; [-0.02154541015625(-0x1.61p-6), 0.0745849609375(0x1.318p-4), 0.1854248046875(0x1.7bcp-3), -0.1754150390625(-0x1.674p-3)] ; [-0.13427734375(-0x1.13p-3), -0.049346923828125(-0x1.944p-5), -0.1302490234375(-0x1.0acp-3), 0.055694580078125(0x1.c84p-5)] +- in33 tap(+0,-1): cols [-0.6923828125(-0x1.628p-1), 0.135009765625(0x1.148p-3), -0.131591796875(-0x1.0d8p-3), -0.320068359375(-0x1.47cp-2)] ; [-0.040802001953125(-0x1.4e4p-5), 0.292724609375(0x1.2bcp-2), 0.09393310546875(0x1.80cp-4), -0.1571044921875(-0x1.41cp-3)] ; [0.49755859375(0x1.fd8p-2), -0.301513671875(-0x1.34cp-2), 0.160400390625(0x1.488p-3), 0.3310546875(0x1.53p-2)] ; [-0.64599609375(-0x1.4acp-1), 0.21923828125(0x1.c1p-3), -0.22509765625(-0x1.cdp-3), 0.82421875(0x1.a6p-1)] +- in33 tap(+0,+0): cols [-1.275390625(-0x1.468p+0), 0.01099395751953125(0x1.684p-7), -0.2178955078125(-0x1.be4p-3), -0.7529296875(-0x1.818p-1)] ; [0.1422119140625(0x1.234p-3), -0.381591796875(-0x1.86cp-2), -0.447021484375(-0x1.c9cp-2), -0.53076171875(-0x1.0fcp-1)] ; [0.2484130859375(0x1.fccp-3), -0.246337890625(-0x1.f88p-3), -0.2109375(-0x1.bp-3), -0.172119140625(-0x1.608p-3)] ; [-0.55859375(-0x1.1ep-1), -0.2073974609375(-0x1.a8cp-3), -0.2486572265625(-0x1.fd4p-3), -0.15234375(-0x1.38p-3)] +- in33 tap(+0,+1): cols [-0.5341796875(-0x1.118p-1), 0.0092315673828125(0x1.2e8p-7), -0.054168701171875(-0x1.bbcp-5), -0.6044921875(-0x1.358p-1)] ; [0.317138671875(0x1.44cp-2), 0.214599609375(0x1.b78p-3), -0.2174072265625(-0x1.bd4p-3), -0.1719970703125(-0x1.604p-3)] ; [0.2003173828125(0x1.9a4p-3), -0.44873046875(-0x1.cb8p-2), 0.051910400390625(0x1.a94p-5), 0.2186279296875(0x1.bfcp-3)] ; [-0.2095947265625(-0x1.ad4p-3), -0.00936126708984375(-0x1.32cp-7), -0.2159423828125(-0x1.ba4p-3), 0.135986328125(0x1.168p-3)] +- in33 tap(+1,-1): cols [-0.32568359375(-0x1.4d8p-2), -0.0120697021484375(-0x1.8b8p-7), 0.053558349609375(0x1.b6cp-5), -0.395263671875(-0x1.94cp-2)] ; [0.193603515625(0x1.8c8p-3), -0.011932373046875(-0x1.87p-7), 0.1298828125(0x1.0ap-3), -0.203369140625(-0x1.a08p-3)] ; [0.476806640625(0x1.e84p-2), -0.148193359375(-0x1.2f8p-3), 0.09368896484375(0x1.7fcp-4), 0.2027587890625(0x1.9f4p-3)] ; [-0.2626953125(-0x1.0dp-2), -0.39453125(-0x1.94p-2), -0.07989501953125(-0x1.474p-4), 0.382568359375(0x1.87cp-2)] +- in33 tap(+1,+0): cols [-0.73828125(-0x1.7ap-1), -0.141357421875(-0x1.218p-3), -0.135009765625(-0x1.148p-3), -0.501953125(-0x1.01p-1)] ; [0.1700439453125(0x1.5c4p-3), 0.12432861328125(0x1.fd4p-4), -0.1968994140625(-0x1.934p-3), -0.318115234375(-0x1.45cp-2)] ; [0.311279296875(0x1.3ecp-2), 0.00620269775390625(0x1.968p-8), -0.245361328125(-0x1.f68p-3), -0.327392578125(-0x1.4f4p-2)] ; [-0.08575439453125(-0x1.5f4p-4), 0.1072998046875(0x1.b78p-4), -0.4140625(-0x1.a8p-2), 0.0071868896484375(0x1.d7p-8)] +- in33 tap(+1,+1): cols [-0.1844482421875(-0x1.79cp-3), -0.00603485107421875(-0x1.8b8p-8), -0.08709716796875(-0x1.64cp-4), -0.18701171875(-0x1.7fp-3)] ; [0.0162353515625(0x1.0ap-6), 0.10382080078125(0x1.a94p-4), -0.080810546875(-0x1.4bp-4), 0.129150390625(0x1.088p-3)] ; [0.302734375(0x1.36p-2), 0.07330322265625(0x1.2c4p-4), 0.11444091796875(0x1.d4cp-4), 0.11517333984375(0x1.d7cp-4)] ; [0.051300048828125(0x1.a44p-5), 0.1199951171875(0x1.eb8p-4), -0.07733154296875(-0x1.3ccp-4), 0.1041259765625(0x1.aa8p-4)] +- in34 tap(-1,-1) ch0: vec [0.206298828125(0x1.a68p-3), 0.67919921875(0x1.5bcp-1), -0.1761474609375(-0x1.68cp-3), 0.6943359375(0x1.638p-1)] +- in34 tap(-1,+0) ch0: vec [0.206787109375(0x1.a78p-3), 0.394287109375(0x1.93cp-2), -0.32080078125(-0x1.488p-2), 0.2208251953125(0x1.c44p-3)] +- in34 tap(-1,+1) ch0: vec [-0.065185546875(-0x1.0bp-4), 0.289306640625(0x1.284p-2), -0.053070068359375(-0x1.b2cp-5), 0.2939453125(0x1.2dp-2)] +- in34 tap(+0,-1) ch0: vec [-0.24609375(-0x1.f8p-3), 0.002658843994140625(0x1.5c8p-9), 0.055450439453125(0x1.c64p-5), 0.658203125(0x1.51p-1)] +- in34 tap(+0,+0) ch0: vec [-0.0087127685546875(-0x1.1d8p-7), -0.1195068359375(-0x1.e98p-4), -0.3974609375(-0x1.97p-2), 0.017730712890625(0x1.228p-6)] +- in34 tap(+0,+1) ch0: vec [-0.0303955078125(-0x1.f2p-6), 0.181396484375(0x1.738p-3), -0.08197021484375(-0x1.4fcp-4), 0.25390625(0x1.04p-2)] +- in34 tap(+1,-1) ch0: vec [0.11102294921875(0x1.c6cp-4), 0.07830810546875(0x1.40cp-4), 0.0693359375(0x1.1cp-4), 0.2335205078125(0x1.de4p-3)] +- in34 tap(+1,+0) ch0: vec [0.064697265625(0x1.09p-4), 0.271728515625(0x1.164p-2), -0.452392578125(-0x1.cf4p-2), 0.1126708984375(0x1.cd8p-4)] +- in34 tap(+1,+1) ch0: vec [-0.1051025390625(-0x1.ae8p-4), -0.309814453125(-0x1.3d4p-2), 0.0098876953125(0x1.44p-7), 0.0247802734375(0x1.96p-6)] diff --git a/cleanroom/specs/16-conv3x3-8to8.md b/cleanroom/specs/16-conv3x3-8to8.md new file mode 100644 index 0000000..6bd444a --- /dev/null +++ b/cleanroom/specs/16-conv3x3-8to8.md @@ -0,0 +1,197 @@ +# shader_16 — 3x3 stride-1 convolution, 8 -> 8 channels (texelFetch, zero-padded) + +Source of truth: `shader_16.dis` (spirv-dis output, kept outside this +repository). One compute pass. It reads a 3x3 integer-texel neighborhood +from two sampled RGBA input images (8 input channels), applies a fixed +(compiled-in) fp16 linear layer (3x3 convolution, stride 1, 8 in-channels, +8 out-channels) followed by a per-channel affine remap, and stores the 8 +output channels as two RGBA8 storage images. + +This is the **8-channel counterpart of the shader_41/42/46/47 family** +(`41-42-46-47-conv3x3-16to16.md`): identical computation pattern — +`texelFetch` at LOD 0 with explicit zero padding, sampler state irrelevant — +but with two input and two output images instead of four of each, and its +own constants. Relative to shader_15 (`15-conv3x3-9to8.md`) it drops the +scalar-channel third input: all 18 taps are f16vec4 matrix taps and there +are no vector-times-scalar terms. + +There is no UBO, no push constants, no spec constants, no shared memory, no +loops. + +## 1. Interface + +- Workgroup size: **16 x 16 x 1**. +- Built-ins: `gl_GlobalInvocationID` (only `.xy`; `.z` ignored). +- All descriptors in **set 0**. The table lists what the shader itself + declares; a host descriptor-set layout may legally declare additional + bindings (e.g. sampled 34/35 or storage 50/51) that the shader never + touches. + +| binding | kind | format | access | role | +|---|---|---|---|---| +| 32 | combined image sampler, 2D float | (sampled; format external) | read (texelFetch only) | input feature image 0 — taps 0-8 | +| 33 | combined image sampler, 2D float | (sampled; format external) | read (texelFetch only) | input feature image 1 — taps 9-17 | +| 48 | storage image 2D | `rgba8` | write-only (`NonReadable`) | output channels 0-3; its size is the bounds-check extent | +| 49 | storage image 2D | `rgba8` | write-only (`NonReadable`) | output channels 4-7 | + +## 2. Behavior + +Notation: + +``` +p = ivec2(gl_GlobalInvocationID.xy) // output texel (unsigned bitcast to signed) +outSize = imageSize(out48) // binding 48 only +D[k], k = 0..8 : (-1,-1), (-1,0), (-1,1), (0,-1), (0,0), (0,1), (1,-1), (1,0), (1,1) + // (dx, dy); c = p + D[k] in integer texel space of the inputs (stride 1) +``` + +Early-out: if `p.x >= outSize.x || p.y >= outSize.y` (signed compare against +binding 48's size only) the invocation returns without writing. There is no +lower-bound check on `p` itself. + +### 2.1 Taps (zero-padded texelFetch) + +For each input image `I` and each offset `D[k]`, with `c = p + D[k]`: + +- **k != 4 (non-center):** the tap is guarded: + `inb = all(c >= ivec2(0)) && all(c < textureSize(I, 0))` + (the `>= 0` half is evaluated once per offset and shared across the two + images; the `< size` half queries **that image's** level-0 size, and is + short-circuited — not evaluated when the `>= 0` half already failed). + `tap = inb ? texelFetch(I, c, 0) : vec4(0)`. +- **k == 4 (center):** `tap = texelFetch(I, p, 0)` — **unguarded** (see §4). + +18 taps, each converted to fp16 immediately after the fetch, before any +arithmetic: + +``` +t[0 + k] (f16vec4) = f16vec4(tap(in32, D[k])) k = 0..8 +t[9 + k] (f16vec4) = f16vec4(tap(in33, D[k])) k = 0..8 +``` + +### 2.2 Per output image + +For each output `o` in {48, 49} the shader bakes in 18 `f16mat4` matrices +`W[o][j]` (one per tap) and 3 `f16vec4` affine constants `a[o]`, `m[o]`, +`b[o]`. Value written at `p`: + +``` +sum = W[o][0]*t[0] + W[o][1]*t[1] + ... + W[o][17]*t[17] // f16vec4 +v = (sum - a[o]) * m[o] + b[o] // componentwise fp16 +imageStore(out_o, p, vec4(v)) // rgba8 unorm store +``` + +- Matrices are given **by column** in the appendix: + `W*t = col0*t.x + col1*t.y + col2*t.z + col3*t.w` — i.e. a GLSL + `f16mat4(col0, col1, col2, col3) * t`. +- All arithmetic is IEEE fp16. The 18 terms of each output's sum associate + **strictly left-to-right in ascending tap order j = 0..17** + (input binding 32 then 33; within each input, offset order D[0]..D[8]). + Verified mechanically for both (shader, output) chains: each add chain is + left-deep and in ascending canonical order. Reproduce this order for + bit-exactness. +- The `rgba8` store clamps each component to [0,1] and quantizes to unorm8; + this clamp is the only nonlinearity in the pass. + +Both outputs are written at the same `p` from the same 18 taps; they differ +only in their constants. + +Interpretation (hint, not normative): the model-0 (narrow, 8-channel) +counterpart of model-1 shader_41 — a stride-1 3x3 conv hidden layer on an +8-channel feature tensor packed as two RGBA8 images; consumes shader_15's +two outputs, and its own two outputs feed shader_18. `(x-a)*m+b` maps +activations into [0,1] for quantized RGBA8 storage; zero padding is +standard conv boundary handling. + +## 3. Control flow + +- One early-out (§2) guarding everything. +- Per non-center tap: the two nested guard conditionals of §2.1 (8 offsets x + 2 images = 16 guard pairs). No loops; the 3x3/per-image structure is fully + unrolled and uniform across taps (verified: all 16 guarded taps follow the + identical pattern; the 2 center taps are the only unguarded fetches). +- No other conditionals. + +## 4. Boundary behavior + +- Out-of-range **reads** are handled by the shader itself: zero padding, as + in §2.1. Coordinates are never clamped and UV normalization is never used. +- The **center** tap is not guarded: the shader assumes each input is at + least as large as `outSize` (binding 48). If an input were smaller, + `texelFetch` out of range would be undefined/robustness-dependent. +- Writes are guarded only against binding 48's size; output 49 is assumed + at least as large. +- Dispatch is expected to cover `outSize` (ceil(outSize/16) workgroups per + axis); overhanging invocations self-terminate. + +## 5. Precision requirements + +- fp32 fetch results convert to fp16 (round-to-nearest-even) before any math. +- All weight/add/affine math in IEEE fp16 + (`GL_EXT_shader_explicit_arithmetic_types_float16`); no contraction + decorations present — use the association order of §2.2. +- Final result converts fp16 -> fp32, then unorm8 store. + +## 6. Constants + +All fp16 constants below were **machine-extracted** from the disassembly by +a parser that follows the dataflow from each store back through the affine +remap and the add chain (mapping every constant to its role by use, not by +position in the file), and cross-checked: all **589** fp16 constants +declared in the module are referenced by exactly the tables below (589/589; +none unreferenced, none missing), for **600** table entries total +(2 outputs x (18 matrices x 16 + 3 affine x 4); the module deduplicates +repeated values). Every value round-trips IEEE binary16 exactly. Values are +written `decimal(hexfloat)` — both forms denote the identical binary16 +value. `affine_sub/mul/add` = `a/m/b` of §2.2; `inNN tap(dx,dy)` keys give +`W[o][j]` as 4 columns. + +--- + +# Appendix — shader_16 constants + +#### output binding 48 +- affine_sub: [-0.8115234375(-0x1.9f8p-1), 0.84521484375(0x1.b0cp-1), 1.7236328125(0x1.b94p+0), 3.65234375(0x1.d38p+1)] +- affine_mul: [0.436767578125(0x1.bf4p-2), 0.34619140625(0x1.628p-2), 0.28955078125(0x1.288p-2), 0.299072265625(0x1.324p-2)] +- affine_add: [-0.302490234375(-0x1.35cp-2), -0.2030029296875(-0x1.9fcp-3), -0.2271728515625(-0x1.d14p-3), -0.40478515625(-0x1.9e8p-2)] +- in32 tap(-1,-1): cols [-0.493408203125(-0x1.f94p-2), 0.1939697265625(0x1.8d4p-3), 0.2381591796875(0x1.e7cp-3), -0.056488037109375(-0x1.cecp-5)] ; [0.46142578125(0x1.d88p-2), -0.11871337890625(-0x1.e64p-4), 1.103515625(0x1.1a8p+0), 0.44580078125(0x1.c88p-2)] ; [0.56884765625(0x1.234p-1), 0.405029296875(0x1.9ecp-2), 0.317138671875(0x1.44cp-2), 0.299560546875(0x1.32cp-2)] ; [-0.449462890625(-0x1.cc4p-2), -0.93798828125(-0x1.e04p-1), 0.62841796875(0x1.41cp-1), 0.033233642578125(0x1.104p-5)] +- in32 tap(-1,+0): cols [-0.197021484375(-0x1.938p-3), -0.2354736328125(-0x1.e24p-3), -0.02923583984375(-0x1.dfp-6), 0.0042266845703125(0x1.15p-8)] ; [-0.1624755859375(-0x1.4ccp-3), -0.18359375(-0x1.78p-3), 0.3349609375(0x1.57p-2), -0.0968017578125(-0x1.8c8p-4)] ; [0.2332763671875(0x1.ddcp-3), 0.492919921875(0x1.f8cp-2), 0.006267547607421875(0x1.9acp-8), 0.315185546875(0x1.42cp-2)] ; [0.044708251953125(0x1.6e4p-5), -0.1923828125(-0x1.8ap-3), 0.34521484375(0x1.618p-2), 0.413818359375(0x1.a7cp-2)] +- in32 tap(-1,+1): cols [-0.3369140625(-0x1.59p-2), 0.3515625(0x1.68p-2), 0.865234375(0x1.bbp-1), 0.76171875(0x1.86p-1)] ; [0.60498046875(0x1.35cp-1), -0.1842041015625(-0x1.794p-3), 0.599609375(0x1.33p-1), 0.4453125(0x1.c8p-2)] ; [0.16357421875(0x1.4fp-3), 0.501953125(0x1.01p-1), 0.401123046875(0x1.9acp-2), 0.06292724609375(0x1.01cp-4)] ; [-0.167724609375(-0x1.578p-3), -0.89404296875(-0x1.c9cp-1), 0.3095703125(0x1.3dp-2), 0.178466796875(0x1.6d8p-3)] +- in32 tap(+0,-1): cols [0.0457763671875(0x1.77p-5), 0.383056640625(0x1.884p-2), 0.19970703125(0x1.99p-3), 0.020721435546875(0x1.538p-6)] ; [-0.0036258697509765625(-0x1.db4p-9), -0.0235443115234375(-0x1.81cp-6), -0.0265045166015625(-0x1.b24p-6), -0.52734375(-0x1.0ep-1)] ; [-0.1273193359375(-0x1.04cp-3), 0.10345458984375(0x1.a7cp-4), -0.00798797607421875(-0x1.05cp-7), -0.0145111083984375(-0x1.db8p-7)] ; [-0.72119140625(-0x1.714p-1), -0.31103515625(-0x1.3e8p-2), 0.107177734375(0x1.b7p-4), 0.71142578125(0x1.6c4p-1)] +- in32 tap(+0,+0): cols [0.39453125(0x1.94p-2), -0.059814453125(-0x1.eap-5), -0.7021484375(-0x1.678p-1), 0.10986328125(0x1.c2p-4)] ; [-0.8212890625(-0x1.a48p-1), -0.0026226043701171875(-0x1.57cp-9), -0.75537109375(-0x1.82cp-1), -0.744140625(-0x1.7dp-1)] ; [-0.369140625(-0x1.7ap-2), 0.0802001953125(0x1.488p-4), -0.42822265625(-0x1.b68p-2), 0.0830078125(0x1.54p-4)] ; [0.5947265625(0x1.308p-1), 0.6328125(0x1.44p-1), 0.4228515625(0x1.b1p-2), 0.86474609375(0x1.bacp-1)] +- in32 tap(+0,+1): cols [-0.07421875(-0x1.3p-4), 0.1768798828125(0x1.6a4p-3), 0.1458740234375(0x1.2acp-3), 0.7294921875(0x1.758p-1)] ; [-0.290283203125(-0x1.294p-2), -0.1663818359375(-0x1.54cp-3), -0.05487060546875(-0x1.c18p-5), -0.24072265625(-0x1.edp-3)] ; [0.0745849609375(0x1.318p-4), 0.2396240234375(0x1.eacp-3), 0.002422332763671875(0x1.3d8p-9), -0.05615234375(-0x1.ccp-5)] ; [-0.7138671875(-0x1.6d8p-1), -0.311279296875(-0x1.3ecp-2), 0.157470703125(0x1.428p-3), 0.65283203125(0x1.4e4p-1)] +- in32 tap(+1,-1): cols [-0.9208984375(-0x1.d78p-1), -0.02105712890625(-0x1.59p-6), 0.422119140625(0x1.b04p-2), -0.1036376953125(-0x1.a88p-4)] ; [0.2340087890625(0x1.df4p-3), -0.15478515625(-0x1.3dp-3), 1.0703125(0x1.12p+0), -0.052581787109375(-0x1.aecp-5)] ; [0.37548828125(0x1.808p-2), 0.078125(0x1.4p-4), 0.1370849609375(0x1.18cp-3), -0.08099365234375(-0x1.4bcp-4)] ; [-0.04168701171875(-0x1.558p-5), -0.93798828125(-0x1.e04p-1), 0.052001953125(0x1.aap-5), 0.08935546875(0x1.6ep-4)] +- in32 tap(+1,+0): cols [-0.08380126953125(-0x1.574p-4), -0.0234527587890625(-0x1.804p-6), -0.0174713134765625(-0x1.1e4p-6), 0.08306884765625(0x1.544p-4)] ; [-0.0751953125(-0x1.34p-4), -0.01885986328125(-0x1.35p-6), 0.133544921875(0x1.118p-3), -0.1485595703125(-0x1.304p-3)] ; [0.5927734375(0x1.2f8p-1), 0.303955078125(0x1.374p-2), 0.1588134765625(0x1.454p-3), 0.137451171875(0x1.198p-3)] ; [-0.61865234375(-0x1.3ccp-1), -0.0838623046875(-0x1.578p-4), 0.509765625(0x1.05p-1), 0.2027587890625(0x1.9f4p-3)] +- in32 tap(+1,+1): cols [-0.47216796875(-0x1.e38p-2), 0.150390625(0x1.34p-3), 0.3291015625(0x1.51p-2), 0.68115234375(0x1.5ccp-1)] ; [0.62890625(0x1.42p-1), -0.0633544921875(-0x1.038p-4), 0.55517578125(0x1.1c4p-1), 0.50634765625(0x1.034p-1)] ; [0.11285400390625(0x1.ce4p-4), 0.123291015625(0x1.f9p-4), 0.54248046875(0x1.15cp-1), -0.1658935546875(-0x1.53cp-3)] ; [-0.57861328125(-0x1.284p-1), -0.796875(-0x1.98p-1), 0.273681640625(0x1.184p-2), -0.12469482421875(-0x1.fecp-4)] +- in33 tap(-1,-1): cols [0.15673828125(0x1.41p-3), 0.54443359375(0x1.16cp-1), 0.1700439453125(0x1.5c4p-3), 0.08514404296875(0x1.5ccp-4)] ; [-0.1995849609375(-0x1.98cp-3), 0.01479339599609375(0x1.e4cp-7), -0.344970703125(-0x1.614p-2), 0.185546875(0x1.7cp-3)] ; [0.78759765625(0x1.934p-1), 0.2154541015625(0x1.b94p-3), -0.5224609375(-0x1.0b8p-1), 0.47265625(0x1.e4p-2)] ; [0.07470703125(0x1.32p-4), 0.059906005859375(0x1.eacp-5), -0.239013671875(-0x1.e98p-3), 0.338134765625(0x1.5a4p-2)] +- in33 tap(-1,+0): cols [0.04876708984375(0x1.8f8p-5), 0.63232421875(0x1.43cp-1), 0.2509765625(0x1.01p-2), 0.0736083984375(0x1.2d8p-4)] ; [-0.4072265625(-0x1.a1p-2), 0.1773681640625(0x1.6b4p-3), 0.00811004638671875(0x1.09cp-7), -0.181640625(-0x1.74p-3)] ; [-0.2041015625(-0x1.a2p-3), -0.016937255859375(-0x1.158p-6), 0.288818359375(0x1.27cp-2), 0.266357421875(0x1.10cp-2)] ; [0.084716796875(0x1.5bp-4), -0.01154327392578125(-0x1.7a4p-7), -0.0341796875(-0x1.18p-5), 0.236328125(0x1.e4p-3)] +- in33 tap(-1,+1): cols [-0.01348114013671875(-0x1.b9cp-7), 0.515625(0x1.08p-1), 0.23193359375(0x1.dbp-3), -0.05926513671875(-0x1.e58p-5)] ; [0.03363037109375(0x1.138p-5), 0.0753173828125(0x1.348p-4), -0.5380859375(-0x1.138p-1), 0.52734375(0x1.0ep-1)] ; [0.74365234375(0x1.7ccp-1), -0.0927734375(-0x1.7cp-4), -0.36376953125(-0x1.748p-2), 0.00441741943359375(0x1.218p-8)] ; [-0.034393310546875(-0x1.19cp-5), 0.046173095703125(0x1.7a4p-5), 0.08905029296875(0x1.6ccp-4), 0.74560546875(0x1.7dcp-1)] +- in33 tap(+0,-1): cols [0.11749267578125(0x1.e14p-4), 0.68896484375(0x1.60cp-1), 0.10858154296875(0x1.bccp-4), 0.287353515625(0x1.264p-2)] ; [0.137939453125(0x1.1a8p-3), -0.14990234375(-0x1.33p-3), -0.06512451171875(-0x1.0acp-4), 0.08465576171875(0x1.5acp-4)] ; [-0.2025146484375(-0x1.9ecp-3), 0.26416015625(0x1.0e8p-2), -0.54052734375(-0x1.14cp-1), 0.7041015625(0x1.688p-1)] ; [0.07928466796875(0x1.44cp-4), -0.0298614501953125(-0x1.e94p-6), -0.05194091796875(-0x1.a98p-5), 0.69384765625(0x1.634p-1)] +- in33 tap(+0,+0): cols [0.162353515625(0x1.4c8p-3), 0.71728515625(0x1.6f4p-1), 0.15771484375(0x1.43p-3), 0.185302734375(0x1.7b8p-3)] ; [-0.328369140625(-0x1.504p-2), -0.186767578125(-0x1.7e8p-3), 0.0662841796875(0x1.0f8p-4), -0.466552734375(-0x1.ddcp-2)] ; [-0.517578125(-0x1.09p-1), 0.1171875(0x1.ep-4), 0.1663818359375(0x1.54cp-3), 0.4912109375(0x1.f7p-2)] ; [0.075927734375(0x1.37p-4), 0.1082763671875(0x1.bb8p-4), -0.0179290771484375(-0x1.25cp-6), 0.2366943359375(0x1.e4cp-3)] +- in33 tap(+0,+1): cols [-0.01080322265625(-0x1.62p-7), 0.7392578125(0x1.7a8p-1), 0.037078857421875(0x1.2fcp-5), 0.171875(0x1.6p-3)] ; [-0.103759765625(-0x1.a9p-4), -0.1458740234375(-0x1.2acp-3), -0.356689453125(-0x1.6d4p-2), 0.020172119140625(0x1.4a8p-6)] ; [0.220703125(0x1.c4p-3), 0.297607421875(0x1.30cp-2), -0.321533203125(-0x1.494p-2), 0.4169921875(0x1.abp-2)] ; [-0.0029964447021484375(-0x1.88cp-9), -0.02337646484375(-0x1.7fp-6), -0.16162109375(-0x1.4bp-3), 0.693359375(0x1.63p-1)] +- in33 tap(+1,-1): cols [0.01513671875(0x1.fp-7), 0.37646484375(0x1.818p-2), -0.01171875(-0x1.8p-7), 0.08929443359375(0x1.6dcp-4)] ; [-0.355712890625(-0x1.6c4p-2), 0.5703125(0x1.24p-1), -0.7880859375(-0x1.938p-1), 0.1982421875(0x1.96p-3)] ; [0.33154296875(0x1.538p-2), 0.05963134765625(0x1.e88p-5), -0.477783203125(-0x1.e94p-2), 0.487060546875(0x1.f2cp-2)] ; [0.384765625(0x1.8ap-2), 0.160400390625(0x1.488p-3), -0.06671142578125(-0x1.114p-4), 0.5234375(0x1.0cp-1)] +- in33 tap(+1,+0): cols [0.148193359375(0x1.2f8p-3), 0.8017578125(0x1.9a8p-1), 0.23876953125(0x1.e9p-3), -0.026458740234375(-0x1.b18p-6)] ; [-0.552734375(-0x1.1bp-1), 0.5625(0x1.2p-1), -0.346923828125(-0x1.634p-2), -0.34716796875(-0x1.638p-2)] ; [0.36181640625(0x1.728p-2), -0.016845703125(-0x1.14p-6), -0.040802001953125(-0x1.4e4p-5), 0.24609375(0x1.f8p-3)] ; [0.25634765625(0x1.068p-2), 0.138671875(0x1.1cp-3), 0.06829833984375(0x1.17cp-4), 0.317138671875(0x1.44cp-2)] +- in33 tap(+1,+1): cols [0.052337646484375(0x1.accp-5), 0.609375(0x1.38p-1), 0.09295654296875(0x1.7ccp-4), -0.09185791015625(-0x1.784p-4)] ; [-0.55712890625(-0x1.1d4p-1), 0.4736328125(0x1.e5p-2), -0.63720703125(-0x1.464p-1), 0.425048828125(0x1.b34p-2)] ; [0.188232421875(0x1.818p-3), -0.1663818359375(-0x1.54cp-3), -0.496337890625(-0x1.fc4p-2), -0.115234375(-0x1.d8p-4)] ; [0.1085205078125(0x1.bc8p-4), -0.00677490234375(-0x1.bcp-8), 0.038238525390625(0x1.394p-5), 0.47509765625(0x1.e68p-2)] + +#### output binding 49 +- affine_sub: [-2.150390625(-0x1.134p+1), -0.712890625(-0x1.6dp-1), -1.279296875(-0x1.478p+0), -1.978515625(-0x1.fa8p+0)] +- affine_mul: [0.261474609375(0x1.0bcp-2), 0.38916015625(0x1.8e8p-2), 0.387939453125(0x1.8d4p-2), 0.4169921875(0x1.abp-2)] +- affine_add: [0.94677734375(0x1.e4cp-1), -0.2471923828125(-0x1.fa4p-3), -0.282470703125(-0x1.214p-2), -0.5048828125(-0x1.028p-1)] +- in32 tap(-1,-1): cols [-0.37109375(-0x1.7cp-2), 0.8583984375(0x1.b78p-1), -0.262939453125(-0x1.0d4p-2), -1.21484375(-0x1.37p+0)] ; [0.403076171875(0x1.9ccp-2), 0.1903076171875(0x1.85cp-3), -0.43359375(-0x1.bcp-2), 0.12322998046875(0x1.f8cp-4)] ; [0.04974365234375(0x1.978p-5), -0.352294921875(-0x1.68cp-2), -1.09765625(-0x1.19p+0), 0.00936126708984375(0x1.32cp-7)] ; [-0.2359619140625(-0x1.e34p-3), -0.1455078125(-0x1.2ap-3), 0.1185302734375(0x1.e58p-4), 0.18994140625(0x1.85p-3)] +- in32 tap(-1,+0): cols [-0.104248046875(-0x1.abp-4), 0.041259765625(0x1.52p-5), 0.0794677734375(0x1.458p-4), -0.6572265625(-0x1.508p-1)] ; [-0.2919921875(-0x1.2bp-2), -0.36767578125(-0x1.788p-2), -0.3310546875(-0x1.53p-2), -0.5810546875(-0x1.298p-1)] ; [0.382080078125(0x1.874p-2), -0.30859375(-0x1.3cp-2), -0.309814453125(-0x1.3d4p-2), -0.060577392578125(-0x1.f04p-5)] ; [-0.1326904296875(-0x1.0fcp-3), -0.14794921875(-0x1.2fp-3), 0.296142578125(0x1.2f4p-2), 0.1824951171875(0x1.75cp-3)] +- in32 tap(-1,+1): cols [0.54638671875(0x1.17cp-1), 0.634765625(0x1.45p-1), -0.2099609375(-0x1.aep-3), -1.3818359375(-0x1.61cp+0)] ; [0.254150390625(0x1.044p-2), -0.26318359375(-0x1.0d8p-2), -0.4775390625(-0x1.e9p-2), -0.2034912109375(-0x1.a0cp-3)] ; [0.443603515625(0x1.c64p-2), -0.08551025390625(-0x1.5e4p-4), -1.2529296875(-0x1.40cp+0), 0.08026123046875(0x1.48cp-4)] ; [0.2266845703125(0x1.d04p-3), 0.00812530517578125(0x1.0a4p-7), -0.152587890625(-0x1.388p-3), 0.050628662109375(0x1.9ecp-5)] +- in32 tap(+0,-1): cols [-0.3251953125(-0x1.4dp-2), -0.0112762451171875(-0x1.718p-7), -0.2098388671875(-0x1.adcp-3), -0.360595703125(-0x1.714p-2)] ; [0.08441162109375(0x1.59cp-4), -0.07318115234375(-0x1.2bcp-4), -0.32958984375(-0x1.518p-2), 0.143798828125(0x1.268p-3)] ; [-0.11712646484375(-0x1.dfcp-4), 0.061431884765625(0x1.f74p-5), -0.11724853515625(-0x1.e04p-4), -0.00704193115234375(-0x1.cd8p-8)] ; [-0.32373046875(-0x1.4b8p-2), -0.08074951171875(-0x1.4acp-4), 0.10540771484375(0x1.afcp-4), 0.29736328125(0x1.308p-2)] +- in32 tap(+0,+0): cols [-0.061492919921875(-0x1.f7cp-5), -0.72607421875(-0x1.73cp-1), 0.345458984375(0x1.61cp-2), 0.5693359375(0x1.238p-1)] ; [-0.65478515625(-0x1.4f4p-1), 0.02435302734375(0x1.8fp-6), 0.4111328125(0x1.a5p-2), -0.326171875(-0x1.4ep-2)] ; [0.36279296875(0x1.738p-2), 0.2198486328125(0x1.c24p-3), 0.287353515625(0x1.264p-2), 0.0263824462890625(0x1.b04p-6)] ; [-0.06427001953125(-0x1.074p-4), -0.64111328125(-0x1.484p-1), -0.004238128662109375(-0x1.15cp-8), 0.43603515625(0x1.be8p-2)] +- in32 tap(+0,+1): cols [0.463134765625(0x1.da4p-2), 0.036895751953125(0x1.2e4p-5), -0.11468505859375(-0x1.d5cp-4), -0.2978515625(-0x1.31p-2)] ; [-0.08245849609375(-0x1.51cp-4), -0.134765625(-0x1.14p-3), -0.1199951171875(-0x1.eb8p-4), -0.1669921875(-0x1.56p-3)] ; [0.301025390625(0x1.344p-2), 0.2257080078125(0x1.ce4p-3), -0.305908203125(-0x1.394p-2), 0.043670654296875(0x1.65cp-5)] ; [0.27685546875(0x1.1b8p-2), -0.0250091552734375(-0x1.99cp-6), 0.1922607421875(0x1.89cp-3), 0.5068359375(0x1.038p-1)] +- in32 tap(+1,-1): cols [-0.2459716796875(-0x1.f7cp-3), 0.8408203125(0x1.ae8p-1), -0.4423828125(-0x1.c5p-2), -1.220703125(-0x1.388p+0)] ; [-0.196044921875(-0x1.918p-3), 0.01012420654296875(0x1.4bcp-7), -0.5634765625(-0x1.208p-1), -0.08807373046875(-0x1.68cp-4)] ; [-0.67431640625(-0x1.594p-1), -0.4658203125(-0x1.ddp-2), -0.57666015625(-0x1.274p-1), 0.00562286376953125(0x1.708p-8)] ; [-0.30029296875(-0x1.338p-2), -0.15869140625(-0x1.45p-3), 0.291259765625(0x1.2a4p-2), -0.1865234375(-0x1.7ep-3)] +- in32 tap(+1,+0): cols [0.0853271484375(0x1.5d8p-4), 0.270751953125(0x1.154p-2), 0.033660888671875(0x1.13cp-5), -0.46337890625(-0x1.da8p-2)] ; [-0.7939453125(-0x1.968p-1), -0.279296875(-0x1.1ep-2), -0.222900390625(-0x1.c88p-3), -0.5927734375(-0x1.2f8p-1)] ; [-0.2958984375(-0x1.2fp-2), -0.2073974609375(-0x1.a8cp-3), -0.1290283203125(-0x1.084p-3), -0.039794921875(-0x1.46p-5)] ; [-0.1158447265625(-0x1.da8p-4), -0.028900146484375(-0x1.d98p-6), 0.1522216796875(0x1.37cp-3), 0.20458984375(0x1.a3p-3)] +- in32 tap(+1,+1): cols [0.54150390625(0x1.154p-1), 0.5234375(0x1.0cp-1), -0.03466796875(-0x1.1cp-5), -1.3486328125(-0x1.594p+0)] ; [-0.311767578125(-0x1.3f4p-2), -0.254150390625(-0x1.044p-2), -0.325439453125(-0x1.4d4p-2), -0.299560546875(-0x1.32cp-2)] ; [-0.36279296875(-0x1.738p-2), -0.1259765625(-0x1.02p-3), -1.0263671875(-0x1.06cp+0), -0.07305908203125(-0x1.2b4p-4)] ; [0.55859375(0x1.1ep-1), 0.4560546875(0x1.d3p-2), 0.09246826171875(0x1.7acp-4), 0.299560546875(0x1.32cp-2)] +- in33 tap(-1,-1): cols [-0.1392822265625(-0x1.1d4p-3), -0.09454345703125(-0x1.834p-4), 0.107421875(0x1.b8p-4), 0.0740966796875(0x1.2f8p-4)] ; [-0.0703125(-0x1.2p-4), 0.74365234375(0x1.7ccp-1), 0.552734375(0x1.1bp-1), 0.0743408203125(0x1.308p-4)] ; [0.45263671875(0x1.cf8p-2), -0.9169921875(-0x1.d58p-1), 0.2032470703125(0x1.a04p-3), 0.428955078125(0x1.b74p-2)] ; [-0.25634765625(-0x1.068p-2), 0.33447265625(0x1.568p-2), 0.045196533203125(0x1.724p-5), 0.11297607421875(0x1.cecp-4)] +- in33 tap(-1,+0): cols [-0.2484130859375(-0x1.fccp-3), -0.093505859375(-0x1.7fp-4), -0.024566650390625(-0x1.928p-6), -0.01715087890625(-0x1.19p-6)] ; [-0.385009765625(-0x1.8a4p-2), -0.169921875(-0x1.5cp-3), -0.06756591796875(-0x1.14cp-4), -0.33935546875(-0x1.5b8p-2)] ; [-0.47900390625(-0x1.ea8p-2), -0.51953125(-0x1.0ap-1), -0.049713134765625(-0x1.974p-5), -0.1412353515625(-0x1.214p-3)] ; [-0.37060546875(-0x1.7b8p-2), 0.25927734375(0x1.098p-2), 0.11083984375(0x1.c6p-4), 0.11053466796875(0x1.c4cp-4)] +- in33 tap(-1,+1): cols [-0.174072265625(-0x1.648p-3), -0.055511474609375(-0x1.c6cp-5), -0.03778076171875(-0x1.358p-5), -0.189697265625(-0x1.848p-3)] ; [-0.10760498046875(-0x1.b8cp-4), 0.0728759765625(0x1.2a8p-4), 0.79833984375(0x1.98cp-1), -0.05694580078125(-0x1.d28p-5)] ; [-0.51806640625(-0x1.094p-1), -1.2197265625(-0x1.384p+0), 0.291015625(0x1.2ap-2), 0.52392578125(0x1.0c4p-1)] ; [0.1201171875(0x1.ecp-4), 0.369873046875(0x1.7acp-2), -0.039459228515625(-0x1.434p-5), 0.250244140625(0x1.004p-2)] +- in33 tap(+0,-1): cols [-0.25048828125(-0x1.008p-2), 0.09490966796875(0x1.84cp-4), 0.43798828125(0x1.c08p-2), 0.040283203125(0x1.4ap-5)] ; [-0.335205078125(-0x1.574p-2), 0.08984375(0x1.7p-4), 0.005817413330078125(0x1.7d4p-8), 0.06597900390625(0x1.0e4p-4)] ; [0.4404296875(0x1.c3p-2), 0.11322021484375(0x1.cfcp-4), -0.087890625(-0x1.68p-4), -0.0230712890625(-0x1.7ap-6)] ; [-0.466552734375(-0x1.ddcp-2), 0.0117034912109375(0x1.7f8p-7), -0.366455078125(-0x1.774p-2), 0.049652099609375(0x1.96cp-5)] +- in33 tap(+0,+0): cols [-0.251708984375(-0x1.01cp-2), 0.078857421875(0x1.43p-4), 0.356201171875(0x1.6ccp-2), -0.03436279296875(-0x1.198p-5)] ; [-0.74462890625(-0x1.7d4p-1), -0.724609375(-0x1.73p-1), -0.86767578125(-0x1.bc4p-1), -0.355224609375(-0x1.6bcp-2)] ; [-0.366455078125(-0x1.774p-2), 0.6748046875(0x1.598p-1), -0.362548828125(-0x1.734p-2), -0.7294921875(-0x1.758p-1)] ; [-0.66064453125(-0x1.524p-1), -0.0694580078125(-0x1.1c8p-4), -0.2056884765625(-0x1.a54p-3), 0.038726806640625(0x1.3d4p-5)] +- in33 tap(+0,+1): cols [-0.295654296875(-0x1.2ecp-2), 0.1781005859375(0x1.6ccp-3), 0.487548828125(0x1.f34p-2), -0.09674072265625(-0x1.8c4p-4)] ; [-0.62939453125(-0x1.424p-1), 0.2626953125(0x1.0dp-2), -0.153564453125(-0x1.3a8p-3), -0.06121826171875(-0x1.f58p-5)] ; [-0.4697265625(-0x1.e1p-2), -0.1427001953125(-0x1.244p-3), 0.08282470703125(0x1.534p-4), 0.024505615234375(0x1.918p-6)] ; [-0.29150390625(-0x1.2a8p-2), 0.0789794921875(0x1.438p-4), -0.27783203125(-0x1.1c8p-2), 0.073486328125(0x1.2dp-4)] +- in33 tap(+1,-1): cols [0.0474853515625(0x1.85p-5), -0.025787353515625(-0x1.a68p-6), 0.06396484375(0x1.06p-4), 0.0968017578125(0x1.8c8p-4)] ; [0.354736328125(0x1.6b4p-2), 0.309814453125(0x1.3d4p-2), 0.318359375(0x1.46p-2), 0.248046875(0x1.fcp-3)] ; [0.802734375(0x1.9bp-1), -0.98779296875(-0x1.f9cp-1), 0.17529296875(0x1.67p-3), 0.468505859375(0x1.dfcp-2)] ; [-0.2010498046875(-0x1.9bcp-3), 0.40087890625(0x1.9a8p-2), 0.2413330078125(0x1.ee4p-3), 0.1617431640625(0x1.4b4p-3)] +- in33 tap(+1,+0): cols [-0.2061767578125(-0x1.a64p-3), -0.11798095703125(-0x1.e34p-4), 0.1390380859375(0x1.1ccp-3), -0.055633544921875(-0x1.c7cp-5)] ; [0.00370025634765625(0x1.e5p-9), -0.272216796875(-0x1.16cp-2), 0.086669921875(0x1.63p-4), -0.3427734375(-0x1.5fp-2)] ; [-0.3291015625(-0x1.51p-2), -0.39111328125(-0x1.908p-2), 0.1134033203125(0x1.d08p-4), -0.0020427703857421875(-0x1.0bcp-9)] ; [-0.25(-0x1p-2), 0.278076171875(0x1.1ccp-2), 0.1669921875(0x1.56p-3), 0.1024169921875(0x1.a38p-4)] +- in33 tap(+1,+1): cols [-0.1727294921875(-0x1.61cp-3), -0.1502685546875(-0x1.33cp-3), 0.1876220703125(0x1.804p-3), -0.0819091796875(-0x1.4f8p-4)] ; [0.293701171875(0x1.2ccp-2), 0.33935546875(0x1.5b8p-2), 0.51611328125(0x1.084p-1), 0.0394287109375(0x1.43p-5)] ; [-0.1339111328125(-0x1.124p-3), -0.81982421875(-0x1.a3cp-1), 0.2137451171875(0x1.b5cp-3), 0.57177734375(0x1.24cp-1)] ; [0.199951171875(0x1.998p-3), 0.248046875(0x1.fcp-3), 0.04522705078125(0x1.728p-5), 0.1513671875(0x1.36p-3)] diff --git a/cleanroom/specs/17-refine-large.md b/cleanroom/specs/17-refine-large.md new file mode 100644 index 0000000..8df13a4 --- /dev/null +++ b/cleanroom/specs/17-refine-large.md @@ -0,0 +1,553 @@ +# Spec: shader_17 — "refine-large" (two-layer 3x3 convolutional network, 2 inputs -> 2 outputs) + +Source of truth: `asm/shader_17.spvasm`. Everything below was derived from that +disassembly alone. + +## 1. Interface + +- **Workgroup size**: `LocalSize 16 16 1` (`gl_WorkGroupSize = (16,16,1)`). +- **Descriptors** (all descriptor set 0): + +| binding | kind | SPIR-V type | access | role name used below | +|---|---|---|---|---| +| 32 | combined image sampler | 2D, float, non-depth, single-sampled | read (texelFetch only, LOD 0) | `tex32` | +| 33 | combined image sampler | 2D, float, non-depth, single-sampled | read (texelFetch only, LOD 0) | `tex33` | +| 48 | storage image | 2D, `rgba8` (unorm) | write-only (`NonReadable`) | `out48` | +| 49 | storage image | 2D, `rgba8` (unorm) | write-only (`NonReadable`) | `out49` | + +- **No UBO, no push constants, no spec constants.** (Pipeline-level context + mentioned a "flowScale" UBO at binding 0; this shader declares no such thing. + It does not appear in the disassembly and must not be added.) +- The sampler halves of bindings 32/33 are never used: every read is an + integer-coordinate `texelFetch(image, ivec2, lod=0)`. No normalized UVs, no + filtering, no explicit sampling exists anywhere in this shader. +- **Capabilities**: `Float16` — all network arithmetic is genuine IEEE + half-precision (`float16_t` / `f16vec4` via + `GL_EXT_shader_explicit_arithmetic_types_float16`), not mediump hints. +- **Shared memory**: two arrays `hidA[18][18]`, `hidB[18][18]` of `f16vec4` + (indexed `[x][y]`, x = first index). + +## 2. Big picture + +This is a tiny fused 2-layer convolutional network evaluated per-pixel: + +- **Layer 1** (per workgroup, cooperative): a 3x3 convolution reading the two + 4-channel input images (8 input channels) and producing two 4-channel hidden + planes; results for an 18x18 tile (16x16 outputs + 1-texel halo) are stored + in shared memory. Activation = affine renorm then clamp to [0,1]. +- **Layer 2** (per thread): a 3x3 convolution over the two hidden planes + (8 hidden channels) producing two 4-channel outputs, each affine-renormed and + written to `out48` / `out49` at the thread's global pixel. + +All convolution weights and affine constants are compile-time literals baked +into the shader (72 half-precision 4x4 matrices + 12 half 4-vectors), listed +exhaustively in section 7. + +### Conventions used below + +- `gid = ivec2(gl_GlobalInvocationID.xy)`, `lid = ivec2(gl_LocalInvocationID.xy)`, + `wg = ivec2(gl_WorkGroupID.xy)`, `lindex = gl_LocalInvocationIndex`. +- Matrices are given as 4 columns `c0..c3` of 4 half values each. The product + used everywhere is SPIR-V `OpMatrixTimesVector`, identical to GLSL + `M * v` with `f16mat4 M = f16mat4(c0, c1, c2, c3)`: + `M*v = c0*v.x + c1*v.y + c2*v.z + c3*v.w`. +- The 9 conv taps are always enumerated in the fixed order + `(dx,dy) = (-1,-1), (-1,0), (-1,+1), (0,-1), (0,0), (0,+1), (+1,-1), (+1,0), (+1,+1)` + (dx outer / slowest, dy inner). Weight tables in section 7 are keyed by this + `(dx,dy)`. +- Accumulation order matters for fp16 bit-exactness. Each conv unit computes, + over its 18 (source, tap) terms in the order: all 9 taps of the first source + in tap order, then all 9 taps of the second source in tap order: + `acc = W[0]*v[0] + W[1]*v[1]; for k in 2..17: acc = acc + W[k]*v[k];` + i.e. a single left-to-right sequential sum, entirely in fp16. + +## 3. Phase 1 — cooperative hidden-layer tile fill + +Tile geometry: `tileOrigin = wg * 16 - ivec2(1,1)`. The 18x18 tile entry +`(tx,ty)`, `0 <= tx,ty < 18`, corresponds to image pixel +`p = wg*16 + ivec2(tx,ty) - ivec2(1,1) = tileOrigin + (tx,ty)`. + +Each thread loops `for (i = lindex; i < 324; i += 256)` (so threads 0..67 fill +two entries, the rest one) with `tx = i % 18`, `ty = i / 18`: + +1. **Center-validity early-out.** Let `sz32 = textureSize(tex32, 0)`. + If `p.x < 0 || p.y < 0 || p.x >= sz32.x || p.y >= sz32.y` then + `hidA[tx][ty] = f16vec4(0); hidB[tx][ty] = f16vec4(0);` and this tile entry + is done. NOTE: this stores *exact zeros*, which is NOT the same value the + network would produce on all-zero inputs (the affine step below has nonzero + offsets); implementers must reproduce the early-out, not fold it into + zero-padding. +2. **Gather 9 taps from each input.** For each `(dx,dy)` in tap order and each + image `I` in `{tex32, tex33}`: + `q = p + (dx,dy)`; + `v_I(dx,dy) = f16vec4( inBounds(q, textureSize(I,0)) ? texelFetch(I, q, 0) : vec4(0) )` + where `inBounds(q,s) = q.x>=0 && q.y>=0 && q.x