chiark / gitweb /
otter.git
3 years agoRocket cleanup: Call our tera tera
Ian Jackson [Sun, 27 Mar 2022 22:54:10 +0000 (23:54 +0100)]
Rocket cleanup: Call our tera tera

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix cleanup: Note a done todo
Ian Jackson [Sun, 27 Mar 2022 22:41:35 +0000 (23:41 +0100)]
actix cleanup: Note a done todo

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix cleanup: Remove actix test programs
Ian Jackson [Sun, 27 Mar 2022 22:41:12 +0000 (23:41 +0100)]
actix cleanup: Remove actix test programs

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoRevert "Mutex debug: Enable it (for demo and testing)"
Ian Jackson [Sun, 27 Mar 2022 22:40:14 +0000 (23:40 +0100)]
Revert "Mutex debug: Enable it (for demo and testing)"

This reverts commit 7456a32426e6b4a487adcc279db4547639a0ffba.

3 years agoMutex debug: Actually add some debug messages.
Ian Jackson [Sun, 27 Mar 2022 12:54:15 +0000 (13:54 +0100)]
Mutex debug: Actually add some debug messages.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMutex debug: Use Debug for DebugIdentify, not Display
Ian Jackson [Sun, 27 Mar 2022 12:54:01 +0000 (13:54 +0100)]
Mutex debug: Use Debug for DebugIdentify, not Display

This will make the types useable with dbg!.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMutex debug: Introduce DebugIdentify trait
Ian Jackson [Sun, 27 Mar 2022 12:32:24 +0000 (13:32 +0100)]
Mutex debug: Introduce DebugIdentify trait

And implement it for many of our types.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMutex debug: Enable it (for demo and testing)
Ian Jackson [Sun, 27 Mar 2022 22:31:03 +0000 (23:31 +0100)]
Mutex debug: Enable it (for demo and testing)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMutex debug: Add example (commented out) of engaging it
Ian Jackson [Sun, 27 Mar 2022 11:47:08 +0000 (12:47 +0100)]
Mutex debug: Add example (commented out) of engaging it

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMutex debug: Introduce Mutex and guard types
Ian Jackson [Sun, 27 Mar 2022 11:46:54 +0000 (12:46 +0100)]
Mutex debug: Introduce Mutex and guard types

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: add Debug bound to Deserialize trait for Parse
Ian Jackson [Sun, 27 Mar 2022 21:54:34 +0000 (22:54 +0100)]
actix: add Debug bound to Deserialize trait for Parse

We don't actually use this but it makes some dbg!() work if in case we
need them.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix conversion: Update docs
Ian Jackson [Sat, 26 Mar 2022 14:14:05 +0000 (14:14 +0000)]
actix conversion: Update docs

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoRocket cleanup: Remove some workarounds from config templates
Ian Jackson [Sat, 26 Mar 2022 14:13:51 +0000 (14:13 +0000)]
Rocket cleanup: Remove some workarounds from config templates

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoRocket cleanup: Remove Rocket dependencies
Ian Jackson [Wed, 23 Mar 2022 22:11:58 +0000 (22:11 +0000)]
Rocket cleanup: Remove Rocket dependencies

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoRocket cleanup: Remove rocket_workers config variable
Ian Jackson [Sun, 27 Mar 2022 21:52:55 +0000 (22:52 +0100)]
Rocket cleanup: Remove rocket_workers config variable

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: Log an error if we have an internal server error
Ian Jackson [Sat, 26 Mar 2022 22:53:57 +0000 (22:53 +0000)]
actix: Log an error if we have an internal server error

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: Add logging
Ian Jackson [Sun, 27 Mar 2022 19:14:28 +0000 (20:14 +0100)]
actix: Add logging

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: Reorder calls on App to put the neader middleware last etc.
Ian Jackson [Sun, 27 Mar 2022 19:11:30 +0000 (20:11 +0100)]
actix: Reorder calls on App to put the neader middleware last etc.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: Replace Rocket
Ian Jackson [Sun, 27 Mar 2022 23:50:10 +0000 (00:50 +0100)]
actix: Replace Rocket

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: Final dependencies for conversion
Ian Jackson [Sun, 27 Mar 2022 14:58:31 +0000 (15:58 +0100)]
actix: Final dependencies for conversion

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: experiments: Test program: CORS
Ian Jackson [Sat, 26 Mar 2022 13:43:52 +0000 (13:43 +0000)]
actix: experiments: Test program: CORS

Partially C&P from Actix docs.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: experiments: Test program: nosniff header
Ian Jackson [Sat, 19 Mar 2022 19:09:54 +0000 (19:09 +0000)]
actix: experiments: Test program: nosniff header

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: experiments: Files test with not found handler
Ian Jackson [Sat, 19 Mar 2022 18:54:20 +0000 (18:54 +0000)]
actix: experiments: Files test with not found handler

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: experiments: Files test example program
Ian Jackson [Sun, 27 Mar 2022 20:18:24 +0000 (21:18 +0100)]
actix: experiments: Files test example program

More C&P from Actix docs.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: experiments: More test example program, with not found handler
Ian Jackson [Sat, 19 Mar 2022 17:01:24 +0000 (17:01 +0000)]
actix: experiments: More test example program, with not found handler

Partially C&P from Actix docs.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: experiments: More test example program
Ian Jackson [Sat, 26 Mar 2022 13:39:50 +0000 (13:39 +0000)]
actix: experiments: More test example program

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: experiments: A test example program for playing with
Ian Jackson [Sun, 6 Mar 2022 13:07:39 +0000 (13:07 +0000)]
actix: experiments: A test example program for playing with

C&P from Actix docs.  Not adding to copyright/licence tracking since
I am going to remove this again.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoactix: Add some initial dependencies
Ian Jackson [Sun, 6 Mar 2022 13:05:19 +0000 (13:05 +0000)]
actix: Add some initial dependencies

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTera templates: Add entry for rendering error to InternalError
Ian Jackson [Sun, 27 Mar 2022 19:05:42 +0000 (20:05 +0100)]
Tera templates: Add entry for rendering error to InternalError

Template rendering errors during web page rendering were previously
handled by Rocket.  We are going to have to deal with them ourselves.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoTera templates: Adjust syntax by moving imports to top
Ian Jackson [Sat, 26 Mar 2022 15:17:07 +0000 (15:17 +0000)]
Tera templates: Adjust syntax by moving imports to top

We are going to switch to a newer Tera which wants these at the top.
Empirically, we get a syntax error without this change.  The
requirementr doesn't seem to be documented, though.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoImport serde::de::Error trait
Ian Jackson [Fri, 25 Mar 2022 23:23:01 +0000 (23:23 +0000)]
Import serde::de::Error trait

Will be usweful for actix error conversion.

3 years agoAdd IpAddress helper trait
Ian Jackson [Thu, 24 Mar 2022 00:15:29 +0000 (00:15 +0000)]
Add IpAddress helper trait

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoIntroduce InvalidAbbrevPresentationLayout error type
Ian Jackson [Sat, 26 Mar 2022 00:32:52 +0000 (00:32 +0000)]
Introduce InvalidAbbrevPresentationLayout error type

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMake AbbrevPresentationLayout and Parse be Debug
Ian Jackson [Sat, 26 Mar 2022 19:45:34 +0000 (19:45 +0000)]
Make AbbrevPresentationLayout and Parse be Debug

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agosession URL: PresentationLayout is mandatory
Ian Jackson [Sun, 27 Mar 2022 00:40:14 +0000 (00:40 +0000)]
session URL: PresentationLayout is mandatory

These requests come from
  xhr_post_then('/_/session/' + layout
in script.ts, which gets layout via global-info and ultimately from
LoadingRenderContext, which contains a PresentationLayout, not an
Option.

git grep for "/session" reveals one in apitest, but that one is
hardcoded to use /Portrait.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDrop an unused type alias
Ian Jackson [Sat, 26 Mar 2022 12:02:21 +0000 (12:02 +0000)]
Drop an unused type alias

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMove DEFKEY_FLIP to where it ought to be used, and use it
Ian Jackson [Sat, 26 Mar 2022 12:02:07 +0000 (12:02 +0000)]
Move DEFKEY_FLIP to where it ought to be used, and use it

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agosse: Remove a now-redundant loop
Ian Jackson [Sun, 11 Jul 2021 22:49:36 +0000 (23:49 +0100)]
sse: Remove a now-redundant loop

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agosse: Return from read() impl immediately after cv return
Ian Jackson [Sun, 11 Jul 2021 22:47:25 +0000 (23:47 +0100)]
sse: Return from read() impl immediately after cv return

This is going to make it easier to work with a condvar wait which
disposes of the mutex guard.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agosse: Move to daemon
Ian Jackson [Sun, 11 Jul 2021 10:56:37 +0000 (11:56 +0100)]
sse: Move to daemon

We might perhaps be going to want this to use some macros from
our web framework.

(Commit originally intended for Rocket 0.5 branch.)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agosse: Introduce BufForRead
Ian Jackson [Mon, 21 Jun 2021 01:13:27 +0000 (02:13 +0100)]
sse: Introduce BufForRead

This abstracts away the &mut u8 and orig_buf from Updatereader.

This will be helpful when UpdateReader becomes AsyncRead rather than
Read.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDoucment current nightly tested version
Ian Jackson [Sat, 19 Mar 2022 16:00:18 +0000 (16:00 +0000)]
Doucment current nightly tested version

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agowasm: No not use wee-alloc. It has bugs and seems unmaintained
Ian Jackson [Sun, 6 Mar 2022 14:16:17 +0000 (14:16 +0000)]
wasm: No not use wee-alloc.  It has bugs and seems unmaintained

3 years agomiri: Skip digest read and write tests
Ian Jackson [Sun, 6 Mar 2022 14:01:55 +0000 (14:01 +0000)]
miri: Skip digest read and write tests

We don't have any unsafe here, and these end up using inline asm.

3 years agocargo: upgrade inventory
Ian Jackson [Sun, 6 Mar 2022 12:54:36 +0000 (12:54 +0000)]
cargo: upgrade inventory

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocli: Make SubcommandProperties const-default, not just default
Ian Jackson [Sun, 6 Mar 2022 12:51:47 +0000 (12:51 +0000)]
cli: Make SubcommandProperties const-default, not just default

inventory 0.2 is going to want this.

3 years agocargo: upgrade usvg
Ian Jackson [Sun, 6 Mar 2022 12:37:21 +0000 (12:37 +0000)]
cargo: upgrade usvg

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocargo: upgrade thirtyfour_sync x11rb
Ian Jackson [Sun, 6 Mar 2022 12:27:41 +0000 (12:27 +0000)]
cargo: upgrade thirtyfour_sync x11rb

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocargo: upgrade derive-into-owned rmp-serde enum-map
Ian Jackson [Sun, 6 Mar 2022 12:25:56 +0000 (12:25 +0000)]
cargo: upgrade derive-into-owned rmp-serde enum-map

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocargo: upgrade chrono-tz parking_lot mio directories ron
Ian Jackson [Sun, 6 Mar 2022 12:22:40 +0000 (12:22 +0000)]
cargo: upgrade chrono-tz parking_lot mio directories ron

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocargo: upgrade digest sha2
Ian Jackson [Sun, 6 Mar 2022 12:20:29 +0000 (12:20 +0000)]
cargo: upgrade digest sha2

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocargo: upgrade console nix flexi_logger image
Ian Jackson [Sun, 6 Mar 2022 12:16:24 +0000 (12:16 +0000)]
cargo: upgrade console nix flexi_logger image

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocargo: upgrade strum
Ian Jackson [Sun, 6 Mar 2022 12:12:22 +0000 (12:12 +0000)]
cargo: upgrade strum

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agostrum: Drop a commented-out dependency
Ian Jackson [Sun, 6 Mar 2022 12:12:12 +0000 (12:12 +0000)]
strum: Drop a commented-out dependency

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocargo: update
Ian Jackson [Sun, 6 Mar 2022 12:08:58 +0000 (12:08 +0000)]
cargo: update

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocmdlistener: Fix an error message
Ian Jackson [Sun, 6 Mar 2022 12:06:23 +0000 (12:06 +0000)]
cmdlistener: Fix an error message

3 years agowdriver: Add an allow for a field there fore debug
Ian Jackson [Sun, 6 Mar 2022 11:51:31 +0000 (11:51 +0000)]
wdriver: Add an allow for a field there fore debug

3 years agowdriver: Expose contents of WPiece
Ian Jackson [Sun, 6 Mar 2022 11:49:37 +0000 (11:49 +0000)]
wdriver: Expose contents of WPiece

These ought to have been pub.  As it happens we only used them here in
this module so we didn't notice - except that the JsV is just there in
case and happens not to be used.

3 years agowdriver: Remove an unused field
Ian Jackson [Sun, 6 Mar 2022 11:48:18 +0000 (11:48 +0000)]
wdriver: Remove an unused field

This was just here for possible use in error messages but we use name
instead.

3 years agowdriver: Add an allow for a field used only for its Drop behaviour
Ian Jackson [Sun, 6 Mar 2022 11:46:38 +0000 (11:46 +0000)]
wdriver: Add an allow for a field used only for its Drop behaviour

3 years agoutils: Replace a deprecated call
Ian Jackson [Sun, 6 Mar 2022 11:44:09 +0000 (11:44 +0000)]
utils: Replace a deprecated call

3 years agozcoord: Make MutateReturn take self parameter
Ian Jackson [Sun, 6 Mar 2022 11:37:25 +0000 (11:37 +0000)]
zcoord: Make MutateReturn take self parameter

This avoids a warning about IteratorCore::mr being dead code.

3 years agobuild fixes for more recent nightly
Ian Jackson [Tue, 14 Sep 2021 23:09:28 +0000 (00:09 +0100)]
build fixes for more recent nightly

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoMakefile: don't override environment's SPHINXBUILD or NAILING_CARGO
Ian Jackson [Tue, 14 Sep 2021 23:06:39 +0000 (00:06 +0100)]
Makefile: don't override environment's SPHINXBUILD or NAILING_CARGO

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoDo not leak in log piece identity of face-down cards
Ian Jackson [Wed, 28 Jul 2021 18:18:31 +0000 (19:18 +0100)]
Do not leak in log piece identity of face-down cards

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoCargo.toml: Update all versions to 0.7.3 otter-0.7.3
Ian Jackson [Sun, 25 Jul 2021 22:54:10 +0000 (23:54 +0100)]
Cargo.toml: Update all versions to 0.7.3

Commit made automatically by update-versions.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoCHANGELOG: Document fix to make-release
Ian Jackson [Sun, 25 Jul 2021 22:52:51 +0000 (23:52 +0100)]
CHANGELOG: Document fix to make-release

cargo packages may have been wrong, so re-tag rather than trying to
recover by hand.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agomake-release: Rely on nailing-cargo's new preclean function
Ian Jackson [Sun, 25 Jul 2021 22:50:58 +0000 (23:50 +0100)]
make-release: Rely on nailing-cargo's new preclean function

Our find rune was buggy and caused the publish of 0.7.2 to fail.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoCHANGELOG: Set date of today's release otter-0.7.2
Ian Jackson [Sun, 25 Jul 2021 22:29:13 +0000 (23:29 +0100)]
CHANGELOG: Set date of today's release

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodocs: Drop a now-stabilised feature declaration
Ian Jackson [Sun, 25 Jul 2021 21:35:44 +0000 (22:35 +0100)]
docs: Drop a now-stabilised feature declaration

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodocs: Document that we need miri for testing
Ian Jackson [Sun, 25 Jul 2021 21:31:25 +0000 (22:31 +0100)]
docs: Document that we need miri for testing

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agodocs: Note testing with latest nightly
Ian Jackson [Sun, 25 Jul 2021 21:30:19 +0000 (22:30 +0100)]
docs: Note testing with latest nightly

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocargo: update to thirtyfour_sync 0.25
Ian Jackson [Sun, 25 Jul 2021 21:27:09 +0000 (22:27 +0100)]
cargo: update to thirtyfour_sync 0.25

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocargo update
Ian Jackson [Sun, 25 Jul 2021 21:24:39 +0000 (22:24 +0100)]
cargo update

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoCHANGELOG: minor adjustments
Ian Jackson [Wed, 21 Jul 2021 20:45:34 +0000 (21:45 +0100)]
CHANGELOG: minor adjustments

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoCHANGELOG: document changes since last attempt
Ian Jackson [Wed, 21 Jul 2021 20:29:40 +0000 (21:29 +0100)]
CHANGELOG: document changes since last attempt

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agojs test: synch: wait for api queue empty
Ian Jackson [Wed, 21 Jul 2021 20:09:47 +0000 (21:09 +0100)]
js test: synch: wait for api queue empty

Otheerwise we can lose a race, if we somehow keep the browser JS
environment and the Otter game server busy enough that the browser
doesn't manage to empty its api queue.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agojs test: call test_update_hook on api queue empty
Ian Jackson [Wed, 21 Jul 2021 20:06:48 +0000 (21:06 +0100)]
js test: call test_update_hook on api queue empty

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agojs test: rename test_update_hook from gen_update_hook
Ian Jackson [Wed, 21 Jul 2021 19:41:36 +0000 (20:41 +0100)]
js test: rename test_update_hook from gen_update_hook

We're going to use it for something else too.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoautolower: Test that it works when claiming a hand
Ian Jackson [Wed, 21 Jul 2021 18:20:52 +0000 (19:20 +0100)]
autolower: Test that it works when claiming a hand

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoautolower: Prep for test by raising the hand we are about to claim
Ian Jackson [Wed, 21 Jul 2021 18:16:57 +0000 (19:16 +0100)]
autolower: Prep for test by raising the hand we are about to claim

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agowdt: Get rid of many redundant .release calls
Ian Jackson [Wed, 21 Jul 2021 17:42:38 +0000 (18:42 +0100)]
wdt: Get rid of many redundant .release calls

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agowdt: Get rid of many open-coded key_up/key_down pairs
Ian Jackson [Wed, 21 Jul 2021 17:35:40 +0000 (18:35 +0100)]
wdt: Get rid of many open-coded key_up/key_down pairs

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoautolower: Call piece_make_heavy when pinning
Ian Jackson [Wed, 21 Jul 2021 17:25:27 +0000 (18:25 +0100)]
autolower: Call piece_make_heavy when pinning

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoapi: Prep for calling make_piece_heavy
Ian Jackson [Wed, 21 Jul 2021 17:24:32 +0000 (18:24 +0100)]
api: Prep for calling make_piece_heavy

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoautolower: Call piece_make_heavy in create_occultation
Ian Jackson [Wed, 21 Jul 2021 17:20:14 +0000 (18:20 +0100)]
autolower: Call piece_make_heavy in create_occultation

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agocreate_occultation: Pass PUOs_Simple_Modify witness at all callers
Ian Jackson [Tue, 20 Jul 2021 19:58:41 +0000 (20:58 +0100)]
create_occultation: Pass PUOs_Simple_Modify witness at all callers

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoautolower: Tolerate empty test module without warning
Ian Jackson [Wed, 21 Jul 2021 19:38:44 +0000 (20:38 +0100)]
autolower: Tolerate empty test module without warning

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoautolower: Introduce facility (no callers yet)
Ian Jackson [Wed, 21 Jul 2021 17:16:22 +0000 (18:16 +0100)]
autolower: Introduce facility (no callers yet)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agoglobal: Provide an escape hatch for tests
Ian Jackson [Wed, 21 Jul 2021 17:15:07 +0000 (18:15 +0100)]
global: Provide an escape hatch for tests

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agogamestate: Fix botched comment
Ian Jackson [Tue, 20 Jul 2021 20:23:07 +0000 (21:23 +0100)]
gamestate: Fix botched comment

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agojst-lower: Check that we only do funky stuff if needed
Ian Jackson [Mon, 19 Jul 2021 01:56:36 +0000 (02:56 +0100)]
jst-lower: Check that we only do funky stuff if needed

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agolowering: Only do clashing Z heavy when needed
Ian Jackson [Mon, 19 Jul 2021 02:23:20 +0000 (03:23 +0100)]
lowering: Only do clashing Z heavy when needed

If there are no pieces Q to insert, we con't need to worry about this,
because it'll just be an empty ignored plan entry.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agolowering: Do not construct range iter for empty plan entries
Ian Jackson [Mon, 19 Jul 2021 23:44:04 +0000 (00:44 +0100)]
lowering: Do not construct range iter for empty plan entries

We are going to want to let these have malformed reanges.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agolowering: Get state transition right for non-heavy targets
Ian Jackson [Mon, 19 Jul 2021 02:05:59 +0000 (03:05 +0100)]
lowering: Get state transition right for non-heavy targets

We would go into state B if we found any target.  But that's not
right: the chart says to disregard heavy targets, and indeed we don't
want to stack other things below them.

This can lead q_z_top legitimately being null on exit from the walk
loop, if there are no pieces in B or Z.  We still need a q_z_top: we
can't leave it open, because we want to make sure we only lower
pieces, not raise them.  So we choose the lowest piece in Q, or,
failing that, P.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agojst-lower: Trap add_log_message to print to somewhere we can see
Ian Jackson [Mon, 19 Jul 2021 02:22:53 +0000 (03:22 +0100)]
jst-lower: Trap add_log_message to print to somewhere we can see

Otherwise, we just get an exception printed by nodejs which doesn't
actually include the message.

What we do here is print it to console.log where it will end up in
stderr, and *also* print a version to the machine-readable output
parsed by jst-lower.rs.

Currently jst-lower.rs bails on seeing it, which means these kind of
log messages are still fatal errors.  This is what we want - we don't
have any test cases that expect them.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agojst-lower: Fix comments for new z level regiem
Ian Jackson [Mon, 19 Jul 2021 01:41:51 +0000 (02:41 +0100)]
jst-lower: Fix comments for new z level regiem

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agojst-lower: Add only-z-same stress tests
Ian Jackson [Mon, 19 Jul 2021 01:39:53 +0000 (02:39 +0100)]
jst-lower: Add only-z-same stress tests

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agojst-lower: Prepare for only-z-same stress tests
Ian Jackson [Mon, 19 Jul 2021 01:39:13 +0000 (02:39 +0100)]
jst-lower: Prepare for only-z-same stress tests

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
3 years agojst-lower: Restore longer non-z-clash tests
Ian Jackson [Mon, 19 Jul 2021 01:35:05 +0000 (02:35 +0100)]
jst-lower: Restore longer non-z-clash tests

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>