Skip to content

Instantly share code, notes, and snippets.

View Zac-HD's full-sized avatar

Zac Hatfield-Dodds Zac-HD

View GitHub Profile
@Zac-HD
Zac-HD / projects.md
Last active September 14, 2023 05:04

EA Hackathon Projects

Almost all projects started at hackathons die young, whether because the team doesn't prioritize continuing work, or because the idea wasn't actually what users needed. So: if you want impact, I think you should contribute to existing projects such as the open-source issues below. Contributing to open-source is also a great way to develop software engineering skills, which are a key bottleneck for AI Safety research among other fields, and I think a day modelled on PyCon sprints can help.

I've selected the issues below to be feasible first-time contributions to open source for people who are already comfortable programming in Python. Even if they seem sm

@Zac-HD
Zac-HD / student-project-ideas.md
Last active September 14, 2023 05:04
Undergraduate project ideas for PBT research
@Zac-HD
Zac-HD / .github__workflows__ci.yml
Created August 18, 2021 05:47
Zac's simple CI setup
name: Project CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
run-tox:
"""
You are writing simple budgeting softare. A Budget consists of a total limit,
represented as a positive integer, and a dictionary of category limits,
represented as a map from strings to integers. For example:
{
"total_limit": 50,
"category_limits": {
"food": 10,
"rent": 11,
@Zac-HD
Zac-HD / hypothesis-crosshair.md
Last active July 18, 2022 06:47
Notes for a project to combine property-based tests with SAT-solving, based on the Hypothesis and Crosshair libraries.

Hybrid concrete/symbolic testing

You’ve probably heard that "testing can be used to show the presence of bugs, but never to show their absence" - usually as an argument for formal methods like symbolic execution. On the other hand, testing is often easier and finds bugs in formally verified systems too. But why not use both?

Crosshair is an SMT-based symbolic execution tool for Python. Providing an interface or extension to check Hypothesis

# Some example code for PyH2 hardware testing
import math
import os
import random
import sys
import afl
from hypothesis import given, strategies as st
@Zac-HD
Zac-HD / plyfile-test.py
Last active July 11, 2020 15:18
This is a very simple test using https://hypothesis.readthedocs.io to assert that cycling write/read/write/read is lossless for plyfile.PlyData instances. Comment serialization is currently lossy (for eg. ascii whitespace) or throws exceptions (unicode encode errors when not ascii).
import string
from hypothesis import given, strategies as st
from hypothesis.extra.numpy import arrays
#import os, sys; sys.path.insert(0, os.path.abspath('.')); del sys; del os
import plyfile
# Simple strategy for a list of unicode strings
st_comments = st.lists(elements=st.text())