Skip to content

Instantly share code, notes, and snippets.

View sskeirik's full-sized avatar

Stephen Skeirik sskeirik

View GitHub Profile
@sskeirik
sskeirik / perf.md
Last active April 29, 2025 21:50
`perf` Explainer

perf Introduction

Using the perf tool centers around the following concepts:

  1. events - these are hardware interrupts, hardware counters, or software events can be tracked
  2. targets - while these CPUs, processes, or threads are executing, events will be tracked (tracking is disabled otherwise)
  3. filters - these are predicates on event contexts used to control which events are tracked in which contexts

As I understand it, perf can operate in two main modes (as indicated by the perf stat and perf record subcommands):

@sskeirik
sskeirik / cross-chain-notes.md
Last active September 22, 2021 05:47
Cross Blockchain Notes

Offsides: Blockchain Scaling and Interoperability

Blockchain Layers

Interoperability and scaling solutions for blockchains can be implemented at two different layers:

  • Layer 1 (L1) - the code which implements the blockchain runtime (e.g., gossip, consensus, txn processing, etc.); L1 updates require a hard/soft network fork
  • Layer 2 (L2) - any code which is not baked into the blockchain runtime (e.g., smart contracts, external entities); L2 updates do not require network forks

Let's use L1/L2 scaling/interoperability to to refer solutions implemented at the respective layer.

@sskeirik
sskeirik / k-history-notes-v1.md
Created August 2, 2021 22:54
A History of K Implementations

K Papers

Theory/Notation Papers

Year Type Name URL
2003 Notes CS322 Fall 2003: Programming Language Design - Lecture Notes – https://www.ideals.illinois.edu/handle/2142/11385
2005 Tech Report K: a Rewrite-based Framework for Modular Language Design, Semantics, Analysis and Implementation - Version 1 - https://www.ideals.illinois.edu/handle/2142/11215
2006 Tech Report K: a Rewrite-based Framework for Modular Language Design, Semantics, Analysis and Implementation - Version 2 - https://www.ideals.illinois.edu/handle/2142/11284
2007 Tech Report K: a Rewrite-based Framework for Modular Language Design, Semantics, Analysis and Implementation - Preliminary Version - https://www.ideals.illinois.edu/handle/2142/11354
@sskeirik
sskeirik / vault_sandbox_setup.sh
Last active February 2, 2021 06:42
Sandbox Setup Script for Vault Application
#!/bin/bash
if [ -z "$SANDBOX_PATH" ] || [ ! -f "$SANDBOX_PATH/sandbox" ] ; then
echo "Error: \$SANDBOX_PATH must be defined and point to a sandbox binary."
echo "To use this script, first clone the Algorand sandbox:"
echo
echo "git clone https://github.com/algorand/sandbox"
echo
echo "Then set \$SANDBOX_PATH to the newly created directory for the git clone"
echo
@sskeirik
sskeirik / michelson-example-rule.txt
Created November 2, 2020 20:17
Michelson Example Rule: Addition
rule <k> ADD => . ... </k>
<stack> [ int I ] ; [ int J ] => [ int (I +Int J) ] ... </stack>
@sskeirik
sskeirik / michelson-example-config.txt
Created November 2, 2020 20:16
Michelson Example Configuration
<k> ADD </k>
<stack> [ int 2 ] ; [ int 3 ] </stack>
@sskeirik
sskeirik / identity-symbolic.tzt
Last active August 20, 2020 15:59
Symbolic Identity Unit Test Michelson
// Symbolic Unit Test for Identity Function
// lines 3 and 24 represent our input and expected output stack respectively
input { Stack_elt nat $N } ;
code { DUP ;
PUSH nat 0 ;
SWAP ;
INT ;
GT ;
// Loop assigned name @I
LOOP @I {
@sskeirik
sskeirik / identity.tzt
Created July 24, 2020 18:10
Identity Unit Test Michelson
input { Stack_elt nat 5 } ;
code { DUP ;
PUSH nat 0 ;
SWAP ;
INT ;
GT ;
LOOP {
PUSH nat 1 ;
ADD ;
DUP ;
@sskeirik
sskeirik / bison-error.k
Last active June 24, 2020 00:00
Bison Error Input
module BISON-ERROR-SYNTAX
imports LIST
// imports SET // this also triggers the error
endmodule
module BISON-ERROR
imports BISON-ERROR-SYNTAX
endmodule
@sskeirik
sskeirik / byte-manipulation-lemmas.k
Created March 21, 2020 03:36
KWasm Lemmas for Byte Manipulation
rule lengthBytes(B1 +Bytes B2) => lengthBytes(B1) +Int lengthBytes(B2) [simplification]
rule substrBytes(B1 +Bytes B2, START, END)
=> substrBytes(B1, START, END)
requires lengthBytes(B1) >=Int END
[simplification]
rule substrBytes(B1 +Bytes B2, START, END)
=> substrBytes(B2, START -Int lengthBytes(B1), END -Int lengthBytes(B1))
requires lengthBytes(B1) <=Int START
[simplification]
rule substrBytes(B1 +Bytes B2, START, END)