Skip to content

Commit

Permalink
mandelbrot update
Browse files Browse the repository at this point in the history
  • Loading branch information
noahmbright committed Nov 20, 2024
1 parent 9d94145 commit 15c1b8b
Show file tree
Hide file tree
Showing 8 changed files with 366 additions and 35 deletions.
47 changes: 26 additions & 21 deletions about.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<nav-bar></nav-bar>
</header>

<section>
<section class="main-content">
<h2> About </h2>

<p>
Expand All @@ -32,8 +32,9 @@ <h2> About </h2>
After getting my BS and realizing I didn't really want to be an
academic, I went back to school for ECE. I figured that I could
find an avenue to apply what I learned in undergrad, or learn a
little bit about programming, something I was always curious about,
but had only gained a little bit of experience with.
little bit about programming. I had done plenty of scientific
computing in Numpy and Scipy, but had never done "real"
programming, and was curious to see what that was really about.
</p>

<p>
Expand All @@ -55,35 +56,36 @@ <h2> About </h2>
class, and that was when I really got hooked on CS and programming.
The professor would mention what the compiler could do before it
emitted assembly and I would always think "the compiler can do
what???". For our final project, we wrote an architectural
simulator, which only in hindsight I realize was a simple assembly
interpreter with extra bookkeeping. That was one of the first real
projects I ever finished, and it was a lot of fun.
what???". For our final project, we wrote an <a
href="projects.html#architecture-simulator">architecture simulator</a>, which
only in hindsight I realize was a simple assembly interpreter with
extra bookkeeping. That was one of the first real projects I ever
finished, and it was a lot of fun.
</p>

<p>
Now, being out of school, I spend a lot of time continuing to study
what I sort of feel like I missed in school. It's easy to regret
not getting on the fast track to FAANG, but I really love math and
physics, and we all need to find our own ways. Part of the
motivation for making this site is to show my enthusiasm and what
I've studied myself, since I can't fall back on the amazing SWE
internships I've had - I never even thought to apply.
what I sort of feel like I missed in school. Now, I couldn't
imagine myself doing much other than coding for a day job, but I
really loved (and still do) math and physics, and we all need to
find our own ways. Part of the motivation for making this site is
to show my enthusiasm and what I've studied myself. I'm also
hoping that my projects will end up complete and well documented
enough to become teaching resources.
</p>

<p>
It's fun to continue to have something to learn though - that will
always be there with something as broad as programming. My current
infatuation is with compilers. I had a moment reading about
dominance frontiers where it clicked that compilers are absolutely
the coolest thing ever. You can empower people to make computers do
whatever you want and you get to study all these super cool
algorithms. I know I have a lot to learn in that field, but I'm
excited to chip away at it. I taught myself General Relativity as
an undergrad so I could do research, so I'm sure I can handle some
graph algorithms (or whatever you might be hiring for). See my <a
href="projects.html"> projects </a> for some of the things I've been
studying.
the coolest thing ever. You get to make coding as most people know
it possible, and there's so much to learn that you'll never get
bored. I taught myself General Relativity as an undergrad so I
could do research, so I'm sure I can handle some graph algorithms
(or whatever you might be hiring for). See my <a
href="projects.html"> projects </a> for some of the things I've
been studying.
</p>

<p>
Expand All @@ -92,6 +94,9 @@ <h2> About </h2>
in a bit of Korean.
</p>

<p>
I use vim, btw.
</p>
</section>

</body>
Expand Down
32 changes: 32 additions & 0 deletions applets.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=devide-width, initial-scale=1">
<title> Toys </title>
<link rel="stylesheet" href="style.css">
<script defer src="navbar.js"></script>
</head>

<body>

<header>
<nav-bar></nav-bar>
</header>

<section class="main-content">
<h2> Some toys </h2>
<ul>
<li> <a href="mandelbrot.html"> A Mandelbrot Set </a>
implementation. A first pass uses some Javascript functional
programming to make a static zoomed out version. The WebGL
implementation is in progress.
</li>
</ul>
</section>

</body>

</html>

4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
<nav-bar></nav-bar>
</header>

<section>
<section class="main-content">
<h2> Welcome </h2>
<p>
Hi everyone, I'm Noah. Welcome to my site.
Hi everyone, I'm Noah. Welcome.
</p>
</section>

Expand Down
40 changes: 31 additions & 9 deletions mandelbrot.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,44 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=devide-width, initial-scale=1">
<title> Noah </title>
<title> The Mandelbrot Set </title>
<link rel="stylesheet" href="style.css">
<script defer src="navbar.js"></script>
</head>

<body>
<h1> asdf </h1>
<header>
<nav-bar></nav-bar>
</header>

<main>
Homepage
</main>
<section class="main-content">
<h1> The Mandelbrot Set </h1>

<canvas id="mandelbrotCanvas" width="512" height="512" style="border:1px solid #000000;"></canvas>
<div class="javascript-mandelbrot">
<h3> The Vanilla Javascript version </h3>

<div>
<script src ="scripts/complex.js"></script>
</div>
<canvas id="mandelbrotCanvas" width="512" height="512" style="border:1px solid #000000;"></canvas>

<div>
<script src ="scripts/complex.js"></script>
</div>

<p>
A version using WebWorkers is on the way.
</p>

</div>

<div class="webgl-mandelbrot">
<h3> Using WebGL </h3>

<canvas id="webgl-mandelcanvas" width="512", height="512" style="border:1px solid #000000;"></canvas>
<div>
<script src ="scripts/mandelbrot_webgl.js"></script>
</div>

</div>
</section>


</body>
Expand Down
1 change: 0 additions & 1 deletion navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class NavBar extends HTMLElement{
<ul>
<li><a href="index.html"> Home </a></li>
<li><a href="about.html"> About </a></li>
<li><a href="mandelbrot.html"> Mandelbrot </a></li>
<li><a href="projects.html"> Projects </a></li>
</ul>
</nav>
Expand Down
125 changes: 125 additions & 0 deletions projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,129 @@
<header>
<nav-bar></nav-bar>
</header>


<section class="main-content">
<p>
Here's a collection of things I've been working on. Most of these
are things I've worked on since finishing school, trying to learn
programming fundamentals.
</p>

<p>
This site is a bit of a project itself, trying to see what
basic HTML, CSS and vanilla Javascript can get you. <a
href="applets.html"> here </a> are some in-browser toys I've
thrown together that I wouldn't really consider their own
standalone projects. Read on for things that warrant their own
repo.
</p>


<div class="project-dropdown">
<details>
<summary>
<h3 class="project-name" id="architecture-simulator"> RISC-V Interpreter and Computer
Architecture Simulator </h3>
</summary>
<div class="project-description">
<p>
This was the final project for the computer architecture course I
took in my last semester of school, which was really influential on
me. I would link to the code if it wasn't going to be reused in
future semesters.
</p>

<p>
The goal of the project was to write a program that simulated an
out-of-order (OoO), speculative CPU with branch prediction and register
renaming. The simulator would read in a configuration
parameterizing the CPU, as well as a program describing the initial
state of the CPU's memory and a program written in a subset of
RISC-V assembly. Our simulator would interpret the program and
output the execution time in number of cycles, as well as report
bottlenecks in the execution pipeline, as measured by where it was
necessary to stall processing.
</p>

<p>
The real complication in the processor was the use of branch
prediction along with OoO, speculative execution. Branch
instructions in the program are assigned a branch predictor, a
state machine describing if the branch is likely to be taken or
not; it's possible that this prediction is incorrect.
</p>

<p>
To increase performance, modern CPUs use pipelined, OoO
execution. Pipelining is a form of parallelism achieved
by having different processing steps occur
simultaneously for different instructions. For example,
in one cycle, an add instruction might be executing the
addition operation while the next instruction is
getting fetched. That way, the add unit on the CPU and
the fetch unit are both utilized, instead of waiting
for each other when their results are unrelated.
</p>

<p>
OoO execution is another optimization that allows
instructions to execute when their data is ready, as
opposed to when it is their turn in program order. For
example if you want to add a and b, but between their
computation and the addition, you also compute c,
out-of-order execution allows the processor to skip
waiting on c.
</p>

<p>
OoO execution and pipelining obviously introduce
concerns about program correctness. These issues are
called hazards, and come in three flavors: write after
write (WAW), write after read (WAR), and read after
write (RAW). A RAW hazard is a true data dependence; a
register is written to, and then afterwards, a subsequent
instruction reads the result. WAWs occur when two instructions
write to the same register; if the writes occur out of order,
thereafter, the register contains the wrong value. In the WAR
case, a write to a register occurs after a read; if these are
out of order, the read value will premature read a value
that should not yet have been there.
</p>

<p>
These risks only exist because a register is at risk of
being written to before it ought to be. This issue
wouldn't exist if we had an infinitely large register
file to use, and only wrote to a register once. This
motivates the technique called register renaming.
Whenever a register is going to be written to, the
processor renames it. It keeps a mapping of real,
physical registers to artificial registers it uses for
renaming, as well as a free list of physical registers
that don't contain a live value, still needing to be
read in its current state.
</p>

<p>
</p>
</details>
</div>


<div class="project-dropdown">
<details>
<summary>
<h3 class="project-name" id="miniclang"> Miniclang </h3>
</summary>
<div class = "project-description">
<p>
asdf
</p>
</div>
</details>
</div>

<section>

</body>
Loading

0 comments on commit 15c1b8b

Please sign in to comment.