Skip to content

Instantly share code, notes, and snippets.

Arseny Kapoulkine zeux

Block or report user

Report or block zeux

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zeux
zeux / roblox-lua-vm.md
Last active May 12, 2019
Frequently asked questions about the Lua VM work we (Roblox) are doing.
View roblox-lua-vm.md

We're working on a new Lua VM for Roblox and also introducing optional type checking to Lua (based on a combination of type inference and type annotations - the latter require extensions to the syntax). This page summarizes the questions often asked.

Why not just use LuaJIT?

We obviously know about LuaJIT; it's a fantastic project, and really what inspired us to go down this route - it provided an existence proof that Lua can be much faster. Our primary performance target is a wide set of platforms, many of which (iOS, Xbox) don't allow JIT per se - but LuaJIT has a very fast interpreter. So - use it, we're done? Well...

LuaJIT is a large, almost complete rewrite of Lua VM. Over the years we had a set of changes aimed at improving sandboxing in the VM -

@zeux
zeux / murmur.h
Last active Feb 28, 2019
MurMurHash finalizers as 32-bit integer/pointer hashers
View murmur.h
uint32_t murmur2(uint32_t h)
{
h ^= h >> 13;
h *= 0x5bd1e995;
h ^= h >> 15;
return h;
}
uint32_t murmur3(uint32_t h)
@zeux
zeux / simplifier.cpp
Created Feb 18, 2019
SIMD sloppy simplifier for "Flavors of SIMD" blog post
View simplifier.cpp
// This file is part of meshoptimizer library; see meshoptimizer.h for version/license details
#include "meshoptimizer.h"
#include <assert.h>
#include <float.h>
#include <math.h>
#include <string.h>
#ifndef TRACE
#define TRACE 0
@zeux
zeux / launch.json
Created Feb 12, 2019
Visual Studio Code launch.json for debugging with gdb via WSL
View launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "/mnt/c/work/meshoptimizer/build/debug/meshoptimizer",
"args": ["-d", "data/kitten.obj"],
"stopAtEntry": false,
@zeux
zeux / README.md
Last active Jan 19, 2019
Reproduction for 36 seconds of simplification time in debug when using MSVC 2017 x64 with default settings on buddha.obj
@zeux
zeux / README.md
Last active May 23, 2019
Simplifier variants
View README.md
View roblox-graphics-apis-2019.md

State of Roblox graphics API across all platforms, with percentage deltas since EOY 2018. Updated May 15 2019.

Windows

API Share
Direct3D 11+ 81.5% (+1.5%)
Direct3D 10.1 10%
Direct3D 10.0 7% (-1%)
Direct3D 9 1.5% (-0.5%)
@zeux
zeux / meshoptimizer.log
Created Dec 5, 2018
Amazon A1 (AArch64) vs Amazon T2 (x64). VtxCodec uses SSSE3 on x64 and NEON on ARM. Look at revision history to see the diff.
View meshoptimizer.log
a1.medium $ ./build/release/meshoptimizer buddha.obj
# buddha.obj: 549409 vertices, 1087474 triangles; read in 483.46 msec; indexed in 354.61 msec
Original : ACMR 1.556966 ATVR 3.081784 (NV 3.124747 AMD 3.277660 Intel 2.289651) Overfetch 2.105950 Overdraw 1.200370 in 0.00 msec
Random : ACMR 2.999919 ATVR 5.937897 (NV 5.937882 AMD 5.937935 Intel 5.936783) Overfetch 10.839888 Overdraw 1.218682 in 33.38 msec
Cache : ACMR 0.661465 ATVR 1.309272 (NV 1.590738 AMD 1.434356 Intel 1.138871) Overfetch 1.509062 Overdraw 1.206893 in 477.86 msec
CacheFifo: ACMR 0.689948 ATVR 1.365651 (NV 1.706663 AMD 1.516610 Intel 1.229416) Overfetch 1.552013 Overdraw 1.197034 in 146.00 msec
Overdraw : ACMR 2.776432 ATVR 5.495538 (NV 5.508446 AMD 5.527603 Intel 5.314811) Overfetch 8.624212 Overdraw 1.086317 in 209.29 msec
Fetch : ACMR 1.556966 ATVR 3.081784 (NV 3.124747 AMD 3.277660 Intel 2.289651) Overfetch 2.105950 Overdraw 1.200370 in 25.13 msec
FetchMap : ACMR 1.556966 ATVR 3.081784 (NV 3.124747 AMD 3.277660 Intel 2.289651) O
@zeux
zeux / ucd.log
Last active Nov 20, 2018
Loading ucd.all.grouped.xml with pugixml (https://pugixml.org), with default settings and with PUGIXML_COMPACT
View ucd.log
~/pugixml$ cat ucd.cpp
#include "pugixml.hpp"
#include <malloc.h>
int main()
{
pugi::xml_document doc;
doc.load_file("ucd.all.grouped.xml");
malloc_stats();
}
@zeux
zeux / remap-interface-ids.cpp
Created Oct 2, 2018
Workaround for Adreno drivers that match varyings across stages using SPIRV names or IDs, but not locations as they should.
View remap-interface-ids.cpp
class RemapInterfaceIdsPass : public spvtools::opt::Pass
{
public:
const char* name() const override { return "remap-interface-ids"; }
RemapInterfaceIdsPass(uint32_t start_id): start_id(start_id)
{
}
Status Process() override
You can’t perform that action at this time.