| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Fix CI.
|
|
|
|
|
| |
Clean up. All apps now translating correctly except for the phases of
the self-hosted translator. Next step: SubX-in-SubX in SubX-in-SubX.
|
|
|
|
| |
Bugfix fifteen -- on the C++ side.
|
|
|
|
| |
All that debugging and it turns out the bug is on the C++ side!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Snapshot while debugging survey.subx by print.
I can see the error in 1 minute with this command:
subx run apps/survey < a.pack
(where a.pack is obtained from `ntranslate 049*.subx 05[0-8]*.subx`)
By contrast, using the trace requires 4.5 minutes:
subx --trace run apps/survey < a.pack
It generates a trace of 4.4GB with almost 83M lines.
The trace takes 2 minutes to load.. oops, I forgot to load labels with
`--debug`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Even though the standard library is building and passing tests, the
binaries it generates aren't exactly bit for bit identical with the
originals. Comparing using `diff_ntranslate`, it looks like the data
segment starting address isn't computed right in survey.subx
(`compute-addresses`) when I start translating layer 058. Deleting some
tests brings the code segment to a p_offset where bits 8-11 (the lowest
4 bits excluding the lowermost byte) are cleared and everything works.
However, if bits 8-11 are set, then they don't make it to p_vaddr and
p_paddr.
Tried reproducing with a unit test, but the unit test passes fine.
|
|
|
|
| |
A couple of scripts that help debug discrepancies in the self-hosted translator.
|
|
|
|
| |
Stop rebuilding example programs just because subx_bin got recreated.
|
|
|
|
| |
Make the output of the `pack` phase a little easier to read.
|
|
|
|
| |
Fix a timeout in CI.
|
|
|
|
| |
Really fix CI.
|
|
|
|
| |
Fix CI.
|
| |
|
|
|
|
|
|
|
| |
Translates 5k lines of input in 26 seconds.
I'm not sure why I need to grow the label table. It was already 512 entries
long, and I'm only using 373 so far.
|
|
|
|
|
|
|
|
|
| |
We can now translate layers 49-72 using the self-hosted translator.
The translator has now demonstrated translation over 4k lines. Most verbose
phase output is 325KB, even if the final binary is 15KB.
Emulation is too slow now, so I'm back to debug by print on a Linux machine.
|
|
|
|
|
| |
Now our debug cycle passes through `translate` or `ntranslate`. Make
sure we rebuild phases whenever we need to.
|
|
|
|
| |
Fix CI.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can now translate layers 49-56 using the self-hosted translator
(`translate` and `ntranslate`).
As a follow-up to commit 5404, the self-hosted translator is a little
more strict than the C++ translator in 3 places:
a) All .subx files must define a data segment.
b) All .subx files must define an `Entry` label.
c) All numbers must be in *lowercase* hex.
In all cases, where programs work with the C++ translator but violate
the self-hosted translator's assumptions, we must make sure we raise
errors rather than silently emit bad code.
|
|
|
|
| |
Break a dependency from `print-int32` to `from-hex-char`.
|
| |
|
|
|
|
|
| |
We can now translate layers 49-55 using translate and ntranslate. Next
step is to support '\n' in dquotes.subx.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Currently failing at layer 54:
```
$ time ./translate 049memory_layout.subx 05[0-4]*.subx; ./subx run a.elf test
leaky-get-or-insert-slice: too many segments
```
Emulation is also damn slow. But running in native mode is fast.
|
|
|
|
|
| |
We now have a new pass called 'tests' which code-generates a new
function called 'run-tests', just like the C++ layer `tests.cc`.
|
|
|
|
| |
Fix CI.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Various buffer sizes needed to be grown for ex11. But the next
bottleneck is that we need to code-generate run-tests.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Bugfix fourteen: we need different address computation logic for code vs
data labels.
It's really about different categories of instructions having different
address computation logic. This subtle distinction will make good error
messages hard. But that's a problem for later.
Now there's just one example program not translating.
|
|
|
|
|
| |
When running a single test, stop always opening the trace. Instead create
a separate affordance for that, and also have it reuse windows.
|
|
|
|
| |
Clean up.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Figured out what's going in with bug fourteen: displacement operands
aren't always used relative to the PC. Does this mean I need to track
instruction boundaries past pack? :'(
No, I just need different logic for labels in code vs data segments.
This was an interesting bug for reminding me of the difference between
the emulator-level trace and the application-level trace. The former has
1.5 million lines, while the latter has a dozen. Luckily, just dumping
the latter immediately made obvious what the issue was.
Though this experience does suggest some further ideas for debugging
tools:
slice trace by line and phase
slice trace by start and end label
debug UI for SubX translator
2D layout: rows = lines of code; columns = translator phases
each 'cell' in this layout contains a list of log lines
shows what came in, what was emitted
easily collapse any cell
These are domain-specific tools. Special-cased to the SubX translator
phases.
|
|
|
|
|
|
|
|
| |
Bugfix thirteen: displacement calculations were wrong because current
offset was not being updated properly as words were being read and
emitted.
Now 10/12 example programs are translated correctly.
|
| |
|
|
|
|
|
|
|
| |
Bugfix twelve: ModR/M was being incorrectly computed.
This is one of two problems with subx/examples/ex3, so no new passing
examples.
|
|
|
|
| |
Fix CI.
|
|
|
|
| |
Fix CI.
|
|
|
|
|
| |
Clean up other examples as well to satisfy the requirements in commit
5404.
|
|
|
|
|
| |
Bugfix eleven: segment flags were incorrectly computed. examples/ex1 now
verified! Added to CI.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bugfix ten: type error in `convert`. I was calling `rewind-stream` on a
`buffered-file`.
examples/ex1 is now just one nibble off the canonical.
I *have* found one missing feature in the self-hosted translator,
though: dquotes doesn't support newlines in strings, even though the C++
version does. dquotes parses them right, but the value initialized in
the data segment is wrong.
|